CFx SDK Documentation  2023 SP0
AECGeCompCurve2d.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef __AECGECOMPCURVE2D_H__
25 #define __AECGECOMPCURVE2D_H__
26 
27 #include "Subobjects/AECImpArray.h"
30 #include "FMContour2D.h"
31 #include <Ge/GeSegmentChain2d.h>
32 
33 class AECGeProfile;
34 class AECGeCompCurve2d;
35 class AECGeInitSegments;
38 
42 namespace FacetModeler { class Contour2D; }
43 
52 class AECBASE_API AECGeCompCurve2d : public AECImpObj
53 {
55 
56  public:
60  bool IsClosed() const;
61 
65  void SetClosed( bool bClosed );
66 
71 
76 
89  virtual bool GetVertexByIndex( OdUInt32 iIndex,
90  OdGePoint2d& ptVertex,
91  double& dBulge ) const;
92 
106  virtual bool GetSegmentByIndex( OdUInt32 iIndex,
107  OdGePoint2d& ptVertex1,
108  OdGePoint2d& ptVertex2,
109  double& dBulge ) const;
110 
118 
123 
135  const OdRxClass* pSegmentType = 0 );
136 
141  const OdRxClass* pSegmentType = 0 );
142 
146  void Init( const OdGeSegmentChain2d& rPolyline,
147  const OdRxClass* pSegmentType = 0 );
148 
152  void Init(const FacetModeler::Contour2D& rContour,
153  const OdRxClass* pSegmentType = 0 );
154 
158  void SetDefaultSegmentType( const OdRxClass* pSegmentType );
159 
163  void GetRawContour(FacetModeler::Contour2D& rContour) const;
164 
169 
173  void SetAttribute( AECAttribute* pAttr );
174 
178  void Translate( const OdGeVector2d& v );
179 
180  protected:
182  // Method regenerates drawing specific data in elements of *m_aVertices* array.
183  void regenDwgData();
184 
186  // Method regenerates DXF specific data in elements of *m_aSegments* array.
187  void regenDxfData();
188 
189  friend class AECGeProfile;
190 
192  virtual void InitSegmentsImpl(
193  const FacetModeler::Contour2D& rContour,
194  const AECGeInitSegments& rSegSource,
195  const OdRxClass* pSegmentType = 0 );
196 
199  FacetModeler::Contour2D& rContour,
200  OdUInt32 uSegmentKey = 0) const;
201 
203  virtual void CopyDataFrom( const AECGeCompCurve2d* pSource );
204 
208  inline bool IsCacheInvalid() const {
209  return GETBIT( m_nFlags, 1 );
210  }
211 
215  inline void SetCacheInvalid( bool bInvalid ) {
216  SETBIT( m_nFlags, 1, bInvalid );
217  }
218  protected:
220  // Internal structure for storing segment data in drawing format.
222  {
224  : m_dBulge(0.0) {
225  }
226 
227  bool IsLine() const {
228  return (m_dBulge==0.0);
229  }
230 
231  // The X coordinate of the curve vertex in the 2d space.
232  double m_dOffsetX;
233 
234  // The Y coordinate of the curve vertex in the 2d space.
235  double m_dOffsetY;
236 
237  // The bulge value. Valid only for arc segments.
238  double m_dBulge;
239  };
240 
241  protected:
242  // Array of implementation classes, each corresponding to a single segment.
243  // The classes has the type of AECGeSegment2d.
245 
246  // Flags.
248 
249  // Indicates that the curve is closed.
250  bool m_bClosed;
251 
252  // Array of curve vertices description structures. The size of this array is equal to
253  // the number of segments stored in AECGeCompCurve2d::m_aSegments
254  // array. See the description of SCompCurve2dVertex for
255  // more details.
256  std::vector<SCompCurve2dVertex> m_aVertices;
257 
258  // Last vertex' x coordinate.
260 
261  // Last vertex' y coordinate.
263 
264  //
266 
267  //
269 };
270 
271 #endif //__AECGECOMPCURVE2D_H__
AECSubPtr< AECGeCompCurve2d > AECGeCompCurve2dSubPtr
OdSmartPtr< AECGeCompCurve2d > AECGeCompCurve2dPtr
#define AEC_DECLARE_MEMBERS(ClassName)
Definition: AECMacros.h:54
unsigned int OdUInt32
unsigned short OdUInt16
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:499
#define GETBIT(flags, bit)
Definition: OdaDefs.h:500
void regenDwgData()
DOM.
virtual OdUInt32 GetRawContourImpl(FacetModeler::Contour2D &rContour, OdUInt32 uSegmentKey=0) const
DOM.
AECAttributeSubPtr GetAttribute() const
void Translate(const OdGeVector2d &v)
void Init(const OdGeSegmentChain2d &rPolyline, const OdRxClass *pSegmentType=0)
void regenDxfData()
DOM.
bool IsClosed() const
bool IsCacheInvalid() const
static AECGeCompCurve2dPtr Create(const FacetModeler::Contour2D &rContour, const OdRxClass *pSegmentType=0)
void SetClosed(bool bClosed)
AECAttributePtr m_pAttribute
static AECGeCompCurve2dPtr Create(const OdGeSegmentChain2d &rPolyline, const OdRxClass *pSegmentType=0)
std::vector< SCompCurve2dVertex > m_aVertices
void GetRawContour(FacetModeler::Contour2D &rContour) const
virtual void InitSegmentsImpl(const FacetModeler::Contour2D &rContour, const AECGeInitSegments &rSegSource, const OdRxClass *pSegmentType=0)
DOM.
void SetAttribute(AECAttribute *pAttr)
virtual bool GetVertexByIndex(OdUInt32 iIndex, OdGePoint2d &ptVertex, double &dBulge) const
void SetCacheInvalid(bool bInvalid)
virtual bool GetSegmentByIndex(OdUInt32 iIndex, OdGePoint2d &ptVertex1, OdGePoint2d &ptVertex2, double &dBulge) const
AECImpArray m_aSegments
const OdRxClass * m_pDefaultSegmentType
OdUInt32 GetVertexCount() const
OdUInt32 GetSegmentCount() const
virtual void CopyDataFrom(const AECGeCompCurve2d *pSource)
DOM.
AECGeSegment2dPtr GetSegmentByIndex(OdUInt32 iIndex) const
void SetDefaultSegmentType(const OdRxClass *pSegmentType)
AECImpArrayPtr GetSegments()
void Init(const FacetModeler::Contour2D &rContour, const OdRxClass *pSegmentType=0)
OdUInt16 m_nFlags
Definition: AECGeProfile.h:171
const GLfloat * v
Definition: gles2_ext.h:315