]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pFigure.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / pPlotter / pFigure.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 #ifndef __pFIGURE__
27 #define __pFIGURE__
28
29 // ----------------------------------------------------------------------------
30 // WX headers inclusion.
31 // For compilers that support precompilation, includes <wx/wx.h>.
32 // ----------------------------------------------------------------------------
33 #include <wx/wxprec.h>
34 #ifdef __BORLANDC__
35 #pragma hdrstop
36 #endif
37 #ifndef WX_PRECOMP
38 #include <wx/wx.h>
39 #endif
40
41 /** @file pFigure.h */
42 class pFigure :public  wxObject{
43
44 public:
45
46         //------------------------------------------------------------------------------------------------------------
47         // Constructors & Destructors
48         //------------------------------------------------------------------------------------------------------------
49         /**
50         * Create a figure with edges_n edges
51         * @param edges_n The number of edges of the new figure
52         * @param _w The width to set
53         * @param _h The height to set
54         * @param _orientation The figure orientation to set
55         * @param bar_orientation The figure orientation to set
56         */
57         pFigure(int edges_n, int _w, int _h,int _orientation, bool bar_orientation);
58         ~pFigure();
59
60         //------------------------------------------------------------------------------------------------------------
61         // Methods
62         //------------------------------------------------------------------------------------------------------------
63
64         /**
65         * Gets the number of edges of the figure
66         * @retval edges Number of edges in the figure
67         */
68         int getNumberEdges();
69
70         /**
71         * Sets the vertex points of the figure
72         * @param edges Number of edges in the figure to set
73         */
74         void setNumberEdges(int n_edges);
75         
76         /**
77         * Gets the vertex points of the figure
78         * @param wxPoint The vector to get the points
79         * @retval points Vertex points distribution in the figure
80         */
81         void getVertexPoints(wxPoint thePoints[]);
82
83         /**
84         * Sets the vertex points of the figure
85         * @param edges Vertex points distribution in the figure to set
86         */
87         void setVertexPoints(wxPoint * n_points);
88
89         /*
90         * Sets the heigth of the figure
91         * @param _h The heigth to set
92         */
93         void setHeigth(int _h);
94
95         /*
96         * Gets the heigth of the figure
97         * @retval heigth The heigth of the figure
98         */
99         int getHeigth();
100
101         /*
102         * Sets the width of the figure
103         * @param _w The width to set
104         */
105         void setWidth(int _w);
106
107         /*
108         * Gets the width of the figure
109         * @retval width The width of the figure
110         */
111         int getWidth();
112
113         /*
114         * Indicates if a pixel point is inside the figure
115         * @param xFig_PixelPoint The known reference point inside the figure
116         * @param xPixel The x-pixel coord asking for
117         * @retval Returns true if the point is inside
118         */
119         bool isPointInside(int xFig_PixelPoint, int xPixel);
120
121         /*
122         * Sets the bar orientation 
123         * @ bar_orientation The orientation to set (true for horizontal, false for vertical)
124         */
125         void setBarOrientation(bool bar_orientation);
126
127         /*
128         * Sets the bar orientation used for triangles
129         * @ bar_orientation The orientation to set (LEFT = -4, RIGHT = -6, UP = -8, DOWN = -2)
130         */
131         void setFigureOrientation(int fig_orientation);
132         
133         //------------------------------------------------------------------------------------------------------------
134         // Constants
135         //------------------------------------------------------------------------------------------------------------
136         
137         enum
138         {
139                 TRIANGLE = 3,
140                 RECTANGLE = 4,
141                 LEFT = -4,
142                 RIGHT = -6,
143                 UP = -8,
144                 DOWN = -2,
145         };
146
147 private:
148
149         //------------------------------------------------------------------------------------------------------------
150         // Attributes
151         //------------------------------------------------------------------------------------------------------------
152
153         /*
154         * Represents the heigth of the figure
155         */
156         int heigth;
157
158         /*
159         * Represents the width of the figure
160         */
161         int width;
162
163         /*
164         * Represents the edges of the figure
165         */
166         int edges;
167
168         /**
169         * Represents the orientation UP, DOWN, LEFT, RIGTH of the figure
170         */
171         int orientation;
172
173         /*
174         * Is the bar orientation (true for HORIZONTAL, false VERTICAL)
175         */
176         bool barOrientation;
177
178         /*
179         * Represents the vertex points distribution of the figure in pixels scale
180         */
181         wxPoint *v_points;
182
183 DECLARE_CLASS(pColorBar)
184
185 };
186 #endif
187
188