Skip to content

Commit

Permalink
Fix #13: PolarPlot2D class is created.
Browse files Browse the repository at this point in the history
  • Loading branch information
jepessen committed Sep 27, 2015
1 parent bf1f5b7 commit c739f30
Show file tree
Hide file tree
Showing 90 changed files with 2,374 additions and 717 deletions.
62 changes: 36 additions & 26 deletions demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,70 @@ cmake_minimum_required (VERSION 3.0.2)

add_subdirectory (background_solid)
add_subdirectory (background_gradient)
add_subdirectory (grid_black)
add_subdirectory (grid_color)
add_subdirectory (cartesiangrid2d_black)
add_subdirectory (cartesiangrid2d_color)
add_subdirectory (polargrid2d_simple)
add_subdirectory (circle_simple)
add_subdirectory (circle_styled)
add_subdirectory (rectangle_simple)
add_subdirectory (rectangle_styled)
add_subdirectory (scatterplot_circle)
add_subdirectory (lineplot)
add_subdirectory (lineplot_styled)
add_subdirectory (lineplot_filling)
add_subdirectory (cartesianscatterplot2d_circle)
add_subdirectory (cartesianlineplot2d_simple)
add_subdirectory (cartesianlineplot2d_styled)
add_subdirectory (cartesianlineplot2d_filling)
add_subdirectory (polarlineplot2d_simple)
add_subdirectory (polarlineplot2d_styled)
add_subdirectory (polarlineplot2d_filled)
add_subdirectory (polarlineplot2d_gradient)
add_subdirectory (arrow_simple)
add_subdirectory (arrow_styled)
add_subdirectory (axes_simple)
add_subdirectory (axes_styled)
add_subdirectory (text_simple)
add_subdirectory (text_styled)
add_subdirectory (tick_labels_simple)
add_subdirectory (barplot2d_simple)
add_subdirectory (barplot2d_styled)
add_subdirectory (candlestick2d_simple)
add_subdirectory (cartesianbarplot2d_simple)
add_subdirectory (cartesianbarplot2d_styled)
add_subdirectory (cartesiancandlestick2d_simple)
add_subdirectory (candlestick2d_styled)
add_subdirectory (ohlcbar2d_simple)
add_subdirectory (ohlcbar2d_styled)
add_subdirectory (candlestickgraph2d_simple)
add_subdirectory (candlestickgraph2d_styled)
add_subdirectory (ohlcgraph2d_simple)
add_subdirectory (ohlcgraph2d_styled)
add_subdirectory (cartesiancandlestickgraph2d_simple)
add_subdirectory (cartesiancandlestickgraph2d_styled)
add_subdirectory (cartesianohlcgraph2d_simple)
add_subdirectory (cartesianohlcgraph2d_styled)

