]> Creatis software - creaContours.git/blob - lib/kernel_ManagerContour_NDimensions/OutlineGroup.h
238386b89258f98f4c9d784c3af76ffc209f06cf
[creaContours.git] / lib / kernel_ManagerContour_NDimensions / OutlineGroup.h
1 #ifndef __OTULINE_GROUP__
2 #define __OTULINE_GROUP__
3
4
5 //------------------------------------------------------------------------------------------------------------
6 // Includes
7 //------------------------------------------------------------------------------------------------------------
8 #include <iostream>
9 #include <vector>
10
11 class OutlineGroup{
12
13 //------------------------------------------------------------------------------------------------------------
14 // Constructors & Destructors
15 //------------------------------------------------------------------------------------------------------------
16 public:
17
18         /*
19         * Constructs an outline group with the given name
20         * @param theName Is the name for the group
21         * @param theGroupType Is the type for the group corresponding to one of the constants of this class
22         */ 
23         OutlineGroup(std::string theName, int theGroupType);
24         
25         /*
26         * Destroyes the outline and its dependencies
27         */
28         ~ OutlineGroup();
29
30 //------------------------------------------------------------------------------------------------------------
31 // Methods definition
32 //------------------------------------------------------------------------------------------------------------
33
34         /*
35         * Indicates if a given name of an outline is member of the group or not
36         * @param aKeyName Is the name of an outline to search for
37         */
38         bool isMemberOfGroup(std::string aKeyName);
39
40         /*
41         * Removes an outline with the given name from the group 
42         * @param theNameToRemove Is the name to remove from member name list
43         * @param allOcurrencies Indicates to errase all ocurrences
44         */
45         void removeOutline(std::string theNameToRemove,  bool allOcurrencies = true);
46         
47         /*
48         * Adds an outline with the given name to the group members list
49         * @param theNameNw Is the name to add to the group
50         */
51         void addOutline(std::string theNameNw);
52
53         /*
54         * Gets the name of the group
55         * @return name Is the name of the group
56         */ 
57         std::string getName();
58
59         /*
60         * Sets the name of the group as the given one 
61         * @param name Is the new name of the group
62         */ 
63         void setName(std::string theNwName);
64
65         /*
66         * Gets the state of visiblility (true:visible) or not of the group
67         * @return visibleGroup Is the corresponding state
68         */ 
69         bool getIfVisibleGroup();
70
71         /*
72         * Sets state of visible (true) or not of the with the given one 
73         * @param theNwVisiblity Is the corresponding state
74         */ 
75         void setIfVisibleGroup(bool theNwVisiblity);
76
77         /*
78         * Gets the state of static (true:static) or not of the group
79         * @return staticGroup Is the corresponding state
80         */ 
81         bool getIfStaticGroup();
82
83         /*
84         * Sets state of static (true) or not of the with the given one 
85         * @param theNwStatic Is the corresponding state
86         */ 
87         void setIfStaticGroup(bool theNwStatic);
88
89         /*
90         * Gets the state of selection (true:selected) or not of the group
91         * @return selecetedGroup Is the corresponding state
92         */ 
93         bool getIfSelectedGroup();
94
95         /*
96         * Sets state of visible (true) or not of the with the given one 
97         * @param theNwSelected Is the corresponding state
98         */ 
99         void setIfSelectedGroup(bool theNwSelected);
100
101         /*
102         * Gets the state of edition (true:editing) or not of the group
103         * @return editingGroup Is the corresponding state
104         */ 
105         bool getIfEditingGroup();
106
107         /*
108         * Sets state of editing (true) or not of the with the given one 
109         * @param theNwEditing Is the corresponding state
110         */ 
111         void setIfEditingGroup(bool theNwEditing);
112
113         /*
114         * Gets the total count of outlines in the group
115         * @return totalCount Is the corresponding number of elements
116         */ 
117         int getGroupType();
118
119         /*
120         * Sets the group type 
121         * @param theType Is the corresponding new type to assign 
122         */ 
123         void setGroupType(int theType);
124
125         /*
126         * Gets the group type 
127         * @return type Is the corresponding number of elements
128         */ 
129         int getOutlinesCount();
130
131         /*
132         * Sets the total count of outlines in the group
133         * @param theNwVisiblity Is the corresponding state
134         */ 
135         void setIfEditingGroup(int theTotal);
136
137         /*
138         * Adds an outline to the group as propagation type
139         * @param theOutlineKeyName Is the name used as identifier of the outline        
140         */
141         void addOutline_PropagationType(std::string theOutlineKeyName);
142
143         /*
144         * Adds an outline to the group as plane section type
145         * @param theOutlineKeyName Is the name used as identifier of the outline        
146         */
147         void addOutline_PlaneSectionType(std::string theOutlineKeyName);
148
149         /*
150         * Adds an outline to the group as overlaped type
151         * @param theOutlineKeyName Is the name used as identifier of the outline        
152         */
153         void addOutline_OverlapedType(std::string theOutlineKeyName);
154         
155         /*
156         * Adds an outline to the group as strip type
157         * @param theOutlineKeyName Is the name used as identifier of the outline        
158         */
159         void addOutline_StripType(std::string theOutlineKeyName);
160
161         /*
162         * Adds an outline to the group as manual type
163         * @param theOutlineKeyName Is the name used as identifier of the outline        
164         */
165         void addOutline_ManualType(std::string theOutlineKeyName);
166
167
168         /*
169         * Gets the outlines of the group
170         * @return Returns the names of the outlines that belong to the group
171         */
172          std::vector< std::string >  getGroupOutlinesNames ( );
173
174 //------------------------------------------------------------------------------------------------------------
175 // Attributes
176 //------------------------------------------------------------------------------------------------------------
177
178 private:        
179
180         bool acceptsRepetedOutlines;
181
182         /*
183         * Represents the name of the group
184         */
185         std::string name;
186
187         /*
188         * Represents the state of visible for the outlines in the group
189         */
190         bool visibleGroup;
191
192         /*
193         * Represents the state of selection for the outlines in the group
194         */
195         bool selectedGroup;
196
197         /*
198         * Represents the state of edition for the outlines in the group
199         */
200         bool editingGroup;
201
202         /*
203         * Represents the state of static for the outlines in the group
204         */
205         bool staticGroup;
206
207         /*
208         * Represents the type of the group
209         */
210         int groupType;
211
212         /*
213         * Represents the total elements count of the group
214         */
215         int totalCount;
216
217         /*
218         * Represents the outlines of the group
219         */
220         std::vector< std::string > outlines_keyNames;
221
222         //------------------------------------------------------------------------------------------------------------
223         // Constants
224         //------------------------------------------------------------------------------------------------------------
225         
226 public :
227         enum
228                 {
229                         PROPAGATION = 0,
230                         PLANE_SECTION = 1,
231                         OVERLAPED = 2,
232                         STRIP = 3,              
233                         MANUAL_GROUP = 4,               
234                 };
235                 
236
237 };
238 #endif