OCC Main Page | ModelingAlgorithms | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

ModelingAlgorithms
TKShHealing
ShapeFix


ShapeFix_Face Class Reference

This operator allows to perform various fixes on face
and its wires: fixes provided by ShapeFix_Wire,
fixing orientation of wires, addition of natural bounds,
fixing of missing seam edge,
and detection and removal of null-area wires
.

#include <ShapeFix_Face.hxx>

Inheritance diagram for ShapeFix_Face:

Inheritance graph
[legend]

Public Member Functions

Standard_EXPORT ShapeFix_Face ()
 Creates an empty tool
.
Standard_EXPORT ShapeFix_Face (const TopoDS_Face &face)
 Creates a tool and loads a face
.
virtual Standard_EXPORT void ClearModes ()
 Sets all modes to default
.
Standard_EXPORT void Init (const TopoDS_Face &face)
 Loads a whole face already created, with its wires, sense and
location
.
Standard_EXPORT void Init (const Handle(Geom_Surface)&surf, const Standard_Real preci, const Standard_Boolean fwd=Standard_True)
 Starts the creation of the face
By default it will be FORWARD, or REVERSED if <fwd> is False
.
Standard_EXPORT void Init (const Handle(ShapeAnalysis_Surface)&surf, const Standard_Real preci, const Standard_Boolean fwd=Standard_True)
 Starts the creation of the face
By default it will be FORWARD, or REVERSED if <fwd> is False
.
virtual Standard_EXPORT void SetMsgRegistrator (const Handle(ShapeExtend_BasicMsgRegistrator)&msgreg)
 Sets message registrator
.
virtual Standard_EXPORT void SetPrecision (const Standard_Real preci)
 Sets basic precision value (also to FixWireTool)
.
virtual Standard_EXPORT void SetMinTolerance (const Standard_Real mintol)
 Sets minimal allowed tolerance (also to FixWireTool)
.
virtual Standard_EXPORT void SetMaxTolerance (const Standard_Real maxtol)
 Sets maximal allowed tolerance (also to FixWireTool)
.
Standard_Integer & FixWireMode ()
 Returns (modifiable) the mode for applying fixes of
ShapeFix_Wire, by default True.
.
Standard_Integer & FixOrientationMode ()
 Returns (modifiable) the fix orientation mode, by default
True. If True, wires oriented to border limited square.
.
Standard_Integer & FixAddNaturalBoundMode ()
 Returns (modifiable) the add natural bound mode.
If true, natural boundary is added on faces that miss them.
Default is False for faces with single wire (they are
handled by FixOrientation in that case) and True for others.
.
Standard_Integer & FixMissingSeamMode ()
 Returns (modifiable) the fix missing seam mode, by default
True. If True, tries to insert seam is missed.
.
Standard_Integer & FixSmallAreaWireMode ()
 Returns (modifiable) the fix small area wire mode, by default
False. If True, drops small wires.
.
Standard_Integer & FixIntersectingWiresMode ()
 Returns (modifiable) the fix intersecting wires mode
by default True.
.
Standard_Integer & FixLoopWiresMode ()
 Returns (modifiable) the fix loop wires mode
by default True.
.
Standard_Integer & FixSplitFaceMode ()
 Returns (modifiable) the fix split face mode
by default True.
.
TopoDS_Face Face () const
 Returns a face which corresponds to the current state
Warning: The finally produced face may be another one ... but with the
same support
.
TopoDS_Shape Result () const
 Returns resulting shape (Face or Shell if splitted)
To be used instead of Face() if FixMissingSeam involved
.
Standard_EXPORT void Add (const TopoDS_Wire &wire)
 Add a wire to current face using BRep_Builder.
Wire is added without taking into account orientation of face
(as if face were FORWARD).
.
Standard_EXPORT Standard_Boolean Perform ()
 Performs all the fixes, depending on modes
Function Status returns the status of last call to Perform()
ShapeExtend_OK : face was OK, nothing done
ShapeExtend_DONE1: some wires are fixed
ShapeExtend_DONE2: orientation of wires fixed
ShapeExtend_DONE3: missing seam added
ShapeExtend_DONE4: small area wire removed
ShapeExtend_DONE5: natural bounds added
ShapeExtend_FAIL1: some fails during fixing wires
ShapeExtend_FAIL2: cannot fix orientation of wires
ShapeExtend_FAIL3: cannot add missing seam
ShapeExtend_FAIL4: cannot remove small area wire
.
Standard_EXPORT Standard_Boolean FixOrientation ()
 Fixes orientation of wires on the face
It tries to make all wires lie outside all others (according
to orientation) by reversing orientation of some of them.
If face lying on sphere or torus has single wire and
AddNaturalBoundMode is True, that wire is not reversed in
any case (supposing that natural bound will be added).
Returns True if wires were reversed
.
Standard_EXPORT Standard_Boolean FixOrientation (TopTools_DataMapOfShapeListOfShape &MapWires)
 Fixes orientation of wires on the face
