Open CASCADE Technology  7.1.0.beta
Public Member Functions | Protected Member Functions | Protected Attributes

ShapeFix_Wire Class Reference

This class provides a set of tools for repairing a wire. More...

#include <ShapeFix_Wire.hxx>

Inheritance diagram for ShapeFix_Wire:
Inheritance graph
[legend]

Public Member Functions

 ShapeFix_Wire ()
 Empty Constructor, creates clear object with default flags. More...
 
 ShapeFix_Wire (const TopoDS_Wire &wire, const TopoDS_Face &face, const Standard_Real prec)
 Create new object with default flags and prepare it for use (Loads analyzer with all the data for the wire and face) More...
 
void ClearModes ()
 Sets all modes to default. More...
 
void ClearStatuses ()
 Clears all statuses. More...
 
void Init (const TopoDS_Wire &wire, const TopoDS_Face &face, const Standard_Real prec)
 Load analyzer with all the data for the wire and face and drops all fixing statuses. More...
 
void Init (const Handle< ShapeAnalysis_Wire > &saw)
 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. More...
 
void Load (const TopoDS_Wire &wire)
 Load data for the wire, and drops all fixing statuses. More...
 
void Load (const Handle< ShapeExtend_WireData > &sbwd)
 Load data for the wire, and drops all fixing statuses. More...
 
void SetFace (const TopoDS_Face &face)
 Set working face for the wire. More...
 
void SetSurface (const Handle< Geom_Surface > &surf)
 Set surface for the wire. More...
 
void SetSurface (const Handle< Geom_Surface > &surf, const TopLoc_Location &loc)
 Set surface for the wire. More...
 
virtual void SetPrecision (const Standard_Real prec) override
 Set working precision (to root and to analyzer) More...
 
void SetMaxTailAngle (const Standard_Real theMaxTailAngle)
 Sets the maximal allowed angle of the tails in radians. More...
 
void SetMaxTailWidth (const Standard_Real theMaxTailWidth)
 Sets the maximal allowed width of the tails. More...
 
Standard_Boolean IsLoaded () const
 Tells if the wire is loaded. More...
 
Standard_Boolean IsReady () const
 Tells if the wire and face are loaded. More...
 
Standard_Integer NbEdges () const
 returns number of edges in the working wire More...
 
TopoDS_Wire Wire () const
 Makes the resulting Wire (by basic Brep_Builder) More...
 
TopoDS_Wire WireAPIMake () const
 Makes the resulting Wire (by BRepAPI_MakeWire) More...
 
Handle< ShapeAnalysis_WireAnalyzer () const
 returns field Analyzer (working tool) More...
 
const Handle< ShapeExtend_WireData > & WireData () const
 returns working wire More...
 
const TopoDS_FaceFace () const
 returns working face (Analyzer.Face()) More...
 
Standard_BooleanModifyTopologyMode ()
 Returns (modifiable) the flag which defines whether it is allowed to modify topology of the wire during fixing (adding/removing edges etc.) More...
 
Standard_BooleanModifyGeometryMode ()
 Returns (modifiable) the flag which defines whether the Fix..() methods are allowed to modify geometry of the edges and vertices. More...
 
Standard_IntegerModifyRemoveLoopMode ()
 Returns (modifiable) the flag which defines whether the Fix..() methods are allowed to modify RemoveLoop of the edges. More...
 
Standard_BooleanClosedWireMode ()
 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). More...
 
Standard_BooleanPreferencePCurveMode ()
 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). More...
 
Standard_BooleanFixGapsByRangesMode ()
 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. More...
 
Standard_IntegerFixReorderMode ()
 
Standard_IntegerFixSmallMode ()
 
Standard_IntegerFixConnectedMode ()
 
Standard_IntegerFixEdgeCurvesMode ()
 
Standard_IntegerFixDegeneratedMode ()
 
Standard_IntegerFixSelfIntersectionMode ()
 
Standard_IntegerFixLackingMode ()
 
Standard_IntegerFixGaps3dMode ()
 
Standard_IntegerFixGaps2dMode ()
 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. More...
 
Standard_IntegerFixReversed2dMode ()
 
