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

This class provides a data structure necessary for work with the wire as with
ordered list of edges, what is required for many algorithms. The advantage of
this class is that it allows to work with wires which are not correct.
The object of the class ShapeExtend_WireData can be initialized by
TopoDS_Wire, and converted back to TopoDS_Wire.
An edge in the wire is defined by its rank number. Operations of accessing,
adding and removing edge at the given rank number are provided. On the whole
wire, operations of circular permutation and reversing (both orientations of
all edges and order of edges) are provided as well.
This class also provides a method to check if the edge in the wire is a seam
(if the wire lies on a face).
This class is handled by reference. Such an approach gives the following advantages:
More...

#include <ShapeExtend_WireData.hxx>

Inheritance diagram for ShapeExtend_WireData:
Inheritance graph
[legend]

Public Member Functions

 ShapeExtend_WireData ()
 Empty constructor, creates empty wire with no edges
More...
 
 ShapeExtend_WireData (const TopoDS_Wire &wire, const Standard_Boolean chained=Standard_True, const Standard_Boolean theManifoldMode=Standard_True)
 Constructor initializing the data from TopoDS_Wire. Calls Init(wire,chained).
More...
 
void Init (const Handle< ShapeExtend_WireData > &other)
 Copies data from another WireData
More...
 
Standard_Boolean Init (const TopoDS_Wire &wire, const Standard_Boolean chained=Standard_True, const Standard_Boolean theManifoldMode=Standard_True)
 
 Loads an already existing wire <br>
     If <chained> is True (default), edges are added in the <br>
     sequence as they are explored by TopoDS_Iterator <br>
     Else, if <chained> is False, wire is explored by <br>
     BRepTools_WireExplorer and it is guaranteed that edges will <br>
     be sequencially connected. <br>

Remark : In the latter case it can happen that not all edges
will be found (because of limitations of
BRepTools_WireExplorer for disconnected wires and wires
with seam edges).
More...

 
void Clear ()
 Clears data about Wire.
More...
 
void ComputeSeams (const Standard_Boolean enforce=Standard_True)
 
 Computes the list of seam edges <br>
     By default (direct call), computing is enforced <br>
     For indirect call (from IsSeam) it is redone only if not yet <br>
     already done or if the list of edges has changed <br>

Remark : A Seam Edge is an Edge present twice in the list, once as
FORWARD and once as REVERSED
Each sense has its own PCurve, the one for FORWARD
must be set in first
More...

 
void SetLast (const Standard_Integer num)
 Does a circular permutation in order to set <num>th edge last
More...
 
void SetDegeneratedLast ()
 
 When the wire contains at least one degenerated edge, sets it <br>
     as last one <br>

Note : It is useful to process pcurves, for instance, while the pcurve
of a DGNR may not be computed from its 3D part (there is none)
it is computed after the other edges have been computed and
chained.
More...

 
void Add (const TopoDS_Edge &edge, const Standard_Integer atnum=0)
 
 Adds an edge to a wire, being defined (not yet ended) <br>
     This is the plain, basic, function to add an edge <br>
     <num> = 0 (D): Appends at end <br>
     <num> = 1: Preprends at start <br>
     else, Insert before <num> <br>

Remark : Null Edge is simply ignored
More...

 
void Add (const TopoDS_Wire &wire, const Standard_Integer atnum=0)
 
 Adds an entire wire, considered as a list of edges <br>

Remark : The wire is assumed to be ordered (TopoDS_Iterator
is used)
More...

 
void Add (const Handle< ShapeExtend_WireData > &wire, const Standard_Integer atnum=0)
 Adds a wire in the form of WireData
More...
 
void Add (const TopoDS_Shape &shape, const Standard_Integer atnum=0)
 Adds an edge or a wire invoking corresponding method Add
More...
 
void AddOriented (const TopoDS_Edge &edge, const Standard_Integer mode)
 Adds an edge to start or end of <me>, according to <mode>
0: at end, as direct
1: at end, as reversed
2: at start, as direct
3: at start, as reversed
< 0: no adding
More...
 
