Open CASCADE Technology  6.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes
ShapeFix_Edge Class Reference

Fixing invalid edge.
Geometrical and/or topological inconsistency:
More...

#include <ShapeFix_Edge.hxx>

Inheritance diagram for ShapeFix_Edge:
Inheritance graph
[legend]

Public Member Functions

 ShapeFix_Edge ()
 Empty constructor
More...
 
Handle_ShapeConstruct_ProjectCurveOnSurface Projector ()
 Returns the projector used for recomputing missing pcurves
Can be used for adjusting parameters of projector
More...
 
Standard_Boolean FixRemovePCurve (const TopoDS_Edge &edge, const TopoDS_Face &face)
 
Standard_Boolean FixRemovePCurve (const TopoDS_Edge &edge, const Handle< Geom_Surface > &surface, const TopLoc_Location &location)
 
Removes the pcurve(s) of the edge if it does not match the <br>
    vertices <br>
    Check is done <br>

Use : It is to be called when pcurve of an edge can be wrong
(e.g., after import from IGES)
Returns: True, if does not match, removed (status DONE)
False, (status OK) if matches or (status FAIL) if no pcurve,
nothing done
More...

 
Standard_Boolean FixRemoveCurve3d (const TopoDS_Edge &edge)
 
Removes 3d curve of the edge if it does not match the vertices <br>

Returns: True, if does not match, removed (status DONE)
False, (status OK) if matches or (status FAIL) if no 3d curve,
nothing done
More...

 
Standard_Boolean FixAddPCurve (const TopoDS_Edge &edge, const TopoDS_Face &face, const Standard_Boolean isSeam, const Standard_Real prec=0.0)
 See method below for information
More...
 
Standard_Boolean FixAddPCurve (const TopoDS_Edge &edge, const Handle< Geom_Surface > &surface, const TopLoc_Location &location, const Standard_Boolean isSeam, const Standard_Real prec=0.0)
 See method below for information
More...
 
Standard_Boolean FixAddPCurve (const TopoDS_Edge &edge, const TopoDS_Face &face, const Standard_Boolean isSeam, const Handle< ShapeAnalysis_Surface > &surfana, const Standard_Real prec=0.0)
 See method below for information
More...
 
Standard_Boolean FixAddPCurve (const TopoDS_Edge &edge, const Handle< Geom_Surface > &surface, const TopLoc_Location &location, const Standard_Boolean isSeam, const Handle< ShapeAnalysis_Surface > &surfana, const Standard_Real prec=0.0)
 
Adds pcurve(s) of the edge if missing (by projecting 3d curve) <br>
    Parameter isSeam indicates if the edge is a seam. <br>
    The parameter <prec> defines the precision for calculations. <br>
    If it is 0 (default), the tolerance of the edge is taken. <br>

Remark : This method is rather for internal use since it accepts parameter
<surfana> for optimization of computations
Use : It is to be called after FixRemovePCurve (if removed) or in any
case when edge can have no pcurve
Returns: True if pcurve was added, else False
Status :
OK : Pcurve exists
FAIL1: No 3d curve
FAIL2: fail during projecting
DONE1: Pcurve was added
DONE2: specific case of pcurve going through degenerated point on
sphere encountered during projection (see class
ShapeConstruct_ProjectCurveOnSurface for more info)
More...

 
Standard_Boolean FixAddCurve3d (const TopoDS_Edge &edge)
 
Tries to build 3d curve of the edge if missing <br>

Use : It is to be called after FixRemoveCurve3d (if removed) or in any
case when edge can have no 3d curve
Returns: True if 3d curve was added, else False
Status :
OK : 3d curve exists
FAIL1: BRepLib::BuildCurve3d() has failed
DONE1: 3d curve was added
More...

 
Standard_Boolean FixVertexTolerance (const TopoDS_Edge &edge, const TopoDS_Face &face)
 
Standard_Boolean FixVertexTolerance (const TopoDS_Edge &edge)
 
Increases the tolerances of the edge vertices to comprise <br>
    the ends of 3d curve and pcurve on the given face <br>
    (first method) or all pcurves stored in an edge (second one) <br>

Returns: True, if tolerances have been increased, otherwise False
Status:
OK : the original tolerances have not been changed
DONE1: the tolerance of first vertex has been increased
DONE2: the tolerance of last vertex has been increased
More...

 
Standard_Boolean FixReversed2d (const TopoDS_Edge &edge, const TopoDS_Face &face)
 
Standard_Boolean FixReversed2d (const TopoDS_Edge &edge, const Handle< Geom_Surface > &surface, const TopLoc_Location &location)
 
Fixes edge if pcurve is directed opposite to 3d curve <br>
    Check is done by call to the function <br>
    ShapeAnalysis_Edge::CheckCurve3dWithPCurve() <br>

