Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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
 
void TraceLine (const char *const line) const
 Just prints a line into the current Trace File. This allows to better characterise the various trace outputs, as desired.
 
void TraceLines (const occ::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)
 
bool IsKind (const occ::handle< Standard_Transient > &item, const occ::handle< Standard_Type > &what) const
 
const charTypeName (const occ::handle< Standard_Transient > &item, const bool nopk=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.
 
occ::handle< Standard_TransientTraValue (const occ::handle< Standard_Transient > &list, const int num) const
 
occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > NewSeqTra () const
 
void AppendTra (const occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > &seqval, const occ::handle< Standard_Transient > &traval) const
 
const charDateString (const int yy, const int mm, const int dd, const int hh, const int mn, const int ss) const
 
void DateValues (const char *const text, int &yy, int &mm, int &dd, int &hh, int &mn, int &ss) const
 
const charToCString (const occ::handle< TCollection_HAsciiString > &strval) const
 
const charToCString (const TCollection_AsciiString &strval) const
 
occ::handle< TCollection_HAsciiStringToHString (const char *const strcon) const
 
TCollection_AsciiString ToAString (const char *const strcon) const
 
const char16_tToEString (const occ::handle< TCollection_HExtendedString > &strval) const
 
const char16_tToEString (const TCollection_ExtendedString &strval) const
 
occ::handle< TCollection_HExtendedStringToHString (const char16_t *const strcon) const
 
TCollection_ExtendedString ToXString (const char16_t *const strcon) const
 
const char16_tAsciiToExtended (const char *const str) const
 
bool IsAscii (const char16_t *const str) const
 
const charExtendedToAscii (const char16_t *const str) const
 
const charCStrValue (const occ::handle< Standard_Transient > &list, const int num) const
 
const char16_tEStrValue (const occ::handle< Standard_Transient > &list, const int num) const
 
occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > NewSeqCStr () const
 
void AppendCStr (const occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > &seqval, const char *const strval) const
 
occ::handle< NCollection_HSequence< occ::handle< TCollection_HExtendedString > > > NewSeqEStr () const
 
void AppendEStr (const occ::handle< NCollection_HSequence< occ::handle< TCollection_HExtendedString > > > &seqval, const char16_t *const strval) const
 
TopoDS_Shape CompoundFromSeq (const occ::handle< NCollection_HSequence< TopoDS_Shape > > &seqval) const
 Converts a list of Shapes to a Compound (a kind of Shape)
 
TopAbs_ShapeEnum ShapeType (const TopoDS_Shape &shape, const bool 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.
 
TopoDS_Shape SortedCompound (const TopoDS_Shape &shape, const TopAbs_ShapeEnum type, const bool explore, const bool 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>
 
TopoDS_Shape ShapeValue (const occ::handle< NCollection_HSequence< TopoDS_Shape > > &seqv, const int num) const
 
occ::handle< NCollection_HSequence< TopoDS_Shape > > NewSeqShape () const
 
void AppendShape (const occ::handle< NCollection_HSequence< TopoDS_Shape > > &seqv, const TopoDS_Shape &shape) const
 
occ::handle< Standard_TransientShapeBinder (const TopoDS_Shape &shape, const bool hs=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.
 
TopoDS_Shape BinderShape (const occ::handle< Standard_Transient > &tr) const
 From a Transient, returns a Shape. In fact, recognizes ShapeBinder ShapeMapper and HShape.
 
int SeqLength (const occ::handle< Standard_Transient > &list) const
 
occ::handle< Standard_TransientSeqToArr (const occ::handle< Standard_Transient > &seq, const int first=1) const
 
occ::handle< Standard_TransientArrToSeq (const occ::handle< Standard_Transient > &arr) const
 
int SeqIntValue (const occ::handle< NCollection_HSequence< int > > &list, const int 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 occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > & seqval,
const char *const strval ) const

◆ AppendEStr()

void XSControl_Utils::AppendEStr ( const occ::handle< NCollection_HSequence< occ::handle< TCollection_HExtendedString > > > & seqval,
const char16_t *const strval ) const

◆ AppendShape()

void XSControl_Utils::AppendShape ( const occ::handle< NCollection_HSequence< TopoDS_Shape > > & seqv,
const TopoDS_Shape & shape ) const

◆ AppendTra()

void XSControl_Utils::AppendTra ( const occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > & seqval,
const occ::handle< Standard_Transient > & traval ) const

◆ ArrToSeq()

occ::handle< Standard_Transient > XSControl_Utils::ArrToSeq ( const occ::handle< Standard_Transient > & arr) const

◆ AsciiToExtended()

const char16_t * XSControl_Utils::AsciiToExtended ( const char *const str) const

◆ BinderShape()

TopoDS_Shape XSControl_Utils::BinderShape ( const occ::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 occ::handle< NCollection_HSequence< TopoDS_Shape > > & seqval) const

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

◆ CStrValue()

const char * XSControl_Utils::CStrValue ( const occ::handle< Standard_Transient > & list,
const int num ) const

◆ DateString()

const char * XSControl_Utils::DateString ( const int yy,
const int mm,
const int dd,
const int hh,
const int mn,
const int ss ) const

◆ DateValues()

void XSControl_Utils::DateValues ( const char *const text,
int & yy,
int & mm,
int & dd,
int & hh,
int & mn,
int & ss ) const

◆ EStrValue()

const char16_t * XSControl_Utils::EStrValue ( const occ::handle< Standard_Transient > & list,
const int num ) const

◆ ExtendedToAscii()

const char * XSControl_Utils::ExtendedToAscii ( const char16_t *const str) const

◆ IsAscii()

bool XSControl_Utils::IsAscii ( const char16_t *const str) const

◆ IsKind()

bool XSControl_Utils::IsKind ( const occ::handle< Standard_Transient > & item,
const occ::handle< Standard_Type > & what ) const

◆ NewSeqCStr()

occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > XSControl_Utils::NewSeqCStr ( ) const

◆ NewSeqEStr()

occ::handle< NCollection_HSequence< occ::handle< TCollection_HExtendedString > > > XSControl_Utils::NewSeqEStr ( ) const

◆ NewSeqShape()

occ::handle< NCollection_HSequence< TopoDS_Shape > > XSControl_Utils::NewSeqShape ( ) const

◆ NewSeqTra()

occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > XSControl_Utils::NewSeqTra ( ) const

◆ SeqIntValue()

int XSControl_Utils::SeqIntValue ( const occ::handle< NCollection_HSequence< int > > & list,
const int num ) const

◆ SeqLength()

int XSControl_Utils::SeqLength ( const occ::handle< Standard_Transient > & list) const

◆ SeqToArr()

occ::handle< Standard_Transient > XSControl_Utils::SeqToArr ( const occ::handle< Standard_Transient > & seq,
const int first = 1 ) const

◆ ShapeBinder()

occ::handle< Standard_Transient > XSControl_Utils::ShapeBinder ( const TopoDS_Shape & shape,
const bool hs = 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 bool 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 occ::handle< NCollection_HSequence< TopoDS_Shape > > & seqv,
const int num ) const

◆ SortedCompound()

TopoDS_Shape XSControl_Utils::SortedCompound ( const TopoDS_Shape & shape,
const TopAbs_ShapeEnum type,
const bool explore,
const bool 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 char *const strcon) const

◆ ToCString() [1/2]

const char * XSControl_Utils::ToCString ( const occ::handle< TCollection_HAsciiString > & strval) const

◆ ToCString() [2/2]

const char * XSControl_Utils::ToCString ( const TCollection_AsciiString & strval) const

◆ ToEString() [1/2]

const char16_t * XSControl_Utils::ToEString ( const occ::handle< TCollection_HExtendedString > & strval) const

◆ ToEString() [2/2]

const char16_t * XSControl_Utils::ToEString ( const TCollection_ExtendedString & strval) const

◆ ToHString() [1/2]

occ::handle< TCollection_HAsciiString > XSControl_Utils::ToHString ( const char *const strcon) const

◆ ToHString() [2/2]

occ::handle< TCollection_HExtendedString > XSControl_Utils::ToHString ( const char16_t *const strcon) const

◆ ToXString()

TCollection_ExtendedString XSControl_Utils::ToXString ( const char16_t *const strcon) const

◆ TraceLine()

void XSControl_Utils::TraceLine ( const char *const 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 occ::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()

occ::handle< Standard_Transient > XSControl_Utils::TraValue ( const occ::handle< Standard_Transient > & list,
const int num ) const

◆ TypeName()

const char * XSControl_Utils::TypeName ( const occ::handle< Standard_Transient > & item,
const bool nopk = 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: