Open CASCADE Technology  7.5.0.beta
Public Member Functions
XSControl_Utils Class Reference

This class provides various useful utility routines, to facilitate handling of most common data structures : transients (type, type name ...), strings (ascii or extended, pointed or handled or ...), shapes (reading, writing, testing ...), sequences & arrays (of strings, of transients, of shapes ...), ... More...

#include <XSControl_Utils.hxx>

Public Member Functions

 XSControl_Utils ()
 the only use of this, is to allow a frontal to get one distinct "Utils" set per separate engine More...
 
void TraceLine (const Standard_CString line) const
 Just prints a line into the current Trace File. This allows to better characterise the various trace outputs, as desired. More...
 
void TraceLines (const Handle< Standard_Transient > &lines) const
 Just prints a line or a set of lines into the current Trace File. <lines> can be a HAscii/ExtendedString (produces a print without ending line) or a HSequence or HArray1 Of .. (one new line per item) More...
 
Standard_Boolean IsKind (const Handle< Standard_Transient > &item, const Handle< Standard_Type > &what) const
 
Standard_CString TypeName (const Handle< Standard_Transient > &item, const Standard_Boolean nopk=Standard_False) const
 Returns the name of the dynamic type of an object, i.e. : If it is a Type, its Name If it is a object not a type, the Name of its DynamicType If it is Null, an empty string If <nopk> is False (D), gives complete name If <nopk> is True, returns class name without package. More...
 
Handle< Standard_TransientTraValue (const Handle< Standard_Transient > &list, const Standard_Integer num) const
 
Handle< TColStd_HSequenceOfTransient > NewSeqTra () const
 
void AppendTra (const Handle< TColStd_HSequenceOfTransient > &seqval, const Handle< Standard_Transient > &traval) const
 
Standard_CString DateString (const Standard_Integer yy, const Standard_Integer mm, const Standard_Integer dd, const Standard_Integer hh, const Standard_Integer mn, const Standard_Integer ss) const
 
void DateValues (const Standard_CString text, Standard_Integer &yy, Standard_Integer &mm, Standard_Integer &dd, Standard_Integer &hh, Standard_Integer &mn, Standard_Integer &ss) const
 
Standard_CString ToCString (const Handle< TCollection_HAsciiString > &strval) const
 
Standard_CString ToCString (const TCollection_AsciiString &strval) const
 
Handle< TCollection_HAsciiStringToHString (const Standard_CString strcon) const
 
TCollection_AsciiString ToAString (const Standard_CString strcon) const
 
Standard_ExtString ToEString (const Handle< TCollection_HExtendedString > &strval) const
 
Standard_ExtString ToEString (const TCollection_ExtendedString &strval) const
 
Handle< TCollection_HExtendedStringToHString (const Standard_ExtString strcon) const
 
TCollection_ExtendedString ToXString (const Standard_ExtString strcon) const
 
Standard_ExtString AsciiToExtended (const Standard_CString str) const
 
Standard_Boolean IsAscii (const Standard_ExtString str) const
 
Standard_CString ExtendedToAscii (const Standard_ExtString str) const
 
Standard_CString CStrValue (const Handle< Standard_Transient > &list, const Standard_Integer num) const
 
Standard_ExtString EStrValue (const Handle< Standard_Transient > &list, const Standard_Integer num) const
 
Handle< TColStd_HSequenceOfHAsciiString > NewSeqCStr () const
 
void AppendCStr (const Handle< TColStd_HSequenceOfHAsciiString > &seqval, const Standard_CString strval) const
 
Handle< TColStd_HSequenceOfHExtendedString > NewSeqEStr () const
 
void AppendEStr (const Handle< TColStd_HSequenceOfHExtendedString > &seqval, const Standard_ExtString strval) const
 
TopoDS_Shape CompoundFromSeq (const Handle< TopTools_HSequenceOfShape > &seqval) const
 Converts a list of Shapes to a Compound (a kind of Shape) More...
 
TopAbs_ShapeEnum ShapeType (const TopoDS_Shape &shape, const Standard_Boolean compound) const
 Returns the type of a Shape : true type if <compound> is False If <compound> is True and <shape> is a Compound, iterates on its items. If all are of the same type, returns this type. Else, returns COMPOUND. If it is empty, returns SHAPE For a Null Shape, returns SHAPE. More...
 
TopoDS_Shape SortedCompound (const TopoDS_Shape &shape, const TopAbs_ShapeEnum type, const Standard_Boolean explore, const Standard_Boolean compound) const
 From a Shape, builds a Compound as follows : explores it level by level If <explore> is False, only COMPOUND items. Else, all items Adds to the result, shapes which comply to <type> More...
 
TopoDS_Shape ShapeValue (const Handle< TopTools_HSequenceOfShape > &seqv, const Standard_Integer num) const
 
