Open CASCADE Technology  7.5.0
Public Member Functions

ShapeAnalysis_WireOrder Class Reference

This class is intended to control and, if possible, redefine the order of a list of edges which define a wire Edges are not given directly, but as their bounds (start,end) More...

#include <ShapeAnalysis_WireOrder.hxx>

Public Member Functions

 ShapeAnalysis_WireOrder ()
 Empty constructor. More...
 
 ShapeAnalysis_WireOrder (const Standard_Boolean mode3d, const Standard_Real tol)
 Creates a WireOrder in 3D (if mode3d is True) or 2D (if False) with a tolerance. More...
 
void SetMode (const Standard_Boolean mode3d, const Standard_Real tol)
 Sets new values. Clears the connexion list If <mode3d> changes, also clears the edge list (else, doesnt) More...
 
Standard_Real Tolerance () const
 Returns the working tolerance. More...
 
void Clear ()
 Clears the list of edges, but not mode and tol. More...
 
void Add (const gp_XYZ &start3d, const gp_XYZ &end3d)
 Adds a couple of points 3D (start,end) More...
 
void Add (const gp_XY &start2d, const gp_XY &end2d)
 Adds a couple of points 2D (start,end) More...
 
Standard_Integer NbEdges () const
 Returns the count of added couples of points (one per edges) More...
 
Standard_BooleanKeepLoopsMode ()
 If this mode is True method perform does not sort edges of different loops. The resulting order is first loop, second one etc... More...
 
void Perform (const Standard_Boolean closed=Standard_True)
 Computes the better order If <closed> is True (D) considers also closure Optimised if the couples were already in order The criterium is : two couples in order if distance between end-prec and start-cur is less then starting tolerance <tol> Else, the smallest distance is reached Gap corresponds to a smallest distance greater than <tol> More...
 
Standard_Boolean IsDone () const
 Tells if Perform has been done Else, the following methods returns original values. More...
 
Standard_Integer Status () const
 Returns the status of the order (0 if not done) : 0 : all edges are direct and in sequence 1 : all edges are direct but some are not in sequence 2 : in addition, unresolved gaps remain -1 : some edges are reversed, but no gap remain -2 : some edges are reversed and some gaps remain -10 : COULD NOT BE RESOLVED, Failure on Reorder gap : regarding starting <tol> More...
 
Standard_Integer Ordered (const Standard_Integer n) const
 Returns the number of original edge which correspond to the newly ordered number <n> Warning : the returned value is NEGATIVE if edge should be reversed. More...
 
void XYZ (const Standard_Integer num, gp_XYZ &start3d, gp_XYZ &end3d) const
 Returns the values of the couple <num>, as 3D values. More...
 
void XY (const Standard_Integer num, gp_XY &start2d, gp_XY &end2d) const
 Returns the values of the couple <num>, as 2D values. More...
 
Standard_Real Gap (const Standard_Integer num=0) const
 Returns the gap between a couple and its preceeding <num> is considered ordered If <num> = 0 (D), returns the greatest gap found. More...
 
void SetChains (const Standard_Real gap)
 Determines the chains inside which successive edges have a gap less than a given value. Queried by NbChains and Chain. More...
 
Standard_Integer NbChains () const
 Returns the count of computed chains. More...
 
void Chain (const Standard_Integer num, Standard_Integer &n1, Standard_Integer &n2) const
 Returns, for the chain n0 num, starting and ending numbers of edges. In the list of ordered edges (see Ordered for originals) More...
 
void SetCouples (const Standard_Real gap)
 Determines the couples of edges for which end and start fit inside a given gap. Queried by NbCouples and Couple. More...
 
Standard_Integer NbCouples () const
 Returns the count of computed couples. More...
 
void Couple (const Standard_Integer num, Standard_Integer &n1, Standard_Integer &n2) const
 Returns, for the couple n0 num, the two implied edges In the list of ordered edges. More...
 

Detailed Description

This class is intended to control and, if possible, redefine the order of a list of edges which define a wire Edges are not given directly, but as their bounds (start,end)

This allows to use this tool, either on existing wire, or on data just taken from a file (coordinates are easy to get)

It can work, either in 2D, or in 3D, but not miscible Warning about tolerance : according to the mode (2D/3D), it must be given as 2D or 3D (i.e. metric) tolerance, uniform on the whole list

Two phases : firstly add the couples (start,end) secondly perform then get the result

Constructor & Destructor Documentation

◆ ShapeAnalysis_WireOrder() [1/2]

ShapeAnalysis_WireOrder::ShapeAnalysis_WireOrder ( )

Empty constructor.

◆ ShapeAnalysis_WireOrder() [2/2]

