26 #include "transformation-matrix.hh"
31 const CVertex& AVertex0,
32 const CVertex& AVertex1)
45 const CVertex** ABottomEdge,
46 const CVertex** ATopEdge,
47 const CVertex** ALeftEdge,
48 const CVertex** ARightEdge)
49 : CMesh2Diver(ASx, ASy)
51 assert(ABottomEdge[ 0 ]==ALeftEdge [ 0 ]);
52 assert(ABottomEdge[FSx]==ARightEdge[ 0 ]);
53 assert(ATopEdge [ 0 ]==ALeftEdge [FSy]);
54 assert(ATopEdge [FSx]==ARightEdge[FSy]);
58 FTopEdge =
new const CVertex* [FSx+1];
63 for (
int i=0; i<=FSx; ++i)
69 for (
int j=0; j<=FSy; ++j)
88 const CVertex*** ALeftFace ,
89 const CVertex*** ARightFace ,
90 const CVertex*** AFrontFace ,
91 const CVertex*** ABackFace ,
92 const CVertex*** ABottomFace,
93 const CVertex*** ATopFace )
94 : CMesh3Diver(ASx, ASy, ASz)
101 assert( ABottomFace[ i ][ 0 ] == AFrontFace[ 0 ][ i ] );
102 assert( ABottomFace[ i ][FSy] == ABackFace [ 0 ][ i ] );
103 assert( ATopFace [ i ][ 0 ] == AFrontFace[FSz][ i ] );
104 assert( ATopFace [ i ][FSy] == ABackFace [FSz][ i ] );
107 for (j=0; j<FSy; ++j)
109 assert( ABottomFace[ 0 ][ j ] == ALeftFace [ j ][ 0 ] );
110 assert( ABottomFace[FSx][ j ] == ARightFace[ j ][ 0 ] );
111 assert( ATopFace [ 0 ][ j ] == ALeftFace [ j ][FSz] );
112 assert( ATopFace [FSx][ j ] == ARightFace[ j ][FSz] );
115 for (k=0; k<FSz; ++k)
117 assert( AFrontFace [ k ][ 0 ] == ALeftFace [ 0 ][ k ] );
118 assert( AFrontFace [ k ][FSx] == ARightFace[ 0 ][ k ] );
119 assert( ABackFace [ k ][ 0 ] == ALeftFace [FSy][ k ] );
120 assert( ABackFace [ k ][FSx] == ARightFace[FSy][ k ] );
130 FTopFace =
new const CVertex** [FSx+1];
132 for (j=0; j<=FSy; ++j)
134 FLeftFace [j] =
new const CVertex* [FSz+1];
138 for (k=0; k<=FSz; ++k)
141 FBackFace [k] =
new const CVertex* [FSx+1];
144 for (i=0; i<=FSx; ++i)
147 FTopFace [i] =
new const CVertex* [FSy+1];
151 for (j=0; j<=FSy; ++j)
152 for (k=0; k<=FSz; ++k)
158 for (k=0; k<=FSz; ++k)
159 for (i=0; i<=FSx; ++i)
165 for (i=0; i<=FSx; ++i)
166 for (j=0; j<=FSy; ++j)
177 for (
int j=0; j<=FSy; ++j)
183 for (
int k=0; k<=FSz; ++k)
189 for (
int i=0; i<=FSx; ++i)
205 const CVertex& AVertex0,
206 const CVertex& AVertex1)
217 const CVertex** ABottomEdge,
218 const CVertex** ATopEdge,
219 const CVertex** ALeftEdge,
220 const CVertex** ARightEdge)
222 ABottomEdge, ATopEdge,
223 ALeftEdge, ARightEdge)
237 const CVertex** ALeftFace[],
238 const CVertex** ARightFace[],
239 const CVertex** AFrontFace[],
240 const CVertex** ABackFace[],
241 const CVertex** ABottomFace[],
242 const CVertex** ATopFace[])
244 ALeftFace, ARightFace,
245 AFrontFace, ABackFace,
254 FP001 = ATopFace [ 0 ][ 0 ];
255 FP011 = ATopFace [ 0 ][ASy];
256 FP101 = ATopFace [ASx][ 0 ];
257 FP111 = ATopFace [ASx][ASy];
266 const CTransformationMatrix& AMethod,
267 const CVertex* AControlPoints)
270 assert(AControlPoints!=NULL);
272 for (
int dim=0; dim<3; ++dim)
275 CVector controlPoints;
277 for (
int i=0; i<4; ++i)
278 controlPoints[i] = AControlPoints[i].getCoord(dim);
281 FControl[dim] = controlPoints* AMethod;
291 const CTransformationMatrix& AMethod,
292 const CVertex** AControlPoints)
293 : CMesh2Diver(ASx, ASy)
295 assert(AControlPoints!=NULL);
299 for (
int i=0; i<4; ++i)
309 for (
int i=0; i<4; ++i)
318 const CTransformationMatrix& AMethod,
319 const CVertex*** AControlPoints)
320 : CMesh3Diver(ASx, ASy, ASz)
322 assert(AControlPoints!=NULL);
326 for (
int i=0; i<4; ++i)
336 for (
int i=0; i<4; ++i)
351 return CVertex(x,y,z);
357 CMesh2InterpolationDiver::setIx(AIx);
366 CMesh2InterpolationDiver::setIy(AIy);
378 FKx0 * FP0j->getX() + FKx1 * FP1j->getX() +
379 FKy0 * FPi0->getX() + FKy1 * FPi1->getX() )
381 ( FKx0 * FKy0 * FP00->getX() + FKx1 * FKy0 * FP10->getX() +
382 FKx0 * FKy1 * FP01->getX() + FKx1 * FKy1 * FP11->getX() ),
386 FKx0 * FP0j->getY() + FKx1 * FP1j->getY() +
387 FKy0 * FPi0->getY() + FKy1 * FPi1->getY() )
389 ( FKx0 * FKy0 * FP00->getY() + FKx1 * FKy0 * FP10->getY() +
390 FKx0 * FKy1 * FP01->getY() + FKx1 * FKy1 * FP11->getY() ),
394 FKx0 * FP0j->getZ() + FKx1 * FP1j->getZ() +
395 FKy0 * FPi0->getZ() + FKy1 * FPi1->getZ() )
397 ( FKx0 * FKy0 * FP00->getZ() + FKx1 * FKy0 * FP10->getZ() +
398 FKx0 * FKy1 * FP01->getZ() + FKx1 * FKy1 * FP11->getZ() );
400 return CVertex(x,y,z);
406 CMesh3InterpolationDiver::setIx(AIx);
423 CMesh3InterpolationDiver::setIy(AIy);
440 CMesh3InterpolationDiver::setIz(AIz);
461 FKx0 * FP0jk->getX() + FKx1 * FP1jk->getX() +
462 FKy0 * FPi0k->getX() + FKy1 * FPi1k->getX() +
463 FKz0 * FPij0->getX() + FKz1 * FPij1->getX() )
467 FKx0 * FKy0 * FP00k->getX() + FKx1 * FKy0 * FP10k->getX() +
468 FKx0 * FKy1 * FP01k->getX() + FKx1 * FKy1 * FP11k->getX() +
470 FKx0 * FKz0 * FP0j0->getX() + FKx1 * FKz0 * FP1j0->getX() +
471 FKx0 * FKz1 * FP0j1->getX() + FKx1 * FKz1 * FP1j1->getX() +
473 FKy0 * FKz0 * FPi00->getX() + FKy1 * FKz0 * FPi10->getX() +
474 FKy0 * FKz1 * FPi01->getX() + FKy1 * FKz1 * FPi11->getX() )
478 FKx0 * FKy0 * FKz0 * FP000->getX() +
479 FKx1 * FKy1 * FKz1 * FP111->getX() +
480 FKx1 * FKy0 * FKz0 * FP100->getX() +
481 FKx0 * FKy1 * FKz0 * FP010->getX() +
482 FKx0 * FKy0 * FKz1 * FP001->getX() +
483 FKx0 * FKy1 * FKz1 * FP011->getX() +
484 FKx1 * FKy0 * FKz1 * FP101->getX() +
485 FKx1 * FKy1 * FKz0 * FP110->getX() ),
490 FKx0 * FP0jk->getY() + FKx1 * FP1jk->getY() +
491 FKy0 * FPi0k->getY() + FKy1 * FPi1k->getY() +
492 FKz0 * FPij0->getY() + FKz1 * FPij1->getY() )
496 FKx0 * FKy0 * FP00k->getY() + FKx1 * FKy0 * FP10k->getY() +
497 FKx0 * FKy1 * FP01k->getY() + FKx1 * FKy1 * FP11k->getY() +
499 FKx0 * FKz0 * FP0j0->getY() + FKx1 * FKz0 * FP1j0->getY() +
500 FKx0 * FKz1 * FP0j1->getY() + FKx1 * FKz1 * FP1j1->getY() +
502 FKy0 * FKz0 * FPi00->getY() + FKy1 * FKz0 * FPi10->getY() +
503 FKy0 * FKz1 * FPi01->getY() + FKy1 * FKz1 * FPi11->getY() )
507 FKx0 * FKy0 * FKz0 * FP000->getY() +
508 FKx1 * FKy1 * FKz1 * FP111->getY() +
509 FKx1 * FKy0 * FKz0 * FP100->getY() +
510 FKx0 * FKy1 * FKz0 * FP010->getY() +
511 FKx0 * FKy0 * FKz1 * FP001->getY() +
512 FKx0 * FKy1 * FKz1 * FP011->getY() +
513 FKx1 * FKy0 * FKz1 * FP101->getY() +
514 FKx1 * FKy1 * FKz0 * FP110->getY() ),
519 FKx0 * FP0jk->getZ() + FKx1 * FP1jk->getZ() +
520 FKy0 * FPi0k->getZ() + FKy1 * FPi1k->getZ() +
521 FKz0 * FPij0->getZ() + FKz1 * FPij1->getZ() )
525 FKx0 * FKy0 * FP00k->getZ() + FKx1 * FKy0 * FP10k->getZ() +
526 FKx0 * FKy1 * FP01k->getZ() + FKx1 * FKy1 * FP11k->getZ() +
528 FKx0 * FKz0 * FP0j0->getZ() + FKx1 * FKz0 * FP1j0->getZ() +
529 FKx0 * FKz1 * FP0j1->getZ() + FKx1 * FKz1 * FP1j1->getZ() +
531 FKy0 * FKz0 * FPi00->getZ() + FKy1 * FKz0 * FPi10->getZ() +
532 FKy0 * FKz1 * FPi01->getZ() + FKy1 * FKz1 * FPi11->getZ() )
536 FKx0 * FKy0 * FKz0 * FP000->getZ() +
537 FKx1 * FKy1 * FKz1 * FP111->getZ() +
538 FKx1 * FKy0 * FKz0 * FP100->getZ() +
539 FKx0 * FKy1 * FKz0 * FP010->getZ() +
540 FKx0 * FKy0 * FKz1 * FP001->getZ() +
541 FKx0 * FKy1 * FKz1 * FP011->getZ() +
542 FKx1 * FKy0 * FKz1 * FP101->getZ() +
543 FKx1 * FKy1 * FKz0 * FP110->getZ() );
545 return CVertex(x,y,z);
551 CMesh1Diver::setIx(AIx);
555 for (
int i=3; i>=0; --i)
565 TCoordinate
coord[3];
567 for (
int i=0; i<3; ++i)
570 return CVertex(coord[0], coord[1], coord[2]);
578 CMesh2Diver::setIx(AIx);
586 CMesh2Diver::setIy(AIy);
588 CVertex controlPoints[4];
590 for (
int i=0; i<4; ++i)
622 CMesh3Diver::setIy(AIy);
624 CVertex controlPoints[4];
626 for (
int i=0; i<4; ++i)
642 CMesh3Diver::setIz(AIz);
644 for (
int i=0; i<4; ++i)