Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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.
 
 ShapeAnalysis_WireOrder (const bool theMode3D, const double theTolerance, const bool theModeBoth=false)
 Creates a WireOrder. Flag <theMode3D> defines 3D or 2d mode. Flag <theModeBoth> defines miscible mode and the flag <theMode3D> is ignored. Warning: Parameter <theTolerance> is not used in algorithm.
 
void SetMode (const bool theMode3D, const double theTolerance, const bool theModeBoth=false)
 Sets new values. Clears the edge list if the mode (<theMode3D> or <theModeBoth> ) changes. Clears the connexion list. Warning: Parameter <theTolerance> is not used in algorithm.
 
double Tolerance () const
 Returns the working tolerance.
 
void Clear ()
 Clears the list of edges, but not mode and tol.
 
void Add (const gp_XYZ &theStart3d, const gp_XYZ &theEnd3d)
 Adds a couple of points 3D (start, end)
 
void Add (const gp_XY &theStart2d, const gp_XY &theEnd2d)
 Adds a couple of points 2D (start, end)
 
void Add (const gp_XYZ &theStart3d, const gp_XYZ &theEnd3d, const gp_XY &theStart2d, const gp_XY &theEnd2d)
 Adds a couple of points 3D and 2D (start, end)
 
int NbEdges () const
 Returns the count of added couples of points (one per edges)
 
boolKeepLoopsMode ()
 If this mode is True method perform does not sort edges of different loops. The resulting order is first loop, second one etc...
 
void Perform (const bool closed=true)
 Computes the better order 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 Warning: Parameter <closed> not used.
 
bool IsDone () const
 Tells if Perform has been done Else, the following methods returns original values.
 
int 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 -1 : some edges are reversed, but no gap remain 3 : edges in sequence are just shifted in forward or reverse manner.
 
int Ordered (const int theIdx) 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.
 
void XYZ (const int theIdx, gp_XYZ &theStart3D, gp_XYZ &theEnd3D) const
 Returns the values of the couple <num>, as 3D values.
 
void XY (const int theIdx, gp_XY &theStart2D, gp_XY &theEnd2D) const
 Returns the values of the couple <num>, as 2D values.
 
double Gap (const int num=0) const
 Returns the gap between a couple and its preceding <num> is considered ordered If <num> = 0 (D), returns the greatest gap found.
 
void SetChains (const double gap)
 Determines the chains inside which successive edges have a gap less than a given value. Queried by NbChains and Chain.
 
int NbChains () const
 Returns the count of computed chains.
 
void Chain (const int num, int &n1, int &n2) const
 Returns, for the chain n0 num, starting and ending numbers of edges. In the list of ordered edges (see Ordered for originals)
 
void SetCouples (const double gap)
 Determines the couples of edges for which end and start fit inside a given gap. Queried by NbCouples and Couple Warning: function isn't implemented.
 
int NbCouples () const
 Returns the count of computed couples.
 
void Couple (const int num, int &n1, int &n2) const
 Returns, for the couple n0 num, the two implied edges In the list of ordered edges.
 

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, or miscible mode The tolerance for each mode is fixed

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 bool theMode3D,
const double theTolerance,
const bool theModeBoth = false )

Creates a WireOrder. Flag <theMode3D> defines 3D or 2d mode. Flag <theModeBoth> defines miscible mode and the flag <theMode3D> is ignored. Warning: Parameter <theTolerance> is not used in algorithm.

Member Function Documentation

◆ Add() [1/3]

void ShapeAnalysis_WireOrder::Add ( const gp_XY & theStart2d,
const gp_XY & theEnd2d )

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

◆ Add() [2/3]

void ShapeAnalysis_WireOrder::Add ( const gp_XYZ & theStart3d,
const gp_XYZ & theEnd3d )

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

◆ Add() [3/3]

void ShapeAnalysis_WireOrder::Add ( const gp_XYZ & theStart3d,
const gp_XYZ & theEnd3d,
const gp_XY & theStart2d,
const gp_XY & theEnd2d )

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

◆ Chain()

void ShapeAnalysis_WireOrder::Chain ( const int num,
int & n1,
int & 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 int num,
int & n1,
int & n2 ) const

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

◆ Gap()

double ShapeAnalysis_WireOrder::Gap ( const int num = 0) const

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

◆ IsDone()

bool ShapeAnalysis_WireOrder::IsDone ( ) const

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

◆ KeepLoopsMode()

bool & 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()

int ShapeAnalysis_WireOrder::NbChains ( ) const

Returns the count of computed chains.

◆ NbCouples()

int ShapeAnalysis_WireOrder::NbCouples ( ) const

Returns the count of computed couples.

◆ NbEdges()

int ShapeAnalysis_WireOrder::NbEdges ( ) const

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

◆ Ordered()

int ShapeAnalysis_WireOrder::Ordered ( const int theIdx) 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 bool closed = true)

Computes the better order 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 Warning: Parameter <closed> not used.

◆ SetChains()

void ShapeAnalysis_WireOrder::SetChains ( const double 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 double gap)

Determines the couples of edges for which end and start fit inside a given gap. Queried by NbCouples and Couple Warning: function isn't implemented.

◆ SetMode()

void ShapeAnalysis_WireOrder::SetMode ( const bool theMode3D,
const double theTolerance,
const bool theModeBoth = false )

Sets new values. Clears the edge list if the mode (<theMode3D> or <theModeBoth> ) changes. Clears the connexion list. Warning: Parameter <theTolerance> is not used in algorithm.

◆ Status()

int 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 -1 : some edges are reversed, but no gap remain 3 : edges in sequence are just shifted in forward or reverse manner.

◆ Tolerance()

double ShapeAnalysis_WireOrder::Tolerance ( ) const

Returns the working tolerance.

◆ XY()

void ShapeAnalysis_WireOrder::XY ( const int theIdx,
gp_XY & theStart2D,
gp_XY & theEnd2D ) const

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

◆ XYZ()

void ShapeAnalysis_WireOrder::XYZ ( const int theIdx,
gp_XYZ & theStart3D,
gp_XYZ & theEnd3D ) const

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


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