| 24 | { |
| 25 | |
| 26 | class Chart { |
| 27 | private: |
| 28 | forge::ChartType mChartType; |
| 29 | std::shared_ptr<detail::AbstractChart> mChart; |
| 30 | |
| 31 | public: |
| 32 | Chart(const forge::ChartType cType) |
| 33 | : mChartType(cType) { |
| 34 | |
| 35 | ARG_ASSERT(0, cType == FG_CHART_2D || cType == FG_CHART_3D); |
| 36 | |
| 37 | if (cType == FG_CHART_2D) { |
| 38 | mChart = std::make_shared<detail::chart2d_impl>(); |
| 39 | } else if (cType == FG_CHART_3D) { |
| 40 | mChart = std::make_shared<detail::chart3d_impl>(); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | Chart(const fg_chart pOther) { |
| 45 | mChart = reinterpret_cast<Chart*>(pOther)->impl(); |
| 46 | } |
| 47 | |
| 48 | inline forge::ChartType chartType() const { |
| 49 | return mChartType; |
| 50 | } |
| 51 | |
| 52 | inline const std::shared_ptr<detail::AbstractChart>& impl() const { |
| 53 | return mChart; |
| 54 | } |
| 55 | |
| 56 | inline void setAxesTitles(const char* pX, |
| 57 | const char* pY, |
| 58 | const char* pZ) { |
| 59 | mChart->setAxesTitles(pX, pY, pZ); |
| 60 | } |
| 61 | |
| 62 | inline void setAxesLimits(const float pXmin, const float pXmax, |
| 63 | const float pYmin, const float pYmax, |
| 64 | const float pZmin, const float pZmax) { |
| 65 | mChart->setAxesLimits(pXmin, pXmax, pYmin, pYmax, pZmin, pZmax); |
| 66 | } |
| 67 | |
| 68 | inline void setAxesLabelFormat(const std::string& pXFormat, |
| 69 | const std::string& pYFormat, |
| 70 | const std::string& pZFormat) { |
| 71 | mChart->setAxesLabelFormat(pXFormat, pYFormat, pZFormat); |
| 72 | } |
| 73 | |
| 74 | inline void getAxesLimits(float* pXmin, float* pXmax, |
| 75 | float* pYmin, float* pYmax, |
| 76 | float* pZmin, float* pZmax) { |
| 77 | mChart->getAxesLimits(pXmin, pXmax, pYmin, pYmax, pZmin, pZmax); |
| 78 | } |
| 79 | |
| 80 | inline void setLegendPosition(const float pX, const float pY) { |
| 81 | mChart->setLegendPosition(pX, pY); |
| 82 | } |
| 83 |
nothing calls this directly
no outgoing calls
no test coverage detected