Standard_IntegerFixRemovePCurveMode ()
 
Standard_IntegerFixAddPCurveMode ()
 
Standard_IntegerFixRemoveCurve3dMode ()
 
Standard_IntegerFixAddCurve3dMode ()
 
Standard_IntegerFixSeamMode ()
 
Standard_IntegerFixShiftedMode ()
 
Standard_IntegerFixSameParameterMode ()
 
Standard_IntegerFixVertexToleranceMode ()
 
Standard_IntegerFixNotchedEdgesMode ()
 
Standard_IntegerFixSelfIntersectingEdgeMode ()
 
Standard_IntegerFixIntersectingEdgesMode ()
 
Standard_IntegerFixNonAdjacentIntersectingEdgesMode ()
 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. More...
 
Standard_IntegerFixTailMode ()
 
Standard_Boolean Perform ()
 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. More...
 
Standard_Boolean FixReorder ()
 Performs an analysis and reorders edges in the wire using class WireOrder. More...
 
Standard_Integer FixSmall (const Standard_Boolean lockvtx, const Standard_Real precsmall=0.0)
 Applies FixSmall(num) to all edges in the wire. More...
 
Standard_Boolean FixConnected (const Standard_Real prec=-1.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 <prec> is -1 then MaxTolerance() is taken. More...
 
Standard_Boolean FixEdgeCurves ()
 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. More...
 
Standard_Boolean FixDegenerated ()
 Applies FixDegenerated(num) to all edges in the wire Connection between first and last edges is treated only if flag ClosedMode is True. More...
 
Standard_Boolean FixSelfIntersection ()
 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. More...
 
Standard_Boolean FixLacking (const Standard_Boolean force=Standard_False)
 Applies FixLacking(num) to all edges in the wire Connection between first and last edges is treated only if flag ClosedMode is True If <force> 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, <force> will lead to inserting lacking edges in replacement of vertices which have big tolerances. More...
 
Standard_Boolean FixClosed (const Standard_Real prec=-1.0)
 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 <prec> is -1 then MaxTolerance() is taken. More...
 
Standard_Boolean FixGaps3d ()
 Fixes gaps between ends of 3d curves on adjacent edges myPrecision is used to detect the gaps. More...
 
Standard_Boolean FixGaps2d ()
 Fixes gaps between ends of pcurves on adjacent edges myPrecision is used to detect the gaps. More...
 
Standard_Boolean FixReorder (const ShapeAnalysis_WireOrder &wi)
 Reorder edges in the wire as determined by WireOrder that should be filled and computed before. More...
 
Standard_Boolean FixSmall (const Standard_Integer num, const Standard_Boolean lockvtx, const Standard_Real precsmall)
 Fixes Null Length Edge to be removed If an Edge has Null Length (regarding preci, or <precsmall> More...
 
Standard_Boolean FixConnected (const Standard_Integer num, const Standard_Real prec)
 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, <prec> If <prec> is -1 then MaxTolerance() is taken. More...
 
Standard_Boolean FixSeam (const Standard_Integer num)
 Fixes a seam edge A Seam edge has two pcurves, one for forward. one for reversed The forward pcurve must be set as first. More...
 
Standard_Boolean FixShifted ()
 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. More...
 
Standard_Boolean FixDegenerated (const Standard_Integer num)
 Fixes Degenerated Edge Checks an <num-th> edge or a point between <num>th-1 and <num>th edges for a singularity on a supporting surface. If singularity is detected, either adds new degenerated edge (before <num>th), or makes <num>th edge to be degenerated. More...
 
Standard_Boolean FixLacking (const Standard_Integer num, const Standard_Boolean force=Standard_False)
 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. More...
 
Standard_Boolean FixNotchedEdges ()
 
Standard_Boolean FixGap3d (const Standard_Integer num, const Standard_Boolean convert=Standard_False)
 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. More...
 
Standard_Boolean FixGap2d (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. More...
 
Standard_Boolean FixTails ()
 
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
 
Standard_Boolean StatusRemovedSegment () 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. More...
 
Standard_Boolean StatusFixTails (const ShapeExtend_Status status) const
 
Standard_Boolean LastFixStatus (const ShapeExtend_Status status) 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. More...
 
Handle< ShapeFix_EdgeFixEdgeTool () const
 Returns tool for fixing wires. More...
 
- Public Member Functions inherited from ShapeFix_Root
 ShapeFix_Root ()
 Empty Constructor (no context is created) More...
 
virtual void Set (const Handle< ShapeFix_Root > &Root)
 Copy all fields from another Root object. More...
 
virtual void SetContext (const Handle< ShapeBuild_ReShape > &context)
 Sets context. More...
 
Handle< ShapeBuild_ReShapeContext () const
 Returns context. More...
 
virtual void SetMsgRegistrator (const Handle< ShapeExtend_BasicMsgRegistrator > &msgreg)
 Sets message registrator. More...
 
Handle< ShapeExtend_BasicMsgRegistratorMsgRegistrator () const
 Returns message registrator. More...
 
Standard_Real Precision () const
 Returns basic precision value. More...
 
virtual void SetMinTolerance (const Standard_Real mintol)
 Sets minimal allowed tolerance. More...
 
Standard_Real MinTolerance () const
 Returns minimal allowed tolerance. More...
 
virtual void SetMaxTolerance (const Standard_Real maxtol)
 Sets maximal allowed tolerance. More...
 
Standard_Real MaxTolerance () const
 Returns maximal allowed tolerance. More...
 
Standard_Real LimitTolerance (const Standard_Real toler) const
 Returns tolerance limited by [myMinTol,myMaxTol]. More...
 
void SendMsg (const TopoDS_Shape &shape, const Message_Msg &message, const Message_Gravity gravity=Message_Info) const
 Sends a message to be attached to the shape. Calls corresponding message of message registrator. More...
 
void SendMsg (const Message_Msg &message, const Message_Gravity gravity=Message_Info) const
 Sends a message to be attached to myShape. Calls previous method. More...
 
void SendWarning (const TopoDS_Shape &shape, const Message_Msg &message) const
 Sends a warning to be attached to the shape. Calls SendMsg with gravity set to Message_Warning. More...
 
void SendWarning (const Message_Msg &message) const
 Calls previous method for myShape. More...
 
void SendFail (const TopoDS_Shape &shape, const Message_Msg &message) const
 Sends a fail to be attached to the shape. Calls SendMsg with gravity set to Message_Fail. More...
 
void SendFail (const Message_Msg &message) const
 Calls previous method for myShape. More...
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const override
 Memory deallocator for transient classes. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Protected Member Functions

void UpdateWire ()
 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. More...
 

Protected Attributes

Handle< ShapeFix_EdgemyFixEdge
 
Handle< ShapeAnalysis_WiremyAnalyzer
 
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 myFixTailMode
 
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
 
Standard_Integer myStatusFixTails
 
Standard_Real myMaxTailAngleSine
 
Standard_Real myMaxTailWidth
 
- Protected Attributes inherited from ShapeFix_Root
TopoDS_Shape myShape
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 
- Static Protected Member Functions inherited from ShapeFix_Root
static Standard_Boolean NeedFix (const Standard_Integer flag, const Standard_Boolean def=Standard_True)
 Auxiliary method for work with three-position (on/off/default) flags (modes) in ShapeFix. More...
 

Detailed Description

This class provides a set of tools for repairing a wire.

These are methods Fix...(), organised in two levels:

Level 1: Advanced - each method in this level fixes one separate problem, usually dealing with either single edge or connection of the two adjacent edges. These methods should be used carefully and called in right sequence, because some of them depend on others.

Level 2: Public (API) - methods which group several methods of level 1 and call them in a proper sequence in order to make some consistent set of fixes for a whole wire. It is possible to control calls to methods of the advanced level from methods of the public level by use of flags Fix..Mode() (see below).

Fixes can be made in three ways:

  1. Increasing tolerance of an edge or a vertex
  2. Changing topology (adding/removing/replacing edge in the wire and/or replacing the vertex in the edge)
  3. Changing geometry (shifting vertex or adjusting ends of edge curve to vertices, or recomputing curves of the edge)

When fix can be made in more than one way (e.g., either by increasing tolerance or shifting a vertex), it is choosen according to the flags: ModifyTopologyMode - allows modification of the topology. This flag can be set when fixing a wire on the separate (free) face, and should be unset for face which is part of shell. ModifyGeometryMode - allows modification of the geometry.

The order of descriptions of Fix() methods in this CDL approximately corresponds to the optimal order of calls.

NOTE: most of fixing methods expect edges in the ShapeExtend_WireData to be ordered, so it is necessary to make call to FixReorder() before any other fixes

ShapeFix_Wire should be initialized prior to any fix by the following data: a) Wire (ether TopoDS_Wire or ShapeExtend_Wire) b) Face or surface c) Precision d) Maximal tail angle and width This can be done either by calling corresponding methods (LoadWire, SetFace or SetSurface, SetPrecision, SetMaxTailAngle and SetMaxTailWidth), or by loading already filled ShapeAnalisis_Wire with method Load

