]> Creatis software - creaContours.git/blob - lib/kernel_ManagerContour_NDimensions/InstantMembersNameList.cxx
fe6da74cac173e20c4e4be6c5a4747687a0b0b69
[creaContours.git] / lib / kernel_ManagerContour_NDimensions / InstantMembersNameList.cxx
1
2 //----------------------------------------------------------------------------------------------------------------
3 // Class definition include
4 //----------------------------------------------------------------------------------------------------------------
5 #include "InstantMembersNameList.h"
6
7 //----------------------------------------------------------------------------------------------------------------
8 // Class implementation
9 //----------------------------------------------------------------------------------------------------------------
10 /** @file InstantMemberNameList.cxx */
11
12 //------------------------------------------------------------------------------------------------------------
13 // Constructors & Destructors
14 //------------------------------------------------------------------------------------------------------------
15
16         /*
17         * Create the InstantMembersNameList with empty data pointers
18         */
19         InstantMembersNameList :: InstantMembersNameList()
20         {
21                 actualAxeNamesWrapp                             = new NameWrapper("","");
22                 actualSourceImageNamesWrapp             = new NameWrapper("","");
23                 actualSectionImageNamesWrapp    = new NameWrapper("","");
24                 actualOutlineNamesWrapp                 = new NameWrapper("","");
25         }
26
27         /*
28         * Destroys the InstantMembersNameList
29         */
30         InstantMembersNameList :: ~InstantMembersNameList()
31         {
32                 clean();
33                 outlinesNamesVector.clear();
34                 axesNamesVector.clear();
35         }
36
37 //------------------------------------------------------------------------------------------------------------
38 // Methods
39 //------------------------------------------------------------------------------------------------------------
40         /*
41         * Sets the actual outline names pair
42         * @param thekeyName The key name asigned to the actual outline  
43         * @param theRealName The real name asigned to the actual outline
44         */
45         void InstantMembersNameList :: setActualOutline(std::string thekeyName, std::string theRealName )
46         {
47                 actualOutlineNamesWrapp->setWrappingPair(thekeyName, theRealName);
48         }
49
50         /*
51         * Sets the actual axes names pair
52         * @param thekeyName The key name asigned to the actual outline  
53         * @param theRealName The real name asigned to the actual outline
54         */
55         void InstantMembersNameList :: addOutlineName(std::string thekeyName, std::string theRealName)
56         {
57                 NameWrapper * outlineWrap = new NameWrapper (thekeyName, theRealName);
58                 outlinesNamesVector.push_back(outlineWrap);
59         }       
60         
61         /*
62         * Sets the actual axes names pair
63         * @param thekeyName The key name asigned to the actual axe      
64         * @param theRealName The real name asigned to the actual axe
65         */
66         void InstantMembersNameList :: setActualAxeWrap(std::string thekeyName, std::string theRealName)
67         {
68                 actualAxeNamesWrapp -> setWrappingPair(thekeyName, theRealName);
69         }
70
71         /*
72         * Gets the actual axes key name
73         * @return actualAxeKeyName The key name asigned to the actual axe
74         */
75         std::string InstantMembersNameList :: getActualAxeKeyName()
76         {
77                 return actualAxeNamesWrapp->getKeyName();
78         }
79
80         /*
81         * Gets the actual axes key name
82         * @return actualSourceImageKeyName The key name asigned to the actual axe
83         */
84         std::string InstantMembersNameList :: getActualSourceImageKeyName()
85         {
86                 return actualSourceImageNamesWrapp->getKeyName();
87         }
88
89         /*
90         * Gets the actual axes key name
91         * @return actualSectionImageKeyName The key name asigned to the actual axe
92         */
93         std::string InstantMembersNameList :: getActualSectionImageKeyName()
94         {
95                 return actualSourceImageNamesWrapp->getKeyName();
96         }
97
98         /*
99         * Gets the vector of the key names of currect instant outlines
100         * @return vectorPairedNames The vector with the pair of outline names wrapping
101         */
102         std::vector<NameWrapper *> InstantMembersNameList :: getOutlinesNamesVector()
103         {
104                 return outlinesNamesVector;
105         }
106
107         /*
108         * Sets the actualSourceImage names pair
109         * @param thekeyName The key name asigned to the actual outline  
110         * @param theRealName The real name asigned to the actual outline
111         */
112         void InstantMembersNameList :: setActualSourceImageNamesWrapp(std::string thekeyName, std::string theRealName)
113         {
114                 actualSourceImageNamesWrapp = new NameWrapper(thekeyName,theRealName);
115         }
116
117         /*
118         * Sets the actualSectionImage names pair
119         * @param thekeyName The key name asigned to the actual outline  
120         * @param theRealName The real name asigned to the actual outline
121         */
122         void InstantMembersNameList :: setActualSectionImageNamesWrapp(std::string thekeyName, std::string theRealName)
123         {
124                 actualSectionImageNamesWrapp = new NameWrapper(thekeyName,theRealName);
125         }
126
127         /*
128         * Cleans the vector and the information of the instant members wrapping
129         */
130         void InstantMembersNameList :: clean()
131         {
132                 
133                 /*
134                 if(!outlinesNamesVector.empty())
135                 {while(outlinesNamesVector.size()>0)
136                         outlinesNamesVector.pop_back();
137                 }
138                 if ( !axesNamesVector.empty())
139                 {
140                 while(axesNamesVector.size()>0)
141                         axesNamesVector.pop_back();
142                 }
143                 */
144                 outlinesNamesVector.clear();
145                 axesNamesVector.clear();
146                 /*
147                 delete actualAxeNamesWrapp;
148                 delete actualSourceImageNamesWrapp;
149                 delete actualSectionImageNamesWrapp;
150                 delete actualOutlineNamesWrapp;*/
151         }
152    
153