void AddOriented (const TopoDS_Wire &wire, const Standard_Integer mode)
 Adds a wire to start or end of <me>, according to <mode>
0: at end, as direct
1: at end, as reversed
2: at start, as direct
3: at start, as reversed
< 0: no adding
More...
 
void AddOriented (const TopoDS_Shape &shape, const Standard_Integer mode)
 Adds an edge or a wire invoking corresponding method
AddOriented
More...
 
void Remove (const Standard_Integer num=0)
 Removes an Edge, given its rank. By default removes the last edge.
More...
 
void Set (const TopoDS_Edge &edge, const Standard_Integer num=0)
 Replaces an edge at the given
rank number <num> with new one. Default is last edge (<num> = 0).
More...
 
void Reverse ()
 Reverses the sense of the list and the orientation of each Edge
This method should be called when either wire has no seam edges
or face is not available
More...
 
void Reverse (const TopoDS_Face &face)
 Reverses the sense of the list and the orientation of each Edge
The face is necessary for swapping pcurves for seam edges
(first pcurve corresponds to orientation FORWARD, and second to
REVERSED; when edge is reversed, pcurves must be swapped)
If face is NULL, no swapping is performed
More...
 
Standard_Integer NbEdges () const
 Returns the count of currently recorded edges
More...
 
Standard_Integer NbNonManifoldEdges () const
 Returns the count of currently recorded non-manifold edges
More...
 
TopoDS_Edge NonmanifoldEdge (const Standard_Integer num) const
 Returns <num>th nonmanifold Edge
More...
 
Handle_TopTools_HSequenceOfShape NonmanifoldEdges () const
 
 Returns sequence of non-manifold edges <br>
     This sequence can be not empty if wire data set in manifold mode but <br>
     initial wire has INTERNAL orientation or contains INTERNAL edges <br>


More...

 
Standard_BooleanManifoldMode ()
 Returns mode defining manifold wire data or not.
If manifold that nonmanifold edges will not be not
consider during operations(previous behaviour)
and they will be added only in result wire
else non-manifold edges will consider during operations
More...
 
TopoDS_Edge Edge (const Standard_Integer num) const
 Returns <num>th Edge
More...
 
Standard_Integer Index (const TopoDS_Edge &edge)
 Returns the index of the edge
If the edge is a seam the orientation is also checked
Returns 0 if the edge is not found in the list
More...
 
Standard_Boolean IsSeam (const Standard_Integer num)
 
 Tells if an Edge is seam (see ComputeSeams) <br>

An edge is considered as seam if it presents twice in
the edge list, once as FORWARD and once as REVERSED.
More...

 
TopoDS_Wire Wire () const
 
 Makes TopoDS_Wire using <br>

BRep_Builder (just creates the TopoDS_Wire object and adds
all edges into it). This method should be called when
the wire is correct (for example, after successful
fixes by ShapeFix_Wire) and adjacent edges share common
vertices. In case if adjacent edges do not share the same
vertices the resulting TopoDS_Wire will be invalid.
More...

 
TopoDS_Wire WireAPIMake () const
 
 Makes TopoDS_Wire using <br>

BRepAPI_MakeWire. Class BRepAPI_MakeWire merges
geometrically coincided vertices and can disturb
correct order of edges in the wire. If this class fails,
null shape is returned.
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...
 

Detailed Description

This class provides a data structure necessary for work with the wire as with
ordered list of edges, what is required for many algorithms. The advantage of
this class is that it allows to work with wires which are not correct.
The object of the class ShapeExtend_WireData can be initialized by
TopoDS_Wire, and converted back to TopoDS_Wire.
An edge in the wire is defined by its rank number. Operations of accessing,
adding and removing edge at the given rank number are provided. On the whole
wire, operations of circular permutation and reversing (both orientations of
all edges and order of edges) are provided as well.
This class also provides a method to check if the edge in the wire is a seam
(if the wire lies on a face).
This class is handled by reference. Such an approach gives the following advantages:

  1. Sharing the object of this class strongly optimizes the processes of
    analysis and fixing performed in parallel on the wire stored in the form
    of this class. Fixing tool (e.g. ShapeFix_Wire) fixes problems one by
    one using analyzing tool (e.g. ShapeAnalysis_Wire). Sharing allows not
    to reinitialize each time the analyzing tool with modified
    ShapeExtend_WireData what consumes certain time.

