CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GiOrthoClipperEx.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 __ODGIORTOCLIPPEREX_H__
25#define __ODGIORTOCLIPPEREX_H__
26
27#include "Gi/GiOrthoClipper.h"
29
30#include "TD_PackPush.h"
31
33class OdStreamBuf;
35
42{
43public:
45
46 // Initial clipper interface support
47
50
51 // Extend initial interface by inverted clipping boundary support
52
67 virtual void set(bool bInverted,
68 OdUInt32 nPoints, // points counter. 0 - disables XY clip; 2 - defines rectangle.
69 const OdGePoint2d* points, // points defining sides of clipping prism perpendicular to XY
70 bool bClipLowerZ = false, double dLowerZ = 0.0,
71 bool bClipUpperZ = false, double dUpperZ = 0.0) = 0;
72
83 virtual void set(bool bInverted,
84 const OdGePoint2dArray& points, // points defining sides of clipping prism perpendicular to XY
85 bool bClipLowerZ = false, double dLowerZ = 0.0,
86 bool bClipUpperZ = false, double dUpperZ = 0.0) = 0;
87
98 virtual void get(bool &bInverted, OdGePoint2dArray& points,
99 bool& bClipLowerZ, double& dLowerZ,
100 bool& bClipUpperZ, double& dUpperZ) const = 0;
101
102 // Extend initial interface by extended clipping boundary support
103
117 virtual void set(bool bPreprocess, OdUInt32 nCounts, const int *counts,
118 OdUInt32 nPoints, const OdGePoint2d *points,
119 bool bClipLowerZ = false, double dLowerZ = 0.0,
120 bool bClipUpperZ = false, double dUpperZ = 0.0) = 0;
121
133 virtual void set(bool bPreprocess, const OdIntArray& counts, const OdGePoint2dArray& points,
134 bool bClipLowerZ = false, double dLowerZ = 0.0,
135 bool bClipUpperZ = false, double dUpperZ = 0.0) = 0;
136
147 virtual void get(OdIntArray& counts, OdGePoint2dArray& points,
148 bool& bClipLowerZ, double& dLowerZ,
149 bool& bClipUpperZ, double& dUpperZ) const = 0;
150
151 // Stubs for old extended clipping boundary interface
152
165 void set(OdUInt32 nCounts, const int *counts,
166 OdUInt32 nPoints, const OdGePoint2d *points,
167 bool bClipLowerZ = false, double dLowerZ = 0.0,
168 bool bClipUpperZ = false, double dUpperZ = 0.0)
169 { set(false, nCounts, counts, nPoints, points, bClipLowerZ, dLowerZ, bClipUpperZ, dUpperZ); }
170
181 void set(const OdIntArray& counts, const OdGePoint2dArray& points,
182 bool bClipLowerZ = false, double dLowerZ = 0.0,
183 bool bClipUpperZ = false, double dUpperZ = 0.0)
184 { set(false, counts, points, bClipLowerZ, dLowerZ, bClipUpperZ, dUpperZ); }
185
186 // Some classification functionality applicable for single (top) clipping stage
187
193 virtual bool isEmpty() const = 0;
194
200 virtual bool isInverted() const = 0;
201
207 virtual bool isExtended() const = 0;
208
214 virtual bool isSingleClipStage() const = 0;
215
221 virtual bool isEmptyClipSet() const = 0;
222
223 // Support direct setting of clipping boundaries
224
232 virtual void set(OdGiClipBoundary* pBoundary, OdGiAbstractClipBoundary* pClipInfo = NULL, const OdGeMatrix3d *pXform = NULL) = 0;
233
244
245 // Configuration
246
253 virtual void enableAnalyticCurvesClipping(bool bEnable) = 0;
254
261 virtual bool isAnalyticCurvesClippingEnabled() const = 0;
262
266 virtual void enable() = 0;
267
271 virtual void disable() = 0;
272
279 virtual bool enabled() const = 0;
280
285 {
287 kPolyClipLimit = 0, // Memory limit (in bytes) which limits internal clipping structures number
289 kNumClipLimits
290 };
291
298 virtual void setLimit(ClipLimit clipLimit, OdUInt32 nLimit) = 0;
299
308 virtual OdUInt32 getLimit(ClipLimit clipLimit) const = 0;
309
310 // Support mutiple clip stages
311
316 {
323 {
325 kNoOverride = 0,
331 kAddition
332 } m_overrideType;
333
337 TolOverride() : m_tolOverride(1.e-10), m_overrideType(kNoOverride) {}
338 };
339
344 {
353 };
354
359 {
368 {
370 kNoMark = 0,
374 kMarkUpper
375 } m_markType;
380
384 ClipPlane() : m_markType(kNoMark) {}
385 };
390
395 {
397 kCSNoFlags = 0,
399 kCSDisabled = (1 << 0),
401 kCSInverted = (1 << 1),
403 kCSEnableSections = (1 << 2),
405 kCSEnableCutting = (1 << 3),
407 kCSPassNonSections = (1 << 4)
408 };
409
414 {
416 kCCDontClassify = 0, // Avoid classification
418 kCCClassifiedByInclusion, // Classify by polygon-polygon inclusion
420 kCCClassifiedByInteger, // Classify by positive/negative counts number
422 kCCClassifiedByOrder, // Classify by CW/CCW ordering
424 kCCClassifiedByNormal, // Classify by positive/negative normal
426 kCCClassifiedByXor, // Preprocess by Xor operation (intersection)
428 kCCClassifiedBySignedXor // Preprocess by set of Union/Subtract operations
429 };
430
438 virtual void pushClipStage(OdGiClipBoundary* pBoundary, OdGiAbstractClipBoundary* pClipInfo = NULL, const OdGeMatrix3d *pXform = NULL) = 0;
439
448 virtual void pushClipStage(OdUInt32 numPlanes, const ClipPlane *pPlanes, const OdGeMatrix3d *pXform = NULL, OdUInt32 stageFlags = kCSNoFlags) = 0;
449
464 virtual void pushClipStage(OdUInt32 nCounts, const int *counts,
465 OdUInt32 nPoints, const OdGePoint2d *points,
466 OdUInt32 stageFlags = kCSNoFlags, CountsClassify countsClass = kCCDontClassify, const OdGeMatrix3d *pXform = NULL,
467 OdUInt32 numPlanes = 0, const ClipPlane *pPlanes = NULL, PolyTolOverride *pPolyTol = NULL) = 0;
468
484 virtual void pushClipStage(OdUInt32 nCounts, const int *counts,
485 OdUInt32 nPoints, const OdGePoint3d *points, const OdGeVector3d *pNormal = NULL,
486 OdUInt32 stageFlags = kCSNoFlags, CountsClassify countsClass = kCCDontClassify, const OdGeMatrix3d *pXform = NULL,
487 OdUInt32 numPlanes = 0, const ClipPlane *pPlanes = NULL, PolyTolOverride *pPolyTol = NULL) = 0;
488
495 virtual bool popClipStage() = 0;
496
502 virtual void clearClipping(bool bClearCache = false) = 0;
503
507 virtual void clearTemporaryArrays() = 0;
508
514 virtual OdUInt32 numClipStages() const = 0;
515
524 virtual void classifyClipStage(OdUInt32 nStage, OdUInt32 *pNPlanes, OdUInt32 *pNPolys = NULL, bool *bFirstPolyInverted = NULL) const = 0;
525
532 virtual bool isClipStageSectionable(OdUInt32 nStage) const = 0;
533
540 virtual bool isClipStageCuttable(OdUInt32 nStage) const = 0;
541
553 virtual bool getClipStage(OdUInt32 nStage, OdIntArray& counts, OdGePoint2dArray& points, OdGeVector3d *pNormal = NULL) const = 0;
554
566 virtual bool getClipStage(OdUInt32 nStage, OdIntArray& counts, OdGePoint3dArray& points, OdGeVector3d *pNormal = NULL) const = 0;
567
577 virtual bool getClipStage(OdUInt32 nStage, ClipPlanesArray& planes) const = 0;
578
585 virtual void enableClipStage(OdUInt32 nStage, bool bEnable) = 0;
586
594 virtual bool isClipStageEnabled(OdUInt32 nStage) const = 0;
595
596 // Interface compatibility with OdGiOrthoPrismIntersector
597
609 virtual OdUInt32 clipStatus() const = 0;
610
614 virtual void clearClipStatus() = 0;
615
616 // Some helpful checking routines
617
622 {
624 kStatusInvisible = -1,
626 kStatusClipped = 0,
628 kStatusVisible = 1
629 };
630
639
650 virtual VisibilityStatus checkSphereVisibility(const OdGePoint3d &origin, double radius) const = 0;
651
659 virtual VisibilityStatus checkExtentsVisibility(const OdGeExtents3d &extents) const = 0;
660
669
670 // Clipping engine debugging
671
677 virtual void enableLogging(OdStreamBuf *pStream) = 0;
678
682 virtual void disableLogging() = 0;
683
689 virtual bool isLoggingEnabled() const = 0;
690
691 // Support sections
692
700
708
715
723 virtual void flushSection(bool bFlushClosed = true, bool bFlushOpened = false,
724 bool bReleaseData = true) = 0;
725
730 virtual void setSkipExtentsCheck(bool bOn) = 0;
731
736 virtual void setTextsNoClip(bool bOn) = 0;
737};
738
746
747// Utility classes
748
754{
759 virtual void selectClipOutput(OdInt32 nClipClient = -1) = 0;
760};
761
768{
769public:
771
777
784
790 virtual bool hasClippedGeometryOutput() const = 0;
791
796 virtual void setDrawContext(OdGiConveyorContext* pDrawCtx) = 0;
797
803
810
816 virtual void setClippedGeometryOutputSkip(bool bSkip) = 0;
817
823 virtual bool isClippedGeometryOutputSkipping() const = 0;
824
830 virtual void disableGeometryOutput(bool bDisable) = 0;
831
837 virtual bool isGeometryOutputDisabled() const = 0;
838
845 virtual bool isClosedSectionsOutputEnabled() const = 0;
846
853 virtual bool isOpenedSectionsOutputEnabled() const = 0;
854};
855
863
864#include "TD_PackPop.h"
865
866#endif //#ifndef __ODGIORTOCLIPPEREX_H__
#define ODGI_EXPORT
Definition: GiExport.h:35
OdSmartPtr< OdGiOrthoClipperEx > OdGiOrthoClipperExPtr
OdSmartPtr< OdGiClippedGeometryConnector > OdGiClippedGeometryConnectorPtr
unsigned int OdUInt32
int OdInt32
virtual void setClippedGeometryOutputSkip(bool bSkip)=0
virtual void setExternalClippedGeometryOutputInterface(OdGiClippedGeometryOutput::ClippedGeometryOutputInterface *pIface)=0
virtual bool isClippedGeometryOutputSkipping() const =0
virtual void setDrawContext(OdGiConveyorContext *pDrawCtx)=0
ODRX_DECLARE_MEMBERS(OdGiClippedGeometryConnector)
virtual bool isGeometryOutputDisabled() const =0
virtual OdGiClippedGeometryOutput * getClippedGeometryOutput() const =0
virtual bool hasClippedGeometryOutput() const =0
virtual OdGiClippedGeometryOutput::ClippedGeometryOutputInterface & clippedGeometryOutputInterface()=0
virtual void disableGeometryOutput(bool bDisable)=0
virtual void setClippedGeometryOutput(OdGiClippedGeometryOutput *pOutput)=0
virtual bool isOpenedSectionsOutputEnabled() const =0
virtual bool isClosedSectionsOutputEnabled() const =0
virtual void clearClipStatus()=0
virtual OdGiClippedGeometryOutput::ClippedGeometryOutputInterface * nativeClippingGeometryInterface()=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
virtual bool isClipStageEnabled(OdUInt32 nStage) const =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 void pushClipStage(OdUInt32 numPlanes, const ClipPlane *pPlanes, const OdGeMatrix3d *pXform=NULL, OdUInt32 stageFlags=kCSNoFlags)=0
virtual VisibilityStatus checkBoundsVisibility(const OdGeBoundBlock3d &bb) const =0
virtual OdGiConveyorOutput & sectionOutput(OdGiMultipleClippedOutputExt *pExt=NULL)=0
ODRX_DECLARE_MEMBERS(OdGiOrthoClipperEx)
virtual bool popClipStage()=0
virtual void enableClipStage(OdUInt32 nStage, bool bEnable)=0
virtual void disableLogging()=0
virtual OdUInt32 numClipStages() const =0
virtual OdGiConveyorOutput & cuttingOutput(OdGiMultipleClippedOutputExt *pExt=NULL)=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(OdUInt32 nCounts, const int *counts, OdUInt32 nPoints, const OdGePoint3d *points, const OdGeVector3d *pNormal=NULL, OdUInt32 stageFlags=kCSNoFlags, CountsClassify countsClass=kCCDontClassify, const OdGeMatrix3d *pXform=NULL, OdUInt32 numPlanes=0, const ClipPlane *pPlanes=NULL, PolyTolOverride *pPolyTol=NULL)=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 void enableLogging(OdStreamBuf *pStream)=0
OdArray< ClipPlane, OdObjectsAllocator< ClipPlane > > ClipPlanesArray
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
virtual void setTextsNoClip(bool bOn)=0
TD_USING(OdGiOrthoClipper::set)
virtual bool isInverted() const =0
virtual bool isSingleClipStage() const =0
virtual void pushClipStage(OdUInt32 nCounts, const int *counts, OdUInt32 nPoints, const OdGePoint2d *points, OdUInt32 stageFlags=kCSNoFlags, CountsClassify countsClass=kCCDontClassify, const OdGeMatrix3d *pXform=NULL, OdUInt32 numPlanes=0, const ClipPlane *pPlanes=NULL, PolyTolOverride *pPolyTol=NULL)=0
virtual void setLimit(ClipLimit clipLimit, OdUInt32 nLimit)=0
virtual bool isEmpty() const =0
virtual bool isClipStageCuttable(OdUInt32 nStage) 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 setSkipExtentsCheck(bool bOn)=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 selectClipOutput(OdInt32 nClipClient=-1)=0