00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148 #ifndef INC_MI32_RVCCAD_H
00149 #define INC_MI32_RVCCAD_H
00150
00151 #ifndef INC_MI32_RVCDEFNS_H
00152 #include <mi32/rvcdefns.h>
00153 #endif
00154
00155 #ifndef INC_MI32_COLOR_H
00156 #include <mi32/color.h>
00157 #endif
00158
00159 #ifndef INC_MI32_ELEMSTYL_H
00160 #include <mi32/elemstyl.h>
00161 #endif
00162
00163 struct RVCCADINFO : public RVCGENINFO {
00164 DPOINT3D_OLD minval;
00165 DPOINT3D_OLD maxval;
00166 UINT16 PointType;
00167 UINT16 LinkType;
00168 UINT16 ElemHdrSize;
00169 UINT16 CAD_BlockSize;
00170 UINT32 MaxSize;
00171 UINT32 NumBlocks;
00172 DOUBLE xscale;
00173 DOUBLE yscale;
00174 DOUBLE zscale;
00175 INT32 NextElemID;
00176 INT32 m_EditBlockNum;
00177 DOUBLE m_TotalLineLength;
00178
00179 RVCCADINFO (
00180 ) {Clear();}
00181
00182 RVCCADINFO (
00183 const RVCGENINFO& ginfo
00184 ) {Clear();*static_cast<RVCGENINFO*>(this) = ginfo;}
00185
00186 RVCCADINFO& operator= (
00187 const RVCGENINFO& ginfo
00188 ) {*static_cast<RVCGENINFO*>(this) = ginfo; return (*this);}
00189
00190 void Clear (
00191 ) {memset(static_cast<void*>(this), 0, sizeof(*this));}
00192
00193
00194
00195 DRECT3D GetExtents (
00196 ) const {
00197 DRECT3D rect;
00198 rect.xinit = minval.x;
00199 rect.yinit = minval.y;
00200 rect.zinit = minval.z;
00201 rect.xlast = maxval.x;
00202 rect.ylast = maxval.y;
00203 rect.zlast = maxval.z;
00204 return (rect);
00205 }
00206
00207
00208 void SetExtents (
00209 const DRECT3D& rect
00210 ) {
00211 minval.x = rect.xinit;
00212 minval.y = rect.yinit;
00213 minval.z = rect.zinit;
00214 maxval.x = rect.xlast;
00215 maxval.y = rect.ylast;
00216 maxval.z = rect.zlast;
00217 return;
00218 }
00219
00220 };
00221
00222
00223
00224 struct CADBLOCK {
00225 RVC::OBJECTNAME name;
00226 RVC::OBJECTDESC desc;
00227 DPOINT3D BasePt;
00228 DPOINT3D GridPt;
00229 DPOINT3D minval;
00230 DPOINT3D maxval;
00231 DOUBLE xscale;
00232 DOUBLE yscale;
00233 DOUBLE zscale;
00234 DOUBLE xsize;
00235 DOUBLE ysize;
00236 DOUBLE zsize;
00237 COLOR GridColor;
00238 UINT32 NumElem;
00239 INT32 dbrecord;
00240 FLOAT rotate;
00241 UINT32 flags;
00242 UINT16 LinkType;
00243 UINT16 space;
00244 UINT32 LinkOffset;
00245
00246 CADBLOCK (
00247 ) {Clear();}
00248
00249 void Clear (
00250 ) {memset(static_cast<void*>(this), 0, sizeof(*this));}
00251
00252
00253
00254 DRECT3D GetExtents (
00255 ) const {
00256 DRECT3D rect;
00257 rect.xinit = minval.x;
00258 rect.yinit = minval.y;
00259 rect.zinit = minval.z;
00260 rect.xlast = maxval.x;
00261 rect.ylast = maxval.y;
00262 rect.zlast = maxval.z;
00263 return (rect);
00264 }
00265
00266 void SetExtents (
00267 const DRECT3D& rect
00268 ) {
00269 minval.x = rect.xinit;
00270 minval.y = rect.yinit;
00271 minval.z = rect.zinit;
00272 maxval.x = rect.xlast;
00273 maxval.y = rect.ylast;
00274 maxval.z = rect.zlast;
00275 return;
00276 }
00277
00278 };
00279
00280
00281 PREVENT_MEMFUNC(RVCCADINFO)
00282 PREVENT_MEMFUNC(CADBLOCK)
00283
00284 #define RVCCAD_MaxLink 5
00285 #define RVCCAD_Internal 0
00286 #define RVCCAD_MIF 1
00287 #define RVCCAD_AGF 2
00288 #define RVCCAD_SHP 3
00289 #define RVCCAD_TAB 4
00290
00291 #define CADBLOCK_HasGrid (0x00000001)
00292 #define CADBLOCK_DrawGridPts (0x00000002)
00293 #define CADBLOCK_DrawLast (0x00000004)
00294
00295
00296 struct CADELEMHDR {
00297 INT32 ElemSize;
00298 UINT16 ElemType;
00299 UINT8 NumAttrib;
00300 UINT8 NumExtra;
00301 };
00302
00303
00304
00305 #define CAD_INSERT 0
00306 #define CAD_POINT 1
00307 #define CAD_CIRCLE 2
00308 #define CAD_ARC 3
00309 #define CAD_ARCCHORD 4
00310 #define CAD_TEXT 5
00311 #define CAD_BLOCKTEXT 6
00312 #define CAD_LINE 7
00313 #define CAD_RBOX 8
00314 #define CAD_POLYGON 9
00315 #define CAD_MESH 10
00316 #define CAD_ELLIPSE 11
00317 #define CAD_EARC 12
00318 #define CAD_POLYNOMIAL 13
00319 #define CAD_ARCWEDGE 14
00320 #define CAD_EARCWEDGE 15
00321 #define CAD_EARCCHORD 16
00322 #define CAD_MULTILINE 17
00323 #define CAD_MULTIPOINT 18
00324 #define CAD_MULTIPOLYGON 19
00325 #define CAD_LAST 20
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338 struct CADELEMOPT {
00339 COLOR color;
00340 COLOR FillColor;
00341 INT32 dbrecord;
00342 INT32 LinePatt;
00343 INT32 FillPatt;
00344 INT32 Symbol;
00345 FLOAT Angle;
00346 FLOAT width;
00347 FLOAT ywidth;
00348 UINT32 StyleFlags;
00349 DPOINT3D Extrusion;
00350
00351 INT32 HyperLink;
00352 UINT16 WidthUnits;
00353 UINT16 Space;
00354 DOUBLE MapScale;
00355 COLOR m_LineDrawColor;
00356 COLOR m_PolyBorderColor;
00357 COLOR m_PolyFillColor;
00358
00359 CADELEMOPT (
00360 ) {
00361 memset(this, 0, sizeof(CADELEMOPT));
00362 }
00363
00364 CADELEMOPT& operator= (
00365 const CADELEMOPT& rhs
00366 ) {
00367 if (this != &rhs) memcpy(this, &rhs, sizeof(CADELEMOPT));
00368 return (*this);
00369 }
00370
00371 void GetStyle (
00372 LINESTYLE& line
00373 ) const {
00374 line.StyleFlags = StyleFlags;
00375 line.PatternNum = LinePatt;
00376 line.DrawColor = color;
00377 line.MapScale = MapScale;
00378 line.Scale = width;
00379 return;
00380 }
00381
00382 void GetStyle (
00383 POINTSTYLE& point
00384 ) const {
00385 point.StyleFlags = StyleFlags;
00386 point.SymbolNum = Symbol;
00387 point.DrawColor = color;
00388 point.Angle = Angle;
00389 point.ScaleX = width;
00390 point.ScaleY = ywidth;
00391 point.MapScale = MapScale;
00392 return;
00393 }
00394
00395 void GetStyle (
00396 POLYSTYLE& poly
00397 ) const {
00398 poly.StyleFlags = StyleFlags;
00399 poly.FillPatternNum = FillPatt;
00400 poly.BorderPatternNum = LinePatt;
00401 poly.BorderColor = color;
00402 poly.FillColor = FillColor;
00403 poly.MapScale = MapScale;
00404 poly.BorderScale = width;
00405 return;
00406 }
00407
00408 void GetStyle (
00409 TEXTSTYLE& text
00410 ) const {
00411 text.FGColor = color;
00412 text.BGColor = FillColor;
00413 text.StyleFlags = StyleFlags;
00414 text.StyleFlags &= ~STYLEFLAG_TextUseStyleHeight;
00415 text.MapScale = MapScale;
00416 return;
00417 }
00418
00419 void SetStyle (
00420 const LINESTYLE& line
00421 ) {
00422 StyleFlags = line.StyleFlags;
00423 LinePatt = line.PatternNum;
00424 color = line.DrawColor;
00425 MapScale = line.MapScale;
00426 width = static_cast<float>(line.Scale);
00427 return;
00428 }
00429
00430 void SetStyle (
00431 const POINTSTYLE& point
00432 ) {
00433 StyleFlags = point.StyleFlags;
00434 Symbol = point.SymbolNum;
00435 color = point.DrawColor;
00436 Angle = static_cast<float>(point.Angle);
00437 width = static_cast<float>(point.ScaleX);
00438 ywidth = static_cast<float>(point.ScaleY);
00439 MapScale = point.MapScale;
00440 return;
00441 }
00442
00443 void SetStyle (
00444 const POLYSTYLE& poly
00445 ) {
00446 StyleFlags = poly.StyleFlags;
00447 FillPatt = poly.FillPatternNum;
00448 LinePatt = poly.BorderPatternNum;
00449 color = poly.BorderColor;
00450 FillColor = poly.FillColor;
00451 MapScale = poly.MapScale;
00452 width = static_cast<float>(poly.BorderScale);
00453 return;
00454 }
00455
00456 void SetStyle (
00457 const TEXTSTYLE& text
00458 ) {
00459 color = text.FGColor;
00460 FillColor = text.BGColor;
00461 StyleFlags = text.StyleFlags;
00462 StyleFlags &= ~STYLEFLAG_TextUseStyleHeight;
00463 MapScale = text.MapScale;
00464 return;
00465 }
00466
00467 };
00468
00469
00470
00471
00472
00473
00474
00475
00476 struct CADCIRCLE {
00477 DPOINT2D_OLD center;
00478 DOUBLE radius;
00479 DOUBLE m_zvalue;
00480 };
00481
00482
00483 struct CADARC {
00484 DPOINT2D_OLD center;
00485 DOUBLE radius;
00486 DOUBLE start;
00487 DOUBLE end;
00488 DOUBLE m_zvalue;
00489 };
00490
00491
00492 struct CADTEXT {
00493 UINT32 NumPoints;
00494 UINT16 NumChars;
00495 UINT16 CharSize;
00496 FLOAT height;
00497 FLOAT rotate;
00498 FLOAT shear;
00499 FLOAT textrotate;
00500 FLOAT xscale;
00501 INT32 font;
00502 UINT32 FontFlags;
00503 UINT8 m_ShadowRelative;
00504 UINT8 m_BaselineFlags;
00505 UINT8 m_bCartoonBalloonLeaders;
00506 UINT8 m_Predefined;
00507
00508
00509 FLOAT m_LineSpace;
00510 FLOAT m_StrokeWidth;
00511 FLOAT m_EnhanceWidth;
00512 FLOAT m_BoldnessWidth;
00513 FLOAT m_UnderlineWidth;
00514 FLOAT m_UnderlineOffset;
00515 FLOAT m_ShadowOffset;
00516 FLOAT m_ShadowAngle;
00517 FLOAT m_ClipWidth;
00518
00519
00520 FLOAT m_Margin;
00521 FLOAT m_TMargin;
00522 FLOAT m_BMargin;
00523 FLOAT m_LMargin;
00524 FLOAT m_RMargin;
00525 UINT32 m_FrameShape;
00526 UINT32 m_LineStyleFlags;
00527 UINT32 m_PolyStyleFlags;
00528 FLOAT m_LineScale;
00529 FLOAT m_PolyBorderScale;
00530 UINT32 m_Arrow;
00531
00532 UINT32 m_NumLeaderLines;
00533 UINT8 spare2[4];
00534
00535
00536
00537
00538 };
00539
00540 #define CADBASELINEFLAG_Straight 0x00
00541 #define CADBASELINEFLAG_Exact 0x01
00542 #define CADBASELINEFLAG_Spline 0x02
00543 #define CADBASELINEFLAG_ClipUnder 0x04
00544
00545 struct CADINSERT {
00546 DPOINT3D_OLD InsertPt;
00547 INT32 BlockNum;
00548 FLOAT rotate;
00549 DOUBLE xscale;
00550 DOUBLE yscale;
00551 DOUBLE zscale;
00552 UINT16 numlins;
00553 UINT16 numcols;
00554 FLOAT linspace;
00555 FLOAT colspace;
00556 UINT32 space;
00557 };
00558
00559
00560 struct CADRBOX {
00561 FLOAT rotate;
00562 UINT32 space;
00563 };
00564
00565
00566 struct CADLINE {
00567 UINT32 NumPoints;
00568 UINT32 CurveFit;
00569 };
00570
00571
00572 struct CADPOLY {
00573 UINT32 NumPoints;
00574 UINT32 NumIslands;
00575 UINT32 CurveFit;
00576 UINT32 space;
00577 };
00578
00579
00580
00581
00582 struct CADMESH {
00583 UINT32 xverts;
00584 UINT32 yverts;
00585 UINT16 CurveFit;
00586 UINT16 flags;
00587 UINT32 space;
00588 };
00589
00590
00591 struct CADELLIPSE {
00592 DPOINT2D_OLD center;
00593 DOUBLE xsize;
00594 DOUBLE ysize;
00595 FLOAT rotate;
00596 UINT32 space;
00597 DOUBLE m_zvalue;
00598 };
00599
00600
00601 struct CADEARC {
00602 DPOINT2D_OLD center;
00603 DOUBLE start;
00604 DOUBLE end;
00605 DOUBLE xsize;
00606 DOUBLE ysize;
00607 FLOAT rotate;
00608
00609 UINT32 space;
00610 DOUBLE m_zvalue;
00611 };
00612
00613
00614 struct CADMULTIPOINT {
00615 UINT32 NumPoints;
00616 UINT32 space;
00617 };
00618
00619
00620 struct CADMULTILINE {
00621 UINT32 NumLines;
00622 UINT32 CurveFit;
00623 };
00624
00625
00626 struct CADMULTIPOLY {
00627 UINT32 NumPolygons;
00628 UINT32 CurveFit;
00629 };
00630
00631 struct CADSUBPOLY {
00632 UINT32 NumPoints;
00633 UINT32 NumIslands;
00634 };
00635
00636
00637 inline void SwapBytes (
00638 CADSUBPOLY& rhs
00639 ) { ::SwapBytes(rhs.NumPoints); ::SwapBytes(rhs.NumIslands); }
00640
00641
00642 struct CADPOLYNOM {
00643 DPOINT2D_OLD minval;
00644 DPOINT2D_OLD maxval;
00645 UINT32 NumCoeff;
00646 UINT32 space;
00647 };
00648
00649 union CADELEMDATA {
00650 CADINSERT insert;
00651 CADCIRCLE circle;
00652 CADARC arc;
00653 CADTEXT text;
00654 CADLINE line;
00655 CADRBOX rbox;
00656 CADPOLY poly;
00657 CADMESH mesh;
00658 CADELLIPSE ellipse;
00659 CADEARC earc;
00660 CADPOLYNOM polynom;
00661 CADMULTIPOINT mpoint;
00662 CADMULTILINE mline;
00663 CADMULTIPOLY mpoly;
00664 };
00665
00666
00667
00668 struct CADELEMENT {
00669 CADELEMHDR hdr;
00670 CADELEMOPT opt;
00671 CADELEMDATA data;
00672 DPOINT3D pt;
00673 void *text;
00674 INT32 *islelist;
00675 void *points;
00676 int PointSize;
00677 };
00678
00679
00680
00681
00682
00683
00684 #if (defined(X_NATIVE) || defined(WIN32_MFC)) && !defined(DEPRECATE_GROUPKEY)
00685
00686 DEPRECATED inline int MdlgGetCADObject (
00687 MDLGPARENT dlgparent,
00688 FILEPATH& filename,
00689 INT32 *inode,
00690 const void *prompt,
00691 RVCCADINFO *objinfo,
00692 MfFiltFuncProto filter=0,
00693 void *filtdata=0,
00694 GETOBJFLAGS flags=GETOBJFLAG_None
00695 ) {
00696 return (MdlgGetObject(dlgparent,filename,inode,prompt,OTYPE_CAD,RVCCONV_CADInfo,objinfo,sizeof(RVCCADINFO),filter,filtdata,flags));
00697 }
00698
00699
00700 DEPRECATED inline int MdlgGetCADObject (
00701 MDLGPARENT dlgparent,
00702 UNICODE *filename,
00703 INT32 *inode,
00704 const void *prompt,
00705 RVCCADINFO *objinfo,
00706 MfFiltFuncProto filter=0,
00707 void *filtdata=0,
00708 GETOBJFLAGS flags=GETOBJFLAG_None
00709 ) {
00710 return (MdlgGetObject(dlgparent,filename,inode,prompt,OTYPE_CAD,RVCCONV_CADInfo,objinfo,sizeof(RVCCADINFO),filter,filtdata,flags));
00711 }
00712
00713 #endif
00714
00715 #if defined(__cplusplus)
00716 extern "C" {
00717 #endif
00718
00719
00720 ERRVALUE MfConvertRasterToCADBound (int sfhandle, INT32 irastinode, int dfhandle, RVCGENINFO& oobjinfo, UINT32 flags);
00721 int MfConvertRasterToCADLine (int sfhandle, INT32 irastinode, RVC::OBJITEM& DestObjItem, double ThinFactor, UINT32 flags);
00722
00723 #if defined(__cplusplus)
00724 }
00725 #endif
00726
00727 #endif