/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2016, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Teigha(R) software pursuant to a license // agreement with Open Design Alliance. // Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef __ODGIORTOCLIPPEREX_H__ #define __ODGIORTOCLIPPEREX_H__ #include "Gi/GiOrthoClipper.h" #include "Gi/GiAbstractClipBoundary.h" #include "TD_PackPush.h" class OdGeBoundBlock3d; class OdStreamBuf; /** \details {group:OdGi_Classes} */ class ODGI_EXPORT OdGiOrthoClipperEx : public OdGiOrthoClipper { public: ODRX_DECLARE_MEMBERS(OdGiOrthoClipperEx); // Initial clipper interface support TD_USING(OdGiOrthoClipper::set); TD_USING(OdGiOrthoClipper::get); // Extend initial interface by inverted clipping boundary support virtual void set(bool bInverted, OdUInt32 nPoints, // points counter. 0 - disables XY clip; 2 - defines rectangle. const OdGePoint2d* points, // points defining sides of clipping prism perpendicular to XY bool bClipLowerZ = false, double dLowerZ = 0.0, bool bClipUpperZ = false, double dUpperZ = 0.0) = 0; virtual void set(bool bInverted, const OdGePoint2dArray& points, // points defining sides of clipping prism perpendicular to XY bool bClipLowerZ = false, double dLowerZ = 0.0, bool bClipUpperZ = false, double dUpperZ = 0.0) = 0; virtual void get(bool &bInverted, OdGePoint2dArray& points, bool& bClipLowerZ, double& dLowerZ, bool& bClipUpperZ, double& dUpperZ) const = 0; // Extend initial interface by extended clipping boundary support 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 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 void get(OdIntArray& counts, OdGePoint2dArray& points, bool& bClipLowerZ, double& dLowerZ, bool& bClipUpperZ, double& dUpperZ) const = 0; // Stubs for old extended clipping boundary interface 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) { set(false, nCounts, counts, nPoints, points, bClipLowerZ, dLowerZ, bClipUpperZ, dUpperZ); } void set(const OdIntArray& counts, const OdGePoint2dArray& points, bool bClipLowerZ = false, double dLowerZ = 0.0, bool bClipUpperZ = false, double dUpperZ = 0.0) { set(false, counts, points, bClipLowerZ, dLowerZ, bClipUpperZ, dUpperZ); } // Some classification functionality applicable for single (top) clipping stage virtual bool isEmpty() const = 0; virtual bool isInverted() const = 0; virtual bool isExtended() const = 0; virtual bool isSingleClipStage() const = 0; virtual bool isEmptyClipSet() const = 0; // Support direct setting of clipping boundaries virtual void set(OdGiClipBoundary* pBoundary, OdGiAbstractClipBoundary* pClipInfo = NULL, const OdGeMatrix3d *pXform = NULL) = 0; virtual OdGiAbstractClipBoundary::BoundaryType getType() const = 0; // Configuration virtual void enableAnalyticCurvesClipping(bool bEnable) = 0; virtual bool isAnalyticCurvesClippingEnabled() const = 0; virtual void enable() = 0; virtual void disable() = 0; virtual bool enabled() const = 0; enum ClipLimit { kPolyClipLimit = 0, // Memory limit (in bytes) which limits internal clipping structures number kNumClipLimits }; virtual void setLimit(ClipLimit clipLimit, OdUInt32 nLimit) = 0; virtual OdUInt32 getLimit(ClipLimit clipLimit) const = 0; // Support mutiple clip stages struct ClipPlane { OdGePoint3d m_origin; OdGeVector3d m_normal; enum MarkType { kNoMark = 0, kMarkLower, kMarkUpper } m_markType; ClipPlane() : m_markType(kNoMark) {} }; typedef OdArray > ClipPlanesArray; enum CountsClassify { kCCDontClassify = 0, // Avoid classification kCCClassifiedByInclusion, // Classify by polygon-polygon inclusion kCCClassifiedByInteger, // Classify by positive/negative counts number kCCClassifiedByOrder, // Classify by CW/CCW ordering kCCClassifiedByNormal, // Classify by positive/negative normal kCCClassifiedByXor, // Preprocess by Xor operation (intersection) kCCClassifiedBySignedXor // Preprocess by set of Union/Subtract operations }; virtual void pushClipStage(OdGiClipBoundary* pBoundary, OdGiAbstractClipBoundary* pClipInfo = NULL, const OdGeMatrix3d *pXform = NULL) = 0; virtual void pushClipStage(OdUInt32 numPlanes, const ClipPlane *pPlanes) = 0; 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) = 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) = 0; virtual bool popClipStage() = 0; virtual void clearClipping(bool bClearCache = false) = 0; // Clear all clipping stages virtual void clearTemporaryArrays() = 0; // Clear all temporarily allocated arrays and caches virtual OdUInt32 numClipStages() const = 0; virtual void classifyClipStage(OdUInt32 nStage, OdUInt32 *pNPlanes, OdUInt32 *pNPolys = NULL, bool *bFirstPolyInverted = NULL) const = 0; virtual bool getClipStage(OdUInt32 nStage, OdIntArray& counts, OdGePoint2dArray& points, OdGeVector3d *pNormal = NULL) const = 0; virtual bool getClipStage(OdUInt32 nStage, OdIntArray& counts, OdGePoint3dArray& points, OdGeVector3d *pNormal = NULL) const = 0; virtual bool getClipStage(OdUInt32 nStage, ClipPlanesArray& planes) const = 0; // Interface compatibility with OdGiOrthoPrismIntersector virtual OdUInt32 clipStatus() const = 0; virtual void clearClipStatus() = 0; // Some helpful checking routines enum VisibilityStatus { kStatusInvisible = -1, kStatusClipped = 0, kStatusVisible = 1 }; virtual VisibilityStatus checkPointVisibility(const OdGePoint3d &pt) const = 0; virtual VisibilityStatus checkSphereVisibility(const OdGePoint3d &origin, double radius) const = 0; virtual VisibilityStatus checkExtentsVisibility(const OdGeExtents3d &extents) const = 0; virtual VisibilityStatus checkBoundsVisibility(const OdGeBoundBlock3d &bb) const = 0; // Clipping engine debugging virtual void enableLogging(OdStreamBuf *pStream) = 0; virtual void disableLogging() = 0; virtual bool isLoggingEnabled() const = 0; }; typedef OdSmartPtr OdGiOrthoClipperExPtr; #include "TD_PackPop.h" #endif //#ifndef __ODGIORTOCLIPPEREX_H__