CFx SDK Documentation  2022 SP0
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_
#define NULL
Definition: GsProperties.h:177
virtual BoundaryType type() const
virtual OdGiAbstractClipBoundary * clone() const
OdGiAbstractClipBoundary * clone() const
OdGiAbstractClipBoundary * clone() const
void setClipBoundaryCounts(const OdIntArray &pCounts)
void setClipBoundaryPoints(const OdGePoint2dArray &pPoints)
const OdIntArray & clipBoundaryCounts() const
OdGiAbstractClipBoundary * copyExtendedData(OdGiExtendedClipBoundary *pNew) const
const OdGePoint2dArray & clipBoundaryPoints() const
const OdGePoint2dArray & invertedClipBoundary() const
void setInvertedClipBoundary(const OdGePoint2dArray &pPoints)
OdGiAbstractClipBoundary * clone() const
OdGiSectionGeometryOutput * sectionGeometryOutput() const
OdGiSectionGeometryOutputPtr m_pSectionOutput
const ClipPlaneArray & clipPlanes() const
OdGiAbstractClipBoundary * clone() const
void setClipPlanes(const ClipPlaneArray &pClipPlanes)
OdArray< ClipPlane > ClipPlaneArray
void setSectionGeometryOutput(OdGiSectionGeometryOutput *pSectionOutput)
OdGiClipBoundaryWithAbstractData(const OdGiClipBoundary &pBoundary, const OdGiAbstractClipBoundary *pAbsData=NULL)
OdGiAbstractClipBoundary * m_pAbstractData
OdGiClipBoundaryWithAbstractData(const OdGiClipBoundaryWithAbstractData &pBoundary)
ClipPlane & setOrigin(const OdGePoint3d &origin)
ClipPlane & setNormal(const OdGeVector3d &normal)
ClipPlane(const OdGePoint3d &origin, const OdGeVector3d &normal)
const OdGeVector3d & normal() const
const OdGePoint3d & origin() const