#ifndef __pFIGURE__ #define __pFIGURE__ // ---------------------------------------------------------------------------- // WX headers inclusion. // For compilers that support precompilation, includes . // ---------------------------------------------------------------------------- #include #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include #endif /** @file pFigure.h */ class pFigure :public wxObject{ public: //------------------------------------------------------------------------------------------------------------ // Constructors & Destructors //------------------------------------------------------------------------------------------------------------ /** * Create a figure with edges_n edges * @param edges_n The number of edges of the new figure * @param _w The width to set * @param _h The height to set * @param _orientation The figure orientation to set * @param bar_orientation The figure orientation to set */ pFigure(int edges_n, int _w, int _h,int _orientation, bool bar_orientation); ~pFigure(); //------------------------------------------------------------------------------------------------------------ // Methods //------------------------------------------------------------------------------------------------------------ /** * Gets the number of edges of the figure * @retval edges Number of edges in the figure */ int getNumberEdges(); /** * Sets the vertex points of the figure * @param edges Number of edges in the figure to set */ void setNumberEdges(int n_edges); /** * Gets the vertex points of the figure * @param wxPoint The vector to get the points * @retval points Vertex points distribution in the figure */ void getVertexPoints(wxPoint thePoints[]); /** * Sets the vertex points of the figure * @param edges Vertex points distribution in the figure to set */ void setVertexPoints(wxPoint * n_points); /* * Sets the heigth of the figure * @param _h The heigth to set */ void setHeigth(int _h); /* * Gets the heigth of the figure * @retval heigth The heigth of the figure */ int getHeigth(); /* * Sets the width of the figure * @param _w The width to set */ void setWidth(int _w); /* * Gets the width of the figure * @retval width The width of the figure */ int getWidth(); /* * Indicates if a pixel point is inside the figure * @param xFig_PixelPoint The known reference point inside the figure * @param xPixel The x-pixel coord asking for * @retval Returns true if the point is inside */ bool isPointInside(int xFig_PixelPoint, int xPixel); /* * Sets the bar orientation * @ bar_orientation The orientation to set (true for horizontal, false for vertical) */ void setBarOrientation(bool bar_orientation); /* * Sets the bar orientation used for triangles * @ bar_orientation The orientation to set (LEFT = -4, RIGHT = -6, UP = -8, DOWN = -2) */ void setFigureOrientation(int fig_orientation); //------------------------------------------------------------------------------------------------------------ // Constants //------------------------------------------------------------------------------------------------------------ enum { TRIANGLE = 3, RECTANGLE = 4, LEFT = -4, RIGHT = -6, UP = -8, DOWN = -2, }; private: //------------------------------------------------------------------------------------------------------------ // Attributes //------------------------------------------------------------------------------------------------------------ /* * Represents the heigth of the figure */ int heigth; /* * Represents the width of the figure */ int width; /* * Represents the edges of the figure */ int edges; /** * Represents the orientation UP, DOWN, LEFT, RIGTH of the figure */ int orientation; /* * Is the bar orientation (true for HORIZONTAL, false VERTICAL) */ bool barOrientation; /* * Represents the vertex points distribution of the figure in pixels scale */ wxPoint *v_points; DECLARE_CLASS(pColorBar) }; #endif