#include <gmould.h>
Inheritance diagram for GMould:
Public Member Functions | |
GMould () | |
BOOL | Define (POINT *P, RECT *pBBox, DWORD pTolerance=0) |
virtual void | CopyShape (POINT *P)=0 |
virtual BOOL | Redefine (POINT *P)=0 |
virtual BOOL | FitPath (CONST POINT *IPoints, CONST BYTE *ITypes, DWORD ILength, LPPOINT OPoints, LPBYTE OTypes, DWORD OLength, BOOL Close=FALSE)=0 |
void | FitPoint (POINT a, POINT &b) |
void | FitPoint (DPOINT a, POINT &b) |
DocRect | GetBoundingRect () |
RECT | GetSourceBBox () const |
Protected Member Functions | |
double | CalcTolerance (DWORD pTolerance) |
BOOL | GenOp (BYTE Op, DPOINT T) |
BOOL | GenMove (DPOINT T) |
BOOL | GenLine (DPOINT T) |
void | ScaleSrc (POINT a, DPOINT &b) |
void | Scale (POINT a, DPOINT &b) |
void | InverseScale (DPOINT a, POINT &b) |
BOOL | GenCurve (DPOINT C2, DPOINT C4, DPOINT P0, DPOINT P2, DPOINT P4, DPOINT P6, DPOINT T0, DPOINT T2, DPOINT T4, DPOINT T6) |
virtual void | ScaleView ()=0 |
virtual void | CalcViewBBox ()=0 |
virtual void | CalcViewConsts ()=0 |
virtual void | Transform (DPOINT a, DPOINT &b)=0 |
Protected Attributes | |
RECT | SrcBBox |
INT32 | MinX |
INT32 | MaxX |
INT32 | MinY |
INT32 | MaxY |
INT32 | Width |
INT32 | Depth |
double | Tolerance |
LPPOINT | OPoints |
LPBYTE | OTypes |
DWORD | OLength |
Definition at line 169 of file gmould.h.
|
Definition at line 111 of file gmould.cpp. 00112 { 00113 SrcBBox.left = 0; 00114 SrcBBox.top = 1; 00115 SrcBBox.right = 1; 00116 SrcBBox.bottom = 0; 00117 00118 MinX = MinY = 0; 00119 MaxX = MaxY = 1; 00120 Width = Depth = 1; 00121 00122 Tolerance = 0.0; 00123 }
|
|
Definition at line 154 of file gmould.cpp. 00155 { 00156 // INT32 x, y ; 00157 // x = (INT32)( ((float)Tolerance*0x10000000)/Width ) ; 00158 // y = (INT32)( ((float)Tolerance*0x10000000)/Depth ) ; 00159 if ( pTolerance==0 ) 00160 return 0.0 ; 00161 00162 double x, y ; 00163 00164 x = (double) pTolerance/Width ; 00165 y = (double) pTolerance/Depth ; 00166 00167 return 16*(x+y+2*max(x,y)) ; 00168 }
|
|
Implemented in GEnvelope, GEnvelope2x2, and GPerspective. |
|
Implemented in GEnvelope, GEnvelope2x2, and GPerspective. |
|
Implemented in GEnvelope, GEnvelope2x2, and GPerspective. |
|
Definition at line 126 of file gmould.cpp. 00127 { 00128 SrcBBox.left = pBBox->left ; 00129 SrcBBox.top = pBBox->top ; 00130 SrcBBox.right = pBBox->right ; 00131 SrcBBox.bottom = pBBox->bottom ; 00132 00133 if (!Redefine( P )) 00134 return FALSE; 00135 00136 Tolerance = CalcTolerance( pTolerance ) ; 00137 00138 return TRUE; 00139 }
|
|
Implemented in GEnvelope, GEnvelope2x2, and GPerspective. |
|
Definition at line 180 of file gmould.cpp. 00181 { 00182 DPOINT t ; 00183 Transform ( a, t ) ; 00184 InverseScale( t, b ) ; 00185 }
|
|
Definition at line 172 of file gmould.cpp. 00173 { 00174 DPOINT t ; 00175 ScaleSrc ( a, t ) ; 00176 Transform ( t, t ) ; 00177 InverseScale( t, b ) ; 00178 }
|
|
Definition at line 189 of file gmould.cpp. 00192 { 00193 if ( Tolerance > 0 ) 00194 { 00195 double T ; 00196 DPOINT D ; 00197 DPOINT P1, P3, P5 ; 00198 DPOINT T1, T3, T5 ; 00199 DPOINT N1, N3, N5 ; 00200 P1.x = (125*P0.x+75*C2.x+15*C4.x + P6.x)/216 ; 00201 P1.y = (125*P0.y+75*C2.y+15*C4.y + P6.y)/216 ; 00202 P3.x = ( P0.x+3*(C2.x+ C4.x)+ P6.x)/8 ; 00203 P3.y = ( P0.y+3*(C2.y+ C4.y)+ P6.y)/8 ; 00204 P5.x = ( P0.x+15*C2.x+75*C4.x +125*P6.x)/216 ; 00205 P5.y = ( P0.y+15*C2.y+75*C4.y +125*P6.y)/216 ; 00206 Transform( P1, T1 ) ; 00207 Transform( P3, T3 ) ; 00208 Transform( P5, T5 ) ; 00209 N3.x = -T0.x+9*(T2.x+T4.x)-T6.x ; 00210 N3.y = -T0.y+9*(T2.y+T4.y)-T6.y ; 00211 D.x = fabs(16*T3.x-N3.x) ; 00212 D.y = fabs(16*T3.y-N3.y) ; 00213 T = D.x+D.y+2*max(D.x,D.y) ; 00214 if ( T<=Tolerance ) 00215 { 00216 N1.x = 5*(T0.x-T4.x)+15*T2.x+T6.x ; 00217 N1.y = 5*(T0.y-T4.y)+15*T2.y+T6.y ; 00218 D.x = fabs(16*T1.x-N1.x) ; 00219 D.y = fabs(16*T1.y-N1.y) ; 00220 T = D.x+D.y+2*max(D.x,D.y) ; 00221 if ( T<=Tolerance ) 00222 { 00223 N5.x = T0.x+15*T4.x+5*(T6.x-T2.x) ; 00224 N5.y = T0.y+15*T4.y+5*(T6.y-T2.y) ; 00225 D.x = fabs(16*T5.x-N5.x) ; 00226 D.y = fabs(16*T5.y-N5.y) ; 00227 T = D.x+D.y+2*max(D.x,D.y) ; 00228 } 00229 } 00230 if ( T>Tolerance ) 00231 { 00232 DPOINT CL1, CL2, CR1, CR2 ; 00233 CL1.x = (P0.x+C2.x)/2 ; 00234 CL1.y = (P0.y+C2.y)/2 ; 00235 CL2.x = (P0.x+2*C2.x+C4.x)/4 ; 00236 CL2.y = (P0.y+2*C2.y+C4.y)/4 ; 00237 CR1.x = (C2.x+2*C4.x+P6.x)/4 ; 00238 CR1.y = (C2.y+2*C4.y+P6.y)/4 ; 00239 CR2.x = (C4.x+P6.x)/2 ; 00240 CR2.y = (C4.y+P6.y)/2 ; 00241 return GenCurve( CL1, CL2, P0, P1, P2, P3, T0, T1, T2, T3 ) && 00242 GenCurve( CR1, CR2, P3, P4, P5, P6, T3, T4, T5, T6 ) ; 00243 } 00244 } 00245 if ( OLength <= 3 ) return FALSE ; 00246 OLength -= 3 ; 00247 DPOINT N2, N4 ; 00248 N2.x = (-5*T0.x+18*T2.x- 9*T4.x+2*T6.x)/6 ; 00249 N2.y = (-5*T0.y+18*T2.y- 9*T4.y+2*T6.y)/6 ; 00250 N4.x = ( 2*T0.x- 9*T2.x+18*T4.x-5*T6.x)/6 ; 00251 N4.y = ( 2*T0.y- 9*T2.y+18*T4.y-5*T6.y)/6 ; 00252 InverseScale( N2, *OPoints++ ) ; *OTypes++ = PT_BEZIERTO ; 00253 InverseScale( N4, *OPoints++ ) ; *OTypes++ = PT_BEZIERTO ; 00254 InverseScale( T6, *OPoints++ ) ; *OTypes++ = PT_BEZIERTO ; 00255 return TRUE ; 00256 }
|
|
Definition at line 303 of file gmould.h.
|
|
Definition at line 298 of file gmould.h.
|
|
Definition at line 291 of file gmould.h. 00292 { 00293 if ( OLength-- < 1 ) return FALSE ; 00294 InverseScale( T, *OPoints++ ) ; *OTypes++ = Op ; 00295 return TRUE ; 00296 }
|
|
Definition at line 141 of file gmould.cpp. 00142 { 00143 DocRect Rect; 00144 Rect.lo.x = MinX; 00145 Rect.lo.y = MinY; 00146 Rect.hi.x = MaxX; 00147 Rect.hi.y = MaxY; 00148 return Rect; 00149 }
|
|
Definition at line 191 of file gmould.h. 00191 { return SrcBBox; }
|
|
Definition at line 272 of file gmould.cpp.
|
|
Implemented in GEnvelope, GEnvelope2x2, and GPerspective. |
|
Definition at line 266 of file gmould.cpp.
|
|
Definition at line 260 of file gmould.cpp. 00261 { 00262 b.x = (double)(a.x-SrcBBox.left )/(SrcBBox.right-SrcBBox.left ) ; 00263 b.y = (double)(a.y-SrcBBox.bottom)/(SrcBBox.top -SrcBBox.bottom) ; 00264 }
|
|
Implemented in GEnvelope, GEnvelope2x2, and GPerspective. |
|
Implemented in GEnvelope, GEnvelope2x2, and GPerspective. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|