30 #define XFORM( a, b ) xForm[4 * ( a ) + ( b )]
31 #define XFORM_INDEX( a, b ) ( 4 * ( a ) + ( b ) )
52 #if defined( __INTEL_COMPILER ) && ( __INTEL_COMPILER < 1310 )
67 HomCoord(
const int coords[],
const int num_coords = 4 );
68 HomCoord(
const int coord0,
const int coord1,
const int coord2,
const int coord3 );
69 HomCoord(
const int coord0,
const int coord1,
const int coord2 );
73 void set(
const int coords[] );
74 void set(
const int i,
const int j,
const int k,
const int h = 1 );
140 inline int operator[](
const int& param )
const;
167 HomXform(
const int rotate[9],
const int scale[3],
const int translate[3] );
225 for(
int tmpj = 0; tmpj < num_coords; tmpj++ )
227 if( num_coords != 4 )
homCoord[3] = 1;
248 #if defined( __INTEL_COMPILER ) && ( __INTEL_COMPILER < 1310 )
250 int coord0 = coords[0];
251 int coord1 = coords[1];
252 int coord2 = coords[2];
253 int coord3 = coords[3];
274 inline void HomCoord::set(
const int ip,
const int jp,
const int kp,
const int hp )
493 str <<
"(" << hc.
i() <<
"," << hc.
j() <<
"," << hc.
k() <<
")";
499 for(
int i = 0; i < 16; i++ )
500 xForm[i] = matrix[i];
508 for( i = 0; i < 3; i++ )
510 for( j = 0; j < 3; j++ )
511 xForm[i * 4 + j] = rotate[i * 3 + j] * scale[j];
513 xForm[12 + i] = translate[i];
558 for(
int i = 0; i < 16; i++ )
568 XFORM( 0, 0 ) * rhs2.XFORM( 0, 0 ) +
XFORM( 0, 1 ) * rhs2.XFORM( 1, 0 ) +
XFORM( 0, 2 ) * rhs2.XFORM( 2, 0 ) +
569 XFORM( 0, 3 ) * rhs2.XFORM( 3, 0 ),
571 XFORM( 0, 0 ) * rhs2.XFORM( 0, 1 ) +
XFORM( 0, 1 ) * rhs2.XFORM( 1, 1 ) +
XFORM( 0, 2 ) * rhs2.XFORM( 2, 1 ) +
572 XFORM( 0, 3 ) * rhs2.XFORM( 3, 1 ),
574 XFORM( 0, 0 ) * rhs2.XFORM( 0, 2 ) +
XFORM( 0, 1 ) * rhs2.XFORM( 1, 2 ) +
XFORM( 0, 2 ) * rhs2.XFORM( 2, 2 ) +
575 XFORM( 0, 3 ) * rhs2.XFORM( 3, 2 ),
577 XFORM( 0, 0 ) * rhs2.XFORM( 0, 3 ) +
XFORM( 0, 1 ) * rhs2.XFORM( 1, 3 ) +
XFORM( 0, 2 ) * rhs2.XFORM( 2, 3 ) +
578 XFORM( 0, 3 ) * rhs2.XFORM( 3, 3 ),
581 XFORM( 1, 0 ) * rhs2.XFORM( 0, 0 ) +
XFORM( 1, 1 ) * rhs2.XFORM( 1, 0 ) +
XFORM( 1, 2 ) * rhs2.XFORM( 2, 0 ) +
582 XFORM( 1, 3 ) * rhs2.XFORM( 3, 0 ),
584 XFORM( 1, 0 ) * rhs2.XFORM( 0, 1 ) +
XFORM( 1, 1 ) * rhs2.XFORM( 1, 1 ) +
XFORM( 1, 2 ) * rhs2.XFORM( 2, 1 ) +
585 XFORM( 1, 3 ) * rhs2.XFORM( 3, 1 ),
587 XFORM( 1, 0 ) * rhs2.XFORM( 0, 2 ) +
XFORM( 1, 1 ) * rhs2.XFORM( 1, 2 ) +
XFORM( 1, 2 ) * rhs2.XFORM( 2, 2 ) +
588 XFORM( 1, 3 ) * rhs2.XFORM( 3, 2 ),
590 XFORM( 1, 0 ) * rhs2.XFORM( 0, 3 ) +
XFORM( 1, 1 ) * rhs2.XFORM( 1, 3 ) +
XFORM( 1, 2 ) * rhs2.XFORM( 2, 3 ) +
591 XFORM( 1, 3 ) * rhs2.XFORM( 3, 3 ),
594 XFORM( 2, 0 ) * rhs2.XFORM( 0, 0 ) +
XFORM( 2, 1 ) * rhs2.XFORM( 1, 0 ) +
XFORM( 2, 2 ) * rhs2.XFORM( 2, 0 ) +
595 XFORM( 2, 3 ) * rhs2.XFORM( 3, 0 ),
597 XFORM( 2, 0 ) * rhs2.XFORM( 0, 1 ) +
XFORM( 2, 1 ) * rhs2.XFORM( 1, 1 ) +
XFORM( 2, 2 ) * rhs2.XFORM( 2, 1 ) +
598 XFORM( 2, 3 ) * rhs2.XFORM( 3, 1 ),
600 XFORM( 2, 0 ) * rhs2.XFORM( 0, 2 ) +
XFORM( 2, 1 ) * rhs2.XFORM( 1, 2 ) +
XFORM( 2, 2 ) * rhs2.XFORM( 2, 2 ) +
601 XFORM( 2, 3 ) * rhs2.XFORM( 3, 2 ),
603 XFORM( 2, 0 ) * rhs2.XFORM( 0, 3 ) +
XFORM( 2, 1 ) * rhs2.XFORM( 1, 3 ) +
XFORM( 2, 2 ) * rhs2.XFORM( 2, 3 ) +
604 XFORM( 2, 3 ) * rhs2.XFORM( 3, 3 ),
609 XFORM( 3, 0 ) * rhs2.XFORM( 0, 0 ) +
XFORM( 3, 1 ) * rhs2.XFORM( 1, 0 ) +
XFORM( 3, 2 ) * rhs2.XFORM( 2, 0 ) +
610 XFORM( 3, 3 ) * rhs2.XFORM( 3, 0 ),
614 XFORM( 3, 0 ) * rhs2.XFORM( 0, 1 ) +
XFORM( 3, 1 ) * rhs2.XFORM( 1, 1 ) +
XFORM( 3, 2 ) * rhs2.XFORM( 2, 1 ) +
615 XFORM( 3, 3 ) * rhs2.XFORM( 3, 1 ),
619 XFORM( 3, 0 ) * rhs2.XFORM( 0, 2 ) +
XFORM( 3, 1 ) * rhs2.XFORM( 1, 2 ) +
XFORM( 3, 2 ) * rhs2.XFORM( 2, 2 ) +
620 XFORM( 3, 3 ) * rhs2.XFORM( 3, 2 ),
624 XFORM( 3, 0 ) * rhs2.XFORM( 0, 3 ) +
XFORM( 3, 1 ) * rhs2.XFORM( 1, 3 ) +
XFORM( 3, 2 ) * rhs2.XFORM( 2, 3 ) +
625 XFORM( 3, 3 ) * rhs2.XFORM( 3, 3 ) );
632 XFORM( 0, 0 ) * rhs2.XFORM( 0, 0 ) +
XFORM( 0, 1 ) * rhs2.XFORM( 1, 0 ) +
XFORM( 0, 2 ) * rhs2.XFORM( 2, 0 ) +
633 XFORM( 0, 3 ) * rhs2.XFORM( 3, 0 ),
635 XFORM( 0, 0 ) * rhs2.XFORM( 0, 1 ) +
XFORM( 0, 1 ) * rhs2.XFORM( 1, 1 ) +
XFORM( 0, 2 ) * rhs2.XFORM( 2, 1 ) +
636 XFORM( 0, 3 ) * rhs2.XFORM( 3, 1 ),
638 XFORM( 0, 0 ) * rhs2.XFORM( 0, 2 ) +
XFORM( 0, 1 ) * rhs2.XFORM( 1, 2 ) +
XFORM( 0, 2 ) * rhs2.XFORM( 2, 2 ) +
639 XFORM( 0, 3 ) * rhs2.XFORM( 3, 2 ),
641 XFORM( 0, 0 ) * rhs2.XFORM( 0, 3 ) +
XFORM( 0, 1 ) * rhs2.XFORM( 1, 3 ) +
XFORM( 0, 2 ) * rhs2.XFORM( 2, 3 ) +
642 XFORM( 0, 3 ) * rhs2.XFORM( 3, 3 ),
645 XFORM( 1, 0 ) * rhs2.XFORM( 0, 0 ) +
XFORM( 1, 1 ) * rhs2.XFORM( 1, 0 ) +
XFORM( 1, 2 ) * rhs2.XFORM( 2, 0 ) +
646 XFORM( 1, 3 ) * rhs2.XFORM( 3, 0 ),
648 XFORM( 1, 0 ) * rhs2.XFORM( 0, 1 ) +
XFORM( 1, 1 ) * rhs2.XFORM( 1, 1 ) +
XFORM( 1, 2 ) * rhs2.XFORM( 2, 1 ) +
649 XFORM( 1, 3 ) * rhs2.XFORM( 3, 1 ),
651 XFORM( 1, 0 ) * rhs2.XFORM( 0, 2 ) +
XFORM( 1, 1 ) * rhs2.XFORM( 1, 2 ) +
XFORM( 1, 2 ) * rhs2.XFORM( 2, 2 ) +
652 XFORM( 1, 3 ) * rhs2.XFORM( 3, 2 ),
654 XFORM( 1, 0 ) * rhs2.XFORM( 0, 3 ) +
XFORM( 1, 1 ) * rhs2.XFORM( 1, 3 ) +
XFORM( 1, 2 ) * rhs2.XFORM( 2, 3 ) +
655 XFORM( 1, 3 ) * rhs2.XFORM( 3, 3 ),
658 XFORM( 2, 0 ) * rhs2.XFORM( 0, 0 ) +
XFORM( 2, 1 ) * rhs2.XFORM( 1, 0 ) +
XFORM( 2, 2 ) * rhs2.XFORM( 2, 0 ) +
659 XFORM( 2, 3 ) * rhs2.XFORM( 3, 0 ),
661 XFORM( 2, 0 ) * rhs2.XFORM( 0, 1 ) +
XFORM( 2, 1 ) * rhs2.XFORM( 1, 1 ) +
XFORM( 2, 2 ) * rhs2.XFORM( 2, 1 ) +
662 XFORM( 2, 3 ) * rhs2.XFORM( 3, 1 ),
664 XFORM( 2, 0 ) * rhs2.XFORM( 0, 2 ) +
XFORM( 2, 1 ) * rhs2.XFORM( 1, 2 ) +
XFORM( 2, 2 ) * rhs2.XFORM( 2, 2 ) +
665 XFORM( 2, 3 ) * rhs2.XFORM( 3, 2 ),
667 XFORM( 2, 0 ) * rhs2.XFORM( 0, 3 ) +
XFORM( 2, 1 ) * rhs2.XFORM( 1, 3 ) +
XFORM( 2, 2 ) * rhs2.XFORM( 2, 3 ) +
668 XFORM( 2, 3 ) * rhs2.XFORM( 3, 3 ),
671 XFORM( 3, 0 ) * rhs2.XFORM( 0, 0 ) +
XFORM( 3, 1 ) * rhs2.XFORM( 1, 0 ) +
XFORM( 3, 2 ) * rhs2.XFORM( 2, 0 ) +
672 XFORM( 3, 3 ) * rhs2.XFORM( 3, 0 ),
674 XFORM( 3, 0 ) * rhs2.XFORM( 0, 1 ) +
XFORM( 3, 1 ) * rhs2.XFORM( 1, 1 ) +
XFORM( 3, 2 ) * rhs2.XFORM( 2, 1 ) +
675 XFORM( 3, 3 ) * rhs2.XFORM( 3, 1 ),
677 XFORM( 3, 0 ) * rhs2.XFORM( 0, 2 ) +
XFORM( 3, 1 ) * rhs2.XFORM( 1, 2 ) +
XFORM( 3, 2 ) * rhs2.XFORM( 2, 2 ) +
678 XFORM( 3, 3 ) * rhs2.XFORM( 3, 2 ),
680 XFORM( 3, 0 ) * rhs2.XFORM( 0, 3 ) +
XFORM( 3, 1 ) * rhs2.XFORM( 1, 3 ) +
XFORM( 3, 2 ) * rhs2.XFORM( 2, 3 ) +
681 XFORM( 3, 3 ) * rhs2.XFORM( 3, 3 ) );