29 using namespace GMap3d;
32 int ANbSelectionLevels,
int ANbRef) :
34 FControlerGMapV(AControlerGMapV),
35 FNbLevels (ANbSelectionLevels),
37 FSelectionOrbit(ORBIT_SELF),
38 FHalfSelection (false),
41 assert(AControlerGMapV != NULL);
42 assert(0 < ANbSelectionLevels);
44 FMarks =
new int[FNbLevels];
45 FLasts =
new CDart* [FNbLevels];
47 for (
int i=0; i<FNbLevels; ++i)
49 FMarks[i] = FControlerGMapV->
getMap()->getNewMark();
56 FControlerGMapV(AParam.FControlerGMapV),
57 FNbLevels (AParam.FNbLevels),
58 FCurrentLevel (AParam.FCurrentLevel),
59 FSelectionOrbit(AParam.FSelectionOrbit),
62 FMarks =
new int[FNbLevels];
63 FLasts =
new CDart* [FNbLevels];
65 for (
int i=0; i<FNbLevels; ++i)
67 FMarks[i] = FControlerGMapV->
getMap()->getNewMark();
74 for (
int i=0; i<FNbLevels; ++i)
75 FControlerGMapV->
getMap()->freeMark(FMarks[i]);
106 { FChanged =
false; }
112 {
return FNbLevels; }
115 {
return FCurrentLevel; }
122 assert( 0<=ALevel && ALevel<FNbLevels );
123 if ( FCurrentLevel!=ALevel )
125 FCurrentLevel = ALevel;
131 {
return FMarks[FCurrentLevel]; }
135 assert( 0<=ALevel && ALevel<FNbLevels );
136 return FMarks[ALevel];
143 {
return FSelectionOrbit; }
147 assert(ORBIT_SELF <= AOrbit && AOrbit <= ORBIT_CC);
148 FSelectionOrbit = AOrbit;
153 FSelectionOrbit = FSelectionOrbit==ORBIT_CC ? ORBIT_SELF : 1 + FSelectionOrbit;
157 {
return FHalfSelection; }
160 { FHalfSelection = ABool; }
163 {
return FLasts[FCurrentLevel]; }
167 assert( 0<=ALevel && ALevel<FNbLevels );
168 return FLasts[ALevel];
176 assert( ALastDart!=NULL );
177 if ( FLasts[FCurrentLevel]!=ALastDart )
179 FLasts[FCurrentLevel] = ALastDart;
186 assert( 0<=ALevel && ALevel<FNbLevels );
187 assert( ALastDart!=NULL );
188 if ( FLasts[ALevel]!=ALastDart )
190 FLasts[ALevel] = ALastDart;
197 if ( FLasts[FCurrentLevel]!=NULL )
199 FLasts[FCurrentLevel] = NULL;
206 assert( 0<=ALevel && ALevel<FNbLevels );
208 if ( FLasts[ALevel]!=NULL )
210 FLasts[ALevel] = NULL;
226 assert( 0<=ALevel1 && ALevel1<FNbLevels );
227 assert( 0<=ALevel2 && ALevel2<FNbLevels );
229 if ( ALevel1==ALevel2 )
return;
235 CDart* last = FLasts[ALevel1];
236 FLasts[ALevel1] = FLasts[ALevel2];
237 FLasts[ALevel2] = last;