00001
00031 #ifndef INC_MI32_CGM_H
00032 #define INC_MI32_CGM_H
00033
00034 #ifndef INC_MI32_TRANS2DAFFINE_H
00035 #include <mi32/trans2daffine.h>
00036 #endif
00037
00038 #ifndef INC_MI32_ELEMSTYL_H
00039 #include <mi32/elemstyl.h>
00040 #endif
00041
00042 #ifndef INC_MI32_UCSTRING_H
00043 #include <mi32/ucstring.h>
00044 #endif
00045
00046 #ifndef INC_MI32_SCRNUNIT_H
00047 #include <mi32/scrnunit.h>
00048 #endif
00049
00050 #ifndef INC_MI32_POLYLINE_H
00051 #include <mi32/polyline.h>
00052 #endif
00053
00054
00055 class CGM;
00056 class CGMPARM;
00057 class CGMELEM;
00058 class PLANECONIC;
00059 class FILEPATH;
00060
00061 #ifndef GENERATING_DOXYGEN_OUTPUT
00067 class CGMPARM {
00068 public:
00069
00070 enum PARMTYPE {
00071 PARMTYPE_REAL = 0,
00072 PARMTYPE_SIGNED,
00073 PARMTYPE_UNSIGNED,
00074 PARMTYPE_STRING,
00075 PARMTYPE_COLOR,
00076 PARMTYPE_POINT
00077 };
00078
00079 PARMTYPE GetType (
00080 ) const {
00081 return (static_cast<PARMTYPE>(m_type));
00082 }
00083
00084 double GetValueDouble (
00085 ) const {
00086 return (*((double*)GetData()));
00087 }
00088
00089 INT32 GetValueSigned (
00090 ) const {
00091 return (*((INT32*)GetData()));
00092 }
00093
00094 INT32 GetValueUnsigned (
00095 ) const {
00096 return (*((UINT32*)GetData()));
00097 }
00098
00099 const MIUNICODE* GetValueString (
00100 ) const {
00101 return ((const MIUNICODE*)GetData());
00102 }
00103
00104 const COLOR& GetValueColor (
00105 ) const {
00106 return (*((const COLOR*)GetData()));
00107 }
00108
00109 const DPOINT2D& GetValuePoint (
00110 ) const {
00111 return (*((const DPOINT2D*)GetData()));
00112 }
00113
00115 const int GetDataSize (
00116 ) const {
00117 return m_size - sizeof(CGMPARM);
00118 }
00119
00126 const int GetFullSize (
00127 ) const {
00128 return m_size;
00129 }
00130
00131 private:
00132 #ifndef GENERATING_DOXYGEN_OUTPUT
00133
00134 CGMPARM() {}
00135
00137 const void* GetData (
00138 ) const {
00139 return (this + 1);
00140 }
00141
00142 INT32 m_type;
00143 UINT32 m_size;
00144
00145 friend class CGM;
00146 #endif // GENERATING_DOXYGEN_OUTPUT
00147 };
00148 #endif // GENERATING_DOXYGEN_OUTPUT
00149
00150
00158 class CGM {
00159 public:
00160
00161 enum ASF {
00162 ASF_INDIVIDUAL = 0,
00163 ASF_BUNDLED
00164 };
00165
00166 enum VDCTYPE {
00167 VDCTYPE_INTEGER,
00168 VDCTYPE_REAL
00169 };
00170
00171 enum REALMODE {
00172 REALMODE_FIXED = 0,
00173 REALMODE_FP
00174 };
00175
00176 enum CLIPMODE {
00177 CLIPMODE_NONE,
00178 CLIPMODE_LOCUS,
00179 CLIPMODE_SHAPE,
00180 CLIPMODE_LOCUSTHENSHAPE
00181 };
00182
00183 enum COLORMODEL {
00184 COLORMODEL_RGB,
00185 COLORMODEL_CMYK
00186 };
00187
00188 enum COLORMODE {
00189 COLORMODE_INDEXED,
00190 COLORMODE_DIRECT
00191 };
00192
00193 enum INTERIORSTYLE {
00194 INTERIORSTYLE_HOLLOW,
00195 INTERIORSTYLE_SOLID,
00196 INTERIORSTYLE_PATTERN,
00197 INTERIORSTYLE_HATCH,
00198 INTERIORSTYLE_EMPTY,
00199 INTERIORSTYLE_GEOMETRIC,
00200 INTERIORSTYLE_INTERPOLATED
00201 };
00202
00203 enum LINETYPE {
00204 LINETYPE_SOLID = 1,
00205 LINETYPE_DASH,
00206 LINETYPE_DOT,
00207 LINETYPE_DASH_DOT,
00208 LINETYPE_DASH_DOT_DOT
00209 };
00210
00211 enum LINECAP {
00212 LINECAP_UNSPECIFIED=1,
00213 LINECAP_BUTT,
00214 LINECAP_ROUND,
00215 LINECAP_PROJECTING,
00216 LINECAP_TRIANGLE
00217 };
00218
00219 enum LINEJOIN {
00220 LINEJOIN_UNSPECIFIED=1,
00221 LINEJOIN_MITRE,
00222 LINEJOIN_ROUND,
00223 LINEJOIN_BEVEL
00224 };
00225
00226 enum LINECONT {
00227 LINECONT_UNSPECIFIED=1,
00228 LINECONT_CONTINUE,
00229 LINECONT_RESTART,
00230 LINECONT_ADAPTIVE
00231 };
00232
00233 enum MARKERTYPE {
00234 MARKERTYPE_DOT=1,
00235 MARKERTYPE_PLUS,
00236 MARKERTYPE_ASTERISK,
00237 MARKERTYPE_CIRCLE,
00238 MARKERTYPE_EX
00241 };
00242
00243 enum TEXTALIGNMENT {
00244 TEXTALIGNMENT_NORMAL,
00245 TEXTALIGNMENT_LEFT,
00246 TEXTALIGNMENT_CENTER,
00247 TEXTALIGNMENT_RIGHT,
00248 TEXTALIGNMENT_CONTINUOUS,
00249 TEXTALIGNMENT_TOP,
00250 TEXTALIGNMENT_CAP,
00251 TEXTALIGNMENT_HALF,
00252 TEXTALIGNMENT_BASE,
00253 TEXTALIGNMENT_BOTTOM
00254 };
00255
00256 enum TEXTPATH {
00257 TEXTPATH_LEFT,
00258 TEXTPATH_RIGHT,
00259 TEXTPATH_UP,
00260 TEXTPATH_DOWN
00261 };
00262
00264 enum TEXTPRECISION {
00265 TEXTPRECISION_STRING,
00266 TEXTPRECISION_CHARACTER,
00267 STROKE
00268 };
00269
00270 enum SCALEMODE {
00271 SCALEMODE_ABSTRACT = 0,
00272 SCALEMODE_METRIC
00273 };
00274
00275 enum SIZEMODE {
00276 SIZEMODE_ABSOLUTE = 0,
00277 SIZEMODE_SCALED,
00278 SIZEMODE_FRACTIONAL,
00279 SIZEMODE_MM
00280 };
00281
00282 enum VIEWPORTSPECMODE {
00283 VIEWPORTSPECMODE_FractionOfDrawingSurface,
00284 VIEWPORTSPECMODE_MMWithScaleFactor,
00285 VIEWPORTSPECMODE_DeviceCoordinates
00286 };
00287
00288
00289
00290
00293 CGM (
00294 );
00295
00296 virtual ~CGM (
00297 );
00298
00299
00300
00307 void GetExtents (
00308 DRECT2D& rect
00309 ) const {
00310 rect = m_VDCExtent;
00311 return;
00312 }
00313
00315 int ReadFile (
00316 const FILEPATH& fname
00317 );
00318
00322 int Render (
00323 );
00324
00326 void SetTransAffine (
00327 const MAT3X3 forward,
00328 const MAT3X3 inverse
00329 );
00330
00332 void SetTransAffine (
00333 const TRANS2D_AFFINE& trans
00334 );
00335
00336
00337 protected:
00341 struct STYLEEXTRA {
00342 SCREENUNIT m_LineWidthUnits;
00343 SCREENUNIT m_EdgeWidthUnits;
00344 SCREENUNIT m_PointSizeUnits;
00345 SCREENUNIT m_TextSizeUnits;
00346
00347 STYLEEXTRA() :
00348 m_LineWidthUnits(SCREENUNIT_Points),
00349 m_EdgeWidthUnits(SCREENUNIT_Points),
00350 m_PointSizeUnits(SCREENUNIT_Points),
00351 m_TextSizeUnits(SCREENUNIT_Points)
00352 {
00353 }
00354 };
00355
00356 struct PRIMITIVECONTEXT {
00357 PRIMITIVECONTEXT();
00358
00359 POINTSTYLE m_PointStyle;
00360 LINESTYLE m_LineStyle;
00361 POLYSTYLE m_PolyStyle;
00362 TEXTSTYLE m_TextStyle;
00363 STYLEEXTRA m_StyleExtra;
00364
00365 UINT32 m_id;
00366 UINT32 m_LineBundleIndex;
00367 LINETYPE m_LineType;
00368 double m_LineWidth;
00369 COLOR m_LineColor;
00370 CLIPMODE m_LineClipMode;
00371 LINECAP m_LineCap;
00372 LINECAP m_DashCap;
00373 LINEJOIN m_LineJoin;
00374 LINECONT m_LineTypeContinuation;
00375 double m_LineTypeInitOffset;
00376
00377 UINT32 m_MarkerBundleIndex;
00378 MARKERTYPE m_MarkerType;
00379 double m_MarkerSize;
00380 COLOR m_MarkerColor;
00381 CLIPMODE m_MarkerClipMode;
00382
00383 UINT32 m_TextBundleIndex;
00384 UINT32 m_TextFontIndex;
00385 TEXTPRECISION m_TextPrecision;
00386 double m_CharExpFactor;
00387 double m_CharSpacing;
00388 COLOR m_TextColor;
00389 double m_CharHeight;
00390
00391 double m_CharOrientXUp;
00392 double m_CharOrientYUp;
00393 double m_CharOrientXBase;
00394 double m_CharOrientYBase;
00395 TEXTPATH m_TextPath;
00396 TEXTALIGNMENT m_TextHAlignment;
00397 TEXTALIGNMENT m_TextVAlignment;
00398 double m_TextContHAlign;
00399 double m_TextContVAlign;
00400 UINT32 m_CharSetIndex;
00401 UINT32 m_AltCharSetIndex;
00402 UINT32 m_TextScoreType;
00403 UINT32 m_RestrictedTextType;
00404
00405 UINT32 m_FillBundleIndex;
00406 INTERIORSTYLE m_InteriorStyle;
00407 COLOR m_FillColor;
00408 UINT32 m_HatchIndex;
00409 UINT32 m_PatternIndex;
00410
00411 UINT32 m_EdgeBundleIndex;
00412 LINETYPE m_EdgeType;
00413 double m_EdgeWidth;
00414 COLOR m_EdgeColor;
00415 bool m_bEdgeVisibility;
00416 CLIPMODE m_EdgeClipMode;
00417 LINECAP m_EdgeCap;
00418 LINECAP m_EdgeDashCap;
00419 LINEJOIN m_EdgeJoin;
00420 LINECONT m_EdgeTypeContinuation;
00421 double m_EdgeTypeInitOffset;
00422
00424 DPOINT2D m_FillReferencePoint;
00428
00429 COLOR m_SymbolColor;
00430 double m_SymbolSize;
00431 double m_SymbolOrientXUp;
00432 double m_SymbolOrientYUp;
00433 double m_SymbolOrientXBase;
00434 double m_SymbolOrientYBase;
00435
00438 DRECT2D m_ClipRect;
00439 bool m_bClipIndicator;
00440 UINT32 m_ProtectionRegionIndicator;
00441 COLOR m_AuxColor;
00442 COLOR m_TransparentCellColor;
00443 bool m_bTransparency;
00444 double m_MitreLimit;
00445
00447 ASF m_asfLineType,
00448 m_asfLineWidth,
00449 m_asfLineColor,
00450 m_asfMarkerType,
00451 m_asfMarkerSize,
00452 m_asfMarkerColor,
00453 m_asfTextFontIndex,
00454 m_asfTextPrecision,
00455 m_asfCharExpFactor,
00456 m_asfCharSpacing,
00457 m_asfTextColor,
00458 m_asfInteriroStyle,
00459 m_asfFillColor,
00460 m_asfHatchIndex,
00461 m_asfPatternIndex,
00462 m_asfEdgeType,
00463 m_asfEdgeWidth,
00464 m_asfEdgeColor;
00465 };
00466
00467
00468
00470 const PRIMITIVECONTEXT& GetPC (
00471 ) {
00472 return m_PC;
00473 }
00474
00475
00479 virtual int v_RenderConic (
00480 const PLANECONIC& conic
00481 );
00482
00487 virtual int v_RenderBSpline (
00488 int order,
00489 int NumPts,
00490 const DPOINT2D* cpoints,
00491 const double* knots,
00492 const double* weights,
00493 double Start,
00494 double End
00495 );
00496
00501 virtual int v_RenderBezier (
00502 int NumPts,
00503 DPOINT2D* cpoints,
00504 bool bContinuous
00505 );
00506
00510 virtual int v_RenderCircle (
00511 const DPOINT2D& center,
00512 double radius
00513 );
00514
00515
00520 virtual int v_RenderEllipse (
00521 const DPOINT2D& center,
00522 double xradius,
00523 double yradius,
00524 double RotAngle
00525 );
00526
00527
00540 virtual int v_RenderEllipse (
00541 const DPOINT2D& center,
00542 const DPOINT2D& EndPoint1,
00543 const DPOINT2D& EndPoint2
00544 );
00545
00550 virtual int v_RenderLine (
00551 const DPOINT2D& start,
00552 const DPOINT2D& end
00553 );
00554
00556 virtual int v_RenderMarker (
00557 const DPOINT2D& point
00558 );
00559
00564 virtual int v_RenderPolygon (
00565 const POLYLINE& polygon
00566 );
00567
00569 virtual int v_RenderPolygons (
00570 const POLYLINELIST& polygons
00571 );
00572
00574 virtual int v_RenderPolyline (
00575 const POLYLINE& line
00576 );
00577
00590 virtual int v_RenderRectangle (
00591 const DPOINT2D* points
00592 );
00593
00601 virtual int v_RenderRectangle (
00602 const DRECT2D& rect
00603 );
00604
00606 virtual int v_RenderText (
00607 const DPOINT2D& basept,
00608 const TEXTSTYLE& style,
00609 const STYLEEXTRA& extra,
00610 const MIUNICODE* str
00611 );
00612
00616 virtual int v_SetPointStyle (
00617 const POINTSTYLE& style,
00618 const STYLEEXTRA& extra
00619 );
00620
00624 virtual int v_SetLineStyle (
00625 const LINESTYLE& style,
00626 const STYLEEXTRA& extra
00627 );
00628
00632 virtual int v_SetPolyStyle (
00633 const POLYSTYLE& style,
00634 const STYLEEXTRA& extra
00635 );
00636
00640 virtual int v_SetTextStyle (
00641 const TEXTSTYLE& style,
00642 const STYLEEXTRA& extra
00643 );
00644
00645 private:
00646 #ifndef GENERATING_DOXYGEN_OUTPUT
00647
00649 class ELEMENT {
00650 public:
00651
00653 int GetClass (
00654 ) const {
00655 return m_ElemClass;
00656 }
00657
00660 int GetElementID (
00661 ) const {
00662 return m_ElemID;
00663 }
00664
00666 int GetNumParms (
00667 ) const {
00668 return m_NumParms;
00669 }
00670
00673 const CGMPARM* GetParm (
00674 const CGM* cgm,
00675 int ParmNum
00676 ) const;
00677
00678 private:
00679 int m_ElemClass;
00680 int m_ElemID;
00681 int m_FirstParmOffset;
00682 int m_NumParms;
00683
00684 friend class CGM;
00685 };
00686
00687
00688
00689
00690
00691 int AddParm (
00692 ELEMENT* elem,
00693 double val
00694 );
00695
00696 int AddParm (
00697 ELEMENT* elem,
00698 INT32 val
00699 );
00700
00701 int AddParm (
00702 ELEMENT* elem,
00703 UINT32 val
00704 );
00705
00706 int AddParm (
00707 ELEMENT* elem,
00708 const MIUNICODE* val
00709 );
00710
00711 int AddParm (
00712 ELEMENT* elem,
00713 COLOR& val
00714 );
00715
00716 int AddParm (
00717 ELEMENT* elem,
00718 DPOINT2D& val
00719 );
00720
00721 void FigureBegin();
00722 void FigureEnd();
00723 void FigureFree();
00724 void FigureNewPoly();
00725 void FigureAddPoints (
00726 const POLYLINE& points
00727 );
00728
00731 double GetAngle (
00732 CGMELEM& elem,
00733 int dxParmNum,
00734 int dyParmNum
00735 );
00736
00738 #ifndef GENERATING_DOXYGEN_OUTPUT
00742 #endif
00743
00745 int GetSI8() {
00746 return *((signed char*)m_pNextByte++);
00747 }
00748
00750 int GetSI16() {
00753 UINT16 word = (m_pNextByte[0] << 8) | m_pNextByte[1];
00754 m_pNextByte += 2;
00755 return ((INT16)word);
00756 }
00757
00759 int GetSI24() {
00762 UINT32 word = (m_pNextByte[0] << 16) | (m_pNextByte[1] << 8) | m_pNextByte[2];
00763 if (word & 0x00800000) word |= 0xFF000000;
00764 m_pNextByte += 3;
00765 return ((INT32)word);
00766 }
00767
00769 int GetSI32() {
00772 UINT32 word = (m_pNextByte[0] << 24) | (m_pNextByte[1] << 16) | (m_pNextByte[2] << 8) | m_pNextByte[3];
00773 m_pNextByte += 4;
00774 return ((INT32)word);
00775 }
00776
00778 int GetSI (
00779 int precision
00780 ) {
00781 switch (precision) {
00782 case 8: return (GetSI8());
00783 case 16: return (GetSI16());
00784 case 24: return (GetSI24());
00785 case 32: return (GetSI32());
00786 }
00787 return (0);
00788 }
00789
00791 UINT8 GetUI8() {
00792 return *m_pNextByte++;
00793 }
00794
00796 UINT8 GetC() {
00797 return *m_pNextByte++;
00798 }
00799
00801 UINT16 GetUI16() {
00802 UINT16 word = (m_pNextByte[0] << 8) | m_pNextByte[1];
00803 m_pNextByte += 2;
00804 return ((INT16)word);
00805 }
00806
00808 UINT32 GetUI24() {
00809 UINT32 word = (m_pNextByte[0] << 16) | (m_pNextByte[1] << 8) | m_pNextByte[2];
00810 m_pNextByte += 3;
00811 return (word);
00812 }
00813
00815 UINT32 GetUI32() {
00816 UINT32 word = (m_pNextByte[0] << 24) | (m_pNextByte[1] << 16) | (m_pNextByte[2] << 8) | m_pNextByte[3];
00817 m_pNextByte += 4;
00818 return (word);
00819 }
00820
00822 UINT32 GetUI (
00823 int precision
00824 ) {
00825 switch (precision) {
00826 case 8: return (GetUI8());
00827 case 16: return (GetUI16());
00828 case 24: return (GetUI24());
00829 case 32: return (GetUI32());
00830 }
00831 return (0);
00832 }
00833
00835 double GetFX32() {
00836 double WholePart = (double)GetSI16();
00837 double FracPart = (double)GetUI16();
00838 return (WholePart + (FracPart / (double)(0xffffUL)));
00839 }
00840
00842 double GetFX64() {
00843 double WholePart = (double)GetSI32();
00844 double FracPart = (double)GetUI32();
00845 return (WholePart + (FracPart / (double)(0xffffffffUL)));
00846 }
00847
00849 double GetFX (
00850 int precision
00851 ) {
00852 switch (precision) {
00853 case 32: return (GetFX32());
00854 case 64: return (GetFX64());
00855 }
00856 return (0.0);
00857 }
00858
00860 double GetFP32() {
00861 #ifdef BYTEORDER_LoHi
00862 UINT8 bytes[4];
00863 bytes[0] = *m_pNextByte++;
00864 bytes[1] = *m_pNextByte++;
00865 bytes[2] = *m_pNextByte++;
00866 bytes[3] = *m_pNextByte++;
00867 SwapBytes4(bytes, 1);
00868 return *(float*)bytes;
00869 #else
00870 float fp = *(float*)m_pNextByte;
00871 m_pNextByte += 4;
00872 return(fp);
00873 #endif
00874 }
00875
00877 double GetFP64() {
00878 #ifdef BYTEORDER_LoHi
00879 UINT8 bytes[8];
00880 bytes[0] = *m_pNextByte++;
00881 bytes[1] = *m_pNextByte++;
00882 bytes[2] = *m_pNextByte++;
00883 bytes[3] = *m_pNextByte++;
00884 bytes[4] = *m_pNextByte++;
00885 bytes[5] = *m_pNextByte++;
00886 bytes[6] = *m_pNextByte++;
00887 bytes[7] = *m_pNextByte++;
00888 SwapBytes8(bytes, 1);
00889 return *(double*)bytes;
00890 #else
00891 double fp = *(double*)m_pNextByte;
00892 m_pNextByte += 4;
00893 return(fp);
00894 #endif
00895 }
00896
00898 double GetFP (
00899 int precision
00900 ) {
00901 switch (precision) {
00902 case 32: return (GetFP32());
00903 case 64: return (GetFP64());
00904 }
00905 return (0.0);
00906 }
00907
00910
00911 double GetR (
00912 int precision,
00913 REALMODE mode
00914 ) {
00915 if (mode == REALMODE_FIXED) {
00916 return (GetFX(precision));
00917 }
00918 else {
00919 return (GetFP(precision));
00920 }
00921 }
00922
00923 double GetVDC() {
00924 if (m_VDCType == VDCTYPE_REAL) {
00925 return (GetR(m_vrp, m_VDCRealMode));
00926 }
00927 else {
00928 return (GetSI(m_vip));
00929 }
00930 }
00931
00932 double GetVC() {
00933 if (m_VPSpecMode == VIEWPORTSPECMODE_FractionOfDrawingSurface) {
00934 return (GetR(m_rp, m_RealMode));
00935 }
00936 else {
00937 return (GetSI(m_ip));
00938 }
00939 }
00940
00941 UINT32 GetLength () {
00942 UINT8 byte = GetUI8();
00943 if (byte < 255) return(byte);
00944 else return(GetLengthLongForm());
00945 }
00946
00954 UINT32 GetLengthLongForm () {
00955 UINT32 length = 0;
00956 for (;;) {
00957 UINT16 word = GetUI16();
00958 length |= word & 0x7FFF;
00959 if (!(word & 0x8000)) return(length);
00960 length <<= 15;
00961 }
00962 }
00963
00964 int ParmAlloc (
00965 CGMPARM::PARMTYPE type,
00966 const void* data,
00967 int size
00968 );
00969
00970 int ProcessClass0Element (CGMELEM& elem, bool bRender);
00971 int ProcessClass1Element (CGMELEM& elem, bool bRender);
00972 int ProcessClass2Element (CGMELEM& elem, bool bRender);
00973 int ProcessClass3Element (CGMELEM& elem, bool bRender);
00974 int ProcessClass4Element (CGMELEM& elem, bool bRender);
00975 int ProcessClass5Element (CGMELEM& elem, bool bRender);
00976 int ProcessClass6Element (CGMELEM& elem, bool bRender);
00977 int ProcessClass7Element (CGMELEM& elem, bool bRender);
00978 int ProcessClass8Element (CGMELEM& elem, bool bRender);
00979
00980 int ProcessElement (
00981 ELEMENT* pelem,
00982 bool bRender
00983 );
00984
00987 int ScanCGM ();
00988
00989 int ScanCGMBinary ();
00990 int ScanCGMCharEncoded ();
00991 int ScanCGMClearText ();
00992
00993 int ScanElemParms (
00994 ELEMENT* elem,
00995 const char* constParmSpec,
00996 int ParmListLen
00997 );
00998
00999 PRIMITIVECONTEXT* GetPC (
01000 UINT32 id,
01001 bool bAllocIfMissing = false
01002 );
01003
01004
01005
01006 SIMPLE_ARRAY<ELEMENT> m_elem;
01007 UINT8* m_buf;
01008 UINT8* m_pNextByte;
01009 int m_BufSize;
01010 int m_ParmBufNext;
01011 int m_ParmBufSize;
01012 UINT8* m_pParmBuf;
01013
01014
01015 VDCTYPE m_VDCType;
01016 REALMODE m_RealMode;
01017 REALMODE m_VDCRealMode;
01018 SCALEMODE m_ScaleMode;
01019 double m_ScaleFactor;
01020 VIEWPORTSPECMODE m_VPSpecMode;
01021 double m_VPScaleFactor;
01022 UINT32 m_rp;
01023 UINT32 m_ip;
01024 UINT32 m_ixp;
01025 UINT32 m_cip;
01026 UINT32 m_dcp;
01027 UINT32 m_vrp;
01028 UINT32 m_vip;
01029 UINT32 m_namep;
01030 double m_TransScale;
01031 double m_TransRotAngle;
01032 double m_TransShearAngle;
01033 MIUNICODE** m_FontList;
01034 MIUNICODE** m_CharSetList;
01037
01038 COLORMODEL m_ColorModel;
01039 COLORMODE m_ColorMode;
01040 INT32 m_ColorCalib;
01041 SIZEMODE m_LineWidthMode;
01042 SIZEMODE m_MarkerSizeMode;
01043 SIZEMODE m_EdgeWidthMode;
01044 DRECT2D m_VDCMaxExtent;
01045 DRECT2D m_VDCExtent;
01046 DRECT2D m_DeviceViewPort;
01047
01048 COLOR m_BGColor;
01049 LPOINT3D m_RGBMin;
01050 LPOINT3D m_RGBMax;
01051 DPOINT3D m_CIEScale;
01052 DPOINT3D m_CIEOffset;
01053
01054 int m_NumPCs;
01055 PRIMITIVECONTEXT **m_PCList;
01056 PRIMITIVECONTEXT m_PC;
01057 POLYLINELIST m_FigurePolygons;
01058 bool m_bDefineFigure;
01059
01074
01076 COLOR *m_pColorTable;
01077 UINT32 m_MaxColorIndex;
01078
01079 TRANS2D_AFFINE m_trans;
01080
01081 MAT3X3 m_FwdAffine, m_InvAffine;
01082
01083 friend class CGMELEM;
01084 friend class ELEMENT;
01085 #endif // GENERATING_DOXYGEN_OUTPUT
01086 };
01087
01088
01089
01090 #ifndef GENERATING_DOXYGEN_OUTPUT
01102 class CGMELEM {
01103 public:
01104
01106 int GetClass (
01107 ) const {
01108 return m_Elem.GetClass();
01109 }
01110
01113 int GetElementID (
01114 ) const {
01115 return m_Elem.GetElementID();
01116 }
01117
01119 int GetNumParms (
01120 ) const {
01121 return m_Elem.GetNumParms();
01122 }
01123
01126 const CGMPARM* GetParm (
01127 int ParmNum
01128 ) const {
01129 return m_Elem.GetParm(m_pCGM, ParmNum);
01130 }
01131
01134 bool GetParm (
01135 int ParmNum,
01136 double& retval
01137 ) {
01138 const CGMPARM* parm = GetParm(ParmNum);
01139 if (!parm) return(false);
01140 retval = parm->GetValueDouble();
01141 return(true);
01142 }
01143
01146 bool GetParm (
01147 int ParmNum,
01148 UINT32& retval
01149 ) {
01150 const CGMPARM* parm = GetParm(ParmNum);
01151 if (!parm) return(false);
01152 retval = parm->GetValueUnsigned();
01153 return(true);
01154 }
01155
01158 bool GetParm (
01159 int ParmNum,
01160 INT32& retval
01161 ) {
01162 const CGMPARM* parm = GetParm(ParmNum);
01163 if (!parm) return(false);
01164 retval = parm->GetValueSigned();
01165 return(true);
01166 }
01167
01170 bool GetParm (
01171 int ParmNum,
01172 COLOR& retval
01173 ) {
01174 const CGMPARM* parm = GetParm(ParmNum);
01175 if (!parm) return(false);
01176 retval = parm->GetValueColor();
01177 return(true);
01178 }
01179
01182 bool GetParm (
01183 int ParmNum,
01184 DPOINT2D& retval
01185 ) {
01186 const CGMPARM* parm = GetParm(ParmNum);
01187 if (!parm) return(false);
01188 retval = parm->GetValuePoint();
01189 return(true);
01190 }
01191
01195 bool GetParm (
01196 int ParmNum,
01197 MIUNICODE** retval
01198 ) {
01199 const CGMPARM* parm = GetParm(ParmNum);
01200 if (!parm || !retval) return(false);
01201 *retval = ucstrdup(parm->GetValueString());
01202 return(true);
01203 }
01204
01205 private:
01206 #ifndef GENERATING_DOXYGEN_OUTPUT
01207 CGMELEM (
01208 CGM* cgm,
01209 const CGM::ELEMENT& elem
01210 ) :
01211 m_pCGM(cgm),
01212 m_Elem(elem)
01213 {
01214 }
01215
01216 CGM* m_pCGM;
01217 const CGM::ELEMENT& m_Elem;
01218
01219 friend class CGM;
01220 #endif // GENERATING_DOXYGEN_OUTPUT
01221 };
01222
01223
01224 #endif
01225
01226 #endif // INC_MI32_CGM_H