|
CGM Objects Library
|
CCgmObjects – CGM Picture container. More...
#include <CgmObjects.h>
Classes | |
| struct | CGMSaveOptions |
| struct | charSet |
| character set structure More... | |
| struct | metafileElementListEntry |
| metafile elements list entry structure More... | |
| struct | pictureDirEntry |
| metafile picture directory More... | |
Public Types | |
| enum | CharCodingAnnouncer { charCodingBasic7 = 0, charCodingBasic8 = 1, charCodingExt7 = 2, charCodingExt8 = 3 } |
| enum | ColorModel { colorModelRGB = 1, colorModelCIELAB = 2, colorModelCIELUV = 3, colorModelCMYK = 4, colorModelRGBRelated = 5, colorModelRGBAlpha = 6, colorModelsRGB = 7, colorModelsRGBAlpha = 8 } |
| enum | RealPrecisionType { realPrecFloat = 0, realPrecFixed = 1 } |
| enum | ScalingMode { scalingModeAbstract = 0, scalingModeMetric = 1 } |
| enum | VDCType { vdcTypeInt = 0, vdcTypeReal = 1 } |
| enum | VdcPrecision { vdcPrecision16int = 0, vdcPrecision32int = 1, vdcPrecision32fp = 2, vdcPrecision64fp = 3 } |
| typedef struct Larson::CCgmObjects::CGMSaveOptions | CGMSaveOptions |
|
typedef struct Larson::CCgmObjects::charSet | charSet |
| character set structure | |
Public Member Functions | |
| void | nextElement (long klass, long elementNumber, CCgmIn *pCgmIn) |
| CCgmObjects (Larson::CConfig *config, webcgmConfig *pWebcgmConfig=NULL) | |
| Constructor. More... | |
| virtual | ~CCgmObjects () |
| Destructor. | |
| void | ReCalcList (vector< PicElement > &elList) |
| Re-calculate vdc bounds for all elements in list. | |
| long | LoadFile (std::wstring inputFile, int iPicture, std::vector< CgmInError > *pErrorList=NULL, ElementCallback *pElementCallback=NULL) |
| long | LoadFile (string inputFile, int iPicture, std::vector< CgmInError > *pErrorList=NULL, ElementCallback *pElementCallback=NULL) |
| void | Draw (CDrawBase *pDB, bool showRegions=false, bool exportAps=false) |
| Draw the entire CGM picture elements list and optionally show regions (hotspots) | |
| void | DrawList (CDrawBase *pDB, vector< PicElement > &gData, bool showRegions=false, bool exportAps=false) |
| Draw specified list of CGM picture elements. | |
| bool | Merge (CCgmObjects *pMergeObjects, CMatrix *pXForm) |
| Merge an elements list specified by pMergeObjects into this CGM picture elements list. | |
| Larson::CConfig * | getConfig () |
| Get application configuration instance. | |
| void | add (CCgmBaseObj *pObj) |
| Add a graphical element to picture elements list. | |
| void | add (CSegment *pSegment) |
| Add a segment to picture elements list. | |
| void | add (CAppStruct *pAppStruct) |
| Add an application structure (APS) to picture elements list subsequent add's will be added this APS until a closeAppStruct() occurs. | |
| void | closeAppStruct () |
| Closes an application structure (APS) | |
| void | add (PicElement &elem) |
| Add an element to picture elements list. | |
| DRect | GetBounds (bool locus=false) const |
| Get actual bounds of picture. | |
| long | Save (const std::wstring &outFile, CGMSaveOptions *pOptions) |
| Save the picture elements list to a CGM file (std::wstring filename) | |
| long | Save (const std::string &outFile, std::string profile, CGMSaveOptions *pOptions) |
| void | ConvertColors (int monoEnhance, int colorConvert) |
| convert colors- see SaveOptions for parameter definition More... | |
| void | ConvertColorsList (vector< PicElement > &elList, int monoEnhance, int colorConvert) |
| std::string | getVersion () |
| get version number string | |
| CColor | getColorTable (long index) |
| get a color table entry | |
| std::wstring | getKeywordValue (std::wstring string, std::wstring keyword) |
| std::wstring | ConformCGMFontNames (std::wstring &fontName) |
| reformat CGM fontName names Helvetica, Time-Roman and Courier to CGM standrd | |
| Larson::DPoint | vdc2nvdc (Larson::DPoint vdc) |
| Larson::DPoint | nvdc2vdc (Larson::DPoint nvdc) |
| void | AddDemoBanner (CDrawBase *pDB, int iDrawAddFlag=1, wchar_t *banner=NULL) |
| long | LoadAllelm01 () |
Public Member Functions inherited from Larson::CElementList | |
| CElementList () | |
| Constructor. | |
| void | add (CCgmBaseObj *pObj) |
| add graphical element | |
| void | add (CAppStruct *pAppStruct) |
| add Application Structure | |
| void | add (CSegment *pSegment) |
| add local segment list | |
| void | add (PicElement &elem) |
| add element | |
| int | find (PicElement &elem) |
| find element in list | |
| bool | erase (int index) |
| erase element at specified index in elements list | |
| bool | insert (int index, PicElement &elem) |
| insert element in elements list | |
Static Public Member Functions | |
| static void | CGMSaveOptionsInit (CGMSaveOptions *pOptions) |
Public Attributes | |
| webcgmConfig * | m_pWebcgmConfig |
| retain pointer to the WebCGM 2.1 application configurable items | |
| CColor | m_backgroundColor |
| Metafile background color. | |
| std::wstring | m_metafileDescription |
| Metafile Description string of loaded CGM file. | |
| std::wstring | m_metafileId |
| Metafile Id string of loaded CGM file. | |
| long | m_metafileVersion |
| Metafile Version number of loaded CGM file. | |
| CFontMap | m_fontMap |
| metafile font map (fontlist) of the loaded CGM file | |
| bool | m_unicode |
| Indicates loaded CGM file contained unicode encoding. | |
| vector< charSet > | m_charSets |
| Character sets of loaded CGM file. | |
| enum CharCodingAnnouncer | m_charCodingAnnouncer |
| metafile character coding announcer | |
| int | m_encoding |
| metafile encoding, binary (0) or clear text (1) | |
| int | m_maximumColorIndex |
| metafile maximum color index | |
| Larson::DPoint | m_maxVdcExtent [2] |
| metafile maximum vdc extent | |
| int | m_colorIndexPrecision |
| metafile color index precision | |
| int | m_colorPrecision |
| metafile color precision | |
| int | m_integerPrecision |
| metafile integer precision | |
| int | m_indexPrecision |
| metafile index precision | |
| int | m_namePrecision |
| metafile name precision | |
| enum ColorModel | m_colorModel |
| metafile color model | |
| struct { | |
| long selection | |
| double refWhiteX | |
| double refWhiteY | |
| double refWhiteZ | |
| double rgbMat [3][3] | |
| double abcMat [3][3] | |
| long numberEntries | |
| long numberGridLocs | |
| number of lookup tabel entries | |
| } | m_colorCalibration |
| metafile color calibration | |
| struct { | |
| RealPrecisionType type | |
| int exponent | |
| int mantissa | |
| } | m_realPrecision |
| metafile real precision | |
| vector< std::wstring > | m_symbolLibraryList |
| metafile symbol library list | |
| struct { | |
| int min | |
| int max | |
| } | m_segementPriorityExtent |
| metafile segment priority extent (min, max) | |
| enum VDCType | m_vdcType |
| metafile VDC type | |
| double | m_defVDCextDx |
| double | m_defVDCextDy |
| vector< metafileElementListEntry > | m_metafileElementList |
| metafile elements list | |
| vector< CSegment * > | m_globalSegments |
| metafile (global) segments list | |
| struct { | |
| int locationDataType | |
| vector< pictureDirEntry > pictureList | |
| 0=UI8, 1= UI16, 2- UI32 | |
| } | m_pictureDirectory |
| struct { | |
| long characterSetIndex | |
| long characterSetType | |
| std::wstring tail | |
| long octetsPerCode | |
| long glyphSouce | |
| vector< long > glyphCodeList | |
| } | m_glyphMapping |
| metafile glyph mapping | |
| std::wstring | m_pictureId |
| picture id of the loaded CGM file | |
| Larson::DPoint | m_vdcExtent [2] |
| picture Vdc Extent | |
| vector< CSegment * > | m_localSegments |
| picture (local) segments list | |
| enum ScalingMode | m_scalingMode |
| picture scaling mode, metric or abstract | |
| double | m_scalingFactor |
| picture scaling factor | |
| Larson::CColorTableEntry | m_colorTable [MAX_COLOR_INDEXES] |
| picture color table | |
| CClipping | m_clipping |
| picture clipping data | |
| CLineEdgeTypes | m_lineEdgeTypes |
| picture Line and Edge definitions | |
| CHatchStyles | m_hatchStyles |
| picture Hatch Style definitions | |
| CPatternTables | m_patternTables |
| picture Pattern Tables | |
| CGeometricPatternTables | m_geometricPatternTables |
| picture Geometric Pattern Tables | |
| bool | m_visibility |
| setable picture visibility | |
| ClippingPath * | m_curClippingPath |
| maintains clipping state while drawing picture elements list | |
| long | m_curClippingPathIndicator |
| ClipRectangle * | m_curClipRectangle |
| CColor | m_regionDrawFillColor |
| hotspot region highlighting parameters | |
| CColor | m_regionDrawLineColor |
| int | m_regionDrawStyle |
| std::wstring | m_hotspotIdPrefix |
| bool | visbilityState |
| maintains visibility state while drawing picture elements list | |
| bool | m_errorChecking |
| set to false to disable error checking during LoadFile | |
| bool | m_stopDrawing |
| set to true to abort Draw loop | |
| void * | hCGMLIB2 |
Public Attributes inherited from Larson::CElementList | |
| std::vector< PicElement > | m_elements |
| elements list | |
| CElementList * | m_pParent |
| pointer to owner of this element list | |
| int | m_growSize |
Friends | |
| class | CAppStruct |
CCgmObjects – CGM Picture container.
CGM Save options description is appended to profile to form a Metafile Description, enclose each keyword and value pair in double quotes and seprate by commas, e.g. description = L"\"ColourClass:color","Source:Company XYZ""
| CCgmObjects::CCgmObjects | ( | Larson::CConfig * | config, |
| webcgmConfig * | pWebcgmConfig = NULL |
||
| ) |
Constructor.
config is pointer to the application configuration pWebcgmConfig is pointer to the WebCGM 2.1 application configurable items
| void CCgmObjects::ConvertColors | ( | int | monoEnhance, |
| int | colorConvert | ||
| ) |
convert colors- see SaveOptions for parameter definition
change line colors onlye if not equal to background color if background is white turn all non-white (ie grey, blue, green, yellow, et.al.) lines to black (the opposite of white) if background is black turn all non-black (ie grey, blue, green, yellow, et.al.) lines to white (the opposite of black colorConvert; 0 = no color change 1 = invert all colors 2 = invert all colors if background color is black 3 = reverse Black and White 4 = invert Black & White only if background color is black
| std::wstring CCgmObjects::getKeywordValue | ( | std::wstring | string, |
| std::wstring | keyword | ||
| ) |
find keyword in string and return associated value example: getKeywordValue(m_metafileDescription, L"ProfileId")
if m_metafileDescription contains ...'ProfileId:WebCGM'... then "WebCGM" is returned.
| long Larson::CCgmObjects::LoadFile | ( | std::wstring | inputFile, |
| int | iPicture, | ||
| std::vector< CgmInError > * | pErrorList = NULL, |
||
| ElementCallback * | pElementCallback = NULL |
||
| ) |
| long Larson::CCgmObjects::LoadFile | ( | string | inputFile, |
| int | iPicture, | ||
| std::vector< CgmInError > * | pErrorList = NULL, |
||
| ElementCallback * | pElementCallback = NULL |
||
| ) |
| long CCgmObjects::Save | ( | const std::string & | outFile, |
| std::string | profile, | ||
| CGMSaveOptions * | pOptions | ||
| ) |
deprecated in 9.8.6 because detail added to profile Saves the picture elements list to a CGM file (string file name)
| Larson::DPoint CCgmObjects::vdc2nvdc | ( | Larson::DPoint | vdc | ) |
converts from vdc to nvdc units which are millimeters, in a coordinate system whose origin corresponds to the lower left corner of the VDC extent, with the X axis pointing to the right, and the Y axis pointing up.
| double Larson::CCgmObjects::m_defVDCextDx |
metafile longest VDC side based on default VDC type and default VDC extent (with possible Metafile Defaults Replacement interjecting)
1.8.6