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 #ifndef INC_MI32_MG2SVG_H
00080 #define INC_MI32_MG2SVG_H
00081
00082 #ifndef INC_MI32_MGD2_H
00083 #include <mi32/mgd2.h>
00084 #endif
00085
00086 #ifndef INC_MI32_MISTRINGLIST_H
00087 #include <mi32/mistringlist.h>
00088 #endif
00089
00090 #ifndef INC_MI32_FILERAW_H
00091 #include <mi32/fileraw.h>
00092 #endif
00093
00094 #ifndef INC_GRE_BASE_H
00095 #include <gre/base.h>
00096 #endif
00097
00098 #ifndef INC_MI32_TRANS2DAFFINE_H
00099 #include <mi32/trans2daffine.h>
00100 #endif
00101
00102 #ifndef INC_MI32_FILELEGACY_H
00103 #include <mi32/filelegacy.h>
00104 #endif
00105
00106 #ifndef INC_RVC_DBTABSTY_H
00107 #include <rvc/dbtabsty.h>
00108 #endif
00109
00110 #ifndef INC_RVC_STYLE_H
00111 #include <rvc/style.h>
00112 #endif
00113
00114 #ifndef INC_RVC_STYLEPATTERNHATCH_H
00115 #include <rvc/stylepatternhatch.h>
00116 #endif
00117
00118 #ifndef INC_RVC_DBPOLY_H
00119 #include <rvc/dbpoly.h>
00120 #endif
00121
00122 #ifndef INC_RVC_DBPOINT_H
00123 #include <rvc/dbpoint.h>
00124 #endif
00125
00126 #ifndef INC_RVC_DBLINE_H
00127 #include <rvc/dbline.h>
00128 #endif
00129
00130
00131 #include <contrib/zlib.h>
00132
00133
00134 #ifndef GENERATING_DOXYGEN_OUTPUT
00135 namespace RVC {
00136 class STYLEPATTERN_BITMAP;
00137 }
00138
00139 class REGION2D;
00140 class SUBREGION2D;
00141
00142 struct SVGSYMBOL {
00143 int number;
00144 int id;
00145 int layer;
00146 double width;
00147 double height;
00148 bool builtin;
00149 };
00150
00151 struct SVGLAYER {
00152 int id;
00153 MISTRING name;
00154 MISTRING description;
00155 bool isGroup;
00156 UINT32 group;
00157 DPOINT2D size;
00158 };
00159
00160 struct SVGFILTER {
00161 int id;
00162 COLOR color;
00163 double opacity;
00164 double x;
00165 double y;
00166 double height;
00167 };
00168
00169 struct SVGSTYLE {
00170 MISTRING className;
00171 MISTRING code;
00172 };
00173
00174 #endif // GENERATING_DOXYGEN_OUTPUT
00175
00176 class SVG;
00177 class JPEGEXT_FILE;
00178
00179 #ifndef GENERATING_DOXYGEN_OUTPUT
00180 class SVGPATTERN {
00181
00182 public:
00183
00184 SVGPATTERN ();
00185
00186 ~SVGPATTERN ();
00187
00188 void GetName (
00189 MISTRING& name,
00190 const COLOR *var = 0
00191 ) const;
00192
00193 char m_name[32];
00194 bool m_bDefined;
00195 bool m_bHasVarColor;
00196 bool m_bHasTransparent;
00197 int m_OtherColorsUsed;
00198 int m_PatternNum;
00199 int m_Version;
00200 int m_NumVarColorsUsed;
00201 UINT8 m_ColorUsage[32];
00202 UINT8 *m_pattbuf;
00203 int m_size;
00204 COLOR *m_VarColor;
00205 SVGPATTERN *m_alias;
00206 };
00207 #endif // GENERATING_DOXYGEN_OUTPUT
00208
00209 #ifndef GENERATING_DOXYGEN_OUTPUT
00210 struct png_struct_def;
00211 struct png_info_struct;
00212 #endif // GENERATING_DOXYGEN_OUTPUT
00213
00214 namespace MGD {
00215
00216 #ifndef GENERATING_DOXYGEN_OUTPUT
00217 class CONTEXT_SVG;
00218 #endif // GENERATING_DOXYGEN_OUTPUT
00219
00220 class DEVICE_SVG : public MGD::DEVICE {
00221
00222 public:
00223
00224 DEVICE_SVG ();
00225
00226 virtual ~DEVICE_SVG();
00227
00228 void InitializeDevice (
00229 UINT32 height,
00230 UINT32 width
00231 );
00232
00233 ERRVALUE Create (
00234 const FILEPATH& filename,
00235 double height,
00236 double width,
00237 const MIUNICODE* title,
00238 UINT32 resolution
00239 );
00240
00244 ERRVALUE Close (
00245 );
00246
00247 bool HasElements() {return m_bHasElements;}
00248 void SetHasElements() {m_bHasElements = true;}
00249
00250 ERRVALUE EndLayer (
00251 );
00252
00253 ERRVALUE BeginGroup (
00254 GRE::GROUP* gp
00255 );
00256
00257
00258 ERRVALUE EndGroup (
00259 GRE::GROUP* gp
00260 );
00261
00262 ERRVALUE StartLayer (
00263 const MIUNICODE* layername,
00264 bool bIsRaster,
00265 GRE::LAYER* lp
00266 );
00267
00268 ERRVALUE StartLayer (
00269 GRE::LAYER* lp
00270 );
00271
00272 ERRVALUE StartElement (
00273 GRE::LAYER* lp,
00274 const RVC::ELEMENT &element
00275 );
00276
00277 ERRVALUE EndElement (
00278 );
00279
00281 void SetForIllustrator (
00282 bool unscaled
00283 ) { m_bForIllustrator = unscaled;}
00284
00286 void SetEventsForWebClient (
00287 bool webscript
00288 ) { m_bWebClient = webscript;}
00289
00291 void EmbedWithNameSpacePrefix (
00292 const MISTRING& prefix
00293 ) {
00294 nsPrefix.Clear();
00295 nsPrefix<<prefix<<":";
00296 m_bHTMLwrap = true;
00297 }
00298
00300 void SetSelfValidate (
00301 bool validate
00302 ) { m_bSelfValidate = validate;}
00303
00304 void DoHighPrecisionLines (
00305 bool usedoubles
00306 ) {m_bDoFloat = usedoubles;}
00307
00310 void SetResolution (
00311 UINT32 resolution
00312 ) { m_vres = m_hres = resolution; }
00313
00315 void UseGZIP (
00316 bool gzip
00317 ) { m_bGzip = gzip; }
00318
00320 void LinkStylesheet (
00321 bool link
00322 ) { m_bExternalStyles = link; }
00323
00325 void UseInlineStyles (
00326 bool inlines
00327 ) { m_bInlineStyles = inlines; }
00328
00330 void ShowCoordinates (
00331 bool show
00332 ) { m_bIncludeShowCoordScript = show; }
00333
00334 void IncludeLayerControls (
00335 bool include
00336 ) { m_bIncludeLayerCtrlScript = include; }
00337
00338 void SetIncludeMeasurementTools (
00339 bool include
00340 ) { m_bIncludeMeasurementScript = include; }
00341
00342 void EmbedFonts (
00343 bool embed
00344 ) { m_bEmbedFonts = embed; }
00345
00347 void EmbedImages (
00348 bool embed
00349 ) { m_bEmbedImages = embed; }
00350
00351 void SetLinkToScripts (
00352 bool link
00353 ) { m_bExternalScripts = link; }
00354
00355 void LinkExternalStyleSheet (
00356 bool external
00357 ) { m_bExternalStyles = external; }
00358
00360 void SetUsePNG (
00361 bool usepngs
00362 ) { m_bUsingPNG = usepngs;}
00363
00364 void SetJPEGQuality (
00365 int quality
00366 ) { m_JPEGQuality = quality;}
00367
00368 void SetDisplayToView (
00369 const MAT3X3 matrix
00370 );
00371
00372 void SetShowDatatips (
00373 bool show,
00374 bool blink,
00375 bool invert
00376 ) {
00377 m_bIncludeDatatipScript = show;
00378 m_bBlinkHighlight = blink;
00379 m_bUseInverseHighlights = invert;
00380 }
00381
00382 void SetUseLayerControlPanel (
00383 bool usepanel
00384 ) { m_bIncludeLayerCtrlPanel = usepanel; }
00385
00386 void SetUseAdobeMenu (
00387 bool usemenu
00388 ) { m_bUseAdobeMenu = usemenu;}
00389
00390 void SetDataTipOpacity (
00391 DOUBLE opacity
00392 ) { m_DataTipOpacity = opacity; }
00393
00394 void SetUseFreehandMeasures (
00395 bool use
00396 ) { m_bUseFreehandMeasures = use;}
00397
00398 void SetUseEntitiesInDataTips (
00399 bool use
00400 ) { m_bUseEntitiesInDataTips = use;}
00401
00402 void SetHighlightColor (
00403 COLOR color
00404 ) { m_HighlightColor = color; }
00405
00406 void SetSymbolEnlargement (
00407 DOUBLE enlargement
00408 ) { m_SymbolEnlargement = enlargement;}
00409
00410 void SetSourceLayout (
00411 GRE::LAYOUT *layout
00412 );
00413
00415 MISTRING Escape (
00416 const MISTRING& str
00417 );
00418
00420 ERRVALUE GetString (
00421 STRUTF8& str
00422 );
00423
00424 ERRVALUE GetString (
00425 STRUTF8* str
00426 );
00427
00429 ERRVALUE WriteToFile (
00430 const FILEPATH& outpath,
00431 const STRUTF8& str,
00432 bool useGzip
00433 );
00434
00436 ERRVALUE WriteToFile (
00437 const FILEPATH& outpath
00438 );
00439
00440 bool GetClassNameFromStyAsTable (
00441 const ELEMTYPE type,
00442 RVC::DBTABLE_STYLE& TableStyle,
00443 INT32 ElemNum,
00444 const RVC::STYLE& StyleObj,
00445 MISTRING& className
00446 );
00447
00448 ERRVALUE Validate (
00449 );
00450
00451 void SetMargin (
00452 DOUBLE margin
00453 ) { m_MasterMargin = margin;}
00454
00455 void SetScale (
00456 DOUBLE scale
00457 ) { m_MasterScale = scale;}
00458
00459 void SetSymbolDirectory (
00460 const FILEPATH& dir
00461 ){ m_SymbolDirectory = dir; }
00462
00463 void GetSymbolDirectory (
00464 FILEPATH& dir
00465 ){ dir = m_SymbolDirectory; }
00466
00467 void SetUseSymbolDefinitions (
00468 bool usesymbols
00469 ){ m_bUseSymbolDefinitions = usesymbols; }
00470
00471 private:
00472 #ifndef GENERATING_DOXYGEN_OUTPUT
00473
00474 ERRVALUE Draw3DPNG ();
00475
00476 virtual bool v_AvoidFillSpans () const;
00477
00478
00479 virtual ERRVALUE v_Clear (
00480 const COLOR& color
00481 );
00482
00483 virtual bool v_UseAntiAliasing() const;
00484
00485 virtual MGD::CAPABILITY v_GetCapabilities (
00486 ) const;
00487
00488 virtual MGD::CONTEXT* v_CreateContext (
00489 );
00490
00491 virtual MGD::PIXEL v_GetColorPixel (
00492 const COLOR& color
00493 ) ;
00494
00495 virtual COLORSPACE v_GetColorSpace () const;
00496
00497 virtual bool v_GetNeedFullImageLine () const;
00498
00499 virtual void v_GetPixelColor (
00500 MGD::PIXEL pixel,
00501 COLOR& color
00502 ) const;
00503
00504 int m_len;
00505 double m_hres;
00506 double m_vres;
00507 double m_LineWidth;
00508 DOUBLE m_DataTipOpacity;
00509 MGD::LINECAP m_LineCapStyle;
00510 MGD::LINEJOIN m_LineJoinStyle;
00511 int m_LayerNum;
00512 INT32 m_ElemNum;
00513 MISTRING m_DisplayToView;
00514 MISTRING m_ViewToGroup;
00515 MISTRING m_EquiToLatLonString;
00516 LRECTXY m_ClipRect;
00517 MISTRINGLIST m_ClipPaths;
00518 MISTRING m_ClipPath;
00519 FILEPATH m_SymbolDirectory;
00520 int m_ClipIndex;
00521 SVGPATTERN *m_Patterns;
00522 int m_NumPatterns;
00523 SVGPATTERN *m_AllPatterns;
00524 int m_TotalPatterns;
00525 RVC::ELEMENT m_ActiveElement;
00526 MISTRINGLIST m_PatternNames;
00527 MILIST<SVGSTYLE> m_StyleSet;
00528 MISTRINGLIST m_Entities;
00529 MISTRINGLIST m_Defs;
00530 INT32 m_CurrentDefs;
00531 SVGLAYER m_SVGGroup;
00532
00533 bool m_bHasElements;
00534 bool m_bNeedsInit;
00535 bool m_bNoMessages;
00536 bool m_bForIllustrator;
00537 bool m_bExternalStyles;
00538 bool m_bExternalScripts;
00539
00540 bool m_bStyleDefine;
00541 bool m_bScriptDefine;
00542 bool m_bClipDefine;
00543
00544 bool m_bBeginningLayer;
00545 bool m_bBeginningGroup;
00546 bool m_bSingleLayerGroup;
00547 bool m_bInLayer;
00548 bool m_bInGroup;
00549 bool m_bInImage;
00550 bool m_bDisableStyles;
00551 bool m_bRendering3DImage;
00552 bool m_bGroupIs3D;
00553 bool m_bProjNotFound;
00554 bool m_bLatLon;
00555 bool m_bStylesAreDefined;
00556 bool m_bEmbedFonts;
00557 bool m_bEmbedImages;
00558 bool m_bGzip;
00559 bool m_bInlineStyles;
00560 bool m_bStandardCompression;
00561 bool m_bIncludeLayerCtrlScript;
00562 bool m_bUseAdobeMenu;
00563 bool m_bIncludeLayerCtrlPanel;
00564 bool m_bIncludeShowCoordScript;
00565 bool m_bIncludeDatatipScript;
00566 bool m_bClickToShowData;
00567 bool m_bIncludeMeasurementScript;
00568 bool m_bUseFreehandMeasures;
00569 bool m_bUseEntitiesInDataTips;
00570 bool m_bUseInverseHighlights;
00571 bool m_bHighlightEnlargePointSymbol;
00572 bool m_bBlinkHighlight;
00573 bool m_bHTMLwrap;
00574 bool m_bClipBounds;
00575 bool m_bInTextBlock;
00576 bool m_bClippingOn;
00577 bool m_bCurLayerIsRaster;
00578 bool m_bColorIsVariable;
00579 bool m_bDoFill;
00580 bool m_bDrawingFillPattern;
00581 bool m_bDrawingDataTip;
00582 bool m_bDoBorder;
00583 bool m_bUsingPNG;
00584 bool m_bForcePNG;
00585 bool m_bCoordsFound;
00586 bool m_bWebClient;
00587 bool m_bDoFloat;
00588 bool m_bDoTitles;
00589 bool m_bSelfValidate;
00590 bool m_bUseStyledDataTips;
00591 bool m_bUseSymbolDefinitions;
00592
00593 COLOR m_DrawColor;
00594 COLOR m_FillColor;
00595 COLOR m_HighlightColor;
00596 double m_Opacity;
00597 bool m_bClosed;
00598
00599 png_struct_def *png_ptr;
00600 png_info_struct *info_ptr;
00601 JPEGEXT_FILE* m_pJPEGFile;
00602
00603 MISTRING m_TextStyle,m_FontName;
00604 double m_BaseAngle;
00605 DPOINT2D m_BasePoint;
00606
00607 int m_JPEGQuality;
00608
00609 int m_TextCurveIndex;
00610 int m_CurFillPattern;
00611 double m_ImageX, m_ImageY;
00612 int m_ImageLins, m_ImageCols;
00613 INT32 m_ImageSize;
00614 int m_ImageLinsSeen;
00615
00616 FILE_RAW m_PatternFile;
00617 FILE_RAW m_OutputFile;
00618 FILE_RAW m_StyleFile;
00619 FILE_RAW m_ScriptFile;
00620 FILE_RAW m_ActiveFile;
00621 FILE_RAW m_ZippedFile;
00622
00623 int m_ImageFileIndex;
00624 FILE_LEGACY_STREAM m_ImageFile;
00625 MISTRING m_FilePrefix;
00626
00627 FILEPATH m_OutputFilename;
00628 FILEPATH m_ImageFilename;
00629
00630 INT32 m_StyleStartOffset;
00631 INT32 m_PatternStartOffset;
00632
00633 int m_PngIndex;
00634 int m_CurrentStyle;
00635 int m_CurrentEntity;
00636 int m_CurrentGroupID;
00637
00638
00639 MILIST<SVGSYMBOL> m_Symbols;
00640 MILIST<SVGFILTER> m_Filters;
00641 MISTRINGLIST m_LayerNames;
00642 MILIST<SVGLAYER> m_SVGLayers;
00643 MISTRINGLIST m_Fonts;
00644 SIMPLE_ARRAY<UINT32> m_GroupChildren;
00645
00646
00647 SIMPLE_ARRAY<UINT8> m_3DimageBuffer;
00648 DRECT2D m_GroupExtents;
00649
00650
00651 MISTRING nsPrefix;
00652 MISTRING m_LayerName;
00653 MISTRING m_GroupName;
00654 MISTRING m_DataTip;
00655
00656
00657 MISTRING m_LastFont;
00658 GRE::LAYER* m_Layer;
00659 SVGSYMBOL m_ActiveSymbol;
00660 SVGFILTER m_ActiveFilter;
00661 int m_SymbolNum,m_CurrentSymbol;
00662 INT32 m_CurrElem;
00663 INT32 m_CurrentDataTip;
00664
00665 bool m_HasEquiToLatLon;
00666 TRANS2D_AFFINE m_EquiToLatLon;
00667 MISTRING m_GeoTransformStr;
00668
00669 bool m_bDrawingSymbol;
00670 bool m_bInDefinition;
00671 bool m_bGzipping;
00672
00673 double vScale, hScale, vOffset, hOffset;
00674
00675
00676
00677
00678
00679
00680
00681 MISTRING m_Projname;
00682 MISTRING m_SVG;
00683 MISTRING m_EntitiesString;
00684 MISTRING m_Head;
00685 MISTRING m_StyleSheet;
00686 MISTRING m_Body;
00687 MISTRING m_Script;
00688 DOUBLE panelLeft;
00689 DOUBLE m_SymbolEnlargement;
00690
00691 MISTRING m_ElementClassName;
00692
00693 RVC::DBASE_POLYGON m_DbObjPolygon;
00694 RVC::STYLE m_StyleObjPolygon;
00695 RVC::DBTABLE_STYLE m_TableStylePolygon;
00696
00697 RVC::DBASE_LINE m_DbObjLine;
00698 RVC::STYLE m_StyleObjLine;
00699 RVC::DBTABLE_STYLE m_TableStyleLine;
00700
00701 RVC::DBASE_POINT m_DbObjPoint;
00702 RVC::STYLE m_StyleObjPoint;
00703 RVC::DBTABLE_STYLE m_TableStylePoint;
00704
00705 RVC::DBTABLE::RECORD_STYLE_ELEMENT m_RecordStyle;
00706
00707 DOUBLE m_MasterMargin;
00708 DOUBLE m_MasterScale;
00709 MISTRING m_ElemTitle;
00710
00711
00712
00713 DEVICE_SVG (const DEVICE_SVG&);
00714
00715
00716 ERRVALUE AppendFile (
00717 const FILEPATH& filename,
00718 bool b_encode64
00719 );
00720
00721 ERRVALUE ActivateGC (
00722 MGD::CONTEXT_SVG* gc
00723 );
00724
00725
00726 MISTRING ActivateTC (
00727 MGD::CONTEXT_SVG* gc
00728 );
00729
00730 ERRVALUE StartClipping (
00731 MGD::CONTEXT_SVG* gc
00732 );
00733
00734 void IncCurveIndex() {
00735 m_TextCurveIndex++;
00736 }
00737
00738 int GetCurveIndex() {
00739 return m_TextCurveIndex;
00740 };
00741
00742 int FindCurrentStyle (
00743 const MISTRING& code,
00744 MISTRING& className
00745 );
00746
00747 int FindEntity (
00748 const MISTRING& code
00749 );
00750
00751 #ifndef NOLIBZ
00752 z_stream m_zstream;
00753 #endif
00754
00755 UINT32 m_crc;
00756 UINT8 m_zbuf[32768];
00757 UINT32 m_filter;
00758
00759 int CompressBegin (
00760 );
00761
00762 int CompressEnd (
00763 );
00764
00765 virtual ERRVALUE v_FillSpan (
00766 MGD::CONTEXT* gc,
00767 INT32 x1,
00768 INT32 x2,
00769 INT32 y
00770 );
00771
00772 int DumpFillPattern (
00773 SVGPATTERN *pat,
00774 const RVC::STYLEPATTERN_BITMAP& BitmapPatt,
00775 COLOR *var,
00776 MISTRING& name
00777 );
00778
00779
00780 int DumpFillPatternLayer (
00781 const RVC::STYLEPATTERN_BITMAP& BitmapPatt,
00782 int c,
00783 const COLOR& color
00784 );
00785
00786 MISTRING Encode64 (
00787 const UINT8* buff,
00788 int len
00789 );
00790
00791 void FreePrivateData();
00792
00793 int AddClippingPath (
00794 MGD::CONTEXT_SVG* gc,
00795 const MISTRING& region
00796 ) ;
00797
00798
00799
00800
00801
00802 INT32 FilterInList (
00803 double x,
00804 double y,
00805 const COLOR& color,
00806 double opacity,
00807 double height
00808 );
00809
00810 DOUBLE GetGreatestCommonDivisor (
00811 DOUBLE a,
00812 DOUBLE b
00813 );
00814
00815 DOUBLE GetLeastCommonMultiple (
00816 DOUBLE a,
00817 DOUBLE b
00818 );
00819
00820 ERRVALUE InsertFile (
00821 FILE_RAW& file1,
00822 FILE_RAW& file2,
00823 UINT32 offset
00824 );
00825
00826 bool IsLatLon (
00827 SPATREF::COORDREFSYS CoordRefSys
00828 );
00829
00830 int PortWrite (
00831 const char *buf,
00832 int len
00833 ) { return (PortWrite(reinterpret_cast<const UINT8*>(buf), len)); }
00834
00835 int PortWrite (
00836 const UINT8 *buf,
00837 int len
00838 );
00839
00840 int SendEOL (
00841 );
00842
00843 int SendString (
00844 const char *str,
00845 UINT32 flags
00846 );
00847
00848 int WriteString (
00849 const MISTRING& str
00850 );
00851
00852 int SendString (
00853 const MISTRING& str,
00854 UINT32 flags
00855 );
00856
00857 int SendLong (
00858 INT32 num
00859 );
00860
00861 int SendDouble (
00862 DOUBLE num
00863 );
00864
00865 int SendGroupHeader (
00866 MGD::CONTEXT_SVG* gc,
00867 bool isGroup,
00868 const MISTRING& name
00869 );
00870
00871 int SendXYCmdDouble (
00872 double x,
00873 double y,
00874 const char *cmd,
00875 UINT32 flags
00876 );
00877
00878 int SendXYCmdUnscaledLong (
00879 INT32 x,
00880 INT32 y,
00881 const char *cmd,
00882 UINT32 flags
00883 );
00884
00885 ERRVALUE SetFillPattern (
00886 MGD::CONTEXT_SVG* gc
00887 );
00888
00889
00890
00891 INT32 SymbolInList (
00892 INT32 symnum,
00893 bool builtin
00894 );
00895
00896
00897 void TransCoord (
00898 INT32 x,
00899 INT32 y,
00900 double *dx,
00901 double *dy
00902 ) {
00903 *dx = (double)x;
00904 *dy = (double)y;
00905 return;
00906 }
00907
00908
00909 int z_putLong (
00910 UINT32 x
00911 );
00912
00913 int z_put (
00914 int x
00915 );
00916
00917 int putByte (
00918 int x
00919 );
00920
00921
00922
00923 ERRVALUE AddFontToList (
00924 const MISTRING& fontfam,
00925 const MISTRING& fontname
00926 );
00927
00928
00929 #endif // GENERATING_DOXYGEN_OUTPUT
00930 friend class MGD::CONTEXT_SVG;
00931
00932 };
00933
00934
00935 class CONTEXT_SVG : public MGD::CONTEXT {
00936 public:
00937
00938 ~CONTEXT_SVG (
00939 ) {}
00940
00941
00942 void AddImageViaLink (
00943 const MISTRING& url,
00944 const DRECT2D& extents
00945 );
00946
00947 #ifndef GENERATING_DOXYGEN_OUTPUT
00948
00949 protected:
00950
00951 CONTEXT_SVG (
00952 MGD::DEVICE_SVG* dev
00953 ) :
00954 MGD::CONTEXT(dev),
00955 m_DevSVG(dev),
00956 m_bHasClip(false),
00957 m_bNewClipRegion(false),
00958 m_bDoDash(false),
00959 m_ActiveClip(-1)
00960 {
00961 }
00962
00963 private:
00964 virtual void v_SetColorIsPatternVariable (
00965 bool value
00966 );
00967
00968 virtual void v_UpdateColor (
00969 );
00970
00971 virtual void v_UpdateColor2 (
00972 const COLOR& color
00973 );
00974
00975 ERRVALUE DrawLinesThick (
00976 const LPOINT2D *lpoints,
00977 INT32 NumPoints
00978 );
00979
00980 ERRVALUE DrawLinesThin(
00981 const LPOINT2D *lpoints,
00982 INT32 NumPoints
00983 );
00984
00985 ERRVALUE Initialize3DImage ();
00986
00987 void TransCoord (
00988 INT32 x,
00989 INT32 y,
00990 double *dx,
00991 double *dy
00992 ) {
00993 m_DevSVG->TransCoord(x,y,dx,dy);
00994 return;
00995 }
00996
00997 virtual void v_UpdateClipRegion (
00998 );
00999
01000 virtual void v_UpdateClipNone (
01001 );
01002
01003 virtual void v_UpdateClipRect (
01004 );
01005
01006 virtual ERRVALUE v_DrawArc (
01007 INT32 xcenter,
01008 INT32 ycenter,
01009 INT32 xradius,
01010 INT32 yradius,
01011 double sangle,
01012 double eangle,
01013 double rotangle,
01014 MGD::SHAPECLOSE closemode
01015 );
01016
01017 virtual ERRVALUE v_DrawArc (
01018 double xcenter,
01019 double ycenter,
01020 double xradius,
01021 double yradius,
01022 double sangle,
01023 double eangle,
01024 double rotangle,
01025 MGD::SHAPECLOSE closemode
01026 );
01027
01028 virtual ERRVALUE v_FillArc (
01029 double xcenter,
01030 double ycenter,
01031 double xradius,
01032 double yradius,
01033 double sangle,
01034 double eangle,
01035 double rotangle,
01036 MGD::SHAPECLOSE closemode
01037 );
01038
01039 virtual ERRVALUE v_FillArc (
01040 INT32 xcenter,
01041 INT32 ycenter,
01042 INT32 xradius,
01043 INT32 yradius,
01044 double sangle,
01045 double eangle,
01046 double rotangle,
01047 MGD::SHAPECLOSE closemode
01048 );
01049
01050 virtual ERRVALUE v_DrawCircle (
01051 INT32 x,
01052 INT32 y,
01053 INT32 radius
01054 );
01055
01056
01057 virtual ERRVALUE v_DrawEllipse (
01058 INT32 xcenter,
01059 INT32 ycenter,
01060 INT32 xradius,
01061 INT32 yradius,
01062 double rotangle = 0
01063 );
01064
01065 virtual ERRVALUE v_DrawLine (
01066 INT32 x1,
01067 INT32 y1,
01068 INT32 x2,
01069 INT32 y2
01070 );
01071
01072 virtual ERRVALUE v_DrawLine (
01073 double x1,
01074 double y1,
01075 double x2,
01076 double y2
01077 );
01078
01079 virtual ERRVALUE v_DrawGlyph (
01080 MGD::FONT* font,
01081 double x,
01082 double y,
01083 double baseangle,
01084 const MGD::STRINGDATA& gidstr,
01085 int num
01086 );
01087
01088 virtual ERRVALUE v_DrawLinesLow (
01089 const LPOINT2D *lpoint,
01090 INT32 NumPoints
01091 );
01092
01093 virtual ERRVALUE v_DrawLinesLow (
01094 const POLYLINE& line
01095 );
01096
01097 virtual ERRVALUE v_DrawLinesDashed (
01098 const LPOINT2D* points,
01099 INT32 numpoints,
01100 const double *DashArray,
01101 INT32 DashCount,
01102 double DashOffset = 0.0,
01103 bool close = false
01104 );
01105
01106 virtual ERRVALUE v_DrawPoint (
01107 INT32 x,
01108 INT32 y
01109 );
01110
01111 virtual ERRVALUE v_DrawPoint (
01112 const DPOINT2D& pt
01113 );
01114
01115 virtual ERRVALUE v_DrawRectangle (
01116 INT32 x1,
01117 INT32 y1,
01118 INT32 x2,
01119 INT32 y2
01120 );
01121
01122 virtual ERRVALUE v_DrawStringStraight (
01123 const DPOINT2D& pt,
01124 double baseangle,
01125 const MGD::STRINGDATA& gidstr,
01126 int sindex,
01127 int eindex,
01128 double SpaceExtra,
01129 double GlyphExtra
01130 );
01131
01132 virtual ERRVALUE v_FillCircle (
01133 INT32 x,
01134 INT32 y,
01135 INT32 radius
01136 );
01137
01138 virtual ERRVALUE v_FillCircle (
01139 double x,
01140 double y,
01141 double radius
01142 );
01143
01144 virtual ERRVALUE v_FillEllipse (
01145 INT32 xcenter,
01146 INT32 ycenter,
01147 INT32 xradius,
01148 INT32 yradius,
01149 double rotangle = 0
01150 );
01151
01152 virtual ERRVALUE v_FillPolygon (
01153 const LPOINT2D *lpoint,
01154 INT32 NumPoints,
01155 MGD::POLYSHAPE shape = MGD::POLYSHAPE_Complex,
01156 bool DrawBorder = false
01157 );
01158
01159 virtual ERRVALUE v_FillPolygons (
01160 const LPOLYGON *lpolygons,
01161 INT32 NumPolys,
01162 bool bDrawBorder
01163 );
01164
01165
01166
01167
01168
01169
01170
01171
01172 virtual ERRVALUE v_FillRectangle (
01173 INT32 x1,
01174 INT32 y1,
01175 INT32 x2,
01176 INT32 y2
01177 );
01178
01179 virtual ERRVALUE v_ImageBegin (
01180 INT32 x,
01181 INT32 y,
01182 INT32 cols,
01183 INT32 lins,
01184 COLORSPACE ColorSpace,
01185 const COLOR_ARRAY *colmap,
01186 UINT32 flags
01187 );
01188
01189 virtual ERRVALUE v_ImageEnd (
01190 UINT32 flags
01191 );
01192
01193 virtual ERRVALUE v_PutImageSpanDirect (
01194 INT32 x,
01195 INT32 y,
01196 INT32 len,
01197 const void *data,
01198 const UINT8 *mask
01199 );
01200
01201 virtual ERRVALUE v_PutPixel (
01202 INT32 x,
01203 INT32 y,
01204 MGD::PIXEL pixel
01205 );
01206
01207 virtual void v_SymbolBegin ();
01208
01209 virtual void v_SymbolEnd ();
01210
01211 virtual void v_TextSpanBegin ();
01212
01213
01214 virtual void v_TextSpanEnd ();
01215
01216
01217 virtual void v_TextBlockBegin (
01218 const MGD::TEXTBLOCK& block
01219 );
01220
01221
01222 virtual void v_TextBlockEnd (
01223 const MGD::TEXTBLOCK& block
01224 );
01225
01226 bool m_bHasClip;
01227 bool m_bNewClipRegion;
01228 bool m_bDoDash;
01229 COLOR m_DrawColor;
01230 COLOR m_FillColor;
01231 COLOR m_SymbolColor;
01232 MGD::DEVICE_SVG* m_DevSVG;
01233 MISTRING m_Style, m_LineStyleCode, m_ActiveFill, m_DashArray;
01234 int m_ActiveClip;
01235 double m_TextHeight;
01236 friend class MGD::DEVICE_SVG;
01237
01238 ERRVALUE BuildDataTipDef (
01239 const MISTRING& tip
01240 );
01241
01242 ERRVALUE DrawLineBody (
01243 double x1,
01244 double y1,
01245 double x2,
01246 double y2
01247 );
01248
01249 ERRVALUE HatchPatch (
01250 const RVC::STYLEPATTERN_HATCH::ELEMENT_SHARED& Element,
01251 const RVC::STYLEPATTERN_HATCH& HatchPatt,
01252 const DRECT2D& rect
01253 );
01254
01255 ERRVALUE InsertDataTip (
01256 const MISTRING& tip
01257 );
01258
01259 ERRVALUE ComposeArc (
01260 INT32 xcenter,
01261 INT32 ycenter,
01262 INT32 xradius,
01263 INT32 yradius,
01264 double sangle,
01265 double eangle,
01266 double rotangle,
01267 MGD::SHAPECLOSE closemode
01268 );
01269
01270 ERRVALUE ComposeArc (
01271 double xcenter,
01272 double ycenter,
01273 double xradius,
01274 double yradius,
01275 double sangle,
01276 double eangle,
01277 double rotangle,
01278 MGD::SHAPECLOSE closemode
01279 );
01280
01281 MISTRING DrawClipRegion (
01282 const LPOLYGON *lpolygons,
01283 INT32 NumPolys
01284 );
01285
01286 ERRVALUE FillClipSubRegion (
01287 const SUBREGION2D& subregion
01288 );
01289
01290 ERRVALUE FillClipRegion (
01291 const REGION2D& region
01292 );
01293
01294 int FindDefs (
01295 const MISTRING& defs
01296 );
01297
01298 ERRVALUE ComposeLines (
01299 const LPOINT2D *lpoint,
01300 INT32 NumPoints,
01301 bool bClose
01302 );
01303
01304 ERRVALUE ComposeLinesFloat (
01305 const POLYLINE& line
01306 );
01307
01308 ERRVALUE Prepare3DImage (
01309 );
01310
01311 };
01312
01313 #endif // GENERATING_DOXYGEN_OUTPUT
01314 }
01315
01316
01317
01318 #endif //end define INC_MI32_MG2SVG_H