Handle< TopTools_HSequenceOfShape > NewSeqShape () const
 
void AppendShape (const Handle< TopTools_HSequenceOfShape > &seqv, const TopoDS_Shape &shape) const
 
Handle< Standard_TransientShapeBinder (const TopoDS_Shape &shape, const Standard_Boolean hs=Standard_True) const
 Creates a Transient Object from a Shape : it is either a Binder (used by functions which require a Transient but can process a Shape, such as viewing functions) or a HShape (according to hs) Default is a HShape. More...
 
TopoDS_Shape BinderShape (const Handle< Standard_Transient > &tr) const
 From a Transient, returns a Shape. In fact, recognizes ShapeBinder ShapeMapper and HShape. More...
 
Standard_Integer SeqLength (const Handle< Standard_Transient > &list) const
 
Handle< Standard_TransientSeqToArr (const Handle< Standard_Transient > &seq, const Standard_Integer first=1) const
 
Handle< Standard_TransientArrToSeq (const Handle< Standard_Transient > &arr) const
 
Standard_Integer SeqIntValue (const Handle< TColStd_HSequenceOfInteger > &list, const Standard_Integer num) const
 

Detailed Description

This class provides various useful utility routines, to facilitate handling of most common data structures : transients (type, type name ...), strings (ascii or extended, pointed or handled or ...), shapes (reading, writing, testing ...), sequences & arrays (of strings, of transients, of shapes ...), ...

Also it gives some helps on some data structures from XSTEP, such as printing on standard trace file, recignizing most currently used auxiliary types (Binder,Mapper ...)

Constructor & Destructor Documentation

◆ XSControl_Utils()

XSControl_Utils::XSControl_Utils ( )

the only use of this, is to allow a frontal to get one distinct "Utils" set per separate engine

Member Function Documentation

◆ AppendCStr()

void XSControl_Utils::AppendCStr ( const Handle< TColStd_HSequenceOfHAsciiString > &  seqval,
const Standard_CString  strval 
) const

◆ AppendEStr()

void XSControl_Utils::AppendEStr ( const Handle< TColStd_HSequenceOfHExtendedString > &  seqval,
const Standard_ExtString  strval 
) const

◆ AppendShape()

void XSControl_Utils::AppendShape ( const Handle< TopTools_HSequenceOfShape > &  seqv,
const TopoDS_Shape shape 
) const

◆ AppendTra()

void XSControl_Utils::AppendTra ( const Handle< TColStd_HSequenceOfTransient > &  seqval,
const Handle< Standard_Transient > &  traval 
) const

◆ ArrToSeq()

Handle< Standard_Transient > XSControl_Utils::ArrToSeq ( const Handle< Standard_Transient > &  arr) const

◆ AsciiToExtended()

Standard_ExtString XSControl_Utils::AsciiToExtended ( const Standard_CString  str) const

◆ BinderShape()

TopoDS_Shape XSControl_Utils::BinderShape ( const Handle< Standard_Transient > &  tr) const

From a Transient, returns a Shape. In fact, recognizes ShapeBinder ShapeMapper and HShape.

◆ CompoundFromSeq()

TopoDS_Shape XSControl_Utils::CompoundFromSeq ( const Handle< TopTools_HSequenceOfShape > &  seqval) const

Converts a list of Shapes to a Compound (a kind of Shape)

◆ CStrValue()

Standard_CString XSControl_Utils::CStrValue ( const Handle< Standard_Transient > &  list,
const Standard_Integer  num 
) const

◆ DateString()

Standard_CString XSControl_Utils::DateString ( const Standard_Integer  yy,
const Standard_Integer  mm,
const Standard_Integer  dd,
const Standard_Integer  hh,
const Standard_Integer  mn,
const Standard_Integer  ss 
) const

◆ DateValues()

void XSControl_Utils::DateValues ( const Standard_CString  text,
Standard_Integer yy,
Standard_Integer mm,
Standard_Integer dd,
Standard_Integer hh,
Standard_Integer mn,
Standard_Integer ss 
) const

◆ EStrValue()

Standard_ExtString XSControl_Utils::EStrValue ( const Handle< Standard_Transient > &  list,
const Standard_Integer  num 
) const

◆ ExtendedToAscii()

Standard_CString XSControl_Utils::ExtendedToAscii ( const Standard_ExtString  str) const

◆ IsAscii()

Standard_Boolean XSControl_Utils::IsAscii ( const Standard_ExtString  str) const

◆ IsKind()

Standard_Boolean XSControl_Utils::IsKind ( const Handle< Standard_Transient > &  item,
const Handle< Standard_Type > &  what 
) const

◆ NewSeqCStr()

Handle< TColStd_HSequenceOfHAsciiString > XSControl_Utils::NewSeqCStr ( ) const