No copying of contents. The object of ShapeExtend_WireData class has
quite big size, returning it as a result of the function would cause
additional copying of contents if this class were one handled by value.
Moreover, this class is stored as a field in other classes which are
they returned as results of functions, storing only a handle to
ShapeExtend_WireData saves time and memory.

Constructor & Destructor Documentation

ShapeExtend_WireData::ShapeExtend_WireData ( )

Empty constructor, creates empty wire with no edges

ShapeExtend_WireData::ShapeExtend_WireData ( const TopoDS_Wire wire,
const Standard_Boolean  chained = Standard_True,
const Standard_Boolean  theManifoldMode = Standard_True 
)

Constructor initializing the data from TopoDS_Wire. Calls Init(wire,chained).

Member Function Documentation

void ShapeExtend_WireData::Add ( const TopoDS_Edge edge,
const Standard_Integer  atnum = 0 
)

 Adds an edge to a wire, being defined (not yet ended) <br>
     This is the plain, basic, function to add an edge <br>
     <num> = 0 (D): Appends at end <br>
     <num> = 1: Preprends at start <br>
     else, Insert before <num> <br>

Remark : Null Edge is simply ignored

void ShapeExtend_WireData::Add ( const TopoDS_Wire wire,
const Standard_Integer  atnum = 0 
)

 Adds an entire wire, considered as a list of edges <br>

Remark : The wire is assumed to be ordered (TopoDS_Iterator
is used)

void ShapeExtend_WireData::Add ( const Handle< ShapeExtend_WireData > &  wire,
const Standard_Integer  atnum = 0 
)

Adds a wire in the form of WireData

void ShapeExtend_WireData::Add ( const TopoDS_Shape shape,
const Standard_Integer  atnum = 0 
)

Adds an edge or a wire invoking corresponding method Add

void ShapeExtend_WireData::AddOriented ( const TopoDS_Edge edge,
const Standard_Integer  mode 
)

Adds an edge to start or end of <me>, according to <mode>
0: at end, as direct
1: at end, as reversed
2: at start, as direct
3: at start, as reversed
< 0: no adding

void ShapeExtend_WireData::AddOriented ( const TopoDS_Wire wire,
const Standard_Integer  mode 
)

Adds a wire to start or end of <me>, according to <mode>
0: at end, as direct
1: at end, as reversed
2: at start, as direct
3: at start, as reversed
< 0: no adding

void ShapeExtend_WireData::AddOriented ( const TopoDS_Shape shape,
const Standard_Integer  mode 
)

Adds an edge or a wire invoking corresponding method
AddOriented

void ShapeExtend_WireData::Clear ( )

Clears data about Wire.

void ShapeExtend_WireData::ComputeSeams ( const Standard_Boolean  enforce = Standard_True)

 Computes the list of seam edges <br>
     By default (direct call), computing is enforced <br>
     For indirect call (from IsSeam) it is redone only if not yet <br>
     already done or if the list of edges has changed <br>

Remark : A Seam Edge is an Edge present twice in the list, once as
FORWARD and once as REVERSED
Each sense has its own PCurve, the one for FORWARD
must be set in first

TopoDS_Edge ShapeExtend_WireData::Edge ( const Standard_Integer  num) const

Returns <num>th Edge

Standard_Integer ShapeExtend_WireData::Index ( const TopoDS_Edge edge)

Returns the index of the edge
If the edge is a seam the orientation is also checked
Returns 0 if the edge is not found in the list

void ShapeExtend_WireData::Init ( const Handle< ShapeExtend_WireData > &  other)