It tries to make all wires lie outside all others (according
to orientation) by reversing orientation of some of them.
If face lying on sphere or torus has single wire and
AddNaturalBoundMode is True, that wire is not reversed in
any case (supposing that natural bound will be added).
Returns True if wires were reversed
OutWires return information about out wires + list of
internal wires for each (for performing split face).
.
Standard_EXPORT Standard_Boolean FixAddNaturalBound ()
 Adds natural boundary on face if it is missing.
Two cases are supported:
- face has no wires
- face lies on geometrically double-closed surface
(sphere or torus) and none of wires is left-oriented
Returns True if natural boundary was added
.
Standard_EXPORT Standard_Boolean FixMissingSeam ()
 Detects and fixes the special case when face on a closed
surface is given by two wires closed in 3d but with gap in 2d.
In that case it creates a new wire from the two, and adds a
missing seam edge
Returns True if missing seam was added
.
Standard_EXPORT Standard_Boolean FixSmallAreaWire ()
 Detects wires with small area (that is less than
100*Precision::PConfusion(). Removes these wires if they are internal.
Returns : True if at least one small wire removed,
False if does nothing.
.
Standard_EXPORT Standard_Boolean FixLoopWire (TopTools_SequenceOfShape &aResWires)
 Detects if wire has a loop and fixes this situation by splitting on the few parts.
if wire has a loops and it was splitted Status was set to value ShapeExtend_DONE6.
.
Standard_EXPORT Standard_Boolean FixIntersectingWires ()
 Detects and fixes the special case when face has more than one wire
and this wires have intersection point
.
Standard_EXPORT Standard_Boolean FixWiresTwoCoincEdges ()
 If wire contains two coincidence edges it must be removed
Queries on status after Perform()
.
Standard_EXPORT Standard_Boolean FixSplitFace (const TopTools_DataMapOfShapeListOfShape &MapWires)
 Split face if there are more than one out wire
using inrormation after FixOrientation()
.
Standard_Boolean Status (const ShapeExtend_Status status) const
 Returns the status of last call to Perform()
ShapeExtend_OK : face was OK, nothing done
ShapeExtend_DONE1: some wires are fixed
ShapeExtend_DONE2: orientation of wires fixed
ShapeExtend_DONE3: missing seam added
ShapeExtend_DONE4: small area wire removed
ShapeExtend_DONE5: natural bounds added
ShapeExtend_DONE8: face may be splited
ShapeExtend_FAIL1: some fails during fixing wires
ShapeExtend_FAIL2: cannot fix orientation of wires
ShapeExtend_FAIL3: cannot add missing seam
ShapeExtend_FAIL4: cannot remove small area wire
.
Handle_ShapeFix_Wire FixWireTool ()
 Returns tool for fixing wires.
.
Standard_EXPORT const Handle (Standard_Type)&DynamicType() const

Protected Attributes

Handle_ShapeAnalysis_Surface mySurf
TopoDS_Face myFace
TopoDS_Shape myResult
Handle_ShapeFix_Wire myFixWire
Standard_Boolean myFwd
Standard_Integer myStatus

Private Member Functions

Standard_EXPORT Standard_Boolean SplitEdge (const Handle(ShapeExtend_WireData)&sewd, const Standard_Integer num, const Standard_Real param, const TopoDS_Vertex &vert, const Standard_Real preci, ShapeFix_DataMapOfShapeBox2d &boxes)
Standard_EXPORT Standard_Boolean SplitEdge (const Handle(ShapeExtend_WireData)&sewd, const Standard_Integer num, const Standard_Real param1, const Standard_Real param2, const TopoDS_Vertex &vert, const Standard_Real preci, ShapeFix_DataMapOfShapeBox2d &boxes)

Private Attributes

Standard_Integer myFixWireMode
Standard_Integer myFixOrientationMode
Standard_Integer myFixAddNaturalBoundMode
Standard_Integer myFixMissingSeamMode
Standard_Integer myFixSmallAreaWireMode
Standard_Integer myFixLoopWiresMode
Standard_Integer myFixIntersectingWiresMode
Standard_Integer myFixSplitFaceMode

Constructor & Destructor Documentation

Standard_EXPORT ShapeFix_Face::ShapeFix_Face  ) 
 

Standard_EXPORT ShapeFix_Face::ShapeFix_Face const TopoDS_Face &  face  ) 
 


Member Function Documentation

Standard_EXPORT void ShapeFix_Face::Add const TopoDS_Wire &  wire  ) 
 

virtual Standard_EXPORT void ShapeFix_Face::ClearModes  )  [virtual]
 

TopoDS_Face ShapeFix_Face::Face  )  const [inline]
 

Standard_EXPORT Standard_Boolean ShapeFix_Face::FixAddNaturalBound  ) 
 

Standard_Integer & ShapeFix_Face::FixAddNaturalBoundMode  )  [inline]
 

Standard_EXPORT Standard_Boolean ShapeFix_Face::FixIntersectingWires  ) 
 

Standard_Integer & ShapeFix_Face::FixIntersectingWiresMode  )  [inline]
 

Standard_EXPORT Standard_Boolean ShapeFix_Face::FixLoopWire TopTools_SequenceOfShape &  aResWires  ) 
 

