WP2LaTeX sources.
Révision | ffbc46817673b1aeda07bf9f742e8ae301757e39 (tree) |
---|---|
l'heure | 2022-06-02 07:40:03 |
Auteur | Fojtik |
Commiter | Fojtik |
Calculate bounding boxes on transformed data with "WorldTx" transform.
@@ -283,6 +283,7 @@ | ||
283 | 283 | #define ST_FLOAT_HI(ptr,val) ST_FLOAT_SWAP(ptr,val) |
284 | 284 | #define LD_DOUBLE_HI(ptr) LD_DOUBLE_SWAP(ptr) |
285 | 285 | #define ST_DOUBLE_HI(ptr,val) ST_DOUBLE_SWAP(ptr,val) |
286 | + #define LD_FLOAT_LO(ptr) LD_UINT32_CPU(ptr) | |
286 | 287 | #endif |
287 | 288 | |
288 | 289 | #ifdef HI_ENDIAN |
@@ -294,6 +295,8 @@ | ||
294 | 295 | #define LD_UINT64_HI(ptr) LD_UINT64_CPU(ptr) |
295 | 296 | #define ST_UINT64_HI(ptr,val) ST_UINT64_CPU(ptr,val) |
296 | 297 | #endif |
298 | + #define LD_FLOAT_HI(ptr) LD_UINT32_CPU(ptr) | |
299 | + #define LD_FLOAT_LO(ptr) LD_FLOAT_SWAP(ptr) | |
297 | 300 | #endif |
298 | 301 | #endif |
299 | 302 |
@@ -1870,7 +1870,7 @@ | ||
1870 | 1870 | FloatBBox bbx; |
1871 | 1871 | VectorList VectList; |
1872 | 1872 | |
1873 | - bbx.MinX=65537; bbx.MaxX=-1; bbx.MinY=65537; bbx.MaxY=-1; | |
1873 | + InitBBox(bbx); | |
1874 | 1874 | |
1875 | 1875 | CurrImg = &Img; |
1876 | 1876 |
@@ -258,6 +258,13 @@ | ||
258 | 258 | } |
259 | 259 | |
260 | 260 | |
261 | +void InitBBox(FloatBBox & bbx) | |
262 | +{ | |
263 | + bbx.MinY = bbx.MinX = 65537; | |
264 | + bbx.MaxY = bbx.MaxX =-32767; | |
265 | +} | |
266 | + | |
267 | + | |
261 | 268 | //------------------ART-------------------------- |
262 | 269 | #ifdef SupportART |
263 | 270 |
@@ -486,6 +486,8 @@ | ||
486 | 486 | float MaxY; |
487 | 487 | } FloatBBox; |
488 | 488 | |
489 | +void InitBBox(FloatBBox & bbx); | |
490 | + | |
489 | 491 | void UpdateBBox(FloatBBox & bbx, |
490 | 492 | float alpha, float x, float y, float dx, float dy); |
491 | 493 |
@@ -284,7 +284,7 @@ | ||
284 | 284 | NoConvertImage = 0; |
285 | 285 | YOffset = XOffset = 0; |
286 | 286 | YExtent = XExtent = 0; |
287 | - bbx.MinX=65537; bbx.MaxX=-32767; bbx.MinY=65537; bbx.MaxY=-32767; | |
287 | + InitBBox(bbx); | |
288 | 288 | // PSS has its own CTOR. |
289 | 289 | PSS.FillPattern = FILL_SOLID; |
290 | 290 | PSS.FontSizeW = PSS.FontSize = 1100/2.66; // Default font size [mm] |
@@ -3149,7 +3149,7 @@ | ||
3149 | 3149 | Rd_dword(wpd, &Count); |
3150 | 3150 | if(Count > (EmfRec.Size - 28)/4) |
3151 | 3151 | Count = (EmfRec.Size - 28)/4; |
3152 | - float *Points = LoadPoints(this, Count, bbx); | |
3152 | + float *Points = LoadPoints(this, Count, bbx, &WorldTx); | |
3153 | 3153 | if(Points==NULL) goto POLY_FAIL; |
3154 | 3154 | |
3155 | 3155 | const float Scale = GetScale2PSU((TMapMode)MapMode); |
@@ -3161,8 +3161,7 @@ | ||
3161 | 3161 | VectorPolygon *pVecPoly = new VectorPolygon(Points, Count); |
3162 | 3162 | Points = NULL; |
3163 | 3163 | pVecPoly->AttribFromPSS(PSS); |
3164 | - pVecPoly->Close = true; | |
3165 | - pVecPoly->Transform(WorldTx); | |
3164 | + pVecPoly->Close = true; | |
3166 | 3165 | VectList.AddObject(pVecPoly); pVecPoly=NULL; |
3167 | 3166 | |
3168 | 3167 | strcpy(ObjType,ObjName+1); |
@@ -3188,7 +3187,7 @@ | ||
3188 | 3187 | Count = (EmfRec.Size-28) / 4; |
3189 | 3188 | if(Count>0) |
3190 | 3189 | { |
3191 | - float *Points = LoadPoints(this, Count, bbx, NULL); | |
3190 | + float *Points = LoadPoints(this, Count, bbx, &WorldTx); | |
3192 | 3191 | if(Points!=NULL) |
3193 | 3192 | { |
3194 | 3193 | const float Scale = GetScale2PSU((TMapMode)MapMode); |
@@ -3202,7 +3201,7 @@ | ||
3202 | 3201 | |
3203 | 3202 | pVecPoly->AttribFromPSS(PSS); |
3204 | 3203 | pVecPoly->Close = false; |
3205 | - pVecPoly->Transform(WorldTx); | |
3204 | + //pVecPoly->Transform(WorldTx); | |
3206 | 3205 | VectList.AddObject(pVecPoly); pVecPoly=NULL; |
3207 | 3206 | |
3208 | 3207 | strcpy(ObjType,ObjName+1); |
@@ -3233,7 +3232,7 @@ | ||
3233 | 3232 | Count = (EmfRec.Size-28) / 4; |
3234 | 3233 | if(Count>0) |
3235 | 3234 | { |
3236 | - float *Points = LoadPoints(this, Count, bbx, NULL); | |
3235 | + float *Points = LoadPoints(this, Count, bbx, &WorldTx); | |
3237 | 3236 | if(Points!=NULL) |
3238 | 3237 | { |
3239 | 3238 | const float Scale = GetScale2PSU((TMapMode)MapMode); |
@@ -3247,7 +3246,7 @@ | ||
3247 | 3246 | |
3248 | 3247 | pVecCurve->AttribFromPSS(PSS); |
3249 | 3248 | pVecCurve->Close = false; |
3250 | - pVecCurve->Transform(WorldTx); | |
3249 | + //pVecCurve->Transform(WorldTx); | |
3251 | 3250 | VectList.AddObject(pVecCurve); pVecCurve=NULL; |
3252 | 3251 | |
3253 | 3252 | strcpy(ObjType,ObjName+1); |
@@ -3297,7 +3296,7 @@ | ||
3297 | 3296 | for(i=0; i<NumberOfPolygons; i++) |
3298 | 3297 | if(PolypolygonPointCount[i]>0) |
3299 | 3298 | { |
3300 | - float *Points = LoadPoints(this, PolypolygonPointCount[i], bbx); | |
3299 | + float *Points = LoadPoints(this, PolypolygonPointCount[i], bbx, &WorldTx); | |
3301 | 3300 | if(Points==NULL) break; |
3302 | 3301 | |
3303 | 3302 | for(int j=0; j<2*PolypolygonPointCount[i]; j++) |
@@ -3309,7 +3308,7 @@ | ||
3309 | 3308 | Points = NULL; |
3310 | 3309 | pVecPoly->AttribFromPSS(PSS); |
3311 | 3310 | pVecPoly->Close = true; |
3312 | - pVecPoly->Transform(WorldTx); | |
3311 | + //pVecPoly->Transform(WorldTx); | |
3313 | 3312 | VectList.AddObject(pVecPoly); pVecPoly=NULL; |
3314 | 3313 | } |
3315 | 3314 |
@@ -3346,7 +3345,7 @@ | ||
3346 | 3345 | for(i=0; i<NumberOfPolylines; i++) |
3347 | 3346 | if(PolylinePointCount[i]>0) |
3348 | 3347 | { |
3349 | - float *Points = LoadPoints(this, PolylinePointCount[i], bbx, NULL); | |
3348 | + float *Points = LoadPoints(this, PolylinePointCount[i], bbx, &WorldTx); | |
3350 | 3349 | if(Points==NULL) break; // PolylinePointCount must be deallocated |
3351 | 3350 | |
3352 | 3351 | for(int j=0; j<2*PolylinePointCount[i]; j++) |
@@ -3359,7 +3358,7 @@ | ||
3359 | 3358 | |
3360 | 3359 | pVecPoly->AttribFromPSS(PSS); |
3361 | 3360 | pVecPoly->Close = false; |
3362 | - pVecPoly->Transform(WorldTx); | |
3361 | + //pVecPoly->Transform(WorldTx); | |
3363 | 3362 | VectList.AddObject(pVecPoly); pVecPoly=NULL; |
3364 | 3363 | |
3365 | 3364 | strcpy(ObjType,ObjName+1); |