CFx SDK Documentation  2022 SP0
GiOrthoClipperEx.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 __ODGIORTOCLIPPEREX_H__
25 #define __ODGIORTOCLIPPEREX_H__
26 
27 #include "Gi/GiOrthoClipper.h"
29 
30 #include "TD_PackPush.h"
31 
32 class OdGeBoundBlock3d;
33 class OdStreamBuf;
34 
41 {
42 public:
44 
45  // Initial clipper interface support
46 
49 
50  // Extend initial interface by inverted clipping boundary support
51 
66  virtual void set(bool bInverted,
67  OdUInt32 nPoints, // points counter. 0 - disables XY clip; 2 - defines rectangle.
68  const OdGePoint2d* points, // points defining sides of clipping prism perpendicular to XY
69  bool bClipLowerZ = false, double dLowerZ = 0.0,
70  bool bClipUpperZ = false, double dUpperZ = 0.0) = 0;
71 
82  virtual void set(bool bInverted,
83  const OdGePoint2dArray& points, // points defining sides of clipping prism perpendicular to XY
84  bool bClipLowerZ = false, double dLowerZ = 0.0,
85  bool bClipUpperZ = false, double dUpperZ = 0.0) = 0;
86 
97  virtual void get(bool &bInverted, OdGePoint2dArray& points,
98  bool& bClipLowerZ, double& dLowerZ,
99  bool& bClipUpperZ, double& dUpperZ) const = 0;
100 
101  // Extend initial interface by extended clipping boundary support
102 
116  virtual void set(bool bPreprocess, OdUInt32 nCounts, const int *counts,
117  OdUInt32 nPoints, const OdGePoint2d *points,
118  bool bClipLowerZ = false, double dLowerZ = 0.0,
119  bool bClipUpperZ = false, double dUpperZ = 0.0) = 0;
120 
132  virtual void set(bool bPreprocess, const OdIntArray& counts, const OdGePoint2dArray& points,
133  bool bClipLowerZ = false, double dLowerZ = 0.0,
134  bool bClipUpperZ = false, double dUpperZ = 0.0) = 0;
135 
146  virtual void get(OdIntArray& counts, OdGePoint2dArray& points,
147  bool& bClipLowerZ, double& dLowerZ,
148  bool& bClipUpperZ, double& dUpperZ) const = 0;
149 
150  // Stubs for old extended clipping boundary interface
151 
164  void set(OdUInt32 nCounts, const int *counts,
165  OdUInt32 nPoints, const OdGePoint2d *points,
166  bool bClipLowerZ = false, double dLowerZ = 0.0,
167  bool bClipUpperZ = false, double dUpperZ = 0.0)
168  { set(false, nCounts, counts, nPoints, points, bClipLowerZ, dLowerZ, bClipUpperZ, dUpperZ); }
169 
180  void set(const OdIntArray& counts, const OdGePoint2dArray& points,
181  bool bClipLowerZ = false, double dLowerZ = 0.0,
182  bool bClipUpperZ = false, double dUpperZ = 0.0)
183  { set(false, counts, points, bClipLowerZ, dLowerZ, bClipUpperZ, dUpperZ); }
184 
185  // Some classification functionality applicable for single (top) clipping stage
186 
190  virtual bool isEmpty() const = 0;
191 
195  virtual bool isInverted() const = 0;
196 
200  virtual bool isExtended() const = 0;
201 
205  virtual bool isSingleClipStage() const = 0;
206 
210  virtual bool isEmptyClipSet() const = 0;
211 
212  // Support direct setting of clipping boundaries
213 
221  virtual void set(OdGiClipBoundary* pBoundary, OdGiAbstractClipBoundary* pClipInfo = NULL, const OdGeMatrix3d *pXform = NULL) = 0;
222 
230 
231  // Configuration
232 
239  virtual void enableAnalyticCurvesClipping(bool bEnable) = 0;
240 
244  virtual bool isAnalyticCurvesClippingEnabled() const = 0;
245 
249  virtual void enable() = 0;
250 
254  virtual void disable() = 0;
255 
259  virtual bool enabled() const = 0;
260 
265  {
267  kPolyClipLimit = 0, // Memory limit (in bytes) which limits internal clipping structures number
269  kNumClipLimits
270  };
271 
278  virtual void setLimit(ClipLimit clipLimit, OdUInt32 nLimit) = 0;
279 
285  virtual OdUInt32 getLimit(ClipLimit clipLimit) const = 0;
286 
287  // Support mutiple clip stages
288 
292  struct TolOverride
293  {
300  {
302  kNoOverride = 0,
308  kAddition
309  } m_overrideType;
310 
311  TolOverride() : m_tolOverride(1.e-10), m_overrideType(kNoOverride) {}
312  };
313 
318  {
327  };
328 
332  struct ClipPlane
333  {
341  enum MarkType
342  {
344  kNoMark = 0,
348  kMarkUpper
349  } m_markType;
354 
355  ClipPlane() : m_markType(kNoMark) {}
356  };
361 
366  {
368  kCCDontClassify = 0, // Avoid classification
370  kCCClassifiedByInclusion, // Classify by polygon-polygon inclusion
372  kCCClassifiedByInteger, // Classify by positive/negative counts number
374  kCCClassifiedByOrder, // Classify by CW/CCW ordering
376  kCCClassifiedByNormal, // Classify by positive/negative normal
378  kCCClassifiedByXor, // Preprocess by Xor operation (intersection)
380  kCCClassifiedBySignedXor // Preprocess by set of Union/Subtract operations
381  };
382 
390  virtual void pushClipStage(OdGiClipBoundary* pBoundary, OdGiAbstractClipBoundary* pClipInfo = NULL, const OdGeMatrix3d *pXform = NULL) = 0;
391 
400  virtual void pushClipStage(OdUInt32 numPlanes, const ClipPlane *pPlanes, const OdGeMatrix3d *pXform = NULL, bool bEnableSections = false) = 0;
401 
417  virtual void pushClipStage(OdUInt32 nCounts, const int *counts,
418  OdUInt32 nPoints, const OdGePoint2d *points,
419  bool bInverted = false, CountsClassify countsClass = kCCDontClassify, const OdGeMatrix3d *pXform = NULL,
420  OdUInt32 numPlanes = 0, const ClipPlane *pPlanes = NULL, bool bEnableSections = false, PolyTolOverride *pPolyTol = NULL) = 0;
421 
438  virtual void pushClipStage(OdUInt32 nCounts, const int *counts,
439  OdUInt32 nPoints, const OdGePoint3d *points, const OdGeVector3d *pNormal = NULL,
440  bool bInverted = false, CountsClassify countsClass = kCCDontClassify, const OdGeMatrix3d *pXform = NULL,
441  OdUInt32 numPlanes = 0, const ClipPlane *pPlanes = NULL, bool bEnableSections = false, PolyTolOverride *pPolyTol = NULL) = 0;
442 
449  virtual bool popClipStage() = 0;
450 
456  virtual void clearClipping(bool bClearCache = false) = 0;
457 
461  virtual void clearTemporaryArrays() = 0;
462 
466  virtual OdUInt32 numClipStages() const = 0;
467 
476  virtual void classifyClipStage(OdUInt32 nStage, OdUInt32 *pNPlanes, OdUInt32 *pNPolys = NULL, bool *bFirstPolyInverted = NULL) const = 0;
477 
482  virtual bool isClipStageSectionable(OdUInt32 nStage) const = 0;
483 
495  virtual bool getClipStage(OdUInt32 nStage, OdIntArray& counts, OdGePoint2dArray& points, OdGeVector3d *pNormal = NULL) const = 0;
496 
508  virtual bool getClipStage(OdUInt32 nStage, OdIntArray& counts, OdGePoint3dArray& points, OdGeVector3d *pNormal = NULL) const = 0;
509 
519  virtual bool getClipStage(OdUInt32 nStage, ClipPlanesArray& planes) const = 0;
520 
521  // Interface compatibility with OdGiOrthoPrismIntersector
522 
532  virtual OdUInt32 clipStatus() const = 0;
533 
537  virtual void clearClipStatus() = 0;
538 
539  // Some helpful checking routines
540 
545  {
547  kStatusInvisible = -1,
549  kStatusClipped = 0,
551  kStatusVisible = 1
552  };
553 
559  virtual VisibilityStatus checkPointVisibility(const OdGePoint3d &pt) const = 0;
560 
567  virtual VisibilityStatus checkSphereVisibility(const OdGePoint3d &origin, double radius) const = 0;
568 
574  virtual VisibilityStatus checkExtentsVisibility(const OdGeExtents3d &extents) const = 0;
575 
582 
583  // Clipping engine debugging
584 
590  virtual void enableLogging(OdStreamBuf *pStream) = 0;
591 
595  virtual void disableLogging() = 0;
596 
601  virtual bool isLoggingEnabled() const = 0;
602 
603  // Support sections
604 
609 
617  virtual void flushSection(bool bFlushClosed = true, bool bFlushOpened = false,
618  bool bReleaseData = true) = 0;
619 };
620 
628 
629 // Utility classes
630 
637 {
638 public:
640 
646 
651 
655  virtual bool hasSectionGeometryOutput() const = 0;
656 
660  virtual void setDrawContext(OdGiConveyorContext* pDrawCtx) = 0;
661 
667  virtual void setSectionGeometryOutputSkip(bool bSkip) = 0;
668 
672  virtual bool isSectionGeometryOutputSkipping() const = 0;
673 
679  virtual void disableGeometryOutput(bool bDisable) = 0;
680 
684  virtual bool isGeometryOutputDisabled() const = 0;
685 
689  virtual bool isClosedSectionsOutputEnabled() const = 0;
690 
694  virtual bool isOpenedSectionsOutputEnabled() const = 0;
695 };
696 
704 
705 #include "TD_PackPop.h"
706 
707 #endif //#ifndef __ODGIORTOCLIPPEREX_H__
#define ODGI_EXPORT
Definition: GiExport.h:35
OdSmartPtr< OdGiOrthoClipperEx > OdGiOrthoClipperExPtr
OdSmartPtr< OdGiSectionGeometryClipConnector > OdGiSectionGeometryClipConnectorPtr
#define NULL
Definition: GsProperties.h:177
unsigned int OdUInt32
virtual void clearClipStatus()=0
virtual bool isClipStageSectionable(OdUInt32 nStage) const =0
virtual void set(OdGiClipBoundary *pBoundary, OdGiAbstractClipBoundary *pClipInfo=NULL, const OdGeMatrix3d *pXform=NULL)=0
virtual void get(OdIntArray &counts, OdGePoint2dArray &points, bool &bClipLowerZ, double &dLowerZ, bool &bClipUpperZ, double &dUpperZ) const =0
virtual void clearClipping(bool bClearCache=false)=0
virtual bool getClipStage(OdUInt32 nStage, OdIntArray &counts, OdGePoint3dArray &points, OdGeVector3d *pNormal=NULL) const =0
virtual void set(bool bInverted, const OdGePoint2dArray &points, bool bClipLowerZ=false, double dLowerZ=0.0, bool bClipUpperZ=false, double dUpperZ=0.0)=0
virtual void clearTemporaryArrays()=0
void set(const OdIntArray &counts, const OdGePoint2dArray &points, bool bClipLowerZ=false, double dLowerZ=0.0, bool bClipUpperZ=false, double dUpperZ=0.0)
virtual void set(bool bPreprocess, const OdIntArray &counts, const OdGePoint2dArray &points, bool bClipLowerZ=false, double dLowerZ=0.0, bool bClipUpperZ=false, double dUpperZ=0.0)=0
virtual bool isLoggingEnabled() const =0
virtual VisibilityStatus checkSphereVisibility(const OdGePoint3d &origin, double radius) const =0
virtual VisibilityStatus checkBoundsVisibility(const OdGeBoundBlock3d &bb) const =0
OdArray< ClipPlane, OdMemoryAllocator< ClipPlane > > ClipPlanesArray
virtual void pushClipStage(OdUInt32 nCounts, const int *counts, OdUInt32 nPoints, const OdGePoint2d *points, bool bInverted=false, CountsClassify countsClass=kCCDontClassify, const OdGeMatrix3d *pXform=NULL, OdUInt32 numPlanes=0, const ClipPlane *pPlanes=NULL, bool bEnableSections=false, PolyTolOverride *pPolyTol=NULL)=0
ODRX_DECLARE_MEMBERS(OdGiOrthoClipperEx)
virtual bool popClipStage()=0
virtual void disableLogging()=0
virtual OdUInt32 numClipStages() const =0
void set(OdUInt32 nCounts, const int *counts, OdUInt32 nPoints, const OdGePoint2d *points, bool bClipLowerZ=false, double dLowerZ=0.0, bool bClipUpperZ=false, double dUpperZ=0.0)
virtual OdUInt32 getLimit(ClipLimit clipLimit) const =0
virtual bool getClipStage(OdUInt32 nStage, ClipPlanesArray &planes) const =0
virtual void flushSection(bool bFlushClosed=true, bool bFlushOpened=false, bool bReleaseData=true)=0
virtual void pushClipStage(OdGiClipBoundary *pBoundary, OdGiAbstractClipBoundary *pClipInfo=NULL, const OdGeMatrix3d *pXform=NULL)=0
virtual OdUInt32 clipStatus() const =0
virtual OdGiAbstractClipBoundary::BoundaryType getType() const =0
virtual bool enabled() const =0
virtual void classifyClipStage(OdUInt32 nStage, OdUInt32 *pNPlanes, OdUInt32 *pNPolys=NULL, bool *bFirstPolyInverted=NULL) const =0
TD_USING(OdGiOrthoClipper::get)
virtual bool isExtended() const =0
virtual bool isEmptyClipSet() const =0
virtual OdGiConveyorOutput & sectionOutput()=0
virtual void pushClipStage(OdUInt32 numPlanes, const ClipPlane *pPlanes, const OdGeMatrix3d *pXform=NULL, bool bEnableSections=false)=0
virtual void enableLogging(OdStreamBuf *pStream)=0
virtual void set(bool bPreprocess, OdUInt32 nCounts, const int *counts, OdUInt32 nPoints, const OdGePoint2d *points, bool bClipLowerZ=false, double dLowerZ=0.0, bool bClipUpperZ=false, double dUpperZ=0.0)=0
virtual bool isAnalyticCurvesClippingEnabled() const =0
virtual void enable()=0
virtual VisibilityStatus checkExtentsVisibility(const OdGeExtents3d &extents) const =0
virtual void disable()=0
TD_USING(OdGiOrthoClipper::set)
virtual bool isInverted() const =0
virtual bool isSingleClipStage() const =0
virtual void setLimit(ClipLimit clipLimit, OdUInt32 nLimit)=0
virtual bool isEmpty() const =0
virtual void enableAnalyticCurvesClipping(bool bEnable)=0
virtual void get(bool &bInverted, OdGePoint2dArray &points, bool &bClipLowerZ, double &dLowerZ, bool &bClipUpperZ, double &dUpperZ) const =0
virtual bool getClipStage(OdUInt32 nStage, OdIntArray &counts, OdGePoint2dArray &points, OdGeVector3d *pNormal=NULL) const =0
virtual void set(bool bInverted, OdUInt32 nPoints, const OdGePoint2d *points, bool bClipLowerZ=false, double dLowerZ=0.0, bool bClipUpperZ=false, double dUpperZ=0.0)=0
virtual void pushClipStage(OdUInt32 nCounts, const int *counts, OdUInt32 nPoints, const OdGePoint3d *points, const OdGeVector3d *pNormal=NULL, bool bInverted=false, CountsClassify countsClass=kCCDontClassify, const OdGeMatrix3d *pXform=NULL, OdUInt32 numPlanes=0, const ClipPlane *pPlanes=NULL, bool bEnableSections=false, PolyTolOverride *pPolyTol=NULL)=0
virtual VisibilityStatus checkPointVisibility(const OdGePoint3d &pt) const =0
virtual void get(OdGePoint2dArray &points, bool &bClipLowerZ, double &dLowerZ, bool &bClipUpperZ, double &dUpperZ) const =0
virtual void set(OdUInt32 nPoints, const OdGePoint2d *points, bool bClipLowerZ=false, double dLowerZ=0.0, bool bClipUpperZ=false, double dUpperZ=0.0)=0
virtual void setSectionGeometryOutput(OdGiSectionGeometryOutput *pOutput)=0
virtual bool hasSectionGeometryOutput() const =0
virtual bool isOpenedSectionsOutputEnabled() const =0
virtual void disableGeometryOutput(bool bDisable)=0
virtual bool isSectionGeometryOutputSkipping() const =0
virtual bool isGeometryOutputDisabled() const =0
ODRX_DECLARE_MEMBERS(OdGiSectionGeometryClipConnector)
virtual bool isClosedSectionsOutputEnabled() const =0
virtual void setDrawContext(OdGiConveyorContext *pDrawCtx)=0
virtual OdGiSectionGeometryOutput * getSectionGeometryOutput() const =0
virtual void setSectionGeometryOutputSkip(bool bSkip)=0