ShapeAnalysis_WireOrder::ShapeAnalysis_WireOrder ( const Standard_Boolean  mode3d,
const Standard_Real  tol 
)

Creates a WireOrder in 3D (if mode3d is True) or 2D (if False) with a tolerance.

Member Function Documentation

◆ Add() [1/2]

void ShapeAnalysis_WireOrder::Add ( const gp_XYZ start3d,
const gp_XYZ end3d 
)

Adds a couple of points 3D (start,end)

◆ Add() [2/2]

void ShapeAnalysis_WireOrder::Add ( const gp_XY start2d,
const gp_XY end2d 
)

Adds a couple of points 2D (start,end)

◆ Chain()

void ShapeAnalysis_WireOrder::Chain ( const Standard_Integer  num,
Standard_Integer n1,
Standard_Integer n2 
) const

Returns, for the chain n0 num, starting and ending numbers of edges. In the list of ordered edges (see Ordered for originals)

◆ Clear()

void ShapeAnalysis_WireOrder::Clear ( )

Clears the list of edges, but not mode and tol.

◆ Couple()

void ShapeAnalysis_WireOrder::Couple ( const Standard_Integer  num,
Standard_Integer n1,
Standard_Integer n2 
) const

Returns, for the couple n0 num, the two implied edges In the list of ordered edges.

◆ Gap()

Standard_Real ShapeAnalysis_WireOrder::Gap ( const Standard_Integer  num = 0) const

Returns the gap between a couple and its preceeding <num> is considered ordered If <num> = 0 (D), returns the greatest gap found.

◆ IsDone()

Standard_Boolean ShapeAnalysis_WireOrder::IsDone ( ) const

Tells if Perform has been done Else, the following methods returns original values.

◆ KeepLoopsMode()

Standard_Boolean& ShapeAnalysis_WireOrder::KeepLoopsMode ( )

If this mode is True method perform does not sort edges of different loops. The resulting order is first loop, second one etc...

◆ NbChains()

Standard_Integer ShapeAnalysis_WireOrder::NbChains ( ) const

Returns the count of computed chains.

◆ NbCouples()

Standard_Integer ShapeAnalysis_WireOrder::NbCouples ( ) const

Returns the count of computed couples.

◆ NbEdges()

Standard_Integer ShapeAnalysis_WireOrder::NbEdges ( ) const

Returns the count of added couples of points (one per edges)

◆ Ordered()

Standard_Integer ShapeAnalysis_WireOrder::Ordered ( const Standard_Integer  n) const

Returns the number of original edge which correspond to the newly ordered number <n> Warning : the returned value is NEGATIVE if edge should be reversed.

◆ Perform()

void ShapeAnalysis_WireOrder::Perform ( const Standard_Boolean  closed = Standard_True)

Computes the better order If <closed> is True (D) considers also closure Optimised if the couples were already in order The criterium is : two couples in order if distance between end-prec and start-cur is less then starting tolerance <tol> Else, the smallest distance is reached Gap corresponds to a smallest distance greater than <tol>

◆ SetChains()

void ShapeAnalysis_WireOrder::SetChains ( const Standard_Real  gap)

Determines the chains inside which successive edges have a gap less than a given value. Queried by NbChains and Chain.

◆ SetCouples()

void ShapeAnalysis_WireOrder::SetCouples ( const Standard_Real  gap)

Determines the couples of edges for which end and start fit inside a given gap. Queried by NbCouples and Couple.

◆ SetMode()

void ShapeAnalysis_WireOrder::SetMode ( const Standard_Boolean  mode3d,
const Standard_Real  tol 
)

Sets new values. Clears the connexion list If <mode3d> changes, also clears the edge list (else, doesnt)

◆ Status()

Standard_Integer ShapeAnalysis_WireOrder::Status ( ) const

Returns the status of the order (0 if not done) : 0 : all edges are direct and in sequence 1 : all edges are direct but some are not in sequence 2 : in addition, unresolved gaps remain -1 : some edges are reversed, but no gap remain -2 : some edges are reversed and some gaps remain -10 : COULD NOT BE RESOLVED, Failure on Reorder gap : regarding starting <tol>

◆ Tolerance()

Standard_Real ShapeAnalysis_WireOrder::Tolerance ( ) const

Returns the working tolerance.

◆ XY()

void ShapeAnalysis_WireOrder::XY ( const Standard_Integer  num,
gp_XY start2d,
gp_XY end2d 
) const

Returns the values of the couple <num>, as 2D values.

◆ XYZ()

void ShapeAnalysis_WireOrder::XYZ ( const Standard_Integer  num,
gp_XYZ start3d,
gp_XYZ end3d 
) const

Returns the values of the couple <num>, as 3D values.


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