CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GiAbstractClipBoundary.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 license
16// 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 _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
41{
42 public:
47 {
48 kNormal = 0, // Default clip boundary (not pass additional data, clip outside contour)
49 kInverted, // Inverted clip boundary (pass inverted clip array, clip inside contour)
50 kExtended, // Extended clip boundary (pass clipping contours, clip by sorted contours array)
51 kComplex, // Complex clip boundary (extended clip boundary which requires additional preprocessing)
52 kPlanar, // Planar clip boundary (clipping by set of 3d planes with ability to output geometry sections)
53 kMulti // Container for multiple clip boundaries (provides way to set multiple boundaries by single call)
54 };
55 public:
57
62
67
74 virtual BoundaryType type() const { return kNormal; }
75
82 virtual OdGiAbstractClipBoundary *clone() const { return new OdGiAbstractClipBoundary(); }
83};
84
93{
94 protected:
95 OdGePoint2dArray m_Points; // Array of points that defines the inverted clip boundary.
96 public:
101
106
113 BoundaryType type() const { return kInverted; }
114
126 void setInvertedClipBoundary(const OdGePoint2dArray &pPoints) { m_Points = pPoints; }
127
137 return pNew;
138 }
139};
140
149{
150 protected:
151 OdIntArray m_Counts; // Array of contour points counts.
152 OdGePoint2dArray m_Points; // Array of points that defines the extended clip boundary contours.
153 public:
158
163
170 BoundaryType type() const { return kExtended; }
171
178 const OdIntArray &clipBoundaryCounts() const { return m_Counts; }
183 void setClipBoundaryCounts(const OdIntArray &pCounts) { m_Counts = pCounts; }
184
196 void setClipBoundaryPoints(const OdGePoint2dArray &pPoints) { m_Points = pPoints; }
197
205 protected:
209 return pNew;
210 }
211};
212
221{
222 public:
227
232
236 BoundaryType type() const { return kComplex; }
237
245};
246
257{
258 public:
263 {
268
273
282
291 ClipPlane &setOrigin(const OdGePoint3d &origin) { m_origin = origin; return *this; }
292
299 const OdGePoint3d &origin() const { return m_origin; }
300
309 ClipPlane &setNormal(const OdGeVector3d &normal) { m_normal = normal; return *this; }
310
317 const OdGeVector3d &normal() const { return m_normal; }
318 };
323 protected:
324 ClipPlaneArray m_ClipPlanes; // Array of clipping planes.
325 mutable OdGiSectionGeometryOutputPtr m_pSectionOutput; // Optional geometry sections output.
326 mutable OdGiCuttedGeometryOutputPtr m_pCuttedOutput; // Optional cutted geometry output.
327 public:
332
337
344 BoundaryType type() const { return kPlanar; }
345
352 const ClipPlaneArray &clipPlanes() const { return m_ClipPlanes; }
357 void setClipPlanes(const ClipPlaneArray &pClipPlanes) { m_ClipPlanes = pClipPlanes; }
358
370 void setSectionGeometryOutput(OdGiSectionGeometryOutput *pSectionOutput) { m_pSectionOutput = pSectionOutput; }
371
383 void setCuttedGeometryOutput(OdGiCuttedGeometryOutput *pCuttedOutput) { m_pCuttedOutput = pCuttedOutput; }
384
393 pNew->setClipPlanes(clipPlanes());
396 return pNew;
397 }
398};
399
408{
409 public:
414 protected:
415 AbstractClipBoundaryArray m_ClipBoundaries; // Array of clip boundaries
416 public:
421
426
433 BoundaryType type() const { return kMulti; }
434
446 void setClipBoundaries(const AbstractClipBoundaryArray &pClipBoundaries) { m_ClipBoundaries = pClipBoundaries; }
447
455};
456
465{
466 private:
467 // Disable ability to set clip boundaries from ouside
468 void setClipBoundaries(const AbstractClipBoundaryArray & /*pClipBoundaries*/) { ODA_FAIL(); }
469 protected:
471 { const OdUInt32 nClones = m_ClipBoundaries.size();
473 for (OdUInt32 nClone = 0; nClone < nClones; nClone++)
474 delete pClone[nClone];
475 }
476 public:
483
488};
489
491{ const OdUInt32 nBoundaries = m_ClipBoundaries.size();
492 AbstractClipBoundaryArray absClones(nBoundaries, 1);
493 absClones.resize(nBoundaries);
494 OdGiAbstractClipBoundary* const *pBoundaries = m_ClipBoundaries.getPtr();
495 OdGiAbstractClipBoundary **pClones = absClones.asArrayPtr();
496 for (OdUInt32 nClone = 0; nClone < nBoundaries; nClone++)
497 {
498 if (pBoundaries[nClone])
499 pClones[nClone] = pBoundaries[nClone]->clone();
500 else
501 pClones[nClone] = NULL;
502 }
503 return new OdGiMultiClipBoundaryClone(absClones);
504}
505
512{
517
522
530 : OdGiClipBoundary(pBoundary), m_pAbstractData(NULL)
531 {
532 if (pAbsData) m_pAbstractData = pAbsData->clone();
533 }
534
541 : OdGiClipBoundary(pBoundary), m_pAbstractData(NULL)
542 {
543 if (pBoundary.m_pAbstractData) m_pAbstractData = pBoundary.m_pAbstractData->clone();
544 }
545
551 }
552};
553
554#include "TD_PackPop.h"
555
556#endif // _GI_ABSTRACT_CLIP_BOUNDARY_H_INCLUDED_
#define ODA_FAIL()
Definition: DebugStuff.h:88
unsigned int OdUInt32
const T * asArrayPtr() const
Definition: OdArray.h:1590
size_type size() const
Definition: OdArray.h:1247
const T * getPtr() const
Definition: OdArray.h:1600
void resize(size_type logicalLength, const T &value)
Definition: OdArray.h:1185
virtual BoundaryType type() const
virtual OdGiAbstractClipBoundary * clone() const
OdGiAbstractClipBoundary * clone() const
const OdGePoint2dArray & clipBoundaryPoints() const
OdGiAbstractClipBoundary * copyExtendedData(OdGiExtendedClipBoundary *pNew) const
const OdIntArray & clipBoundaryCounts() const
OdGiAbstractClipBoundary * clone() const
void setClipBoundaryCounts(const OdIntArray &pCounts)
void setClipBoundaryPoints(const OdGePoint2dArray &pPoints)
OdGiAbstractClipBoundary * clone() const
void setInvertedClipBoundary(const OdGePoint2dArray &pPoints)
const OdGePoint2dArray & invertedClipBoundary() const
OdGiMultiClipBoundaryClone(AbstractClipBoundaryArray &arrayOfClones)
AbstractClipBoundaryArray m_ClipBoundaries
OdGiAbstractClipBoundary * clone() const
BoundaryType type() const
OdArray< OdGiAbstractClipBoundary *, OdMemoryAllocator< OdGiAbstractClipBoundary * > > AbstractClipBoundaryArray
void setClipBoundaries(const AbstractClipBoundaryArray &pClipBoundaries)
const AbstractClipBoundaryArray & clipBoundaries() const
OdGiCuttedGeometryOutputPtr m_pCuttedOutput
OdGiCuttedGeometryOutput * cuttedGeometryOutput() const
OdGiSectionGeometryOutputPtr m_pSectionOutput
OdGiSectionGeometryOutput * sectionGeometryOutput() const
OdGiAbstractClipBoundary * clone() const
void setClipPlanes(const ClipPlaneArray &pClipPlanes)
void setCuttedGeometryOutput(OdGiCuttedGeometryOutput *pCuttedOutput)
OdArray< ClipPlane > ClipPlaneArray
const ClipPlaneArray & clipPlanes() const
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)
const OdGeVector3d & normal() const
const OdGePoint3d & origin() const
ClipPlane(const OdGePoint3d &origin, const OdGeVector3d &normal)