rvccad.h

Go to the documentation of this file.
00001 /**
00002  * \file rvccad.h <mi32/rvccad.h>
00003  * \brief CAD object descriptions Version 2.0      (RVCCAD format)
00004  *
00005  * \if NODOC
00006  * $Id: rvccad.h_v 1.94 2004/09/02 16:15:32 scowan Exp $
00007  *
00008  * $Log: rvccad.h_v $
00009  * Revision 1.94  2004/09/02 16:15:32  scowan
00010  * Removed prototypes and an include file.
00011  *
00012  * Revision 1.93  2004/09/01 22:54:20  scowan
00013  * Most functions removed or moved to private include file.
00014  *
00015  * Revision 1.92  2004/08/24 22:09:04  scowan
00016  * Added total line length field to header.
00017  *
00018  * Revision 1.91  2004/08/10 21:27:12  scowan
00019  * *** empty log message ***
00020  *
00021  * Revision 1.90  2004/08/10 21:10:10  scowan
00022  * Removed now unused prototypes.
00023  *
00024  * Revision 1.89  2004/06/14 16:20:42  scowan
00025  * Added baseline flags.
00026  *
00027  * Revision 1.88  2004/06/03 22:10:54  scowan
00028  * Removed archived prototype.
00029  *
00030  * Revision 1.87  2004/05/18 21:59:57  scowan
00031  * Adde dmore fields to cad text.
00032  *
00033  * Revision 1.86  2004/05/17 23:30:07  scowan
00034  * Added many items to text structure.
00035  *
00036  * Revision 1.85  2004/04/13 16:01:18  scowan
00037  * Fixed invalid style flag value in cad objects.
00038  *
00039  * Revision 1.84  2004/03/10 22:47:14  mju
00040  * Remove getCADObjectSet, deprecate other getCADObject inlines.
00041  *
00042  * Revision 1.83  2003/10/15 17:39:00  mju
00043  * Deprecate groupkey.
00044  *
00045  * Revision 1.82  2003/10/13 17:05:45  scowan
00046  * Removed unused structre.
00047  *
00048  * Revision 1.81  2003/10/13 17:03:58  scowan
00049  * Removed unused function prototypes and inlines.
00050  *
00051  * Revision 1.80  2003/09/15 13:49:56  fileserver!dwilliss
00052  * Doxygen
00053  *
00054  * Revision 1.79  2003/08/27 21:31:17  scowan
00055  * Removed function to get linked file.
00056  *
00057  * Revision 1.78  2003/02/06 21:30:21  scowan
00058  * Removed some functions.
00059  *
00060  * Revision 1.77  2002/12/26 16:23:40  scowan
00061  * Fixed invalid extents handling.
00062  *
00063  * Revision 1.76  2002/09/09 13:54:00  mju
00064  * Use prevent_memfunc.
00065  *
00066  * Revision 1.75  2002/08/21 20:38:49  scowan
00067  * Deprecated old object name define.
00068  *
00069  * Revision 1.74  2002/08/20 15:08:39  mju
00070  * Remove deprecated dialog defines.
00071  *
00072  * Revision 1.73  2002/03/08 18:48:10  scowan
00073  * Added clear method.
00074  * delrecate mem.. functions using info struct.
00075  *
00076  * Revision 1.72  2002/01/03 22:51:29  scowan
00077  * Added methods to manage extents.
00078  *
00079  * Revision 1.71  2001/09/14 14:58:03  mju
00080  * No Mdlg in win32native.
00081  *
00082  * Revision 1.70  2001/07/18 21:04:09  scowan
00083  * Added TAB file linking.
00084  *
00085  * Revision 1.69  2001/07/11 16:07:34  scowan
00086  * Added encoding for link creation.
00087  *
00088  * Revision 1.68  2001/07/10 17:42:14  scowan
00089  * Mored CAD object linking to private include file.
00090  *
00091  * Revision 1.67  2001/06/18 15:40:47  mju
00092  * Convert RasterToCADBoundary now takes GENINFO reference.
00093  * ConvertVectorToCAD now takes geninfo reference.
00094  *
00095  * Revision 1.66  2001/05/29 21:11:28  scowan
00096  * Added functions to assist in wrapper classes.
00097  *
00098  * Revision 1.65  2000/09/06 16:39:41  scowan
00099  * Added read open header function.
00100  *
00101  * Revision 1.64  2000/07/13 21:30:42  mju
00102  * Deprecated old MfGet...UC #defines.
00103  *
00104  * Revision 1.63  2000/04/21 15:02:19  scowan
00105  * Added assignment operator.
00106  *
00107  * Revision 1.62  2000/03/21 23:14:32  scowan
00108  * More const.
00109  *
00110  * Revision 1.60  2000/01/03 20:09:26  scowan
00111  * More inline methods.
00112  *
00113  * Revision 1.59  1999/12/29 16:53:59  scowan
00114  * Move cad element definition.
00115  *
00116  * Revision 1.58  1999/12/23 16:31:24  scowan
00117  * Definition of new CAD element class.
00118  *
00119  * Revision 1.57  1999/12/17 18:11:21  scowan
00120  * More const.
00121  *
00122  * Revision 1.54  1999/10/05 22:45:08  scowan
00123  * Change headeer to Inheritance.
00124  *
00125  * Revision 1.53  1999/08/06 17:11:35  dwilliss
00126  * Just added a comment to clarify something.
00127  *
00128  * Revision 1.52  1999/07/26 19:37:08  scowan
00129  * Added function to return linked to file.
00130  *
00131  * Revision 1.49  1999/06/11  16:09:19  mju
00132  * In obj sel dlg add defaults for filter+filtdata.
00133  *
00134  * Revision 1.48  1999/06/11  14:45:09  mju
00135  * Obj sel dlg.
00136  *
00137  * Revision 1.47  1999/06/10  22:10:42  mju
00138  * Object selection dialog update.
00139  *
00140  * Revision 1.46  1999/05/07  21:22:06  mju
00141  * Header restruct.
00142  *
00143  *
00144  * By Steve Cowan    9-19-90
00145  * \endif
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;    //!< 24  Min coord values for the entire CADobj 
00165    DPOINT3D_OLD maxval;    //!< 24  Max coord values for the entire CADobj 
00166    UINT16 PointType;       //!< 2   RVC CAD point types 
00167    UINT16 LinkType;        //!< 2   Type of link (DXF, MIF, ...) 
00168    UINT16 ElemHdrSize;     //!< 2   Size of CADELEMHDR  (set by MfMakeCAD routine) 
00169    UINT16 CAD_BlockSize;   //!< 2   Size of CADBLOCK    (set by MfMakeCAD routine) 
00170    UINT32 MaxSize;         //!< 4   Maximum Size of an CAD object element  (set by MfUpdateCAD routine) 
00171    UINT32 NumBlocks;       //!< 4   Number of CAD object Block Headers 
00172    DOUBLE xscale;          //!< 8   Scale between CAD object and ground distances 
00173    DOUBLE yscale;          //!< 8   Scale between CAD object and ground distances 
00174    DOUBLE zscale;          //!< 8   Scale between CAD object and ground distances 
00175    INT32 NextElemID;       //!< 4   Next element ID variable 
00176    INT32 m_EditBlockNum;   //!< 4   In memory field only
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    //! Get extents of CAD object.
00194    //! @return extents of CAD object
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    //! Set extents of CAD object.
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 /* If structure size changes, geom.dll will need to be changed */
00224 struct CADBLOCK {
00225    RVC::OBJECTNAME name;   //!< 32 Name of Block 
00226    RVC::OBJECTDESC desc;   //!< 128 Description of a block 
00227    DPOINT3D BasePt;        //!< 24 Base point for the block 
00228    DPOINT3D GridPt;        //!< 24 Base point of snap grid 
00229    DPOINT3D minval;        //!< 24 Minimum coordinate values for the block 
00230    DPOINT3D maxval;        //!< 24 Maximum coordinate values for the block 
00231    DOUBLE xscale;          //!<  8 Scale between CAD block and ground distances (x scale) 
00232    DOUBLE yscale;          //!<  8 Scale between CAD block and ground distances (y scale) 
00233    DOUBLE zscale;          //!<  8 Scale between CAD block and ground distances (z scale) 
00234    DOUBLE xsize;           //!<  8 X direction size in CAD units (snap grid) 
00235    DOUBLE ysize;           //!<  8 Y direction size in CAD units (snap grid) 
00236    DOUBLE zsize;           //!<  8 Z direction size in CAD units (snap grid) 
00237    COLOR GridColor;        //!<  8 Grid snap point color - XColor format 
00238    UINT32 NumElem;            //!<  4 Total number of elements in block 
00239    INT32 dbrecord;            //!<  4 Pointer to dblist entry (set by editor) 
00240    FLOAT rotate;           //!<  4 Rotation angle (snap grid) 
00241    UINT32 flags;           //!<  4 Flags defined below 
00242    UINT16 LinkType;        //!<  2 Type of link (DXF, MIF, ...) 
00243    UINT16 space;           //!<  2 Spare bytes 
00244    UINT32 LinkOffset;         //!<  4 File offset to linked data 
00245    
00246    CADBLOCK (
00247       ) {Clear();}
00248    
00249    void Clear (
00250       ) {memset(static_cast<void*>(this), 0, sizeof(*this));}
00251    
00252    //! Get extents of CAD block
00253    //! @return extents of CAD block
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 //! Disallow memset/memcpy.
00281 PREVENT_MEMFUNC(RVCCADINFO)
00282 PREVENT_MEMFUNC(CADBLOCK)
00283 
00284 #define RVCCAD_MaxLink     5
00285 #define RVCCAD_Internal    0
00286 #define RVCCAD_MIF         1     //!< Mapinfo .MIF format
00287 #define RVCCAD_AGF         2     //!< Atlas GIS 3.0 internal format
00288 #define RVCCAD_SHP         3     //!< Arc/Info Shapefile format
00289 #define RVCCAD_TAB         4     //!< MapInfo TAB format
00290 
00291 #define CADBLOCK_HasGrid      (0x00000001)
00292 #define CADBLOCK_DrawGridPts  (0x00000002)
00293 #define CADBLOCK_DrawLast     (0x00000004)
00294 
00295 
00296 struct CADELEMHDR {
00297    INT32 ElemSize;                  //!<  Entire size of CAD element stored (set by MfUpdateCADElem()) 
00298    UINT16 ElemType;              //!<  Type of CADobj element stored (see below) 
00299    UINT8 NumAttrib;              //!<  Number of attributes in data (set by MfWriteCADElem()) 
00300    UINT8 NumExtra;               //!<  Number of extra attributes in extra (set by MfUpdateCADElem()) 
00301    };
00302 
00303 /*--- Defined CAD elements ---*/
00304 
00305 #define CAD_INSERT         0
00306 #define CAD_POINT          1     //!<  Has no structure 
00307 #define CAD_CIRCLE         2
00308 #define CAD_ARC            3
00309 #define CAD_ARCCHORD       4     //!<  Uses CADARC structure 
00310 #define CAD_TEXT           5
00311 #define CAD_BLOCKTEXT      6     //!<  Uses CADTEXT structure  N.I.Y. 
00312 #define CAD_LINE           7
00313 #define CAD_RBOX           8     //!<  An easy way to define a rectangle 
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    //!<                          N.I.Y. 
00319 #define CAD_ARCWEDGE       14    //!<  Uses CADARC structure 
00320 #define CAD_EARCWEDGE      15    //!<  Uses CADEARC structure 
00321 #define CAD_EARCCHORD      16    //!<  Uses CADEARC structure 
00322 #define CAD_MULTILINE      17
00323 #define CAD_MULTIPOINT     18
00324 #define CAD_MULTIPOLYGON   19
00325 #define CAD_LAST           20
00326 
00327 /*#define CAD_PARABOLA     21    not defined yet*/
00328 /*#define CAD_HYPERBOLA    22    not defined yet*/
00329 /*#define CAD_VARITEXT     23    not defined yet*/
00330 
00331 /**
00332 * Any addition to the list "MUST" be noted in _rvcCADInit() (rvccad.c)
00333 * and in StyleQueryEvalCAD (dbqstyle.c)
00334 * and in hdrdesc.ref (see person in charge of RVC).
00335 * If structure size changes, geom.dll will need to be changed
00336 **/
00337 
00338 struct CADELEMOPT {
00339    COLOR color;                  //!<  8  Color - XColor format 
00340    COLOR FillColor;              //!<  8  Fill color - XColor format 
00341    INT32 dbrecord;               //!<  4  Pointer to dblist entry 
00342    INT32 LinePatt;               //!<  4  Line Pattern index 
00343    INT32 FillPatt;               //!<  4  Fill Pattern index 
00344    INT32 Symbol;                 //!<  4  Point Symbol index 
00345    FLOAT Angle;                  //!<  4  Angle of point symbol 
00346    FLOAT width;                  //!<  4  Width of element in CAD coordinates!, also X-Width for points 
00347    FLOAT ywidth;                 //!<  4  Y-Width for points 
00348    UINT32 StyleFlags;            //!<  4  See STDDEFNS.H for flag definitions 
00349    DPOINT3D Extrusion;           /* 24 X, Y, or Z coordinate used in VPOINT_3D?? coords.
00350                                        For planar data, this is the normal vector to the plane that the element is placed on. */
00351    INT32 HyperLink;              //!<  4  Index to hyperindex shape definition 
00352    UINT16 WidthUnits;            //!<  2  Units that width field is in 
00353    UINT16 Space;                 //!<  2  Reserved for future use 
00354    DOUBLE MapScale;              //!<  8  MapScale to use given scales at 
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 * Any addition to CADELEMOPT "MUST" be noted in _rvcCADInit() (rvccad.c)
00471 * and in headers.def (see person in charge of RVC).
00472 **/
00473 
00474 /*--- Structure definitions for CAD elements */
00475 
00476 struct CADCIRCLE {      /* Size = 32 */
00477    DPOINT2D_OLD center;          //!<  Center point of circle 
00478    DOUBLE radius;                //!<  Radius of circle 
00479    DOUBLE m_zvalue;              //!< Z value of center point
00480    };
00481 
00482 
00483 struct CADARC {         /* Size = 48 */
00484    DPOINT2D_OLD center;          //!<  Center point of arc 
00485    DOUBLE radius;                //!<  Radius of arc 
00486    DOUBLE start;                 //!<  Start angle of arc 
00487    DOUBLE end;                   //!<  End angle of arc 
00488    DOUBLE m_zvalue;              //!< Z value of center point
00489    };
00490 
00491 
00492 struct CADTEXT {        /* Size = 128 */
00493    UINT32 NumPoints;             //!< Number of points 
00494    UINT16 NumChars;              //!< Number of charaters in text string 
00495    UINT16 CharSize;              //!< Number of bytes per character (1 or 2) 
00496    FLOAT height;                 //!< Height of text in CAD coordinates 
00497    FLOAT rotate;                 //!< Rotation angle of string 
00498    FLOAT shear;                  //!< Shear angle 
00499    FLOAT textrotate;             //!< Rotation angle of each character in the string 
00500    FLOAT xscale;                 //!< X Scale factor relative to height (default 1.0) 
00501    INT32 font;                   //!< Font number 
00502    UINT32 FontFlags;             //!< Text style bits 
00503    UINT8 m_ShadowRelative;       //!< true if shadow angle relative to baseline angle
00504    UINT8 m_BaselineFlags;        //!< Baseline flags
00505    UINT8 m_bCartoonBalloonLeaders;
00506    UINT8 m_Predefined;              //!< Predefined label styles
00507    
00508    //!< From TEXTSTYLE
00509    FLOAT m_LineSpace;            //!< Line spacing in CAD units
00510    FLOAT m_StrokeWidth;          //!< Stroke width in % of glyph height (1.0 = 100%)
00511    FLOAT m_EnhanceWidth;         //!< Enhanced width in % of glyph height (1.0 = 100%)
00512    FLOAT m_BoldnessWidth;        //!< Boldness width in % of glyph height (1.0 = 100%) Ignored unless FONTSTYLE_Bold is set
00513    FLOAT m_UnderlineWidth;       //!< Underline with in % of glyph height (1.0 = 100%)
00514    FLOAT m_UnderlineOffset;      //!< Underline Offset from baseline in % (1.0 = 100%)
00515    FLOAT m_ShadowOffset;         //!< Drop shadow offset in % (1.0 = 100%) Ignored unless FONTSTYLE_Shadow is set
00516    FLOAT m_ShadowAngle;          //!< Drop shadow angle in radians
00517    FLOAT m_ClipWidth;            //!< Clip extended area around text in TextAddToClip()
00518    
00519    //!< From LABELFRAMEPARMS
00520    FLOAT m_Margin;               //!< Units: % of font ascent 
00521    FLOAT m_TMargin;              //!< Units: % of font ascent
00522    FLOAT m_BMargin;              //!< Units: % of font ascent
00523    FLOAT m_LMargin;              //!< Units: % of font ascent
00524    FLOAT m_RMargin;              //!< Units: % of font ascent
00525    UINT32 m_FrameShape;
00526    UINT32 m_LineStyleFlags;
00527    UINT32 m_PolyStyleFlags;
00528    FLOAT m_LineScale;            //!< Width of line (usually in millimeters) or pattern zoom factor
00529    FLOAT m_PolyBorderScale;      //!< Width of border (usually in millimeters) or pattern zoom factor
00530    UINT32 m_Arrow;
00531 
00532    UINT32 m_NumLeaderLines;
00533    UINT8 spare2[4];
00534 // FLOAT m_HatchAngle;           //!< Use CADELEMOPT::Angle: Rotation angle for hatch patterns (was spare[8])
00535 // INT32 PatternNum;             //!< Use CADELEMOPT::LinePatt
00536 // INT32 FillPatternNum;         //!< Use CADELEMOPT::FillPatt
00537 // INT32 BorderPatternNum;       //!< Use CADELEMOPT::Symbol
00538    };                            /* Followed by the actual points then the number of characters */
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 {               /* Size = 72 */
00546    DPOINT3D_OLD InsertPt;        //!<  Point where to insert the block 
00547    INT32 BlockNum;               //!<  Index of block to insert 
00548    FLOAT rotate;                 //!<  Rotation angle 
00549    DOUBLE xscale;                //!<  X Scale factor          (default 1.0) 
00550    DOUBLE yscale;                //!<  Y Scale factor          (default 1.0) 
00551    DOUBLE zscale;                //!<  Z Scale factor          (default 1.0) 
00552    UINT16 numlins;               //!<  Number of lines         (default 1) 
00553    UINT16 numcols;               //!<  Number of columns       (default 1) 
00554    FLOAT linspace;               //!<  Spacing between lines 
00555    FLOAT colspace;               //!<  Spacing between columns 
00556    UINT32 space;
00557    };
00558 
00559 
00560 struct CADRBOX {        /* Size = 8 */
00561    FLOAT rotate;                 //!<  Rotation of box 
00562    UINT32 space;
00563    };
00564 
00565 
00566 struct CADLINE {        /* Size = 8 */
00567    UINT32 NumPoints;             //!<  Number of points in polyline 
00568    UINT32 CurveFit;              //!<  Type of curve fitting used 
00569    };                            /* Followed by the point data */
00570 
00571 
00572 struct CADPOLY {        /* Size = 16 */
00573    UINT32 NumPoints;             //!<  Number of points in first polygon. 
00574    UINT32 NumIslands;            //!<  Number of islands in polygon.  0 if none. 
00575    UINT32 CurveFit;              //!<  Type of curve fitting used 
00576    UINT32 space;
00577    };                            /*
00578                                  * Followed by the "number of points per island" buffer and the point data for the
00579                                  * polygon and islands.  If NumIslands == 0 then only the polygon is stored.
00580                                  */
00581 
00582 struct CADMESH {        /* Size = 16 */
00583    UINT32 xverts;                //!<  Number of X vertices for mesh 
00584    UINT32 yverts;                //!<  Number of Y vertices for mesh 
00585    UINT16 CurveFit;              //!<  Type of curve fitting used 
00586    UINT16 flags;                 //!<  1 = Closed in x verts: 2 = Closed in y verts 
00587    UINT32 space;
00588    };                            /* Followed by the point data in the form of array[xverts][yverts]. */
00589 
00590 
00591 struct CADELLIPSE {     /* Size = 48 */
00592    DPOINT2D_OLD center;             //!<  Center of ellipse 
00593    DOUBLE xsize;                 //!<  Relative X width of ellipse 
00594    DOUBLE ysize;                 //!<  Relative Y width of ellipse 
00595    FLOAT rotate;                 //!<  Rotation of ellipse X axis with respect to the the world X axis 
00596    UINT32 space;
00597    DOUBLE m_zvalue;              //!< Z value of center point
00598    };
00599 
00600 
00601 struct CADEARC {        /* Size = 64 */
00602    DPOINT2D_OLD center;          //!<  Center of ellipse 
00603    DOUBLE start;                 //!<  Start angle of elliptical arc 
00604    DOUBLE end;                   //!<  End angle of elliptical arc 
00605    DOUBLE xsize;                 //!<  Relative X width of ellipse 
00606    DOUBLE ysize;                 //!<  Relative Y width of ellipse 
00607    FLOAT rotate;                 //!<  Rotation of ellipse X axis with respect to the 
00608                                  /* the world X axis*/
00609    UINT32 space;
00610    DOUBLE m_zvalue;              //!< Z value of center point
00611    };
00612 
00613 
00614 struct CADMULTIPOINT {
00615    UINT32 NumPoints;             //!<  Number of points, duh 
00616    UINT32 space;
00617    };                            /* Followed by the point data */
00618 
00619 
00620 struct CADMULTILINE {
00621    UINT32 NumLines;              //!<  Number of lines, duh 
00622    UINT32 CurveFit;              //!<  Type of curve fitting used 
00623    };                            /* Followed by the number of points array then followed by the point data */
00624 
00625 
00626 struct CADMULTIPOLY {
00627    UINT32 NumPolygons;           //!<  Number of CADSUBPOLY regions 
00628    UINT32 CurveFit;              //!<  Type of curve fitting used 
00629    };                            /* Followed by the array of subregion structures then by the data for each sub-region */
00630 
00631 struct CADSUBPOLY {
00632    UINT32 NumPoints;             //!<  Number of points in the polygon 
00633    UINT32 NumIslands;            //!<  Number of islands 
00634    };
00635 
00636 //! Perform byte-swapping.
00637 inline void SwapBytes (
00638    CADSUBPOLY& rhs
00639    ) { ::SwapBytes(rhs.NumPoints); ::SwapBytes(rhs.NumIslands); }
00640 
00641 
00642 struct CADPOLYNOM {     /* Size = 40 */
00643    DPOINT2D_OLD minval;          //!<  Maximum x, y range of polynomial 
00644    DPOINT2D_OLD maxval;          //!<  Minimum x, y range of polynomial 
00645    UINT32 NumCoeff;              //!<  Number of coefficients in polynomial 
00646    UINT32 space;
00647    };                            /* Followed by the coefficients of the polynomial */
00648 
00649 union CADELEMDATA {              /* Size = 72 */
00650    CADINSERT insert;             //!<  Biggest structure (if changed, need to recompile) 
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 /* If structure size changes, geom.dll will need to be changed */
00668 struct CADELEMENT {
00669    CADELEMHDR hdr;
00670    CADELEMOPT opt;
00671    CADELEMDATA data;
00672    DPOINT3D pt;                  //!<  Text or point point 
00673    void *text;                   //!<  Either text string or CADSUBPOLY array 
00674    INT32 *islelist;              //!<  Array of number of points for islands or lines 
00675    void *points;                 //!<  All of the points that are fit to load 
00676    int PointSize;                //!<  Needed for functions without access to data source 
00677    };
00678 
00679 
00680 /*-------------------------------------------------------------------------*/
00681 /*    Object Selection Dialogs                                             */
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   //!< X_NATIVE || WIN32_MFC
00714 
00715 #if defined(__cplusplus)
00716 extern "C" {
00717 #endif
00718 
00719    /* Higher level CAD functions */
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      //!<  #ifndef  INC_MI32_RVCCAD_H

Generated on Tue Dec 14 13:18:33 2004 for TNTsdk by  doxygen 1.3.8-20040913