◆ NewSeqEStr()

Handle< TColStd_HSequenceOfHExtendedString > XSControl_Utils::NewSeqEStr ( ) const

◆ NewSeqShape()

Handle< TopTools_HSequenceOfShape > XSControl_Utils::NewSeqShape ( ) const

◆ NewSeqTra()

Handle< TColStd_HSequenceOfTransient > XSControl_Utils::NewSeqTra ( ) const

◆ SeqIntValue()

Standard_Integer XSControl_Utils::SeqIntValue ( const Handle< TColStd_HSequenceOfInteger > &  list,
const Standard_Integer  num 
) const

◆ SeqLength()

Standard_Integer XSControl_Utils::SeqLength ( const Handle< Standard_Transient > &  list) const

◆ SeqToArr()

Handle< Standard_Transient > XSControl_Utils::SeqToArr ( const Handle< Standard_Transient > &  seq,
const Standard_Integer  first = 1 
) const

◆ ShapeBinder()

Handle< Standard_Transient > XSControl_Utils::ShapeBinder ( const TopoDS_Shape shape,
const Standard_Boolean  hs = Standard_True 
) const

Creates a Transient Object from a Shape : it is either a Binder (used by functions which require a Transient but can process a Shape, such as viewing functions) or a HShape (according to hs) Default is a HShape.

◆ ShapeType()

TopAbs_ShapeEnum XSControl_Utils::ShapeType ( const TopoDS_Shape shape,
const Standard_Boolean  compound 
) const

Returns the type of a Shape : true type if <compound> is False If <compound> is True and <shape> is a Compound, iterates on its items. If all are of the same type, returns this type. Else, returns COMPOUND. If it is empty, returns SHAPE For a Null Shape, returns SHAPE.

◆ ShapeValue()

TopoDS_Shape XSControl_Utils::ShapeValue ( const Handle< TopTools_HSequenceOfShape > &  seqv,
const Standard_Integer  num 
) const

◆ SortedCompound()

TopoDS_Shape XSControl_Utils::SortedCompound ( const TopoDS_Shape shape,
const TopAbs_ShapeEnum  type,
const Standard_Boolean  explore,
const Standard_Boolean  compound 
) const

From a Shape, builds a Compound as follows : explores it level by level If <explore> is False, only COMPOUND items. Else, all items Adds to the result, shapes which comply to <type>

  • if <type> is WIRE, considers free edges (and makes wires)
  • if <type> is SHELL, considers free faces (and makes shells) If <compound> is True, gathers items in compounds which correspond to starting COMPOUND,SOLID or SHELL containers, or items directly contained in a Compound

◆ ToAString()

TCollection_AsciiString XSControl_Utils::ToAString ( const Standard_CString  strcon) const

◆ ToCString() [1/2]

Standard_CString XSControl_Utils::ToCString ( const Handle< TCollection_HAsciiString > &  strval) const

◆ ToCString() [2/2]

Standard_CString XSControl_Utils::ToCString ( const TCollection_AsciiString strval) const

◆ ToEString() [1/2]

Standard_ExtString XSControl_Utils::ToEString ( const Handle< TCollection_HExtendedString > &  strval) const

◆ ToEString() [2/2]

Standard_ExtString XSControl_Utils::ToEString ( const TCollection_ExtendedString strval) const

◆ ToHString() [1/2]

Handle< TCollection_HAsciiString > XSControl_Utils::ToHString ( const Standard_CString  strcon) const

◆ ToHString() [2/2]

Handle< TCollection_HExtendedString > XSControl_Utils::ToHString ( const Standard_ExtString  strcon) const

◆ ToXString()

TCollection_ExtendedString XSControl_Utils::ToXString ( const Standard_ExtString  strcon) const

◆ TraceLine()

void XSControl_Utils::TraceLine ( const Standard_CString  line) const

Just prints a line into the current Trace File. This allows to better characterise the various trace outputs, as desired.

◆ TraceLines()

void XSControl_Utils::TraceLines ( const Handle< Standard_Transient > &  lines) const

Just prints a line or a set of lines into the current Trace File. <lines> can be a HAscii/ExtendedString (produces a print without ending line) or a HSequence or HArray1 Of .. (one new line per item)

◆ TraValue()

Handle< Standard_Transient > XSControl_Utils::TraValue ( const Handle< Standard_Transient > &  list,
const Standard_Integer  num 
) const

◆ TypeName()

Standard_CString XSControl_Utils::TypeName ( const Handle< Standard_Transient > &  item,
const Standard_Boolean  nopk = Standard_False 
) const

Returns the name of the dynamic type of an object, i.e. : If it is a Type, its Name If it is a object not a type, the Name of its DynamicType If it is Null, an empty string If <nopk> is False (D), gives complete name If <nopk> is True, returns class name without package.


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