Go to the source code of this file.
Defines | |
| #define | realtype float |
| #define | SUCCESS 0 |
| #define | M_PI 3.14159265358979323846 |
| #define | DegreeToRad(val) (val)*(M_PI/180) |
| #define | _X_ 0 |
| #define | _Y_ 1 |
| #define | _Z_ 2 |
| #define | _W_ 3 |
| #define | IDENTITY "ident;" |
Typedefs | |
| typedef float | Matrix44 [4][4] |
Functions | |
| __J2K__EXTERN_C int | ComputeStringTransform (char *s, Matrix44 *transform) |
| void | __ComputeTransform (char *com, char *val, Matrix44 *m) |
| void | __Rotate (double nv, char axe, Matrix44 *m) |
| void | __Translate (double nv, char axe, Matrix44 *m) |
| void | __Resize (double nv, char axe, Matrix44 *m) |
| void | MatSwapProd (float *m1, float *m2, int l, int m, int n, float *m3) |
| void | SetIdentityMat (float *m1, int m) |
| void | SetNullMat (float *m1, int m, int n) |
|
|
Definition at line 18 of file Pos.hpp. Referenced by ModeleurRotationZ(), and __Rotate().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
Definition at line 62 of file Pos.cpp. 00063 {
00064 int pos = -1, end;
00065 char *sbegin1 = s,*sbegin, commande[3];
00066
00067 SetIdentityMat ((realtype*)*transform, 4 );
00068
00069 if ( s == NULL ||*s == ENDOFSTRING ||
00070 strcmp(s,IDENTITY) == SUCCESS ) return SUCCESS;
00071
00072 end = strlen( s )-1; /* -1 car on recale sur 0*/
00073 commande[2] = ENDOFSTRING;
00074
00075 while ( pos != end )
00076 {
00077 sbegin = strchr ( sbegin1, SEPARATEUR );
00078 pos += sbegin - sbegin1 + 1;
00079 *sbegin = ENDOFSTRING;
00080
00081 /* ici on se retrouve avec une seule commande isolé sbegin1*/
00082 /* on a par exemple RX-32 ou EX1 ou TY-1456.5....... */
00083 commande[0] = sbegin1[0];
00084 commande[1] = sbegin1[1];
00085
00086 /* ici on se retrouve avec la chaine de value en sbegin1+2 .*/
00087
00088 __ComputeTransform( commande, sbegin1+2, transform );
00089
00090 /* On remet la chaîne en forme.*/
00091 *sbegin = SEPARATEUR;
00092 sbegin1 = sbegin+1;
00093 }
00094
00095 return SUCCESS; }
|
|
||||||||||||||||||||||||||||
|
Referenced by __Resize(), __Rotate(), and __Translate().
|
|
||||||||||||
|
Referenced by ComputeStringTransform(), __Resize(), __Rotate(), and __Translate().
|
|
||||||||||||||||
|
Referenced by SetIdentityMat().
|
|
||||||||||||||||
|
Definition at line 97 of file Pos.cpp. Referenced by ComputeStringTransform().
00098 {
00099 double nv;
00100
00101 if ( com[0] == 'R' || com[0] == 'r' )
00102 {
00103 nv = atof( val );
00104 __Rotate( nv, com[1], m );
00105 return; }
00106
00107 if ( com[0] == 'T' || com[0] == 't' )
00108 {
00109 nv = atof( val );
00110 __Translate( nv, com[1], m );
00111 return; }
00112
00113 if ( com[0] == 'E' || com[0] == 'e' )
00114 {
00115 nv = atof( val );
00116 __Resize( nv, com[1], m );
00117 return; }
00118 }
|
|
||||||||||||||||
|
Definition at line 187 of file Pos.cpp. Referenced by __ComputeTransform().
00187 {
00188
00189 Matrix44 matrix;
00190
00191 SetIdentityMat ((realtype*) matrix, 4 );
00192
00193 do {
00194 if ( axe == 'X' || axe == 'x' )
00195 {
00196 matrix[_X_][_X_] = nv;
00197 break;
00198 }
00199
00200 if ( axe == 'Y' || axe == 'y' )
00201 {
00202 matrix[_Y_][_Y_] = nv;
00203 break;
00204 }
00205
00206 if ( axe == 'Z' || axe == 'z' )
00207 {
00208 matrix[_Z_][_Z_] = nv;
00209 break;
00210 }
00211
00212 } while (1); /* une boucle sans fin pour le break.*/
00213
00214 MatSwapProd( (realtype*)*m, (realtype*)matrix, 4, 4, 4, (realtype*)*m );
00215 }
|
|
||||||||||||||||
|
Definition at line 120 of file Pos.cpp. Referenced by __ComputeTransform().
00121 { Matrix44 matrix;
00122 realtype cos, sin;
00123
00124 SetIdentityMat ((realtype*) matrix, 4 );
00125 cos = cos ( DegreeToRad(nv) );
00126 sin = sin ( DegreeToRad(nv) );
00127
00128 do{
00129 if ( axe == 'X' || axe == 'x' )
00130 {
00131 matrix[_Y_][_Y_] = cos;
00132 matrix[_Z_][_Z_] = cos;
00133 matrix[_Z_][_Y_] = -sin;
00134 matrix[_Y_][_Z_] = sin;
00135
00136 break; }
00137
00138 if ( axe == 'Y' || axe == 'y' )
00139 {
00140 matrix[_X_][_X_] = cos;
00141 matrix[_Z_][_Z_] = cos;
00142 matrix[_X_][_Z_] = -sin;
00143 matrix[_Z_][_X_] = sin;
00144
00145 break; }
00146
00147 if ( axe == 'Z' || axe == 'z' )
00148 {
00149 matrix[_X_][_X_] = cos;
00150 matrix[_Y_][_Y_] = cos;
00151 matrix[_Y_][_X_] = -sin;
00152 matrix[_X_][_Y_] = sin;
00153
00154 break; }
00155
00156 } while (1); /* une boucle sans fin pour le break.*/
00157
00158 MatSwapProd( (realtype*)*m, (realtype*)matrix, 4, 4, 4, (realtype*)*m );
00159 }
|
|
||||||||||||||||
|
Definition at line 161 of file Pos.cpp. Referenced by __ComputeTransform().
00162 { Matrix44 matrix;
00163
00164 SetIdentityMat ((realtype*) matrix, 4 );
00165
00166 do{
00167 if ( axe == 'X' || axe == 'x' )
00168 {
00169 matrix[_W_][_X_] = nv;
00170 break; }
00171
00172 if ( axe == 'Y' || axe == 'y' )
00173 {
00174 matrix[_W_][_Y_] = nv;
00175 break; }
00176
00177 if ( axe == 'Z' || axe == 'z' )
00178 {
00179 matrix[_W_][_Z_] = nv;
00180 break; }
00181
00182 } while (1); /* une boucle sans fin pour le break.*/
00183
00184 MatSwapProd( (realtype*)*m, (realtype*)matrix, 4, 4, 4, (realtype*)*m );
00185 }
|
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001