// This file is generated by WOK (CPPExt). // Please do not edit this file; modify original file instead. // The copyright and license terms as defined for the original file apply to // this header file considered to be the "object code" form of the original source. #ifndef _ShapeFix_Wire_HeaderFile #define _ShapeFix_Wire_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_DefineHandle_HeaderFile #include #endif #ifndef _Handle_ShapeFix_Wire_HeaderFile #include #endif #ifndef _Handle_ShapeFix_Edge_HeaderFile #include #endif #ifndef _Handle_ShapeAnalysis_Wire_HeaderFile #include #endif #ifndef _Standard_Boolean_HeaderFile #include #endif #ifndef _Standard_Integer_HeaderFile #include #endif #ifndef _ShapeFix_Root_HeaderFile #include #endif #ifndef _Standard_Real_HeaderFile #include #endif #ifndef _Handle_ShapeExtend_WireData_HeaderFile #include #endif #ifndef _Handle_Geom_Surface_HeaderFile #include #endif #ifndef _TopoDS_Wire_HeaderFile #include #endif #ifndef _ShapeExtend_Status_HeaderFile #include #endif class ShapeFix_Edge; class ShapeAnalysis_Wire; class TopoDS_Wire; class TopoDS_Face; class ShapeExtend_WireData; class Geom_Surface; class TopLoc_Location; class ShapeAnalysis_WireOrder; //! This class provides a set of tools for repairing a wire.
class ShapeFix_Wire : public ShapeFix_Root { public: //! Empty Constructor, creates clear object with default flags
Standard_EXPORT ShapeFix_Wire(); //! Create new object with default flags and prepare it for use
//! (Loads analyzer with all the data for the wire and face)
Standard_EXPORT ShapeFix_Wire(const TopoDS_Wire& wire,const TopoDS_Face& face,const Standard_Real prec); //! Sets all modes to default
Standard_EXPORT void ClearModes() ; //! Clears all statuses
Standard_EXPORT void ClearStatuses() ; //! Load analyzer with all the data for the wire and face
//! and drops all fixing statuses
Standard_EXPORT void Init(const TopoDS_Wire& wire,const TopoDS_Face& face,const Standard_Real prec) ; //! Load analyzer with all the data already prepared
//! and drops all fixing statuses
//! If analyzer contains face, there is no need to set it
//! by SetFace or SetSurface
Standard_EXPORT void Init(const Handle(ShapeAnalysis_Wire)& saw) ; //! Load data for the wire, and drops all fixing statuses
Standard_EXPORT void Load(const TopoDS_Wire& wire) ; //! Load data for the wire, and drops all fixing statuses
Standard_EXPORT void Load(const Handle(ShapeExtend_WireData)& sbwd) ; //! Set working face for the wire
void SetFace(const TopoDS_Face& face) ; //! Set surface for the wire
void SetSurface(const Handle(Geom_Surface)& surf) ; //! Set surface for the wire
void SetSurface(const Handle(Geom_Surface)& surf,const TopLoc_Location& loc) ; //! Set working precision (to root and to analyzer)
Standard_EXPORT virtual void SetPrecision(const Standard_Real prec) ; //! Tells if the wire is loaded
Standard_Boolean IsLoaded() const; //! Tells if the wire and face are loaded
Standard_Boolean IsReady() const; //! returns number of edges in the working wire
Standard_EXPORT Standard_Integer NbEdges() const; //! Makes the resulting Wire (by basic Brep_Builder)
TopoDS_Wire Wire() const; //! Makes the resulting Wire (by BRepAPI_MakeWire)
TopoDS_Wire WireAPIMake() const; //! returns field Analyzer (working tool)
Standard_EXPORT Handle_ShapeAnalysis_Wire Analyzer() const; //! returns working wire
const Handle_ShapeExtend_WireData& WireData() const; //! returns working face (Analyzer.Face())
const TopoDS_Face& Face() const; //! Returns (modifiable) the flag which defines whether it is
//! allowed to modify topology of the wire during fixing
//! (adding/removing edges etc.)
Standard_Boolean& ModifyTopologyMode() ; //! Returns (modifiable) the flag which defines whether the Fix..()
//! methods are allowed to modify geometry of the edges and vertices
Standard_Boolean& ModifyGeometryMode() ; //! Returns (modifiable) the flag which defines whether the Fix..()
//! methods are allowed to modify RemoveLoop of the edges
Standard_Integer& ModifyRemoveLoopMode() ; //! Returns (modifiable) the flag which defines whether the wire
//! is to be closed (by calling methods like FixDegenerated()
//! and FixConnected() for last and first edges).
Standard_Boolean& ClosedWireMode() ; //! Returns (modifiable) the flag which defines whether the 2d (True)
//! representation of the wire is preferable over 3d one (in the
//! case of ambiguity in FixEdgeCurves).
Standard_Boolean& PreferencePCurveMode() ; //! Returns (modifiable) the flag which defines whether tool
//! tries to fix gaps first by changing curves ranges (i.e.
//! using intersection, extrema, projections) or not.
Standard_Boolean& FixGapsByRangesMode() ; Standard_Integer& FixReorderMode() ; Standard_Integer& FixSmallMode() ; Standard_Integer& FixConnectedMode() ; Standard_Integer& FixEdgeCurvesMode() ; Standard_Integer& FixDegeneratedMode() ; Standard_Integer& FixSelfIntersectionMode() ; Standard_Integer& FixLackingMode() ; Standard_Integer& FixGaps3dMode() ; //! Returns (modifiable) the flag for corresponding Fix..() method
//! which defines whether this method will be called from the
//! method APIFix():
//! -1 default
//! 1 method will be called
//! 0 method will not be called
Standard_Integer& FixGaps2dMode() ; Standard_Integer& FixReversed2dMode() ; Standard_Integer& FixRemovePCurveMode() ; Standard_Integer& FixAddPCurveMode() ; Standard_Integer& FixRemoveCurve3dMode() ; Standard_Integer& FixAddCurve3dMode() ; Standard_Integer& FixSeamMode() ; Standard_Integer& FixShiftedMode() ; Standard_Integer& FixSameParameterMode() ; Standard_Integer& FixVertexToleranceMode() ; Standard_Integer& FixNotchedEdgesMode() ; Standard_Integer& FixSelfIntersectingEdgeMode() ; Standard_Integer& FixIntersectingEdgesMode() ; //! Returns (modifiable) the flag for corresponding Fix..() method
//! which defines whether this method will be called from the
//! corresponding Fix..() method of the public level:
//! -1 default
//! 1 method will be called
//! 0 method will not be called
Standard_Integer& FixNonAdjacentIntersectingEdgesMode() ; //! This method performs all the available fixes.
//! If some fix is turned on or off explicitly by the Fix..Mode() flag,
//! this fix is either called or not depending on that flag.
//! Else (i.e. if flag is default) fix is called depending on the
//! situation: some fixes are not called or are limited if order of
//! edges in the wire is not OK, or depending on modes
Standard_EXPORT Standard_Boolean Perform() ; //! Performs an analysis and reorders edges in the wire using
//! class WireOrder
Standard_EXPORT Standard_Boolean FixReorder() ; //! Applies FixSmall(num) to all edges in the wire
Standard_EXPORT Standard_Integer FixSmall(const Standard_Boolean lockvtx,const Standard_Real precsmall = 0.0) ; //! Applies FixConnected(num) to all edges in the wire
//! Connection between first and last edges is treated only if
//! flag ClosedMode is True
//! If is -1 then MaxTolerance() is taken.
Standard_EXPORT Standard_Boolean FixConnected(const Standard_Real prec = -1.0) ; //! Groups the fixes dealing with 3d and pcurves of the edges.
//! The order of the fixes and the default behaviour are:
//! ShapeFix_Edge::FixReversed2d
//! ShapeFix_Edge::FixRemovePCurve (only if forced)
//! ShapeFix_Edge::FixAddPCurve
//! ShapeFix_Edge::FixRemoveCurve3d (only if forced)
//! ShapeFix_Edge::FixAddCurve3d
//! FixSeam,
//! FixShifted,
//! ShapeFix_Edge::FixSameParameter
Standard_EXPORT Standard_Boolean FixEdgeCurves() ; //! Applies FixDegenerated(num) to all edges in the wire
//! Connection between first and last edges is treated only if
//! flag ClosedMode is True
Standard_EXPORT Standard_Boolean FixDegenerated() ; //! Applies FixSelfIntersectingEdge(num) and
//! FixIntersectingEdges(num) to all edges in the wire and
//! FixIntersectingEdges(num1, num2) for all pairs num1 and num2
//! such that num2 >= num1 + 2
//! and removes wrong edges if any
Standard_EXPORT Standard_Boolean FixSelfIntersection() ; //! Applies FixLacking(num) to all edges in the wire
//! Connection between first and last edges is treated only if
//! flag ClosedMode is True
//! If is False (default), test for connectness is done with
//! precision of vertex between edges, else it is done with minimal
//! value of vertex tolerance and Analyzer.Precision().
//! Hence, will lead to inserting lacking edges in replacement
//! of vertices which have big tolerances.
Standard_EXPORT Standard_Boolean FixLacking(const Standard_Boolean force = Standard_False) ; //! Fixes a wire to be well closed
//! It performs FixConnected, FixDegenerated and FixLacking between
//! last and first edges (independingly on flag ClosedMode and modes
//! for these fixings)
//! If is -1 then MaxTolerance() is taken.
Standard_EXPORT Standard_Boolean FixClosed(const Standard_Real prec = -1.0) ; //! Fixes gaps between ends of 3d curves on adjacent edges
//! myPrecision is used to detect the gaps.
Standard_EXPORT Standard_Boolean FixGaps3d() ; //! Fixes gaps between ends of pcurves on adjacent edges
//! myPrecision is used to detect the gaps.
Standard_EXPORT Standard_Boolean FixGaps2d() ; //! Reorder edges in the wire as determined by WireOrder
//! that should be filled and computed before
Standard_EXPORT Standard_Boolean FixReorder(const ShapeAnalysis_WireOrder& wi) ; //! Fixes Null Length Edge to be removed
//! If an Edge has Null Length (regarding preci, or
//! - what is smaller), it should be removed
//! It can be with no problem if its two vertices are the same
//! Else, if lockvtx is False, it is removed and its end vertex
//! is put on the preceeding edge
//! But if lockvtx is True, this edge must be kept ...
Standard_EXPORT Standard_Boolean FixSmall(const Standard_Integer num,const Standard_Boolean lockvtx,const Standard_Real precsmall) ; //! Fixes connected edges (preceeding and current)
//! Forces Vertices (end of preceeding-begin of current) to be
//! the same one
//! Tests with starting preci or, if given greater,
//! If is -1 then MaxTolerance() is taken.
Standard_EXPORT Standard_Boolean FixConnected(const Standard_Integer num,const Standard_Real prec) ; //! Fixes a seam edge
//! A Seam edge has two pcurves, one for forward. one for reversed
//! The forward pcurve must be set as first
Standard_EXPORT Standard_Boolean FixSeam(const Standard_Integer num) ; //! Fixes edges which have pcurves shifted by whole parameter
//! range on the closed surface (the case may occur if pcurve
//! of edge was computed by projecting 3d curve, which goes
//! along the seam).
//! It compares each two consequent edges and tries to connect them
//! if distance between ends is near to range of the surface.
//! It also can detect and fix the case if all pcurves are connected,
//! but lie out of parametric bounds of the surface.
//! In addition to FixShifted from ShapeFix_Wire, more
//! sophisticated check of degenerate points is performed,
//! and special cases like sphere given by two meridians
//! are treated.
Standard_EXPORT Standard_Boolean FixShifted() ; //! Fixes Degenerated Edge
//! Checks an edge or a point between th-1 and th
//! edges for a singularity on a supporting surface.
//! If singularity is detected, either adds new degenerated edge
//! (before th), or makes th edge to be degenerated.
Standard_EXPORT Standard_Boolean FixDegenerated(const Standard_Integer num) ; //! Fixes Lacking Edge
//! Test if two adjucent edges are disconnected in 2d (while
//! connected in 3d), and in that case either increase tolerance
//! of the vertex or add a new edge (straight in 2d space), in
//! order to close wire in 2d.
//! Returns True if edge was added or tolerance was increased.
Standard_EXPORT Standard_Boolean FixLacking(const Standard_Integer num,const Standard_Boolean force = Standard_False) ; Standard_EXPORT Standard_Boolean FixNotchedEdges() ; //! Fixes gap between ends of 3d curves on num-1 and num-th edges.
//! myPrecision is used to detect the gap.
//! If convert is True, converts curves to bsplines to bend.
Standard_EXPORT Standard_Boolean FixGap3d(const Standard_Integer num,const Standard_Boolean convert = Standard_False) ; //! Fixes gap between ends of pcurves on num-1 and num-th edges.
//! myPrecision is used to detect the gap.
//! If convert is True, converts pcurves to bsplines to bend.
Standard_EXPORT Standard_Boolean FixGap2d(const Standard_Integer num,const Standard_Boolean convert = Standard_False) ; Standard_Boolean StatusReorder(const ShapeExtend_Status status) const; Standard_Boolean StatusSmall(const ShapeExtend_Status status) const; Standard_Boolean StatusConnected(const ShapeExtend_Status status) const; Standard_Boolean StatusEdgeCurves(const ShapeExtend_Status status) const; Standard_Boolean StatusDegenerated(const ShapeExtend_Status status) const; Standard_Boolean StatusSelfIntersection(const ShapeExtend_Status status) const; Standard_Boolean StatusLacking(const ShapeExtend_Status status) const; Standard_Boolean StatusClosed(const ShapeExtend_Status status) const; Standard_Boolean StatusGaps3d(const ShapeExtend_Status status) const; Standard_Boolean StatusGaps2d(const ShapeExtend_Status status) const; Standard_Boolean StatusNotches(const ShapeExtend_Status status) const; //! Querying the status of perfomed API fixing procedures
//! Each Status..() methods gives information about the last call to
//! the corresponding Fix..() method of API level:
//! OK : no problems detected; nothing done
//! DONE: some problem(s) was(were) detected and successfully fixed
//! FAIL: some problem(s) cannot be fixed
Standard_Boolean StatusRemovedSegment() const; //! Queries the status of last call to methods Fix... of
//! advanced level
//! For details see corresponding methods; universal statuses are:
//! OK : problem not detected; nothing done
//! DONE: problem was detected and successfully fixed
//! FAIL: problem cannot be fixed
Standard_Boolean LastFixStatus(const ShapeExtend_Status status) const; //! Returns tool for fixing wires.
Handle_ShapeFix_Edge FixEdgeTool() const; DEFINE_STANDARD_RTTI(ShapeFix_Wire) protected: //! Updates WireData if some replacements are made
//! This is necessary for wires (unlike other shape types)
//! since one edge can present in wire several times
Standard_EXPORT void UpdateWire() ; Handle_ShapeFix_Edge myFixEdge; Handle_ShapeAnalysis_Wire myAnalyzer; Standard_Boolean myGeomMode; Standard_Boolean myTopoMode; Standard_Boolean myClosedMode; Standard_Boolean myPreference2d; Standard_Boolean myFixGapsByRanges; Standard_Integer myFixReversed2dMode; Standard_Integer myFixRemovePCurveMode; Standard_Integer myFixAddPCurveMode; Standard_Integer myFixRemoveCurve3dMode; Standard_Integer myFixAddCurve3dMode; Standard_Integer myFixSeamMode; Standard_Integer myFixShiftedMode; Standard_Integer myFixSameParameterMode; Standard_Integer myFixVertexToleranceMode; Standard_Integer myFixNotchedEdgesMode; Standard_Integer myFixSelfIntersectingEdgeMode; Standard_Integer myFixIntersectingEdgesMode; Standard_Integer myFixNonAdjacentIntersectingEdgesMode; Standard_Integer myRemoveLoopMode; Standard_Integer myFixReorderMode; Standard_Integer myFixSmallMode; Standard_Integer myFixConnectedMode; Standard_Integer myFixEdgeCurvesMode; Standard_Integer myFixDegeneratedMode; Standard_Integer myFixSelfIntersectionMode; Standard_Integer myFixLackingMode; Standard_Integer myFixGaps3dMode; Standard_Integer myFixGaps2dMode; Standard_Integer myLastFixStatus; Standard_Integer myStatusReorder; Standard_Integer myStatusSmall; Standard_Integer myStatusConnected; Standard_Integer myStatusEdgeCurves; Standard_Integer myStatusDegenerated; Standard_Integer myStatusClosed; Standard_Integer myStatusSelfIntersection; Standard_Integer myStatusLacking; Standard_Integer myStatusGaps3d; Standard_Integer myStatusGaps2d; Standard_Boolean myStatusRemovedSegment; Standard_Integer myStatusNotches; private: //! Detect and fix self-intersecting pcurve of edge .
//! Fix is made by one of two methods:
//! - cut out the self-intersection loop on pcurve (thus
//! producing C0 pcurve). This also increases tolerance of edge
//! in order to satisfy SameParameter requirement.
//! - increase tolerance of the vertex of edge nearest to the
//! self-intersection point so that it comprises that point.
//! The first method is considered only if ModifyGeometryMode
//! is True. In that case, the method which requires less
//! increasing of tolerance is selected.
Standard_EXPORT Standard_Boolean FixSelfIntersectingEdge(const Standard_Integer num) ; //! Test if two consequent edges are intersecting and fix it
//! by increasing of tolerance of vertex between edges,
//! shifting this vertex to the point of intersection,
//! cutting edges to the intersection point.
//! It also can give signal to remove edge if it whole is cut by
//! intersection (if flag ModifyTopologyMode is set).
Standard_EXPORT Standard_Boolean FixIntersectingEdges(const Standard_Integer num) ; //! Tests if two edges and are intersecting and
//! fix intersection by increasing of tolerance of vertex
//! nearest to the point of intersection.
Standard_EXPORT Standard_Boolean FixIntersectingEdges(const Standard_Integer num1,const Standard_Integer num2) ; Standard_EXPORT void FixDummySeam(const Standard_Integer num) ; }; #include // other Inline functions and methods (like "C++: function call" methods) #endif