CFx SDK Documentation  2020SP3
GiAbstractClipBoundary.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 _GI_ABSTRACT_CLIP_BOUNDARY_H_INCLUDED_
25 #define _GI_ABSTRACT_CLIP_BOUNDARY_H_INCLUDED_
26 
27 #include "TD_PackPush.h"
28 
29 #include "GiClipBoundary.h"
31 #include "IntArray.h"
32 
39 {
40  public:
42  {
43  kNormal = 0, // Default clip boundary (not pass additional data, clip outside contour)
44  kInverted, // Inverted clip boundary (pass inverted clip array, clip inside contour)
45  kExtended, // Extended clip boundary (pass clipping contours, clip by sorted contours array)
46  kComplex, // Complex clip boundary (extended clip boundary which requires additional preprocessing)
47  kPlanar // Planar clip boundary (clipping by set of 3d planes with ability to output geometry sections)
48  };
49  public:
51 
54 
58  virtual BoundaryType type() const { return kNormal; }
59 
63  virtual OdGiAbstractClipBoundary *clone() const { return new OdGiAbstractClipBoundary(); }
64 };
65 
72 {
73  protected:
74  OdGePoint2dArray m_Points; // Array of points that defines the inverted clip boundary.
75  public:
78 
82  BoundaryType type() const { return kInverted; }
83 
87  const OdGePoint2dArray &invertedClipBoundary() const { return m_Points; }
92  void setInvertedClipBoundary(const OdGePoint2dArray &pPoints) { m_Points = pPoints; }
93 
100  return pNew;
101  }
102 };
103 
110 {
111  protected:
112  OdIntArray m_Counts; // Array of contour points counts.
113  OdGePoint2dArray m_Points; // Array of points that defines the extended clip boundary contours.
114  public:
117 
121  BoundaryType type() const { return kExtended; }
122 
126  const OdIntArray &clipBoundaryCounts() const { return m_Counts; }
131  void setClipBoundaryCounts(const OdIntArray &pCounts) { m_Counts = pCounts; }
132 
136  const OdGePoint2dArray &clipBoundaryPoints() const { return m_Points; }
141  void setClipBoundaryPoints(const OdGePoint2dArray &pPoints) { m_Points = pPoints; }
142 
147  protected:
151  return pNew;
152  }
153 };
154 
161 {
162  public:
165 
169  BoundaryType type() const { return kComplex; }
170 
175 };
176 
183 {
184  public:
188  struct ClipPlane
189  {
194 
198  ClipPlane &setOrigin(const OdGePoint3d &origin) { m_origin = origin; return *this; }
199  const OdGePoint3d &origin() const { return m_origin; }
200  ClipPlane &setNormal(const OdGeVector3d &normal) { m_normal = normal; return *this; }
201  const OdGeVector3d &normal() const { return m_normal; }
202  };
207  protected:
208  ClipPlaneArray m_ClipPlanes; // Array of clipping planes.
209  mutable OdGiSectionGeometryOutputPtr m_pSectionOutput; // Optional geometry sections output.
210  public:
213 
217  BoundaryType type() const { return kPlanar; }
218 
222  const ClipPlaneArray &clipPlanes() const { return m_ClipPlanes; }
227  void setClipPlanes(const ClipPlaneArray &pClipPlanes) { m_ClipPlanes = pClipPlanes; }
228 
237  void setSectionGeometryOutput(OdGiSectionGeometryOutput *pSectionOutput) { m_pSectionOutput = pSectionOutput; }
238 
244  pNew->setClipPlanes(clipPlanes());
246  return pNew;
247  }
248 };
249 
256 {
258 
261  : OdGiClipBoundary(pBoundary), m_pAbstractData(NULL)
262  {
263  if (pAbsData) m_pAbstractData = pAbsData->clone();
264  }
266  : OdGiClipBoundary(pBoundary), m_pAbstractData(NULL)
267  {
268  if (pBoundary.m_pAbstractData) m_pAbstractData = pBoundary.m_pAbstractData->clone();
269  }
271  if (m_pAbstractData) delete m_pAbstractData;
272  }
273 };
274 
275 #include "TD_PackPop.h"
276 
277 #endif // _GI_ABSTRACT_CLIP_BOUNDARY_H_INCLUDED_
OdGiAbstractClipBoundary::kExtended
@ kExtended
Definition: GiAbstractClipBoundary.h:45
OdGiPlanarClipBoundary::ClipPlane::m_normal
OdGeVector3d m_normal
Definition: GiAbstractClipBoundary.h:193
OdGiExtendedClipBoundary::m_Points
OdGePoint2dArray m_Points
Definition: GiAbstractClipBoundary.h:113
OdGiPlanarClipBoundary::~OdGiPlanarClipBoundary
~OdGiPlanarClipBoundary()
Definition: GiAbstractClipBoundary.h:212
OdGiAbstractClipBoundary::type
virtual BoundaryType type() const
Definition: GiAbstractClipBoundary.h:58
OdGeVector3d
Definition: GeVector3d.h:54
NULL
#define NULL
Definition: GsProperties.h:177
OdGiAbstractClipBoundary::kPlanar
@ kPlanar
Definition: GiAbstractClipBoundary.h:47
OdGiPlanarClipBoundary::ClipPlane
Definition: GiAbstractClipBoundary.h:189
OdGiPlanarClipBoundary::ClipPlane::origin
const OdGePoint3d & origin() const
Definition: GiAbstractClipBoundary.h:199
OdGiInvertedClipBoundary::invertedClipBoundary
const OdGePoint2dArray & invertedClipBoundary() const
Definition: GiAbstractClipBoundary.h:87
OdGiPlanarClipBoundary::m_pSectionOutput
OdGiSectionGeometryOutputPtr m_pSectionOutput
Definition: GiAbstractClipBoundary.h:209
OdGiPlanarClipBoundary::ClipPlaneArray
OdArray< ClipPlane > ClipPlaneArray
Definition: GiAbstractClipBoundary.h:206
OdGiPlanarClipBoundary::ClipPlane::normal
const OdGeVector3d & normal() const
Definition: GiAbstractClipBoundary.h:201
OdGiAbstractClipBoundary::clone
virtual OdGiAbstractClipBoundary * clone() const
Definition: GiAbstractClipBoundary.h:63
OdGiPlanarClipBoundary::ClipPlane::setNormal
ClipPlane & setNormal(const OdGeVector3d &normal)
Definition: GiAbstractClipBoundary.h:200
OdGiPlanarClipBoundary::sectionGeometryOutput
OdGiSectionGeometryOutput * sectionGeometryOutput() const
Definition: GiAbstractClipBoundary.h:232
OdGiComplexClipBoundary::OdGiComplexClipBoundary
OdGiComplexClipBoundary()
Definition: GiAbstractClipBoundary.h:163
OdGiExtendedClipBoundary::type
BoundaryType type() const
Definition: GiAbstractClipBoundary.h:121
OdGiAbstractClipBoundary::ODRX_HEAP_OPERATORS
ODRX_HEAP_OPERATORS()
OdGiComplexClipBoundary
Definition: GiAbstractClipBoundary.h:161
OdGiClipBoundaryWithAbstractData::OdGiClipBoundaryWithAbstractData
OdGiClipBoundaryWithAbstractData(const OdGiClipBoundaryWithAbstractData &pBoundary)
Definition: GiAbstractClipBoundary.h:265
OdGiExtendedClipBoundary::copyExtendedData
OdGiAbstractClipBoundary * copyExtendedData(OdGiExtendedClipBoundary *pNew) const
Definition: GiAbstractClipBoundary.h:148
OdArray< OdGePoint2d, OdMemoryAllocator< OdGePoint2d > >
TD_PackPop.h
IntArray.h
OdGiClipBoundaryWithAbstractData::~OdGiClipBoundaryWithAbstractData
~OdGiClipBoundaryWithAbstractData()
Definition: GiAbstractClipBoundary.h:270
OdGiExtendedClipBoundary::clone
OdGiAbstractClipBoundary * clone() const
Definition: GiAbstractClipBoundary.h:146
OdGiClipBoundaryWithAbstractData
Definition: GiAbstractClipBoundary.h:256
OdGiExtendedClipBoundary::setClipBoundaryCounts
void setClipBoundaryCounts(const OdIntArray &pCounts)
Definition: GiAbstractClipBoundary.h:131
OdGiAbstractClipBoundary::kComplex
@ kComplex
Definition: GiAbstractClipBoundary.h:46
OdGiClipBoundary
Definition: GiClipBoundary.h:41
OdGiPlanarClipBoundary
Definition: GiAbstractClipBoundary.h:183
OdGiClipBoundaryWithAbstractData::OdGiClipBoundaryWithAbstractData
OdGiClipBoundaryWithAbstractData()
Definition: GiAbstractClipBoundary.h:259
OdGiExtendedClipBoundary::~OdGiExtendedClipBoundary
~OdGiExtendedClipBoundary()
Definition: GiAbstractClipBoundary.h:116
OdSmartPtr< OdGiSectionGeometryOutput >
OdGePoint3d
Definition: GePoint3d.h:55
OdGiInvertedClipBoundary::OdGiInvertedClipBoundary
OdGiInvertedClipBoundary()
Definition: GiAbstractClipBoundary.h:76
GiSectionGeometryOutput.h
OdGiAbstractClipBoundary
Definition: GiAbstractClipBoundary.h:39
OdGiInvertedClipBoundary::setInvertedClipBoundary
void setInvertedClipBoundary(const OdGePoint2dArray &pPoints)
Definition: GiAbstractClipBoundary.h:92
OdGiPlanarClipBoundary::setSectionGeometryOutput
void setSectionGeometryOutput(OdGiSectionGeometryOutput *pSectionOutput)
Definition: GiAbstractClipBoundary.h:237
OdGiComplexClipBoundary::~OdGiComplexClipBoundary
~OdGiComplexClipBoundary()
Definition: GiAbstractClipBoundary.h:164
OdGiPlanarClipBoundary::m_ClipPlanes
ClipPlaneArray m_ClipPlanes
Definition: GiAbstractClipBoundary.h:208
OdGiPlanarClipBoundary::ClipPlane::ClipPlane
ClipPlane()
Definition: GiAbstractClipBoundary.h:195
OdGiClipBoundaryWithAbstractData::m_pAbstractData
OdGiAbstractClipBoundary * m_pAbstractData
Definition: GiAbstractClipBoundary.h:257
OdGiPlanarClipBoundary::setClipPlanes
void setClipPlanes(const ClipPlaneArray &pClipPlanes)
Definition: GiAbstractClipBoundary.h:227
OdGiInvertedClipBoundary::clone
OdGiAbstractClipBoundary * clone() const
Definition: GiAbstractClipBoundary.h:97
OdGiExtendedClipBoundary::setClipBoundaryPoints
void setClipBoundaryPoints(const OdGePoint2dArray &pPoints)
Definition: GiAbstractClipBoundary.h:141
TD_PackPush.h
OdGiAbstractClipBoundary::kNormal
@ kNormal
Definition: GiAbstractClipBoundary.h:43
GiClipBoundary.h
OdGiClipBoundaryWithAbstractData::OdGiClipBoundaryWithAbstractData
OdGiClipBoundaryWithAbstractData(const OdGiClipBoundary &pBoundary, const OdGiAbstractClipBoundary *pAbsData=NULL)
Definition: GiAbstractClipBoundary.h:260
OdGiInvertedClipBoundary::type
BoundaryType type() const
Definition: GiAbstractClipBoundary.h:82
OdGiExtendedClipBoundary::clipBoundaryPoints
const OdGePoint2dArray & clipBoundaryPoints() const
Definition: GiAbstractClipBoundary.h:136
OdGiPlanarClipBoundary::clipPlanes
const ClipPlaneArray & clipPlanes() const
Definition: GiAbstractClipBoundary.h:222
OdGiPlanarClipBoundary::ClipPlane::m_origin
OdGePoint3d m_origin
Definition: GiAbstractClipBoundary.h:191
OdGiExtendedClipBoundary::OdGiExtendedClipBoundary
OdGiExtendedClipBoundary()
Definition: GiAbstractClipBoundary.h:115
OdGiAbstractClipBoundary::~OdGiAbstractClipBoundary
virtual ~OdGiAbstractClipBoundary()
Definition: GiAbstractClipBoundary.h:53
OdGiExtendedClipBoundary::m_Counts
OdIntArray m_Counts
Definition: GiAbstractClipBoundary.h:112
OdGiAbstractClipBoundary::kInverted
@ kInverted
Definition: GiAbstractClipBoundary.h:44
OdGiAbstractClipBoundary::OdGiAbstractClipBoundary
OdGiAbstractClipBoundary()
Definition: GiAbstractClipBoundary.h:52
OdGiPlanarClipBoundary::ClipPlane::setOrigin
ClipPlane & setOrigin(const OdGePoint3d &origin)
Definition: GiAbstractClipBoundary.h:198
OdGiExtendedClipBoundary::clipBoundaryCounts
const OdIntArray & clipBoundaryCounts() const
Definition: GiAbstractClipBoundary.h:126
OdGiPlanarClipBoundary::OdGiPlanarClipBoundary
OdGiPlanarClipBoundary()
Definition: GiAbstractClipBoundary.h:211
OdGiInvertedClipBoundary::~OdGiInvertedClipBoundary
~OdGiInvertedClipBoundary()
Definition: GiAbstractClipBoundary.h:77
OdGiAbstractClipBoundary::BoundaryType
BoundaryType
Definition: GiAbstractClipBoundary.h:42
OdGiExtendedClipBoundary
Definition: GiAbstractClipBoundary.h:110
OdGiPlanarClipBoundary::type
BoundaryType type() const
Definition: GiAbstractClipBoundary.h:217
OdGiSectionGeometryOutput
Definition: GiSectionGeometryOutput.h:39
OdGiComplexClipBoundary::clone
OdGiAbstractClipBoundary * clone() const
Definition: GiAbstractClipBoundary.h:174
OdGiPlanarClipBoundary::clone
OdGiAbstractClipBoundary * clone() const
Definition: GiAbstractClipBoundary.h:242
OdGiComplexClipBoundary::type
BoundaryType type() const
Definition: GiAbstractClipBoundary.h:169
OdGiInvertedClipBoundary
Definition: GiAbstractClipBoundary.h:72
OdGiInvertedClipBoundary::m_Points
OdGePoint2dArray m_Points
Definition: GiAbstractClipBoundary.h:74
OdGiPlanarClipBoundary::ClipPlane::ClipPlane
ClipPlane(const OdGePoint3d &origin, const OdGeVector3d &normal)
Definition: GiAbstractClipBoundary.h:196