Constructor & Destructor Documentation

ShapeFix_Wire::ShapeFix_Wire ( )

Empty Constructor, creates clear object with default flags.

ShapeFix_Wire::ShapeFix_Wire ( const TopoDS_Wire wire,
const TopoDS_Face face,
const Standard_Real  prec 
)

Create new object with default flags and prepare it for use (Loads analyzer with all the data for the wire and face)

Member Function Documentation

Handle< ShapeAnalysis_Wire > ShapeFix_Wire::Analyzer ( ) const

returns field Analyzer (working tool)

void ShapeFix_Wire::ClearModes ( )

Sets all modes to default.

void ShapeFix_Wire::ClearStatuses ( )

Clears all statuses.

Standard_Boolean& ShapeFix_Wire::ClosedWireMode ( )

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).

const TopoDS_Face& ShapeFix_Wire::Face ( ) const

returns working face (Analyzer.Face())

Standard_Integer& ShapeFix_Wire::FixAddCurve3dMode ( )
Standard_Integer& ShapeFix_Wire::FixAddPCurveMode ( )
Standard_Boolean ShapeFix_Wire::FixClosed ( const Standard_Real  prec = -1.0)

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 <prec> is -1 then MaxTolerance() is taken.

Standard_Boolean ShapeFix_Wire::FixConnected ( const Standard_Real  prec = -1.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 <prec> is -1 then MaxTolerance() is taken.

Standard_Boolean ShapeFix_Wire::FixConnected ( const Standard_Integer  num,
const Standard_Real  prec 
)

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, <prec> If <prec> is -1 then MaxTolerance() is taken.

Standard_Integer& ShapeFix_Wire::FixConnectedMode ( )
Standard_Boolean ShapeFix_Wire::FixDegenerated ( )

Applies FixDegenerated(num) to all edges in the wire Connection between first and last edges is treated only if flag ClosedMode is True.

Standard_Boolean ShapeFix_Wire::FixDegenerated ( const Standard_Integer  num)

Fixes Degenerated Edge Checks an <num-th> edge or a point between <num>th-1 and <num>th edges for a singularity on a supporting surface. If singularity is detected, either adds new degenerated edge (before <num>th), or makes <num>th edge to be degenerated.

Standard_Integer& ShapeFix_Wire::FixDegeneratedMode ( )
Standard_Boolean ShapeFix_Wire::FixEdgeCurves ( )

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_Integer& ShapeFix_Wire::FixEdgeCurvesMode ( )
Handle< ShapeFix_Edge > ShapeFix_Wire::FixEdgeTool ( ) const

Returns tool for fixing wires.

Standard_Boolean ShapeFix_Wire::FixGap2d ( 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_Boolean ShapeFix_Wire::FixGap3d ( const Standard_Integer  num,
const Standard_Boolean  convert = Standard_False 
)

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_Boolean ShapeFix_Wire::FixGaps2d ( )

Fixes gaps between ends of pcurves on adjacent edges myPrecision is used to detect the gaps.

Standard_Integer& ShapeFix_Wire::FixGaps2dMode ( )

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_Boolean ShapeFix_Wire::FixGaps3d ( )

Fixes gaps between ends of 3d curves on adjacent edges myPrecision is used to detect the gaps.

Standard_Integer& ShapeFix_Wire::FixGaps3dMode ( )
Standard_Boolean& ShapeFix_Wire::FixGapsByRangesMode ( )

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_Integer& ShapeFix_Wire::FixIntersectingEdgesMode ( )
Standard_Boolean ShapeFix_Wire::FixLacking ( const Standard_Boolean  force = Standard_False)

Applies FixLacking(num) to all edges in the wire Connection between first and last edges is treated only if flag ClosedMode is True If <force> 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, <force> will lead to inserting lacking edges in replacement of vertices which have big tolerances.

Standard_Boolean ShapeFix_Wire::FixLacking ( const Standard_Integer  num,
const Standard_Boolean  force = Standard_False 
)

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_Integer& ShapeFix_Wire::FixLackingMode ( )
Standard_Integer& ShapeFix_Wire::FixNonAdjacentIntersectingEdgesMode ( )

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_Boolean ShapeFix_Wire::FixNotchedEdges ( )
Standard_Integer& ShapeFix_Wire::FixNotchedEdgesMode ( )
Standard_Integer& ShapeFix_Wire::FixRemoveCurve3dMode ( )
Standard_Integer& ShapeFix_Wire::FixRemovePCurveMode ( )
Standard_Boolean ShapeFix_Wire::FixReorder ( )

Performs an analysis and reorders edges in the wire using class WireOrder.

Standard_Boolean ShapeFix_Wire::FixReorder ( const ShapeAnalysis_WireOrder wi)

Reorder edges in the wire as determined by WireOrder that should be filled and computed before.

Standard_Integer& ShapeFix_Wire::FixReorderMode ( )
Standard_Integer& ShapeFix_Wire::FixReversed2dMode ( )
Standard_Integer& ShapeFix_Wire::FixSameParameterMode ( )
Standard_Boolean ShapeFix_Wire::FixSeam ( const Standard_Integer  num)

Fixes a seam edge A Seam edge has two pcurves, one for forward. one for reversed The forward pcurve must be set as first.

NOTE that correct order of pcurves in the seam edge depends on its orientation (i.e., on orientation of the wire, method of exploration of edges etc.). Since wire represented by the ShapeExtend_WireData is always forward (orientation is accounted by edges), it will work correct if:

  1. Wire created from ShapeExtend_WireData with methods ShapeExtend_WireData::Wire..() is added into the FORWARD face (orientation can be applied later)
  2. Wire is extracted from the face with orientation not composed with orientation of the face
Standard_Integer& ShapeFix_Wire::FixSeamMode ( )
Standard_Integer& ShapeFix_Wire::FixSelfIntersectingEdgeMode ( )
Standard_Boolean ShapeFix_Wire::FixSelfIntersection ( )

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_Integer& ShapeFix_Wire::FixSelfIntersectionMode ( )
Standard_Boolean ShapeFix_Wire::FixShifted ( )

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_Integer& ShapeFix_Wire::FixShiftedMode ( )
Standard_Integer ShapeFix_Wire::FixSmall ( const Standard_Boolean  lockvtx,
const Standard_Real  precsmall = 0.0 
)

Applies FixSmall(num) to all edges in the wire.

Standard_Boolean ShapeFix_Wire::FixSmall ( const Standard_Integer  num,
const Standard_Boolean  lockvtx,
const Standard_Real  precsmall 
)

Fixes Null Length Edge to be removed If an Edge has Null Length (regarding preci, or <precsmall>

  • 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_Integer& ShapeFix_Wire::FixSmallMode ( )
Standard_Integer& ShapeFix_Wire::FixTailMode ( )
Standard_Boolean ShapeFix_Wire::FixTails ( )
Standard_Integer& ShapeFix_Wire::FixVertexToleranceMode ( )
void ShapeFix_Wire::Init ( const TopoDS_Wire wire,
const TopoDS_Face face,
const Standard_Real  prec 
)

Load analyzer with all the data for the wire and face and drops all fixing statuses.

void ShapeFix_Wire::Init ( const Handle< ShapeAnalysis_Wire > &  saw)

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_Boolean ShapeFix_Wire::IsLoaded ( ) const

Tells if the wire is loaded.

Standard_Boolean ShapeFix_Wire::IsReady ( ) const

Tells if the wire and face are loaded.

Standard_Boolean ShapeFix_Wire::LastFixStatus ( const ShapeExtend_Status  status) 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.

void ShapeFix_Wire::Load ( const TopoDS_Wire wire)

Load data for the wire, and drops all fixing statuses.

void ShapeFix_Wire::Load ( const Handle< ShapeExtend_WireData > &  sbwd)

Load data for the wire, and drops all fixing statuses.

Standard_Boolean& ShapeFix_Wire::ModifyGeometryMode ( )

Returns (modifiable) the flag which defines whether the Fix..() methods are allowed to modify geometry of the edges and vertices.

Standard_Integer& ShapeFix_Wire::ModifyRemoveLoopMode ( )

Returns (modifiable) the flag which defines whether the Fix..() methods are allowed to modify RemoveLoop of the edges.

Standard_Boolean& ShapeFix_Wire::ModifyTopologyMode ( )

Returns (modifiable) the flag which defines whether it is allowed to modify topology of the wire during fixing (adding/removing edges etc.)

Standard_Integer ShapeFix_Wire::NbEdges ( ) const

returns number of edges in the working wire

Standard_Boolean ShapeFix_Wire::Perform ( )

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.

The order of the fixes and default behaviour of Perform() are: FixReorder FixSmall (with lockvtx true if ! TopoMode or if wire is not ordered) FixConnected (if wire is ordered) FixEdgeCurves (without FixShifted if wire is not ordered) FixDegenerated (if wire is ordered) FixSelfIntersection (if wire is ordered and ClosedMode is True) FixLacking (if wire is ordered)

Standard_Boolean& ShapeFix_Wire::PreferencePCurveMode ( )

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).

void ShapeFix_Wire::SetFace ( const TopoDS_Face face)

Set working face for the wire.

void ShapeFix_Wire::SetMaxTailAngle ( const Standard_Real  theMaxTailAngle)

Sets the maximal allowed angle of the tails in radians.

void ShapeFix_Wire::SetMaxTailWidth ( const Standard_Real  theMaxTailWidth)

Sets the maximal allowed width of the tails.

virtual void ShapeFix_Wire::SetPrecision ( const Standard_Real  prec)
overridevirtual

Set working precision (to root and to analyzer)

Reimplemented from ShapeFix_Root.

void ShapeFix_Wire::SetSurface ( const Handle< Geom_Surface > &  surf)

Set surface for the wire.

void ShapeFix_Wire::SetSurface ( const Handle< Geom_Surface > &  surf,
const TopLoc_Location loc 
)

Set surface for the wire.

Standard_Boolean ShapeFix_Wire::StatusClosed ( const ShapeExtend_Status  status) const
Standard_Boolean ShapeFix_Wire::StatusConnected ( const ShapeExtend_Status  status) const
Standard_Boolean ShapeFix_Wire::StatusDegenerated ( const ShapeExtend_Status  status) const
Standard_Boolean ShapeFix_Wire::StatusEdgeCurves ( const ShapeExtend_Status  status) const
Standard_Boolean ShapeFix_Wire::StatusFixTails ( const ShapeExtend_Status  status) const
Standard_Boolean ShapeFix_Wire::StatusGaps2d ( const ShapeExtend_Status  status) const
Standard_Boolean ShapeFix_Wire::StatusGaps3d ( const ShapeExtend_Status  status) const
Standard_Boolean ShapeFix_Wire::StatusLacking ( const ShapeExtend_Status  status) const
Standard_Boolean ShapeFix_Wire::StatusNotches ( const ShapeExtend_Status  status) const
Standard_Boolean ShapeFix_Wire::StatusRemovedSegment ( ) 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 ShapeFix_Wire::StatusReorder ( const ShapeExtend_Status  status) const
Standard_Boolean ShapeFix_Wire::StatusSelfIntersection ( const ShapeExtend_Status  status) const
Standard_Boolean ShapeFix_Wire::StatusSmall ( const ShapeExtend_Status  status) const
void ShapeFix_Wire::UpdateWire ( )
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.

TopoDS_Wire ShapeFix_Wire::Wire ( ) const

Makes the resulting Wire (by basic Brep_Builder)

TopoDS_Wire ShapeFix_Wire::WireAPIMake ( ) const

Makes the resulting Wire (by BRepAPI_MakeWire)

const Handle< ShapeExtend_WireData >& ShapeFix_Wire::WireData ( ) const

returns working wire

Field Documentation

Handle< ShapeAnalysis_Wire > ShapeFix_Wire::myAnalyzer
protected
Standard_Boolean ShapeFix_Wire::myClosedMode
protected
Standard_Integer ShapeFix_Wire::myFixAddCurve3dMode
protected
Standard_Integer ShapeFix_Wire::myFixAddPCurveMode
protected
Standard_Integer ShapeFix_Wire::myFixConnectedMode
protected
Standard_Integer ShapeFix_Wire::myFixDegeneratedMode
protected
Handle< ShapeFix_Edge > ShapeFix_Wire::myFixEdge
protected
Standard_Integer ShapeFix_Wire::myFixEdgeCurvesMode
protected
Standard_Integer ShapeFix_Wire::myFixGaps2dMode
protected
Standard_Integer ShapeFix_Wire::myFixGaps3dMode
protected
Standard_Boolean ShapeFix_Wire::myFixGapsByRanges
protected
Standard_Integer ShapeFix_Wire::myFixIntersectingEdgesMode
protected
Standard_Integer ShapeFix_Wire::myFixLackingMode
protected
Standard_Integer ShapeFix_Wire::myFixNonAdjacentIntersectingEdgesMode
protected
Standard_Integer ShapeFix_Wire::myFixNotchedEdgesMode
protected
Standard_Integer ShapeFix_Wire::myFixRemoveCurve3dMode
protected
Standard_Integer ShapeFix_Wire::myFixRemovePCurveMode
protected
Standard_Integer ShapeFix_Wire::myFixReorderMode
protected
Standard_Integer ShapeFix_Wire::myFixReversed2dMode
protected
Standard_Integer ShapeFix_Wire::myFixSameParameterMode
protected
Standard_Integer ShapeFix_Wire::myFixSeamMode
protected
Standard_Integer ShapeFix_Wire::myFixSelfIntersectingEdgeMode
protected
Standard_Integer ShapeFix_Wire::myFixSelfIntersectionMode
protected
Standard_Integer ShapeFix_Wire::myFixShiftedMode
protected
Standard_Integer ShapeFix_Wire::myFixSmallMode
protected
Standard_Integer ShapeFix_Wire::myFixTailMode
protected
Standard_Integer ShapeFix_Wire::myFixVertexToleranceMode
protected
Standard_Boolean ShapeFix_Wire::myGeomMode
protected
Standard_Integer ShapeFix_Wire::myLastFixStatus
protected
Standard_Real ShapeFix_Wire::myMaxTailAngleSine
protected
Standard_Real ShapeFix_Wire::myMaxTailWidth
protected
Standard_Boolean ShapeFix_Wire::myPreference2d
protected
Standard_Integer ShapeFix_Wire::myRemoveLoopMode
protected
Standard_Integer ShapeFix_Wire::myStatusClosed
protected
Standard_Integer ShapeFix_Wire::myStatusConnected
protected
Standard_Integer ShapeFix_Wire::myStatusDegenerated
protected
Standard_Integer ShapeFix_Wire::myStatusEdgeCurves
protected
Standard_Integer ShapeFix_Wire::myStatusFixTails
protected
Standard_Integer ShapeFix_Wire::myStatusGaps2d
protected
Standard_Integer ShapeFix_Wire::myStatusGaps3d
protected
Standard_Integer ShapeFix_Wire::myStatusLacking
protected
Standard_Integer ShapeFix_Wire::myStatusNotches
protected
Standard_Boolean ShapeFix_Wire::myStatusRemovedSegment
protected
Standard_Integer ShapeFix_Wire::myStatusReorder
protected
Standard_Integer ShapeFix_Wire::myStatusSelfIntersection
protected
Standard_Integer ShapeFix_Wire::myStatusSmall
protected
Standard_Boolean ShapeFix_Wire::myTopoMode
protected

The documentation for this class was generated from the following file: