25 #include "g-map-vertex.hh"
28 using namespace GMap3d;
30 #define A0(DART) (ADirectInfoAlpha0<0 \
31 ? FMap->alpha0(DART) \
32 : FMap->getDirectInfoAsDart((DART), ADirectInfoAlpha0))
34 #define A1(DART) (FMap->alpha1(DART))
36 #define SUCC(DART) ((((CGMapGeneric*) FMap)->*succ)(DART))
39 int ADirectInfoAlpha0)
42 assert(AVertexArray!=NULL);
44 CDart* dart0 =
A0(ADart);
46 AVertexArray[1] = * FMap->findVertex(ADart);
47 AVertexArray[2] = * FMap->findVertex(dart0);
49 if (FMap->isFree2(ADart) &&
50 FMap->isFree2(
A1(ADart)) &&
51 FMap->isFree2(
A1(dart0)))
54 if (FMap->isFree1(ADart))
55 AVertexArray[0] = AVertexArray[1];
57 AVertexArray[0] = * FMap->findVertex(
A0(
A1(ADart)));
59 if (FMap->isFree1(dart0))
60 AVertexArray[3] = AVertexArray[2];
62 AVertexArray[3] = * FMap->findVertex(
A0(
A1(dart0)));
64 else if (FMap->isFree3(ADart) &&
65 FMap->isFree3(FMap->alpha12(ADart)) &&
66 FMap->isFree3(FMap->alpha12(dart0)))
69 if (FMap->isFree2(
A1(ADart)))
70 AVertexArray[0] = AVertexArray[1];
72 AVertexArray[0] = * FMap->findVertex(
A0(FMap->alpha121(ADart)));
74 if (FMap->isFree2(
A1(dart0)))
75 AVertexArray[3] = AVertexArray[2];
77 AVertexArray[3] = * FMap->findVertex(
A0(FMap->alpha121(dart0)));
82 if (FMap->isFree3(FMap->alpha12(ADart)))
83 AVertexArray[0] = AVertexArray[1];
85 AVertexArray[0] = * FMap->findVertex(
A0(FMap->alpha12321(ADart)));
87 if (FMap->isFree3(FMap->alpha12(dart0)))
88 AVertexArray[3] = AVertexArray[1];
90 AVertexArray[3] = * FMap->findVertex(
A0(FMap->alpha12321(dart0)));
95 int ADirectInfoAlpha0)
98 assert(AVertexArray!=NULL);
100 CDart* dart0 =
A1(
A0(ADart));
104 if (FMap->isFree3(FMap->alpha12(ADart)) &&
105 FMap->isFree3(FMap->alpha12(dart0)))
165 int ADirectInfoAlpha0)
168 assert(AVertexArray!=NULL);
171 A0(FMap->alpha12321(FMap->alpha1(
A0(FMap->alpha2321(FMap->alpha12(
A0(FMap->alpha321(ADart))))))));
173 for (
int i=0; i<4; ++i)
175 CDart* currentY = FMap->alpha1(currentX);
177 for (
int j=0; j<4; ++j)
179 CDart* currentZ = FMap->alpha21(currentY);
181 for (
int k=0; k<4; ++k)
183 AVertexArray[i][j][k] = * FMap->findVertex(currentZ);
185 currentZ = k<3 ? FMap->alpha12321(
A0(currentZ)) :
A0(currentZ);
188 currentY = j<3 ? FMap->alpha12321(
A0(currentY)) :
A0(currentY);
191 currentX = i<3 ? FMap->alpha12321(
A0(currentX)) :
A0(currentX);
199 const CVertex** AVertexTable,
200 bool AAlready2MeshedSquare)
203 assert(AVertexTable!=NULL);
206 CDart* currentX = ADart;
208 CDart* (CGMapGeneric::* succ) (CDart*)
const
209 = AAlready2MeshedSquare ?
210 & CGMapGeneric::alpha0121 : & CGMapGeneric::alpha01;
212 for (
int i=0; i<=ASx; ++i)
214 assert(FMap->findVertex(currentX) != NULL);
216 AVertexTable[i] = FMap->findVertex(currentX);
219 currentX =
SUCC(currentX);
222 currentX = FMap->alpha0(currentX);
229 const CVertex*** AVertexTable,
230 bool AAlready3MeshedCube,
234 assert(AVertexTable!=NULL);
237 assert(1<=AReturnedDart && AReturnedDart<=3);
239 CDart* currentX, * currentY=NULL, * returned;
241 CDart* (CGMapGeneric::* succ) (CDart*)
const
242 = AAlready3MeshedCube ?
243 & CGMapGeneric::alpha012321 : & CGMapGeneric::alpha0121;
247 for (
int i=0; i<=ASx; ++i)
249 if (i==ASx && AReturnedDart==1)
252 currentY = FMap->alpha1(currentX);
254 for (
int j=0; j<=ASy; ++j)
256 assert(FMap->findVertex(currentY) != NULL);
258 AVertexTable[i][j] = FMap->findVertex(currentY);
261 currentY =
SUCC(currentY);
264 currentY = FMap->alpha0(currentY);
267 if (i==0 && AReturnedDart==2)
268 returned = FMap->alpha1(currentY);
271 currentX =
SUCC(currentX);
274 currentX = FMap->alpha0(currentX);
277 if (AReturnedDart==1)
280 returned = FMap->alpha1(currentY);