1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
29 // ----------------------------------------------------------------------------
30 // WX headers inclusion.
31 // For compilers that support precompilation, includes <wx/wx.h>.
32 // ----------------------------------------------------------------------------
33 #include <wx/wxprec.h>
41 /** @file pFigure.h */
42 class pFigure :public wxObject{
46 //------------------------------------------------------------------------------------------------------------
47 // Constructors & Destructors
48 //------------------------------------------------------------------------------------------------------------
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
57 pFigure(int edges_n, int _w, int _h,int _orientation, bool bar_orientation);
60 //------------------------------------------------------------------------------------------------------------
62 //------------------------------------------------------------------------------------------------------------
65 * Gets the number of edges of the figure
66 * @retval edges Number of edges in the figure
71 * Sets the vertex points of the figure
72 * @param edges Number of edges in the figure to set
74 void setNumberEdges(int n_edges);
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
81 void getVertexPoints(wxPoint thePoints[]);
84 * Sets the vertex points of the figure
85 * @param edges Vertex points distribution in the figure to set
87 void setVertexPoints(wxPoint * n_points);
90 * Sets the heigth of the figure
91 * @param _h The heigth to set
93 void setHeigth(int _h);
96 * Gets the heigth of the figure
97 * @retval heigth The heigth of the figure
102 * Sets the width of the figure
103 * @param _w The width to set
105 void setWidth(int _w);
108 * Gets the width of the figure
109 * @retval width The width of the figure
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
119 bool isPointInside(int xFig_PixelPoint, int xPixel);
122 * Sets the bar orientation
123 * @ bar_orientation The orientation to set (true for horizontal, false for vertical)
125 void setBarOrientation(bool bar_orientation);
128 * Sets the bar orientation used for triangles
129 * @ bar_orientation The orientation to set (LEFT = -4, RIGHT = -6, UP = -8, DOWN = -2)
131 void setFigureOrientation(int fig_orientation);
133 //------------------------------------------------------------------------------------------------------------
135 //------------------------------------------------------------------------------------------------------------
149 //------------------------------------------------------------------------------------------------------------
151 //------------------------------------------------------------------------------------------------------------
154 * Represents the heigth of the figure
159 * Represents the width of the figure
164 * Represents the edges of the figure
169 * Represents the orientation UP, DOWN, LEFT, RIGTH of the figure
174 * Is the bar orientation (true for HORIZONTAL, false VERTICAL)
179 * Represents the vertex points distribution of the figure in pixels scale
183 DECLARE_CLASS(pColorBar)