CGM Objects Library
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
MakeCgmObjs.h
1 // MakeCgmObjs.h - create individual CGM primitive objects
2 //
5 
6 #pragma message("*********************************************")
7 #pragma message("*** MakeCgmObjs is a work in progress *******")
8 #pragma message("*** ToDo: Figures, ApsStruct ***")
9 #pragma message("*********************************************")
10 
11 #include "CgmObjects/CgmObj.h"
12 
13 #pragma once
14 
15 namespace Larson
16 {
18  {
19  public:
20  CCgmAttrState();
21  ~CCgmAttrState();
22 
23  public:
24  CCgmBaseObj::Transparency transparency;
25  Larson::CColor auxColor;
26 
27  Larson::CColor lineColor;
28  struct {
29  CCgmBaseObj::LineCapIndicator edge;
30  CCgmBaseObj::LineCapIndicator dash;
31  } lineCap;
32  CCgmBaseObj::LineJoinIndicator lineJoin;
33  CCgmBaseObj::LineTypeContinuation lineCont;
34  CCgmBaseObj::LineType lineType;
35  double lineTypeInitial;
36  double lineWidth;
37  CCgmBaseObj::SpecMode lineWidthSpecMode;
38 
39  Larson::CColor markerColor;
40  CCgmBaseObj::MarkerType markerType;
41  double markerSize;
42 
43  long textFontIndex;
44  long characterSetIndex;
45  long altCharacterSetIndex;
46  double characterExpFactor;
47  double characterSpacing;
48  Larson::CColor textColor;
49  double characterHeight;
50  CCgmBaseObj::TextScoreType textScoreType;
51  CCgmBaseObj::RestrTextType restrTextType;
52  struct {
53  DPoint up;
54  DPoint base;
55  } characterOrientation;
56  CCgmBaseObj::TextPath textPath;
57  struct {
58  CCgmBaseObj::TextAlignmentHorizontal horizontal;
59  CCgmBaseObj::TextAlignmentVertical vertical;
60  } textAlignment;
61  CCgmText *textAppendParent;
62 
63  CCgmBaseObj::InteriorStyle interiorStyle;
64  Larson::CColor fillColor;
65  CCgmBaseObj::HatchIndex hatchIndex;
66  long patternIndex;
67  CCgmBaseObj::InterpolatedInteriorStyle interpolatedInterior;
68  struct {
69  DPoint height;
70  DPoint width;
71  } patternSize;
72  DPoint patternRefPoint;
73  CCgmBaseObj::SpecMode interiorStyleSpecMode;
74  CCgmBaseObj::Transparency transparentCellIndicator;
75  CColor transparentCellColor;
76 
77  CCgmBaseObj::EdgeVisibility edgeVisible;
78  Larson::CColor edgeColor;
79  struct {
80  CCgmBaseObj::DashCapIndicator edge;
81  CCgmBaseObj::LineCapIndicator dash;
82  } edgeCap;
83  CCgmBaseObj::LineJoinIndicator edgeJoin;
84  CCgmBaseObj::LineTypeContinuation edgeCont;
85  CCgmBaseObj::LineType edgeType;
86  double edgeTypeInitial;
87  double edgeWidth;
88  CCgmBaseObj::SpecMode edgeWidthSpecMode;
89 
90  double miterLimit;
91 
92  CCgmTileArray *tileArray;
93  long currentTileNumber;
94 
95  long clipRectIndex;
96  long clipIndicator;
97  long protectionRegionIndicator;
98  Path *pProtectionRegionPath;
99 
100  CAppStruct *pAppStruct;
101  };
102 
105  {
106  public:
107  MakeCgmObjs(){};
108  ~MakeCgmObjs(){};
109 
110  // ***************************************************************************************** //
111  // Static Methods...
112  // ***************************************************************************************** //
113 
114  private:
115  static void CopyLineAttr(CCgmBaseObj *pObj, CCgmAttrState *pAttr);
116  static void CopyFillAttr(CCgmBaseObj *pObj, CCgmAttrState *pAttr);
117 
118  public:
120  static CCgmBaseObj* CellArray(DPoint p, DPoint q, DPoint r, long nx, long ny,
121  long colorPrecision, void *colorSpecifiers, long compressionLength,
122  CCgmObjects* pOwner, CCgmAttrState* pAttr);
124  static CCgmBaseObj* Circle(DPoint center, double radius, CCgmObjects* pOwner,
125  CCgmAttrState* pAttr);
127  static CCgmBaseObj* CircularArc3Pt(DPoint start, DPoint mid, DPoint end,
128  CCgmBaseObj::ArcClosureType closureType, CCgmObjects* pOwner, CCgmAttrState* pAttr);
130  static CCgmBaseObj* CircularArcCenter(DPoint center, DPoint startVec,
131  DPoint endVec, double radius, CCgmBaseObj::ArcClosureType closureType,
132  CCgmObjects* pOwner, CCgmAttrState* pAttr);
134  static CCgmBaseObj* CircularArcCenterRev(DPoint center, DPoint startVec,
135  DPoint endVec, CCgmObjects* pOwner, CCgmAttrState* pAttr);
137  static CCgmBaseObj* Ellipse(DPoint center, DPoint cdp1, DPoint cdp2,
138  CCgmObjects* pOwner, CCgmAttrState* pAttr);
140  static CCgmBaseObj* EllipticalArc(DPoint center, DPoint cdp1, DPoint cdp2,
141  DPoint startVec, DPoint endVec, CCgmBaseObj::ArcClosureType closureType,
142  CCgmObjects* pOwner, CCgmAttrState* pAttr);
144  static CCgmBaseObj* Rectangle(DPoint pt1, DPoint pt2, CCgmObjects* pOwner,
145  CCgmAttrState* pAttr);
146  private:
147  static CCgmBaseObj* Poly(CCgmBaseObj::Shape shape, DPoint* pts, long nPts,
148  CCgmBaseObj::EdgeFlags* flags, CCgmObjects* pOwner, CCgmAttrState* pAttr);
149  public:
151  static CCgmBaseObj* Polyline(DPoint* pts, long nPts, CCgmObjects* pOwner,
152  CCgmAttrState* pAttr);
154  static CCgmBaseObj* DisjointPolyline(DPoint* pts, long nPts, CCgmObjects* pOwner,
155  CCgmAttrState* pAttr);
157  static CCgmBaseObj* Polygon(DPoint* pts, long nPts, CCgmObjects* pOwner,
158  CCgmAttrState* pAttr);
160  static CCgmBaseObj* PolygonSet(DPoint* pts, long nPts, CCgmBaseObj::EdgeFlags* flags,
161  CCgmObjects* pOwner, CCgmAttrState* pAttr);
163  static CCgmBaseObj* Polymarker(DPoint* pts, long nPts, CCgmObjects* pOwner,
164  CCgmAttrState* pAttr);
166  static CCgmBaseObj* PolyBezier(CCgmBaseObj::ContinuityIndicator continuityIndicator,
167  DPoint* pts, long nPts, CCgmObjects* pOwner, CCgmAttrState* pAttr);
168 
169  private:
170  static void CopyTextAttr(CCgmText* pText, CCgmAttrState* pAttr);
171 
172  public:
174  static CCgmBaseObj* Text(DPoint pt, bool final, std::wstring text, CCgmObjects* pOwner,
175  CCgmAttrState* pAttr);
176 
178  static CCgmBaseObj* AppendText(bool final, std::wstring text, CCgmObjects* pOwner,
179  CCgmAttrState* pAttr);
180 
182  static CCgmBaseObj* RestrictedText(double width, double height, DPoint pt,
183  bool final, std::wstring text, CCgmObjects* pOwner, CCgmAttrState* pAttr);
184 
191  static long BeginTileArray(DPoint position,
192  CCgmBaseObj::CellPathDirection cellPathDirection,
193  CCgmBaseObj::LineProgressionDirection lineProgressionDirection,
194  long numTilePathDirection, long numTileLineDirection,
195  long numCellPathDirection, long numCellLineDirection,
196  double cellSizePathDirection, double cellSizeLineDirection,
197  long imageOffsetPathDirection, long imageOffsetLineDirection,
198  long imageNumCellPathDirection, long imageNumCellLine,
199  CCgmObjects* pOwner, CCgmAttrState* pAttr);
200 
204  static CCgmBaseObj *EmptyFigure(CCgmObjects* pOwner, CCgmAttrState* pAttr);
205 
206  private:
208  static long EitherTile(bool bBitonalTile, CCgmBaseObj::TileCompressionType compressionType,
209  long cellColorPrecision, CColor biBgc, CColor biFgc, void *parameters,
210  void *colorSpecifiers, long colorSpecifiersSize, CCgmObjects* pOwner,
211  CCgmAttrState* pAttr);
212 
213  public:
214 
216  static long BiTonalTile(CCgmBaseObj::TileCompressionType compressionType,
217  CColor bgc,
218  CColor fgc,
219  void *parameters,
220  void *colorSpecifiers,
221  long colorSpecifiersSize,
222  CCgmObjects* pOwner, CCgmAttrState* pAttr);
223 
225  static long Tile(CCgmBaseObj::TileCompressionType compressionType,
226  long cellColorPrecision, void *parameters,
227  void *colorSpecifiers,
228  long colorSpecifiersSize,
229  CCgmObjects* pOwner, CCgmAttrState* pAttr);
230 
232  static CCgmBaseObj* EndTileArray(CCgmObjects* pOwner, CCgmAttrState* pAttr);
233 
234  }; // end class MakeCgmObjs
235 
236 };
static long BiTonalTile(CCgmBaseObj::TileCompressionType compressionType, CColor bgc, CColor fgc, void *parameters, void *colorSpecifiers, long colorSpecifiersSize, CCgmObjects *pOwner, CCgmAttrState *pAttr)
add a bi-tonal (1 bit per cell) tile to a Tile Array object (CCgmTileArray)
Definition: MakeCgmObjs.cpp:981
static CCgmBaseObj * Polymarker(DPoint *pts, long nPts, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Polygon Marker object (a variant of CCgmPolyline) from parameters and current state list ...
Definition: MakeCgmObjs.cpp:628
static CCgmBaseObj * Polyline(DPoint *pts, long nPts, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Polyline object (CCgmPolyline) from parameters and current state list ...
Definition: MakeCgmObjs.cpp:604
static CCgmBaseObj * CellArray(DPoint p, DPoint q, DPoint r, long nx, long ny, long colorPrecision, void *colorSpecifiers, long compressionLength, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Cell Array object (CCgmCellArray) from parameters and current state list ...
Definition: MakeCgmObjs.cpp:257
static CCgmBaseObj * Rectangle(DPoint pt1, DPoint pt2, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Rectangle object (CCgmRect) from parameters and current state list
Definition: MakeCgmObjs.cpp:515
static CCgmBaseObj * AppendText(bool final, std::wstring text, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Append Text object (a variant of CCgmText) from parameters and current state list ...
Definition: MakeCgmObjs.cpp:770
static CCgmBaseObj * RestrictedText(double width, double height, DPoint pt, bool final, std::wstring text, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Restricted Text object (a variant of CCgmText) from parameters and current state list ...
Definition: MakeCgmObjs.cpp:801
static CCgmBaseObj * EndTileArray(CCgmObjects *pOwner, CCgmAttrState *pAttr)
end construction of a Tile Array object (CCgmTileArray)
Definition: MakeCgmObjs.cpp:1005
static long BeginTileArray(DPoint position, CCgmBaseObj::CellPathDirection cellPathDirection, CCgmBaseObj::LineProgressionDirection lineProgressionDirection, long numTilePathDirection, long numTileLineDirection, long numCellPathDirection, long numCellLineDirection, double cellSizePathDirection, double cellSizeLineDirection, long imageOffsetPathDirection, long imageOffsetLineDirection, long imageNumCellPathDirection, long imageNumCellLine, CCgmObjects *pOwner, CCgmAttrState *pAttr)
Definition: MakeCgmObjs.cpp:840
static CCgmBaseObj * Ellipse(DPoint center, DPoint cdp1, DPoint cdp2, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Ellipse object (CCgmEllipse) from parameters and current state list
Definition: MakeCgmObjs.cpp:454
static CCgmBaseObj * CircularArcCenter(DPoint center, DPoint startVec, DPoint endVec, double radius, CCgmBaseObj::ArcClosureType closureType, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Circular Arc Center object (a variant of CCgmCircle) from parameters and current state li...
Definition: MakeCgmObjs.cpp:390
static CCgmBaseObj * CircularArcCenterRev(DPoint center, DPoint startVec, DPoint endVec, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Circular Arc Center Reverse object (a variant of CCgmCircle) from parameters and current ...
Definition: MakeCgmObjs.cpp:429
static CCgmBaseObj * Text(DPoint pt, bool final, std::wstring text, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Text object (CCgmText) from parameters and current state list
Definition: MakeCgmObjs.cpp:725
Path – graphical path data container class.
Definition: Path.h:17
static CCgmBaseObj * DisjointPolyline(DPoint *pts, long nPts, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Disjoint Polyline object (a variant of CCgmPolyline) from parameters and current state li...
Definition: MakeCgmObjs.cpp:610
static CCgmBaseObj * Polygon(DPoint *pts, long nPts, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Polygon object (a variant of CCgmPolyline) from parameters and current state list ...
Definition: MakeCgmObjs.cpp:616
static CCgmBaseObj * PolyBezier(CCgmBaseObj::ContinuityIndicator continuityIndicator, DPoint *pts, long nPts, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Poly Bezier object (a variant of CCgmPolyline) from parameters and current state list ...
Definition: MakeCgmObjs.cpp:636
MakeCgmObjs – CGM primitive object creation functions.
Definition: MakeCgmObjs.h:104
static CCgmBaseObj * PolygonSet(DPoint *pts, long nPts, CCgmBaseObj::EdgeFlags *flags, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Polygon Set object (a variant of CCgmPolyline) from parameters and current state list ...
Definition: MakeCgmObjs.cpp:622
static CCgmBaseObj * CircularArc3Pt(DPoint start, DPoint mid, DPoint end, CCgmBaseObj::ArcClosureType closureType, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Circular Arc 3Pt object (a variant of CCgmCircle) from parameters and current state list ...
Definition: MakeCgmObjs.cpp:352
CCgmTileArray – TileArray element container class.
Definition: CgmObj.h:995
static long Tile(CCgmBaseObj::TileCompressionType compressionType, long cellColorPrecision, void *parameters, void *colorSpecifiers, long colorSpecifiersSize, CCgmObjects *pOwner, CCgmAttrState *pAttr)
add a tile (any precions per cell) to a Tile Array object (CCgmTileArray)
Definition: MakeCgmObjs.cpp:992
CCgmBaseObj – graphical element container base class.
Definition: CgmObj.h:121
CAppStruct – Application Structure (APS) container class.
Definition: AppStruct.h:23
CCgmText – Text and RestrictedText elements container class.
Definition: CgmObj.h:794
static CCgmBaseObj * Circle(DPoint center, double radius, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Circle object (CCgmCircle) from parameters and current state list
Definition: MakeCgmObjs.cpp:329
static CCgmBaseObj * EllipticalArc(DPoint center, DPoint cdp1, DPoint cdp2, DPoint startVec, DPoint endVec, CCgmBaseObj::ArcClosureType closureType, CCgmObjects *pOwner, CCgmAttrState *pAttr)
construct a Elliptical Arce object (a variant of CCgmEllipse) from parameters and current state list ...
Definition: MakeCgmObjs.cpp:475
CCgmAttrState()
Copyright (c) 2012-2013, Larson Software Technology, Inc.
Definition: MakeCgmObjs.cpp:21
CCgmObjects – CGM Picture container.
Definition: CgmObjects.h:472
Definition: MakeCgmObjs.h:17
static CCgmBaseObj * EmptyFigure(CCgmObjects *pOwner, CCgmAttrState *pAttr)