![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
This class is intended to record data attached to a case to be exploited. Cases can be : More...
#include <MoniTool_CaseData.hxx>

Public Member Functions | |
| MoniTool_CaseData (const char *const caseid="", const char *const name="") | |
| Creates a CaseData with a CaseId and a Name (by default not defined) | |
| void | SetCaseId (const char *const caseid) |
| Sets a CaseId. | |
| void | SetName (const char *const name) |
| Sets a Name. | |
| const char * | CaseId () const |
| Returns the CaseId. | |
| const char * | Name () const |
| Returns the Name. | |
| bool | IsCheck () const |
| Tells if <me> is Check (Warning or Fail), else it is Info. | |
| bool | IsWarning () const |
| Tells if <me> is Warning. | |
| bool | IsFail () const |
| Tells if <me> is Fail. | |
| void | ResetCheck () |
| Resets Check Status, i.e. sets <me> as Info. | |
| void | SetWarning () |
| Sets <me> as Warning. | |
| void | SetFail () |
| Sets <me> as Fail. | |
| void | SetChange () |
| Sets the next Add... not to add but to change the data item designated by its name. If next Add... is not called with a name, SetChange is ignored Reset by next Add... , whatever <num> is correct or not. | |
| void | SetReplace (const int num) |
| Sets the next Add... not to add but to replace the data item <num>, if <num> is between 1 and NbData. Reset by next Add... , whatever <num> is correct or not. | |
| void | AddData (const occ::handle< Standard_Transient > &val, const int kind, const char *const name="") |
| Unitary adding a data; rather internal. | |
| void | AddRaised (const Standard_Failure &theException, const char *const name="") |
| Adds the currently caught exception. | |
| void | AddShape (const TopoDS_Shape &sh, const char *const name="") |
| Adds a Shape (recorded as a HShape) | |
| void | AddXYZ (const gp_XYZ &aXYZ, const char *const name="") |
| Adds a XYZ. | |
| void | AddXY (const gp_XY &aXY, const char *const name="") |
| Adds a XY. | |
| void | AddReal (const double val, const char *const name="") |
| Adds a Real. | |
| void | AddReals (const double v1, const double v2, const char *const name="") |
| Adds two reals (for instance, two parameters) | |
| void | AddCPU (const double lastCPU, const double curCPU=0, const char *const name="") |
| Adds the CPU time between lastCPU and now if <curCPU> is given, the CPU amount is curCPU-lastCPU else it is currently measured CPU - lastCPU lastCPU has been read by call to GetCPU See GetCPU to get amount, and LargeCPU to test large amount. | |
| double | GetCPU () const |
| Returns the current amount of CPU This allows to laterly test and record CPU amount Its value has to be given to LargeCPU and AddCPU. | |
| bool | LargeCPU (const double maxCPU, const double lastCPU, const double curCPU=0) const |
| Tells if a CPU time amount is large <maxCPU> gives the amount over which an amount is large <lastCPU> gives the start CPU amount if <curCPU> is given, the tested CPU amount is curCPU-lastCPU else it is currently measured CPU - lastCPU. | |
| void | AddGeom (const occ::handle< Standard_Transient > &geom, const char *const name="") |
| Adds a Geometric as a Transient (Curve, Surface ...) | |
| void | AddEntity (const occ::handle< Standard_Transient > &ent, const char *const name="") |
| Adds a Transient, as an Entity from an InterfaceModel for instance : it will then be printed with the help of a DBPE. | |
| void | AddText (const char *const text, const char *const name="") |
| Adds a Text (as HAsciiString) | |
| void | AddInteger (const int val, const char *const name="") |
| Adds an Integer. | |
| void | AddAny (const occ::handle< Standard_Transient > &val, const char *const name="") |
| Adds a Transient, with no more meaning. | |
| void | RemoveData (const int num) |
| Removes a Data from its rank. Does nothing if out of range. | |
| int | NbData () const |
| Returns the count of data recorded to a set. | |
| occ::handle< Standard_Transient > | Data (const int nd) const |
| Returns a data item (n0 <nd> in the set <num>) | |
| bool | GetData (const int nd, const occ::handle< Standard_Type > &type, occ::handle< Standard_Transient > &val) const |
| Returns a data item, under control of a Type If the data item is kind of this type, it is returned in <val> and the returned value is True Else, <val> is unchanged and the returned value is False. | |
| int | Kind (const int nd) const |
| Returns the kind of a data : KIND TYPE MEANING 0 ANY any (not one of the following) 1 EX raised exception 2 EN entity 3 G geom 4 SH shape 5 XYZ XYZ 6 XY or UV XY 7 RR 2 reals 8 R 1 real 9 CPU CPU (1 real) 10 T text 11 I integer. | |
| const TCollection_AsciiString & | Name (const int nd) const |
| Returns the name of a data. If it has no name, the string is empty (length = 0) | |
| int | NameNum (const char *const name) const |
| Returns the first suitable data rank for a given name Exact matching (exact case, no completion) is required Firstly checks the recorded names If not found, considers the name as follows : Name = "TYPE" : search for the first item with this TYPE Name = "TYPE:nn" : search for the nn.th item with this TYPE See allowed values in method Kind. | |
| TopoDS_Shape | Shape (const int nd) const |
| Returns a data as a shape, Null if not a shape. | |
| bool | XYZ (const int nd, gp_XYZ &val) const |
| Returns a data as a XYZ (i.e. Geom_CartesianPoint) Returns False if not the good type. | |
| bool | XY (const int nd, gp_XY &val) const |
| Returns a data as a XY (i.e. Geom2d_CartesianPoint) Returns False if not the good type. | |
| bool | Reals (const int nd, double &v1, double &v2) const |
| Returns a couple of reals (stored in Geom2d_CartesianPoint) | |
| bool | Real (const int nd, double &val) const |
| Returns a real or CPU amount (stored in Geom2d_CartesianPoint) (allows an Integer converted to a Real) | |
| bool | Text (const int nd, const char *&text) const |
| Returns a text (stored in TCollection_HAsciiString) | |
| bool | Integer (const int nd, int &val) const |
| Returns an Integer. | |
| Message_Msg | Msg () const |
| Returns a Msg from a CaseData : it is build from DefMsg, which gives the message code plus the designation of items of the CaseData to be added to the Msg Empty if no message attached. | |
Public Member Functions inherited from Standard_Transient | |
| Standard_Transient () | |
| Empty constructor. | |
| Standard_Transient (const Standard_Transient &) | |
| Copy constructor – does nothing. | |
| Standard_Transient & | operator= (const Standard_Transient &) |
| Assignment operator, needed to avoid copying reference counter. | |
| virtual | ~Standard_Transient ()=default |
| Destructor must be virtual. | |
| virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
| Returns a type descriptor about this object. | |
| bool | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
| Returns a true value if this is an instance of Type. | |
| bool | IsInstance (const char *const theTypeName) const |
| Returns a true value if this is an instance of TypeName. | |
| bool | IsKind (const opencascade::handle< Standard_Type > &theType) const |
| Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
| bool | IsKind (const char *const theTypeName) const |
| Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
| Standard_Transient * | This () const |
| Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. | |
| int | GetRefCount () const noexcept |
| Get the reference counter of this object. | |
| void | IncrementRefCounter () noexcept |
| Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations. | |
| int | DecrementRefCounter () noexcept |
| Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement. | |
| virtual void | Delete () const |
| Memory deallocator for transient classes. | |
Static Public Member Functions | |
| static void | SetDefWarning (const char *const acode) |
| Sets a Code to give a Warning. | |
| static void | SetDefFail (const char *const acode) |
| Sets a Code to give a Fail. | |
| static int | DefCheck (const char *const acode) |
| Returns Check Status for a Code : 0 non/info (default), 1 warning, 2 fail. | |
| static void | SetDefMsg (const char *const casecode, const char *const mesdef) |
| Attaches a message definition to a case code This definition includes the message code plus designation of items of the CaseData to be added to the message (this part not yet implemented) | |
| static const char * | DefMsg (const char *const casecode) |
| Returns the message definition for a case code Empty if no message attached. | |
Static Public Member Functions inherited from Standard_Transient | |
| static constexpr const char * | get_type_name () |
| Returns a type descriptor about this object. | |
| static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
| Returns type descriptor of Standard_Transient class. | |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
| typedef void | base_type |
| Returns a type descriptor about this object. | |
This class is intended to record data attached to a case to be exploited. Cases can be :
A CaseData is defined by
Each Data has a type (integer, real etc...) and can have a name Hence, each data may be identified by :
Creates a CaseData with a CaseId and a Name (by default not defined)
| void MoniTool_CaseData::AddAny | ( | const occ::handle< Standard_Transient > & | val, |
| const char *const | name = "" ) |
Adds a Transient, with no more meaning.
| void MoniTool_CaseData::AddCPU | ( | const double | lastCPU, |
| const double | curCPU = 0, | ||
| const char *const | name = "" ) |
Adds the CPU time between lastCPU and now if <curCPU> is given, the CPU amount is curCPU-lastCPU else it is currently measured CPU - lastCPU lastCPU has been read by call to GetCPU See GetCPU to get amount, and LargeCPU to test large amount.
| void MoniTool_CaseData::AddData | ( | const occ::handle< Standard_Transient > & | val, |
| const int | kind, | ||
| const char *const | name = "" ) |
Unitary adding a data; rather internal.
| void MoniTool_CaseData::AddEntity | ( | const occ::handle< Standard_Transient > & | ent, |
| const char *const | name = "" ) |
Adds a Transient, as an Entity from an InterfaceModel for instance : it will then be printed with the help of a DBPE.
| void MoniTool_CaseData::AddGeom | ( | const occ::handle< Standard_Transient > & | geom, |
| const char *const | name = "" ) |
Adds a Geometric as a Transient (Curve, Surface ...)
| void MoniTool_CaseData::AddRaised | ( | const Standard_Failure & | theException, |
| const char *const | name = "" ) |
Adds the currently caught exception.
Adds two reals (for instance, two parameters)
| void MoniTool_CaseData::AddShape | ( | const TopoDS_Shape & | sh, |
| const char *const | name = "" ) |
Adds a Shape (recorded as a HShape)
Adds a Text (as HAsciiString)
| const char * MoniTool_CaseData::CaseId | ( | ) | const |
Returns the CaseId.
| occ::handle< Standard_Transient > MoniTool_CaseData::Data | ( | const int | nd | ) | const |
Returns a data item (n0 <nd> in the set <num>)
Returns Check Status for a Code : 0 non/info (default), 1 warning, 2 fail.
Remark : DefCheck is used to set the check status of a CaseData when it is attached to a case code, it can be changed later (by SetFail, SetWarning, ResetCheck)
Returns the message definition for a case code Empty if no message attached.
| double MoniTool_CaseData::GetCPU | ( | ) | const |
Returns the current amount of CPU This allows to laterly test and record CPU amount Its value has to be given to LargeCPU and AddCPU.
| bool MoniTool_CaseData::GetData | ( | const int | nd, |
| const occ::handle< Standard_Type > & | type, | ||
| occ::handle< Standard_Transient > & | val ) const |
Returns a data item, under control of a Type If the data item is kind of this type, it is returned in <val> and the returned value is True Else, <val> is unchanged and the returned value is False.
| bool MoniTool_CaseData::IsCheck | ( | ) | const |
Tells if <me> is Check (Warning or Fail), else it is Info.
| bool MoniTool_CaseData::IsFail | ( | ) | const |
Tells if <me> is Fail.
| bool MoniTool_CaseData::IsWarning | ( | ) | const |
Tells if <me> is Warning.
Returns the kind of a data : KIND TYPE MEANING 0 ANY any (not one of the following) 1 EX raised exception 2 EN entity 3 G geom 4 SH shape 5 XYZ XYZ 6 XY or UV XY 7 RR 2 reals 8 R 1 real 9 CPU CPU (1 real) 10 T text 11 I integer.
For NameNum, these codes for TYPE must be given exact i.e. SH for a Shape, not S nor SHAPE nor SOLID etc
| bool MoniTool_CaseData::LargeCPU | ( | const double | maxCPU, |
| const double | lastCPU, | ||
| const double | curCPU = 0 ) const |
Tells if a CPU time amount is large <maxCPU> gives the amount over which an amount is large <lastCPU> gives the start CPU amount if <curCPU> is given, the tested CPU amount is curCPU-lastCPU else it is currently measured CPU - lastCPU.
| Message_Msg MoniTool_CaseData::Msg | ( | ) | const |
Returns a Msg from a CaseData : it is build from DefMsg, which gives the message code plus the designation of items of the CaseData to be added to the Msg Empty if no message attached.
Remains to be implemented
| const char * MoniTool_CaseData::Name | ( | ) | const |
Returns the Name.
| const TCollection_AsciiString & MoniTool_CaseData::Name | ( | const int | nd | ) | const |
Returns the name of a data. If it has no name, the string is empty (length = 0)
Returns the first suitable data rank for a given name Exact matching (exact case, no completion) is required Firstly checks the recorded names If not found, considers the name as follows : Name = "TYPE" : search for the first item with this TYPE Name = "TYPE:nn" : search for the nn.th item with this TYPE See allowed values in method Kind.
| int MoniTool_CaseData::NbData | ( | ) | const |
Returns the count of data recorded to a set.
Returns a real or CPU amount (stored in Geom2d_CartesianPoint) (allows an Integer converted to a Real)
Returns a couple of reals (stored in Geom2d_CartesianPoint)
Removes a Data from its rank. Does nothing if out of range.
| void MoniTool_CaseData::ResetCheck | ( | ) |
Resets Check Status, i.e. sets <me> as Info.
| void MoniTool_CaseData::SetChange | ( | ) |
Sets the next Add... not to add but to change the data item designated by its name. If next Add... is not called with a name, SetChange is ignored Reset by next Add... , whatever <num> is correct or not.
Sets a Code to give a Fail.
|
static |
Attaches a message definition to a case code This definition includes the message code plus designation of items of the CaseData to be added to the message (this part not yet implemented)
Sets a Code to give a Warning.
| void MoniTool_CaseData::SetFail | ( | ) |
Sets <me> as Fail.
Sets the next Add... not to add but to replace the data item <num>, if <num> is between 1 and NbData. Reset by next Add... , whatever <num> is correct or not.
| void MoniTool_CaseData::SetWarning | ( | ) |
Sets <me> as Warning.
| TopoDS_Shape MoniTool_CaseData::Shape | ( | const int | nd | ) | const |
Returns a data as a shape, Null if not a shape.
Returns a text (stored in TCollection_HAsciiString)
Returns a data as a XY (i.e. Geom2d_CartesianPoint) Returns False if not the good type.
Returns a data as a XYZ (i.e. Geom_CartesianPoint) Returns False if not the good type.