Standard_Integer & ShapeFix_Face::FixLoopWiresMode  )  [inline]
 

Standard_EXPORT Standard_Boolean ShapeFix_Face::FixMissingSeam  ) 
 

Standard_Integer & ShapeFix_Face::FixMissingSeamMode  )  [inline]
 

Standard_EXPORT Standard_Boolean ShapeFix_Face::FixOrientation TopTools_DataMapOfShapeListOfShape &  MapWires  ) 
 

Standard_EXPORT Standard_Boolean ShapeFix_Face::FixOrientation  ) 
 

Standard_Integer & ShapeFix_Face::FixOrientationMode  )  [inline]
 

Standard_EXPORT Standard_Boolean ShapeFix_Face::FixSmallAreaWire  ) 
 

Standard_Integer & ShapeFix_Face::FixSmallAreaWireMode  )  [inline]
 

Standard_EXPORT Standard_Boolean ShapeFix_Face::FixSplitFace const TopTools_DataMapOfShapeListOfShape &  MapWires  ) 
 

Standard_Integer & ShapeFix_Face::FixSplitFaceMode  )  [inline]
 

Standard_Integer & ShapeFix_Face::FixWireMode  )  [inline]
 

Standard_EXPORT Standard_Boolean ShapeFix_Face::FixWiresTwoCoincEdges  ) 
 

Handle_ShapeFix_Wire ShapeFix_Face::FixWireTool  ) 
 

Standard_EXPORT const ShapeFix_Face::Handle Standard_Type   )  const
 

Reimplemented from ShapeFix_Root.

Standard_EXPORT void ShapeFix_Face::Init const Handle(ShapeAnalysis_Surface)&  surf,
const Standard_Real  preci,
const Standard_Boolean  fwd = Standard_True
 

Standard_EXPORT void ShapeFix_Face::Init const Handle(Geom_Surface)&  surf,
const Standard_Real  preci,
const Standard_Boolean  fwd = Standard_True
 

Standard_EXPORT void ShapeFix_Face::Init const TopoDS_Face &  face  ) 
 

Standard_EXPORT Standard_Boolean ShapeFix_Face::Perform  ) 
 

TopoDS_Shape ShapeFix_Face::Result  )  const [inline]
 

virtual Standard_EXPORT void ShapeFix_Face::SetMaxTolerance const Standard_Real  maxtol  )  [virtual]
 

Reimplemented from ShapeFix_Root.

virtual Standard_EXPORT void ShapeFix_Face::SetMinTolerance const Standard_Real  mintol  )  [virtual]
 

Reimplemented from ShapeFix_Root.

virtual Standard_EXPORT void ShapeFix_Face::SetMsgRegistrator const Handle(ShapeExtend_BasicMsgRegistrator)&  msgreg  )  [virtual]
 

Reimplemented from ShapeFix_Root.

virtual Standard_EXPORT void ShapeFix_Face::SetPrecision const Standard_Real  preci  )  [virtual]
 

Reimplemented from ShapeFix_Root.

Standard_EXPORT Standard_Boolean ShapeFix_Face::SplitEdge const Handle(ShapeExtend_WireData)&  sewd,
const Standard_Integer  num,
const Standard_Real  param1,
const Standard_Real  param2,
const TopoDS_Vertex &  vert,
const Standard_Real  preci,
ShapeFix_DataMapOfShapeBox2d boxes
[private]
 

Standard_EXPORT Standard_Boolean ShapeFix_Face::SplitEdge const Handle(ShapeExtend_WireData)&  sewd,
const Standard_Integer  num,
const Standard_Real  param,
const TopoDS_Vertex &  vert,
const Standard_Real  preci,
ShapeFix_DataMapOfShapeBox2d boxes
[private]
 

Standard_Boolean ShapeFix_Face::Status const ShapeExtend_Status  status  )  const [inline]
 


Field Documentation

TopoDS_Face ShapeFix_Face::myFace [protected]
 

Standard_Integer ShapeFix_Face::myFixAddNaturalBoundMode [private]
 

Standard_Integer ShapeFix_Face::myFixIntersectingWiresMode [private]
 

Standard_Integer ShapeFix_Face::myFixLoopWiresMode [private]
 

Standard_Integer ShapeFix_Face::myFixMissingSeamMode [private]
 

Standard_Integer ShapeFix_Face::myFixOrientationMode [private]
 

Standard_Integer ShapeFix_Face::myFixSmallAreaWireMode [private]
 

Standard_Integer ShapeFix_Face::myFixSplitFaceMode [private]
 

Handle_ShapeFix_Wire ShapeFix_Face::myFixWire [protected]
 

Standard_Integer ShapeFix_Face::myFixWireMode [private]
 

Standard_Boolean ShapeFix_Face::myFwd [protected]
 

TopoDS_Shape ShapeFix_Face::myResult [protected]
 

Standard_Integer ShapeFix_Face::myStatus [protected]
 

Handle_ShapeAnalysis_Surface ShapeFix_Face::mySurf [protected]
 


The documentation for this class was generated from the following files:
Generated on Mon Aug 25 13:42:38 2008 for OpenCASCADE by  doxygen 1.4.1