CGM Objects Library
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
CgmInfo.h
1 
4 #pragma once
5 
6 #include "CgmDecode.h"
7 #include "CgmObjects.h"
8 
40 namespace Larson
41 {
43  class CgmInfo
44  {
45  public:
47  CgmInfo(std::wstring fileName);
48  virtual ~CgmInfo();
49  /*
50  // description = metafile description; Metafile colour conformance class, source, and date items will
51  // be encoded as substrings using the keywords: "ColourClass:", "Source:", "Date:", "Profile:" and "ProfileEd:
52  // for example: "ProfileId:WebCGM","ProfileEd:2.1"
53  // fontlist = metafile fontlist
54  // metafile encoding = binary (0) or clear text (1)
55  */
56  typedef struct MetafileInfo
57  {
58  std::wstring description;
59  std::vector<std::wstring> fontlist;
60  long encoding;
61  } MetafileInfo;
63  void getMetafileInfo(MetafileInfo& metaInfo);
64 
65  /*
66  // vdcExtent: 2 points that define the lower left and upper corners of picture bounds in VDC units
67  // scalingFactor: metric scaling factor
68  // scalingMode: 0 = Abstract scaling mode, 1= Metric scaling mode
69  // If set to Abstract, the VDC space is dimensionless
70  // If set to Metric, the VDC space has implied measure: the metric scale factor represents the
71  // distance (in millimetres) in the picture corresponding to one VDC unit. One VDC unit represents
72  // one millimetre multiplied by the metric scale factor
73  // id = picture identifier
74  */
75  typedef struct PictureInfo
76  {
77  Larson::DPoint vdcExtent[2];
78  double scalingFactor;
79  long scalingMode;
80  std::wstring id;
81  } PictureInfo;
83  void getPictureInfo(vector<PictureInfo>& picsInfo);
84  int m_error;
85 
86  private:
87  long pdElements(CGMI_DS *cgmi_ds, long element, long count, int state);
88  long controlElements(CGMI_DS *cgmi_ds, long element, int state);
89  CGMI_FMTBL format;
90  VDC_PRECISIONS vdcPrecisions;
91  CGMI_DS metafileDefRep; /* METAFILE DEFAULTS REPLACEMENT */
92  /* pointer to MDR data record(s) */
93  CGMI_FMTBL metafileDefFmtbl; // format table containing data types at point where MDR occured
94  PictureInfo currentPicInfo;
95 
96  MetafileInfo metafileInfo;
97  vector<PictureInfo> picturesInfo;
98  };
99 };
CgmInfo(std::wstring fileName)
Constructor.
Definition: CgmInfo.cpp:8
CgmInfo – get CGM information.
Definition: CgmInfo.h:43
void getMetafileInfo(MetafileInfo &metaInfo)
get metafile information
Definition: CgmInfo.cpp:471
Definition: CgmInfo.h:75
decoder data stream structure
Definition: CgmDecode.h:74
Definition: CgmDecode.h:128
Definition: CgmInfo.h:56
void getPictureInfo(vector< PictureInfo > &picsInfo)
get picture(s) information
Definition: CgmInfo.cpp:476