// This file is generated by WOK (CPPExt). // Please do not edit this file; modify original file instead. // The copyright and license terms as defined for the original file apply to // this header file considered to be the "object code" form of the original source. #ifndef _ShapeAnalysis_WireOrder_HeaderFile #define _ShapeAnalysis_WireOrder_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_Macro_HeaderFile #include #endif #ifndef _Standard_Boolean_HeaderFile #include #endif #ifndef _Handle_TColStd_HArray1OfInteger_HeaderFile #include #endif #ifndef _Handle_TColgp_HSequenceOfXYZ_HeaderFile #include #endif #ifndef _Standard_Real_HeaderFile #include #endif #ifndef _Standard_Integer_HeaderFile #include #endif class TColStd_HArray1OfInteger; class TColgp_HSequenceOfXYZ; class Standard_TypeMismatch; class gp_XYZ; class gp_XY; //! 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
class ShapeAnalysis_WireOrder { public: void* operator new(size_t,void* anAddress) { return anAddress; } void* operator new(size_t size) { return Standard::Allocate(size); } void operator delete(void *anAddress) { if (anAddress) Standard::Free((Standard_Address&)anAddress); } //! Empty constructor
Standard_EXPORT ShapeAnalysis_WireOrder(); //! Creates a WireOrder in 3D (if mode3d is True) or 2D (if False)
//! with a tolerance
Standard_EXPORT ShapeAnalysis_WireOrder(const Standard_Boolean mode3d,const Standard_Real tol); //! Sets new values. Clears the connexion list
//! If changes, also clears the edge list (else, doesnt)
Standard_EXPORT void SetMode(const Standard_Boolean mode3d,const Standard_Real tol) ; //! Returns the working tolerance
Standard_EXPORT Standard_Real Tolerance() const; //! Clears the list of edges, but not mode and tol
Standard_EXPORT void Clear() ; //! Adds a couple of points 3D (start,end)
Standard_EXPORT void Add(const gp_XYZ& start3d,const gp_XYZ& end3d) ; //! Adds a couple of points 2D (start,end)
Standard_EXPORT void Add(const gp_XY& start2d,const gp_XY& end2d) ; //! Returns the count of added couples of points (one per edges)
Standard_EXPORT Standard_Integer NbEdges() const; //! If this mode is True method perform does not sort edges of
//! different loops. The resulting order is first loop, second
//! one etc...
Standard_EXPORT Standard_Boolean& KeepLoopsMode() ; //! Computes the better order
//! If 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
//! Else, the smallest distance is reached
//! Gap corresponds to a smallest distance greater than
Standard_EXPORT void Perform(const Standard_Boolean closed = Standard_True) ; //! Tells if Perform has been done
//! Else, the following methods returns original values
Standard_EXPORT Standard_Boolean IsDone() 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
Standard_EXPORT Standard_Integer Status() const; //! Returns the number of original edge which correspond to the
//! newly ordered number
//! Warning : the returned value is NEGATIVE if edge should be reversed
Standard_EXPORT Standard_Integer Ordered(const Standard_Integer n) const; //! Returns the values of the couple , as 3D values
Standard_EXPORT void XYZ(const Standard_Integer num,gp_XYZ& start3d,gp_XYZ& end3d) const; //! Returns the values of the couple , as 2D values
Standard_EXPORT void XY(const Standard_Integer num,gp_XY& start2d,gp_XY& end2d) const; //! Returns the gap between a couple and its preceeding
//! is considered ordered
//! If = 0 (D), returns the greatest gap found
Standard_EXPORT Standard_Real Gap(const Standard_Integer num = 0) const; //! Determines the chains inside which successive edges have a gap
//! less than a given value. Queried by NbChains and Chain
Standard_EXPORT void SetChains(const Standard_Real gap) ; //! Returns the count of computed chains
Standard_EXPORT Standard_Integer NbChains() const; //! Returns, for the chain n0 num, starting and ending numbers of
//! edges. In the list of ordered edges (see Ordered for originals)
Standard_EXPORT void Chain(const Standard_Integer num,Standard_Integer& n1,Standard_Integer& n2) const; //! Determines the couples of edges for which end and start fit
//! inside a given gap. Queried by NbCouples and Couple
Standard_EXPORT void SetCouples(const Standard_Real gap) ; //! Returns the count of computed couples
Standard_EXPORT Standard_Integer NbCouples() const; //! Returns, for the couple n0 num, the two implied edges
//! In the list of ordered edges
Standard_EXPORT void Couple(const Standard_Integer num,Standard_Integer& n1,Standard_Integer& n2) const; protected: private: Standard_Boolean myKeepLoops; Handle_TColStd_HArray1OfInteger myOrd; Handle_TColStd_HArray1OfInteger myChains; Handle_TColStd_HArray1OfInteger myCouples; Handle_TColgp_HSequenceOfXYZ myXYZ; Standard_Real myTol; Standard_Real myGap; Standard_Integer myStat; Standard_Boolean myMode; }; // other Inline functions and methods (like "C++: function call" methods) #endif