26 #include "g-map-generic.hh"
28 using namespace GMap3d;
32 assert(ADart != NULL);
37 const CTransformationMatrix* ,
39 bool AMeshWithAdjacentSews,
40 bool AMeshAssociatedCells,
41 int ,
int ADirectInfoAssoc)
47 CDart* extremities[2];
51 FMap->createTopoMesh1(ASx, extremities, ADart);
56 assert(ADirectInfoAssoc >= 0);
58 if (AMeshWithAdjacentSews)
60 CDart* assoc = FMap->getDirectInfoAsDart(ADart, ADirectInfoAssoc);
61 FMap->createTopoMesh1(ASx, extremities, assoc);
66 if (AMeshAssociatedCells)
68 CDart* assoc = FMap->getDirectInfoAsDart(ADart, ADirectInfoAssoc);
70 FMap->createTopoMesh1(ASx, extremities, assoc);
75 FMap->createTopoMesh1(ASx, extremities, NULL);
76 FMap->setDirectInfo( ADart , ADirectInfoAssoc, extremities[0]);
77 FMap->setDirectInfo(FMap->alpha0(ADart), ADirectInfoAssoc, extremities[1]);
84 int ASx,
int ASy,
int AInitialMeshDim)
89 assert(0<=AInitialMeshDim && AInitialMeshDim<=1);
92 true, ! FMap->isFree3(ADart));
97 const CTransformationMatrix * AMeshMatrix,
99 bool AMeshWithAdjacentSews,
100 bool AMeshAssociatedCells,
102 int AInitialMeshDim,
int AFinalMeshDim,
103 int ADirectInfoAlpha0,
int ADirectInfoAssoc)
108 assert(0<=AInitialMeshDim && AInitialMeshDim<=1);
109 assert(1<=AFinalMeshDim && AFinalMeshDim <=2);
110 assert(AInitialMeshDim < AFinalMeshDim);
112 assert(
canMesh2(AMeshAssociatedCells
113 ? FMap->getDirectInfoAsDart(ADart, ADirectInfoAssoc) : ADart,
114 ASx,ASy, AInitialMeshDim));
116 bool isolated = !AMeshWithMerges && !AMeshWithAdjacentSews;
119 if (AInitialMeshDim==0 && (AFinalMeshDim==1 || !isolated))
121 CDart* dart1 = ADart;
122 CDart* dart2 = FMap->alpha0101(ADart);
124 mesh1( dart1, ASx, AMeshMatrix, AMeshWithMerges, AMeshWithAdjacentSews,
125 AMeshAssociatedCells, ADirectInfoAlpha0, ADirectInfoAssoc);
126 mesh1( FMap->alpha1(dart1), ASy, AMeshMatrix, AMeshWithMerges, AMeshWithAdjacentSews,
127 AMeshAssociatedCells, ADirectInfoAlpha0, ADirectInfoAssoc);
128 mesh1( dart2, ASx, AMeshMatrix, AMeshWithMerges, AMeshWithAdjacentSews,
129 AMeshAssociatedCells, ADirectInfoAlpha0, ADirectInfoAssoc);
130 mesh1( FMap->alpha1(dart2), ASy, AMeshMatrix, AMeshWithMerges, AMeshWithAdjacentSews,
131 AMeshAssociatedCells, ADirectInfoAlpha0, ADirectInfoAssoc);
135 if (AFinalMeshDim==2)
139 ? FMap->getDirectInfoAsDart(ADart, ADirectInfoAssoc)
142 CDart* mesh = FMap->createTopoMesh2(ASx, ASy, !isolated &&
143 ! FMap->isFree3(first));
150 int ASx,
int ASy,
int ASz,
int AInitialMeshDim)
156 assert(0<=AInitialMeshDim && AInitialMeshDim<=2);
162 int ASx,
int ASy,
int ASz,
163 const CTransformationMatrix * AMeshMatrix,
164 bool AMeshWithMerges,
165 bool AMeshWithAdjacentSews,
166 bool AMeshAssociatedCells,
167 int AInitialMeshDim,
int AFinalMeshDim,
168 int ,
int ADirectInfoAssoc)
174 assert(0<=AInitialMeshDim && AInitialMeshDim<=2);
175 assert(1<=AFinalMeshDim && AFinalMeshDim <=3);
176 assert(AInitialMeshDim < AFinalMeshDim);
177 assert(
canMesh3(ADart, ASx,ASy,ASz, AInitialMeshDim));
180 if (AInitialMeshDim==0)
182 CDart* dart1 = ADart;
183 CDart* dart2 = FMap->alpha21012(FMap->alpha0101(ADart));
185 mesh1( FMap->alpha21 (dart1), ASz, AMeshMatrix, AMeshWithMerges,
186 AMeshWithAdjacentSews, AMeshAssociatedCells, ADirectInfoAssoc);
187 mesh1( FMap->alpha21 (dart2), ASz, AMeshMatrix, AMeshWithMerges,
188 AMeshWithAdjacentSews, AMeshAssociatedCells, ADirectInfoAssoc);
189 mesh1( FMap->alpha021(dart1), ASz, AMeshMatrix, AMeshWithMerges,
190 AMeshWithAdjacentSews, AMeshAssociatedCells, ADirectInfoAssoc);
191 mesh1( FMap->alpha021(dart2), ASz, AMeshMatrix, AMeshWithMerges,
192 AMeshWithAdjacentSews, AMeshAssociatedCells, ADirectInfoAssoc);
193 mesh1( FMap->alpha01 (dart1), ASy, AMeshMatrix, AMeshWithMerges,
194 AMeshWithAdjacentSews, AMeshAssociatedCells, ADirectInfoAssoc);
195 mesh1( FMap->alpha01 (dart2), ASy, AMeshMatrix, AMeshWithMerges,
196 AMeshWithAdjacentSews, AMeshAssociatedCells, ADirectInfoAssoc);
197 mesh1( FMap->alpha101(dart1), ASx, AMeshMatrix, AMeshWithMerges,
198 AMeshWithAdjacentSews, AMeshAssociatedCells, ADirectInfoAssoc);
199 mesh1( FMap->alpha101(dart2), ASx, AMeshMatrix, AMeshWithMerges,
200 AMeshWithAdjacentSews, AMeshAssociatedCells, ADirectInfoAssoc);
201 mesh1( FMap->alpha1 (dart1), ASy, AMeshMatrix, AMeshWithMerges,
202 AMeshWithAdjacentSews, AMeshAssociatedCells, ADirectInfoAssoc);
203 mesh1( FMap->alpha1 (dart2), ASy, AMeshMatrix, AMeshWithMerges,
204 AMeshWithAdjacentSews, AMeshAssociatedCells, ADirectInfoAssoc);
205 mesh1( dart1 , ASx, AMeshMatrix, AMeshWithMerges,
206 AMeshWithAdjacentSews, AMeshAssociatedCells, ADirectInfoAssoc);
207 mesh1( dart2 , ASx, AMeshMatrix, AMeshWithMerges,
208 AMeshWithAdjacentSews, AMeshAssociatedCells, ADirectInfoAssoc);
211 if (AFinalMeshDim>=2)
214 if (AInitialMeshDim<2)
216 CDart* dart1 = ADart;
217 CDart* dart2 = ADart;
219 for (
int i=0; i<ASx; ++i)
220 dart2 = FMap->alpha01(dart2);
222 for (
int j=0; j<ASy; ++j)
223 dart2 = FMap->alpha01(dart2);
225 dart2 = FMap->alpha21(dart2);
227 for (
int k=0; k<ASz; ++k)
228 dart2 = FMap->alpha01(dart2);
230 mesh2( dart1 , ASx,ASy, AMeshMatrix, AMeshWithMerges,
231 AMeshWithAdjacentSews, AMeshAssociatedCells,
false,
232 1,2, ADirectInfoAssoc);
233 mesh2( dart2 , ASx,ASy, AMeshMatrix, AMeshWithMerges,
234 AMeshWithAdjacentSews, AMeshAssociatedCells,
false,
235 1,2, ADirectInfoAssoc);
236 mesh2(FMap->alpha2 (dart1), ASx,ASz, AMeshMatrix, AMeshWithMerges,
237 AMeshWithAdjacentSews, AMeshAssociatedCells,
false,
238 1,2, ADirectInfoAssoc);
239 mesh2(FMap->alpha2 (dart2), ASx,ASz, AMeshMatrix, AMeshWithMerges,
240 AMeshWithAdjacentSews, AMeshAssociatedCells,
false,
241 1,2, ADirectInfoAssoc);
242 mesh2(FMap->alpha12(dart1), ASy,ASz, AMeshMatrix, AMeshWithMerges,
243 AMeshWithAdjacentSews, AMeshAssociatedCells,
false,
244 1,2, ADirectInfoAssoc);
245 mesh2(FMap->alpha12(dart2), ASy,ASz, AMeshMatrix, AMeshWithMerges,
246 AMeshWithAdjacentSews, AMeshAssociatedCells,
false,
247 1,2, ADirectInfoAssoc);
251 if (AFinalMeshDim==3)
253 FMap->createTopoMesh3(ASx, ASy, ASz),