Warning: For seam edge this method will check and fix the pcurve in only
one direction. Hence, it should be called twice for seam edge:
once with edge orientation FORWARD and once with REVERSED.
Returns: False if nothing done, True if reversed (status DONE)
Status: OK - pcurve OK, nothing done
FAIL1 - no pcurve
FAIL2 - no 3d curve
DONE1 - pcurve was reversed
More...

 
Standard_Boolean FixSameParameter (const TopoDS_Edge &edge, const Standard_Real tolerance=0.0)
 
 Tries to make edge SameParameter and sets corresponding <br>
     tolerance and SameParameter flag. <br>
     First, it makes edge same range if SameRange flag is not set. <br>


If flag SameParameter is set, this method calls the
function ShapeAnalysis_Edge::CheckSameParameter() that
calculates the maximal deviation of pcurves of the edge from
its 3d curve. If deviation > tolerance, the tolerance of edge
is increased to a value of deviation. If deviation < tolerance
nothing happens.

If flag SameParameter is not set, this method chooses the best
variant (one that has minimal tolerance), either
a. only after computing deviation (as above) or
b. after calling standard procedure BRepLib::SameParameter
and computing deviation (as above). If <tolerance> > 0, it is
used as parameter for BRepLib::SameParameter, otherwise,
tolerance of the edge is used.

Use : Is to be called after all pcurves and 3d curve of the edge are
correctly computed
Remark : SameParameter flag is always set to True after this method
Returns: True, if something done, else False
Status : OK - edge was initially SameParameter, nothing is done
FAIL1 - computation of deviation of pcurves from 3d curve has failed
FAIL2 - BRepLib::SameParameter() has failed
DONE1 - tolerance of the edge was increased
DONE2 - flag SameParameter was set to True (only if
BRepLib::SameParameter() did not set it)
DONE3 - edge was modified by BRepLib::SameParameter() to SameParameter
DONE4 - not used anymore
DONE5 - if the edge resulting from BRepLib has been chosen, i.e. variant b. above
(only for edges with not set SameParameter)
More...

 
Standard_Boolean Status (const ShapeExtend_Status status) const
 Returns the status (in the form of True/False) of last Fix
More...
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const
 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 void ShallowDump (Standard_OStream &) const
 
virtual const
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const 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 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...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Protected Attributes

Standard_Integer myStatus
 
Handle_ShapeConstruct_ProjectCurveOnSurface myProjector
 

Detailed Description

Fixing invalid edge.
Geometrical and/or topological inconsistency:

Constructor & Destructor Documentation

ShapeFix_Edge::ShapeFix_Edge ( )

Empty constructor

Member Function Documentation

Standard_Boolean ShapeFix_Edge::FixAddCurve3d ( const TopoDS_Edge edge)

Tries to build 3d curve of the edge if missing <br>

Use : It is to be called after FixRemoveCurve3d (if removed) or in any
case when edge can have no 3d curve
Returns: True if 3d curve was added, else False
Status :
OK : 3d curve exists
FAIL1: BRepLib::BuildCurve3d() has failed
DONE1: 3d curve was added

Standard_Boolean ShapeFix_Edge::FixAddPCurve ( const TopoDS_Edge edge,
const TopoDS_Face face,
const Standard_Boolean  isSeam,
const Standard_Real  prec = 0.0 
)

See method below for information

Standard_Boolean ShapeFix_Edge::FixAddPCurve ( const TopoDS_Edge edge,
const Handle< Geom_Surface > &  surface,
const TopLoc_Location location,
const Standard_Boolean  isSeam,
const Standard_Real  prec = 0.0 
)

See method below for information

Standard_Boolean ShapeFix_Edge::FixAddPCurve ( const TopoDS_Edge edge,
const TopoDS_Face face,
const Standard_Boolean  isSeam,
const Handle< ShapeAnalysis_Surface > &  surfana,
const Standard_Real  prec = 0.0 
)

See method below for information

Standard_Boolean ShapeFix_Edge::FixAddPCurve ( const TopoDS_Edge edge,
const Handle< Geom_Surface > &  surface,
const TopLoc_Location location,
const Standard_Boolean  isSeam,
const Handle< ShapeAnalysis_Surface > &  surfana,
const Standard_Real  prec = 0.0 
)

Adds pcurve(s) of the edge if missing (by projecting 3d curve) <br>
    Parameter isSeam indicates if the edge is a seam. <br>
    The parameter <prec> defines the precision for calculations. <br>
    If it is 0 (default), the tolerance of the edge is taken. <br>

Remark : This method is rather for internal use since it accepts parameter
<surfana> for optimization of computations
Use : It is to be called after FixRemovePCurve (if removed) or in any
case when edge can have no pcurve
Returns: True if pcurve was added, else False
Status :
OK : Pcurve exists
FAIL1: No 3d curve
FAIL2: fail during projecting
DONE1: Pcurve was added
DONE2: specific case of pcurve going through degenerated point on
sphere encountered during projection (see class
ShapeConstruct_ProjectCurveOnSurface for more info)

