| 23 | { |
| 24 | |
| 25 | class AbstractChart : public AbstractRenderable { |
| 26 | protected: |
| 27 | /* internal class attributes for |
| 28 | * drawing ticks on axes for plots*/ |
| 29 | std::vector<float> mTickTextX; |
| 30 | std::vector<float> mTickTextY; |
| 31 | std::vector<float> mTickTextZ; |
| 32 | std::vector<std::string> mXText; |
| 33 | std::vector<std::string> mYText; |
| 34 | std::vector<std::string> mZText; |
| 35 | int mTickCount; /* should be an odd number always */ |
| 36 | float mTickSize; |
| 37 | /* margin variables represent the % of current dimensions |
| 38 | * and not the exact units of length */ |
| 39 | float mLeftMargin; |
| 40 | float mRightMargin; |
| 41 | float mTopMargin; |
| 42 | float mBottomMargin; |
| 43 | /* chart axes ranges and titles */ |
| 44 | std::string mXLabelFormat; |
| 45 | float mXMax; |
| 46 | float mXMin; |
| 47 | std::string mYLabelFormat; |
| 48 | float mYMax; |
| 49 | float mYMin; |
| 50 | std::string mZLabelFormat; |
| 51 | float mZMax; |
| 52 | float mZMin; |
| 53 | std::string mXTitle; |
| 54 | std::string mYTitle; |
| 55 | std::string mZTitle; |
| 56 | /* OpenGL Objects */ |
| 57 | gl::GLuint mDecorVBO; |
| 58 | ShaderProgram mBorderProgram; |
| 59 | ShaderProgram mSpriteProgram; |
| 60 | /* shader uniform variable locations */ |
| 61 | gl::GLuint mBorderAttribPointIndex; |
| 62 | gl::GLuint mBorderUniformColorIndex; |
| 63 | gl::GLuint mBorderUniformMatIndex; |
| 64 | gl::GLuint mSpriteUniformMatIndex; |
| 65 | gl::GLuint mSpriteUniformTickcolorIndex; |
| 66 | gl::GLuint mSpriteUniformTickaxisIndex; |
| 67 | /* Chart legend position*/ |
| 68 | float mLegendX; |
| 69 | float mLegendY; |
| 70 | /* VAO map to store a vertex array object |
| 71 | * for each valid window context */ |
| 72 | std::map<int, gl::GLuint> mVAOMap; |
| 73 | /* list of renderables to be displayed on the chart*/ |
| 74 | std::vector< std::shared_ptr<AbstractRenderable> > mRenderables; |
| 75 | |
| 76 | /* rendering helper functions */ |
| 77 | inline float getTickStepSize(float minval, float maxval) const { |
| 78 | return (maxval-minval)/(mTickCount-1); |
| 79 | } |
| 80 | |
| 81 | inline int getNumTicksC2E() const { |
| 82 | /* Get # of ticks from center(0,0) to edge along axis */ |
nothing calls this directly
no outgoing calls
no test coverage detected