CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
AECGeCompCurve2d.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a
16// license agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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
30#include "FMContour2D.h"
31#include <Ge/GeSegmentChain2d.h>
32
33class AECGeProfile;
35class AECGeInitSegments;
38
42namespace FacetModeler { class Contour2D; }
43
52class 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
164
169
174
178 void Translate( const OdGeVector2d& v );
179
183 void Reverse();
184
185 protected:
187 // Method regenerates drawing specific data in elements of *m_aVertices* array.
189
191 // Method regenerates DXF specific data in elements of *m_aSegments* array.
193
194 friend class AECGeProfile;
195
197 virtual void InitSegmentsImpl(
198 const FacetModeler::Contour2D& rContour,
199 const AECGeInitSegments& rSegSource,
200 const OdRxClass* pSegmentType = 0 );
201
204 FacetModeler::Contour2D& rContour,
205 OdUInt32 uSegmentKey = 0) const;
206
208 virtual void CopyDataFrom( const AECGeCompCurve2d* pSource );
209
213 inline bool IsCacheInvalid() const {
214 return GETBIT( m_nFlags, 1 );
215 }
216
220 inline void SetCacheInvalid( bool bInvalid ) {
221 SETBIT( m_nFlags, 1, bInvalid );
222 }
223 protected:
225 // Internal structure for storing segment data in drawing format.
227 {
229 : m_dBulge(0.0) {
230 }
231
232 bool IsLine() const {
233 return (m_dBulge==0.0);
234 }
235
236 // The X coordinate of the curve vertex in the 2d space.
238
239 // The Y coordinate of the curve vertex in the 2d space.
241
242 // The bulge value. Valid only for arc segments.
243 double m_dBulge;
244 };
245
246 protected:
247 // Array of implementation classes, each corresponding to a single segment.
248 // The classes has the type of AECGeSegment2d.
250
251 // Flags.
253
254 // Indicates that the curve is closed.
256
257 // Array of curve vertices description structures. The size of this array is equal to
258 // the number of segments stored in AECGeCompCurve2d::m_aSegments
259 // array. See the description of SCompCurve2dVertex for
260 // more details.
261 std::vector<SCompCurve2dVertex> m_aVertices;
262
263 // Last vertex' x coordinate.
265
266 // Last vertex' y coordinate.
268
269 //
271
272 //
274};
275
276#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:516
#define GETBIT(flags, bit)
Definition: OdaDefs.h:517
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)
const GLfloat * v
Definition: gles2_ext.h:315