Standard_Boolean ShapeFix_Edge::FixRemoveCurve3d ( const TopoDS_Edge edge)

Removes 3d curve of the edge if it does not match the vertices <br>

Returns: True, if does not match, removed (status DONE)
False, (status OK) if matches or (status FAIL) if no 3d curve,
nothing done

Standard_Boolean ShapeFix_Edge::FixRemovePCurve ( const TopoDS_Edge edge,
const TopoDS_Face face 
)
Standard_Boolean ShapeFix_Edge::FixRemovePCurve ( const TopoDS_Edge edge,
const Handle< Geom_Surface > &  surface,
const TopLoc_Location location 
)

Removes the pcurve(s) of the edge if it does not match the <br>
    vertices <br>
    Check is done <br>

Use : It is to be called when pcurve of an edge can be wrong
(e.g., after import from IGES)
Returns: True, if does not match, removed (status DONE)
False, (status OK) if matches or (status FAIL) if no pcurve,
nothing done

Standard_Boolean ShapeFix_Edge::FixReversed2d ( const TopoDS_Edge edge,
const TopoDS_Face face 
)
Standard_Boolean ShapeFix_Edge::FixReversed2d ( const TopoDS_Edge edge,
const Handle< Geom_Surface > &  surface,
const TopLoc_Location location 
)

Fixes edge if pcurve is directed opposite to 3d curve <br>
    Check is done by call to the function <br>
    ShapeAnalysis_Edge::CheckCurve3dWithPCurve() <br>

Warning: For seam edge this method will check and fix the pcurve in only
one direction. Hence, it should be called twice for seam edge:
once with edge orientation FORWARD and once with REVERSED.
Returns: False if nothing done, True if reversed (status DONE)
Status: OK - pcurve OK, nothing done
FAIL1 - no pcurve
FAIL2 - no 3d curve
DONE1 - pcurve was reversed

Standard_Boolean ShapeFix_Edge::FixSameParameter ( const TopoDS_Edge edge,
const Standard_Real  tolerance = 0.0 
)

 Tries to make edge SameParameter and sets corresponding <br>
     tolerance and SameParameter flag. <br>
     First, it makes edge same range if SameRange flag is not set. <br>


If flag SameParameter is set, this method calls the
function ShapeAnalysis_Edge::CheckSameParameter() that
calculates the maximal deviation of pcurves of the edge from
its 3d curve. If deviation > tolerance, the tolerance of edge
is increased to a value of deviation. If deviation < tolerance
nothing happens.

If flag SameParameter is not set, this method chooses the best
variant (one that has minimal tolerance), either
a. only after computing deviation (as above) or
b. after calling standard procedure BRepLib::SameParameter
and computing deviation (as above). If <tolerance> > 0, it is
used as parameter for BRepLib::SameParameter, otherwise,
tolerance of the edge is used.

Use : Is to be called after all pcurves and 3d curve of the edge are
correctly computed
Remark : SameParameter flag is always set to True after this method
Returns: True, if something done, else False
Status : OK - edge was initially SameParameter, nothing is done
FAIL1 - computation of deviation of pcurves from 3d curve has failed
FAIL2 - BRepLib::SameParameter() has failed
DONE1 - tolerance of the edge was increased
DONE2 - flag SameParameter was set to True (only if
BRepLib::SameParameter() did not set it)
DONE3 - edge was modified by BRepLib::SameParameter() to SameParameter
DONE4 - not used anymore
DONE5 - if the edge resulting from BRepLib has been chosen, i.e. variant b. above
(only for edges with not set SameParameter)

Standard_Boolean ShapeFix_Edge::FixVertexTolerance ( const TopoDS_Edge edge,
const TopoDS_Face face 
)
Standard_Boolean ShapeFix_Edge::FixVertexTolerance ( const TopoDS_Edge edge)

Increases the tolerances of the edge vertices to comprise <br>
    the ends of 3d curve and pcurve on the given face <br>
    (first method) or all pcurves stored in an edge (second one) <br>

Returns: True, if tolerances have been increased, otherwise False
Status:
OK : the original tolerances have not been changed
DONE1: the tolerance of first vertex has been increased
DONE2: the tolerance of last vertex has been increased

Handle_ShapeConstruct_ProjectCurveOnSurface ShapeFix_Edge::Projector ( )

Returns the projector used for recomputing missing pcurves
Can be used for adjusting parameters of projector

Standard_Boolean ShapeFix_Edge::Status ( const ShapeExtend_Status  status) const

Returns the status (in the form of True/False) of last Fix

Field Documentation

Handle_ShapeConstruct_ProjectCurveOnSurface ShapeFix_Edge::myProjector
protected
Standard_Integer ShapeFix_Edge::myStatus
protected

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