Copies data from another WireData

Standard_Boolean ShapeExtend_WireData::Init ( const TopoDS_Wire wire,
const Standard_Boolean  chained = Standard_True,
const Standard_Boolean  theManifoldMode = Standard_True 
)

 Loads an already existing wire <br>
     If <chained> is True (default), edges are added in the <br>
     sequence as they are explored by TopoDS_Iterator <br>
     Else, if <chained> is False, wire is explored by <br>
     BRepTools_WireExplorer and it is guaranteed that edges will <br>
     be sequencially connected. <br>

Remark : In the latter case it can happen that not all edges
will be found (because of limitations of
BRepTools_WireExplorer for disconnected wires and wires
with seam edges).

Standard_Boolean ShapeExtend_WireData::IsSeam ( const Standard_Integer  num)

 Tells if an Edge is seam (see ComputeSeams) <br>

An edge is considered as seam if it presents twice in
the edge list, once as FORWARD and once as REVERSED.

Standard_Boolean& ShapeExtend_WireData::ManifoldMode ( )

Returns mode defining manifold wire data or not.
If manifold that nonmanifold edges will not be not
consider during operations(previous behaviour)
and they will be added only in result wire
else non-manifold edges will consider during operations

Standard_Integer ShapeExtend_WireData::NbEdges ( ) const

Returns the count of currently recorded edges

Standard_Integer ShapeExtend_WireData::NbNonManifoldEdges ( ) const

Returns the count of currently recorded non-manifold edges

TopoDS_Edge ShapeExtend_WireData::NonmanifoldEdge ( const Standard_Integer  num) const

Returns <num>th nonmanifold Edge

Handle_TopTools_HSequenceOfShape ShapeExtend_WireData::NonmanifoldEdges ( ) const

 Returns sequence of non-manifold edges <br>
     This sequence can be not empty if wire data set in manifold mode but <br>
     initial wire has INTERNAL orientation or contains INTERNAL edges <br>


void ShapeExtend_WireData::Remove ( const Standard_Integer  num = 0)

Removes an Edge, given its rank. By default removes the last edge.

void ShapeExtend_WireData::Reverse ( )

Reverses the sense of the list and the orientation of each Edge
This method should be called when either wire has no seam edges
or face is not available

void ShapeExtend_WireData::Reverse ( const TopoDS_Face face)

Reverses the sense of the list and the orientation of each Edge
The face is necessary for swapping pcurves for seam edges
(first pcurve corresponds to orientation FORWARD, and second to
REVERSED; when edge is reversed, pcurves must be swapped)
If face is NULL, no swapping is performed

void ShapeExtend_WireData::Set ( const TopoDS_Edge edge,
const Standard_Integer  num = 0 
)

Replaces an edge at the given
rank number <num> with new one. Default is last edge (<num> = 0).

void ShapeExtend_WireData::SetDegeneratedLast ( )

 When the wire contains at least one degenerated edge, sets it <br>
     as last one <br>

Note : It is useful to process pcurves, for instance, while the pcurve
of a DGNR may not be computed from its 3D part (there is none)
it is computed after the other edges have been computed and
chained.

void ShapeExtend_WireData::SetLast ( const Standard_Integer  num)

Does a circular permutation in order to set <num>th edge last

TopoDS_Wire ShapeExtend_WireData::Wire ( ) const

 Makes TopoDS_Wire using <br>

BRep_Builder (just creates the TopoDS_Wire object and adds
all edges into it). This method should be called when
the wire is correct (for example, after successful
fixes by ShapeFix_Wire) and adjacent edges share common
vertices. In case if adjacent edges do not share the same
vertices the resulting TopoDS_Wire will be invalid.

TopoDS_Wire ShapeExtend_WireData::WireAPIMake ( ) const

 Makes TopoDS_Wire using <br>

BRepAPI_MakeWire. Class BRepAPI_MakeWire merges
geometrically coincided vertices and can disturb
correct order of edges in the wire. If this class fails,
null shape is returned.


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