add_dependencies (demo_background_solid wplot)
add_dependencies (demo_background_gradient wplot)
add_dependencies (demo_grid_black wplot)
add_dependencies (demo_grid_color wplot)
add_dependencies (demo_cartesiangrid2d_black wplot)
add_dependencies (demo_cartesiangrid2d_color wplot)
add_dependencies (demo_polargrid2d_simple wplot)
add_dependencies (demo_circle_simple wplot)
add_dependencies (demo_circle_styled wplot)
add_dependencies (demo_rectangle_simple wplot)
add_dependencies (demo_rectangle_styled wplot)
add_dependencies (demo_scatterplot_circle wplot)
add_dependencies (demo_lineplot wplot)
add_dependencies (demo_lineplot_styled wplot)
add_dependencies (demo_lineplot_filling wplot)
add_dependencies (demo_cartesianscatterplot2d_circle wplot)
add_dependencies (demo_cartesianlineplot2d_simple wplot)
add_dependencies (demo_cartesianlineplot2d_styled wplot)
add_dependencies (demo_cartesianlineplot2d_filling wplot)
add_dependencies (demo_polarlineplot2d_simple wplot)
add_dependencies (demo_polarlineplot2d_styled wplot)
add_dependencies (demo_polarlineplot2d_filled wplot)
add_dependencies (demo_polarlineplot2d_gradient wplot)
add_dependencies (demo_arrow_simple wplot)
add_dependencies (demo_arrow_styled wplot)
add_dependencies (demo_axes_simple wplot)
add_dependencies (demo_axes_styled wplot)
add_dependencies (demo_text_simple wplot)
add_dependencies (demo_text_styled wplot)
add_dependencies (demo_tick_labels_simple wplot)
add_dependencies (demo_barplot2d_simple wplot)
add_dependencies (demo_barplot2d_styled wplot)
add_dependencies (demo_candlestick2d_simple wplot)
add_dependencies (demo_cartesianbarplot2d_simple wplot)
add_dependencies (demo_cartesianbarplot2d_styled wplot)
add_dependencies (demo_cartesiancandlestick2d_simple wplot)
add_dependencies (demo_candlestick2d_styled wplot)
add_dependencies (demo_ohlcbar2d_simple wplot)
add_dependencies (demo_ohlcbar2d_styled wplot)
add_dependencies (demo_candlestickgraph2d wplot)
add_dependencies (demo_candlestickgraph2d_styled wplot)
add_dependencies (demo_ohlcgraph2d_simple wplot)
add_dependencies (demo_ohlcgraph2d_styled wplot)
add_dependencies (demo_cartesiancandlestickgraph2d_simple wplot)
add_dependencies (demo_cartesiancandlestickgraph2d_styled wplot)
add_dependencies (demo_cartesianohlcgraph2d_simple wplot)
add_dependencies (demo_cartesianohlcgraph2d_styled wplot)
4 changes: 2 additions & 2 deletions demo/arrow_simple/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wplot/Plot2D.h"
#include "wplot/CartesianPlot2D.h"
#include "wplot/Arrow2D.h"
#include <QApplication>
#include <iostream>
Expand All @@ -7,7 +7,7 @@ int main(int argc, char *argv[])
{
std::cout << "Simple arrow inset demo" << std::endl;
QApplication a(argc, argv);
WPlot::Plot2D* plot2D(new WPlot::Plot2D);
WPlot::CartesianPlot2D* plot2D(new WPlot::CartesianPlot2D);
WPlot::Arrow2D::Ptr arrowWidget(new WPlot::Arrow2D);
WPlot::Arrow2D::Ptr arrowPlot(new WPlot::Arrow2D);
// By default widget coordinate system is used
Expand Down
4 changes: 2 additions & 2 deletions demo/arrow_styled/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wplot/Plot2D.h"
#include "wplot/CartesianPlot2D.h"
#include "wplot/Arrow2D.h"
#include <QApplication>
#include <iostream>
Expand All @@ -7,7 +7,7 @@ int main(int argc, char *argv[])
{
std::cout << "Styled arrow inset demo" << std::endl;
QApplication a(argc, argv);
WPlot::Plot2D* plot2D(new WPlot::Plot2D);
WPlot::CartesianPlot2D* plot2D(new WPlot::CartesianPlot2D);
WPlot::Arrow2D::Ptr arrow(new WPlot::Arrow2D);
arrow->setPivotCoordinates(WPlot::Item2D::COORDINATE_PLOT, WPlot::Item2D::AXIS_BOTH);
arrow->setDimensionCoordinates(WPlot::Item2D::COORDINATE_WIDGET, WPlot::Item2D::AXIS_BOTH);
Expand Down
4 changes: 2 additions & 2 deletions demo/axes_simple/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wplot/Plot2D.h"
#include "wplot/CartesianPlot2D.h"
#include "wplot/Axes2D.h"
#include <QApplication>
#include <iostream>
Expand All @@ -7,7 +7,7 @@ int main(int argc, char *argv[])
{
std::cout << "Simple axes inset demo" << std::endl;
QApplication a(argc, argv);
WPlot::Plot2D* plot2D(new WPlot::Plot2D);
WPlot::CartesianPlot2D* plot2D(new WPlot::CartesianPlot2D);
WPlot::Axes2D::Ptr axesInside(new WPlot::Axes2D);
WPlot::Axes2D::Ptr axesOutside(new WPlot::Axes2D);
axesInside->setOrigin(0.5, 1.3);
Expand Down
4 changes: 2 additions & 2 deletions demo/axes_styled/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wplot/Plot2D.h"
#include "wplot/CartesianPlot2D.h"
#include "wplot/Axes2D.h"
#include <QApplication>
#include <iostream>
Expand All @@ -7,7 +7,7 @@ int main(int argc, char *argv[])
{
std::cout << "Simple axes inset demo" << std::endl;
QApplication a(argc, argv);
WPlot::Plot2D* plot2D(new WPlot::Plot2D);
WPlot::CartesianPlot2D* plot2D(new WPlot::CartesianPlot2D);
WPlot::Axes2D::Ptr axes(new WPlot::Axes2D);
axes->setOrigin(0.5, 1.3);
axes->setAxisXColor(Qt::red);
Expand Down
4 changes: 2 additions & 2 deletions demo/candlestick2d_styled/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wplot/Plot2D.h"
#include "wplot/CartesianPlot2D.h"
#include "wplot/CandleStick2D.h"
#include <QApplication>
#include <iostream>
Expand All @@ -7,7 +7,7 @@ int main(int argc, char *argv[])
{
std::cout << "Simple CandleStick2D inset demo" << std::endl;
QApplication a(argc, argv);
WPlot::Plot2D* plot2D(new WPlot::Plot2D);
WPlot::CartesianPlot2D* plot2D(new WPlot::CartesianPlot2D);
WPlot::CandleStick2D::Ptr candlestick(new WPlot::CandleStick2D);
// Here we use the plot coordinate system
candlestick->setPivotCoordinates(WPlot::Item2D::COORDINATE_PLOT, WPlot::Item2D::AXIS_X);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.0.2)

project (demo_candlestickgraph2d_styled)
project (demo_cartesianbarplot2d_simple)

set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/export/bin)
set (CMAKE_PREFIX_PATH ${QT_ROOT}/lib/cmake)
Expand All @@ -12,13 +12,13 @@ include_directories (${CMAKE_SOURCE_DIR} ${Qt5Widgets_INCLUDE_DIRS})
file (GLOB DEMO_SOURCES "*.cpp")

# Compile project
add_executable (demo_candlestickgraph2d_styled ${DEMO_SOURCES})
target_link_libraries(demo_candlestickgraph2d_styled ${Qt5Widgets_LIBRARIES})
target_link_libraries(demo_candlestickgraph2d_styled wplot)
add_executable (demo_cartesianbarplot2d_simple ${DEMO_SOURCES})
target_link_libraries(demo_cartesianbarplot2d_simple ${Qt5Widgets_LIBRARIES})
target_link_libraries(demo_cartesianbarplot2d_simple wplot)

# This enable C++11 for CMake version >= 3.1.0
set_property(TARGET wplot PROPERTY CXX_STANDARD 11)
set_property(TARGET wplot PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(TARGET demo_cartesianbarplot2d_simple PROPERTY CXX_STANDARD 11)
set_property(TARGET demo_cartesianbarplot2d_simple PROPERTY CXX_STANDARD_REQUIRED ON)

# This enable C++11 for gcc for CMake version priors to 3.1.0
include(CheckCXXCompilerFlag)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "wplot/Plot2D.h"
#include "wplot/CartesianPlot2D.h"
#include "wplot/Circle.h"
#include "wplot/BarGraph2D.h"
#include "wplot/Grid2D.h"
#include "wplot/CartesianBarGraph2D.h"
#include "wplot/CartesianGrid2D.h"
#include <QApplication>
#include <iostream>
#include <cmath>
Expand All @@ -10,9 +10,9 @@ int main(int argc, char *argv[])
{
std::cout << "Simple bargraph demo" << std::endl;
QApplication a(argc, argv);
WPlot::Plot2D* plot2D(new WPlot::Plot2D);
WPlot::BarGraph2D::Ptr barGraph(new WPlot::BarGraph2D);
WPlot::Grid2D::Ptr grid(new WPlot::Grid2D);
WPlot::CartesianPlot2D* plot2D(new WPlot::CartesianPlot2D);
WPlot::CartesianBarGraph2D::Ptr barGraph(new WPlot::CartesianBarGraph2D);
WPlot::CartesianGrid2D::Ptr grid(new WPlot::CartesianGrid2D);
for (double x = 0.0; x < 8.0; x += 0.5) {
barGraph->appendPoint(x, sin(x));
}
Expand Down
32 changes: 32 additions & 0 deletions demo/cartesianbarplot2d_styled/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
cmake_minimum_required (VERSION 3.0.2)

project (demo_cartesianbarplot2d_styled)

set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/export/bin)
set (CMAKE_PREFIX_PATH ${QT_ROOT}/lib/cmake)
set (CMAKE_AUTOMOC ON)
set (CMAKE_INCLUDE_CURRENT_DIR ON)

find_package (Qt5Widgets REQUIRED)
include_directories (${CMAKE_SOURCE_DIR} ${Qt5Widgets_INCLUDE_DIRS})
file (GLOB DEMO_SOURCES "*.cpp")

# Compile project
add_executable (demo_cartesianbarplot2d_styled ${DEMO_SOURCES})
target_link_libraries(demo_cartesianbarplot2d_styled ${Qt5Widgets_LIBRARIES})
target_link_libraries(demo_cartesianbarplot2d_styled wplot)

# This enable C++11 for CMake version >= 3.1.0
set_property(TARGET demo_cartesianbarplot2d_styled PROPERTY CXX_STANDARD 11)
set_property(TARGET demo_cartesianbarplot2d_styled PROPERTY CXX_STANDARD_REQUIRED ON)

# This enable C++11 for gcc for CMake version priors to 3.1.0
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "wplot/Plot2D.h"
#include "wplot/CartesianPlot2D.h"
#include "wplot/Circle.h"
#include "wplot/BarGraph2D.h"
#include "wplot/Grid2D.h"
#include "wplot/CartesianBarGraph2D.h"
#include "wplot/CartesianGrid2D.h"
#include <QApplication>
#include <iostream>
#include <cmath>
Expand All @@ -16,9 +16,9 @@ int main(int argc, char *argv[])
{
std::cout << "Simple bargraph demo" << std::endl;
QApplication a(argc, argv);
WPlot::Plot2D* plot2D(new WPlot::Plot2D);
WPlot::BarGraph2D::Ptr barGraph(new WPlot::BarGraph2D);
WPlot::Grid2D::Ptr grid(new WPlot::Grid2D);
WPlot::CartesianPlot2D* plot2D(new WPlot::CartesianPlot2D);
WPlot::CartesianBarGraph2D::Ptr barGraph(new WPlot::CartesianBarGraph2D);
WPlot::CartesianGrid2D::Ptr grid(new WPlot::CartesianGrid2D);
std::function<QColor(const QPointF&)> colorFunction = [=](const QPointF &point) {
QColor color(0, 0, 0);
const double blue = clamp(point.y(), 0, 1);
Expand Down
32 changes: 32 additions & 0 deletions demo/cartesiancandlestick2d_simple/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
cmake_minimum_required (VERSION 3.0.2)

project (demo_cartesiancandlestick2d_simple)

set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/export/bin)
set (CMAKE_PREFIX_PATH ${QT_ROOT}/lib/cmake)
set (CMAKE_AUTOMOC ON)
set (CMAKE_INCLUDE_CURRENT_DIR ON)

find_package (Qt5Widgets REQUIRED)
include_directories (${CMAKE_SOURCE_DIR} ${Qt5Widgets_INCLUDE_DIRS})
file (GLOB DEMO_SOURCES "*.cpp")

# Compile project
add_executable (demo_cartesiancandlestick2d_simple ${DEMO_SOURCES})
target_link_libraries(demo_cartesiancandlestick2d_simple ${Qt5Widgets_LIBRARIES})
target_link_libraries(demo_cartesiancandlestick2d_simple wplot)

# This enable C++11 for CMake version >= 3.1.0
set_property(TARGET demo_cartesiancandlestick2d_simple PROPERTY CXX_STANDARD 11)
set_property(TARGET demo_cartesiancandlestick2d_simple PROPERTY CXX_STANDARD_REQUIRED ON)

# This enable C++11 for gcc for CMake version priors to 3.1.0
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "wplot/Plot2D.h"
#include "wplot/CartesianPlot2D.h"
#include "wplot/CandleStick2D.h"
#include <QApplication>
#include <iostream>
Expand All @@ -7,7 +7,7 @@ int main(int argc, char *argv[])
{
std::cout << "Simple CandleStick2D inset demo" << std::endl;
QApplication a(argc, argv);
WPlot::Plot2D* plot2D(new WPlot::Plot2D);
WPlot::CartesianPlot2D* plot2D(new WPlot::CartesianPlot2D);
WPlot::CandleStick2D::Ptr candlestickWidget(new WPlot::CandleStick2D);
WPlot::CandleStick2D::Ptr candlestickPlot(new WPlot::CandleStick2D);
// By default widget coordinate system is used
Expand Down
32 changes: 32 additions & 0 deletions demo/cartesiancandlestickgraph2d_simple/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
cmake_minimum_required (VERSION 3.0.2)

project (demo_cartesiancandlestickgraph2d_simple)

set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/export/bin)
set (CMAKE_PREFIX_PATH ${QT_ROOT}/lib/cmake)
set (CMAKE_AUTOMOC ON)
set (CMAKE_INCLUDE_CURRENT_DIR ON)

find_package (Qt5Widgets REQUIRED)
include_directories (${CMAKE_SOURCE_DIR} ${Qt5Widgets_INCLUDE_DIRS})
file (GLOB DEMO_SOURCES "*.cpp")

# Compile project
add_executable (demo_cartesiancandlestickgraph2d_simple ${DEMO_SOURCES})
target_link_libraries(demo_cartesiancandlestickgraph2d_simple ${Qt5Widgets_LIBRARIES})
target_link_libraries(demo_cartesiancandlestickgraph2d_simple wplot)

# This enable C++11 for CMake version >= 3.1.0
set_property(TARGET demo_cartesiancandlestickgraph2d_simple PROPERTY CXX_STANDARD 11)
set_property(TARGET demo_cartesiancandlestickgraph2d_simple PROPERTY CXX_STANDARD_REQUIRED ON)

# This enable C++11 for gcc for CMake version priors to 3.1.0
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "wplot/Plot2D.h"
#include "wplot/CartesianPlot2D.h"
#include "wplot/CandleStickGraph2D.h"
#include "wplot/Grid2D.h"
#include "wplot/CartesianGrid2D.h"
#include <QApplication>
#include <iostream>
#include <cmath>
Expand All @@ -9,9 +9,9 @@ int main(int argc, char *argv[])
{
std::cout << "Simple circle inset demo" << std::endl;
QApplication a(argc, argv);
WPlot::Plot2D* plot2D(new WPlot::Plot2D);
WPlot::CartesianPlot2D* plot2D(new WPlot::CartesianPlot2D);
WPlot::CandleStickGraph2D::Ptr candlestickGraph(new WPlot::CandleStickGraph2D);
WPlot::Grid2D::Ptr grid(new WPlot::Grid2D);
WPlot::CartesianGrid2D::Ptr grid(new WPlot::CartesianGrid2D);
for (double x = 0.0; x < 8.0; x += 0.2) {
const double open = sin(x * 0.6) -1;
const double high = sin(x * 0.4) + 3;
Expand Down
Loading

0 comments on commit c739f30

Please sign in to comment.