OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    MoniTool_CaseData Class Reference

    This class is intended to record data attached to a case to be exploited. Cases can be : More...

    #include <MoniTool_CaseData.hxx>

    Inheritance diagram for MoniTool_CaseData:

    Public Member Functions

     MoniTool_CaseData (const char *const caseid="", const char *const namename="")
     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 namename)
     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 numnum)
     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 > &valval, const int kind, const char *const namename="")
     Unitary adding a data; rather internal.
    void AddRaised (const Standard_Failure &theException, const char *const namename="")
     Adds the currently caught exception.
    void AddShape (const TopoDS_Shape &sh, const char *const namename="")
     Adds a Shape (recorded as a HShape).
    void AddXYZ (const gp_XYZ &aXYZ, const char *const namename="")
     Adds a XYZ.
    void AddXY (const gp_XY &aXY, const char *const namename="")
     Adds a XY.
    void AddReal (const double valval, const char *const namename="")
     Adds a Real.
    void AddReals (const double v1v1, const double v2v2, const char *const namename="")
     Adds two reals (for instance, two parameters).
    void AddCPU (const double lastCPU, const double curCPU=0, const char *const namename="")
     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 namename="")
     Adds a Geometric as a Transient (Curve, Surface ...).
    void AddEntity (const occ::handle< Standard_Transient > &ent, const char *const namename="")
     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 namename="")
     Adds a Text (as HAsciiString).
    void AddInteger (const int valval, const char *const namename="")
     Adds an Integer.
    void AddAny (const occ::handle< Standard_Transient > &valval, const char *const namename="")
     Adds a Transient, with no more meaning.
    void RemoveData (const int numnum)
     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_TransientData (const int nd) const
     Returns a data item (n0 <nd> in the set <num>).
    bool GetData (const int nd, const occ::handle< Standard_Type > &typetype, occ::handle< Standard_Transient > &valval) 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_AsciiStringName (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 namename) 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 &valval) 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 &valval) const
     Returns a data as a XY (i.e. Geom2d_CartesianPoint) Returns False if not the good type.
    bool Reals (const int nd, double &v1v1, double &v2v2) const
     Returns a couple of reals (stored in Geom2d_CartesianPoint).
    bool Real (const int nd, double &valval) 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 &valval) 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_Transientoperator= (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_TransientThis () 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 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

    typedef void base_type
     Returns a type descriptor about this object.

    Detailed Description

    This class is intended to record data attached to a case to be exploited. Cases can be :

    • internal, i.e. for immediate debug for instance, on an abnormal exception, fill a CaseData in a DB (see class DB) then look at its content by XSDRAW
    • to record abnormal situation, which cause a warning or fail message, for instance during a transfer This will allow, firstly to build a more comprehensive message (with associated data), secondly to help seeing "what happened"
    • to record data in order to fix a problem If a CASE is well defined and its fix is well known too, recording a CaseData which identifies the CASE will allow to furstherly call the appropriate fix routine

    A CaseData is defined by

    • an optional CASE identifier If it is defined, this will allow systematic exploitation such as calling a fix routine
    • an optional Check Status, Warning or Fail, else it is Info
    • a NAME : it just allows to identify where this CaseData was created (help to debug)
    • a LIST OF DATA

    Each Data has a type (integer, real etc...) and can have a name Hence, each data may be identified by :

    • its absolute rank (from 1 to NbData)
    • its name if it has one (exact matching)
    • else, an interpreted identifier, which gives the type and the rank in the type (for instance, first integer; etc) (See NameRank)

    Constructor & Destructor Documentation

    ◆ MoniTool_CaseData()

    MoniTool_CaseData::MoniTool_CaseData ( const char *const caseid = "",
    const char *const name = "" )

    Creates a CaseData with a CaseId and a Name (by default not defined).

    Member Function Documentation

    ◆ AddAny()

    void MoniTool_CaseData::AddAny ( const occ::handle< Standard_Transient > & val,
    const char *const name = "" )

    Adds a Transient, with no more meaning.

    ◆ AddCPU()

    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.

    ◆ AddData()

    void MoniTool_CaseData::AddData ( const occ::handle< Standard_Transient > & val,
    const int kind,
    const char *const name = "" )

    Unitary adding a data; rather internal.

    ◆ AddEntity()

    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.

    ◆ AddGeom()

    void MoniTool_CaseData::AddGeom ( const occ::handle< Standard_Transient > & geom,
    const char *const name = "" )

    Adds a Geometric as a Transient (Curve, Surface ...).

    ◆ AddInteger()

    void MoniTool_CaseData::AddInteger ( const int val,
    const char *const name = "" )

    Adds an Integer.

    ◆ AddRaised()

    void MoniTool_CaseData::AddRaised ( const Standard_Failure & theException,
    const char *const name = "" )

    Adds the currently caught exception.

    ◆ AddReal()

    void MoniTool_CaseData::AddReal ( const double val,
    const char *const name = "" )

    Adds a Real.

    ◆ AddReals()

    void MoniTool_CaseData::AddReals ( const double v1,
    const double v2,
    const char *const name = "" )

    Adds two reals (for instance, two parameters).

    ◆ AddShape()

    void MoniTool_CaseData::AddShape ( const TopoDS_Shape & sh,
    const char *const name = "" )

    Adds a Shape (recorded as a HShape).

    ◆ AddText()

    void MoniTool_CaseData::AddText ( const char *const text,
    const char *const name = "" )

    Adds a Text (as HAsciiString).

    ◆ AddXY()

    void MoniTool_CaseData::AddXY ( const gp_XY & aXY,
    const char *const name = "" )

    Adds a XY.

    ◆ AddXYZ()

    void MoniTool_CaseData::AddXYZ ( const gp_XYZ & aXYZ,
    const char *const name = "" )

    Adds a XYZ.

    ◆ CaseId()

    const char * MoniTool_CaseData::CaseId ( ) const

    Returns the CaseId.

    ◆ Data()

    occ::handle< Standard_Transient > MoniTool_CaseData::Data ( const int nd) const

    Returns a data item (n0 <nd> in the set <num>).

    ◆ DefCheck()

    int MoniTool_CaseData::DefCheck ( const char *const acode)
    static

    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)

    ◆ DefMsg()

    const char * MoniTool_CaseData::DefMsg ( const char *const casecode)
    static

    Returns the message definition for a case code Empty if no message attached.

    ◆ GetCPU()

    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.

    ◆ GetData()

    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.

    ◆ Integer()

    bool MoniTool_CaseData::Integer ( const int nd,
    int & val ) const

    Returns an Integer.

    ◆ IsCheck()

    bool MoniTool_CaseData::IsCheck ( ) const

    Tells if <me> is Check (Warning or Fail), else it is Info.

    ◆ IsFail()

    bool MoniTool_CaseData::IsFail ( ) const

    Tells if <me> is Fail.

    ◆ IsWarning()

    bool MoniTool_CaseData::IsWarning ( ) const

    Tells if <me> is Warning.

    ◆ Kind()

    int MoniTool_CaseData::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.

    For NameNum, these codes for TYPE must be given exact i.e. SH for a Shape, not S nor SHAPE nor SOLID etc

    ◆ LargeCPU()

    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.

    ◆ Msg()

    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

    ◆ Name() [1/2]

    const char * MoniTool_CaseData::Name ( ) const

    Returns the Name.

    ◆ Name() [2/2]

    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).

    ◆ NameNum()

    int MoniTool_CaseData::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.

    ◆ NbData()

    int MoniTool_CaseData::NbData ( ) const

    Returns the count of data recorded to a set.

    ◆ Real()

    bool MoniTool_CaseData::Real ( const int nd,
    double & val ) const

    Returns a real or CPU amount (stored in Geom2d_CartesianPoint) (allows an Integer converted to a Real).

    ◆ Reals()

    bool MoniTool_CaseData::Reals ( const int nd,
    double & v1,
    double & v2 ) const

    Returns a couple of reals (stored in Geom2d_CartesianPoint).

    ◆ RemoveData()

    void MoniTool_CaseData::RemoveData ( const int num)

    Removes a Data from its rank. Does nothing if out of range.

    ◆ ResetCheck()

    void MoniTool_CaseData::ResetCheck ( )

    Resets Check Status, i.e. sets <me> as Info.

    ◆ SetCaseId()

    void MoniTool_CaseData::SetCaseId ( const char *const caseid)

    Sets a CaseId.

    ◆ SetChange()

    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.

    ◆ SetDefFail()

    void MoniTool_CaseData::SetDefFail ( const char *const acode)
    static

    Sets a Code to give a Fail.

    ◆ SetDefMsg()

    void MoniTool_CaseData::SetDefMsg ( const char *const casecode,
    const char *const mesdef )
    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).

    ◆ SetDefWarning()

    void MoniTool_CaseData::SetDefWarning ( const char *const acode)
    static

    Sets a Code to give a Warning.

    ◆ SetFail()

    void MoniTool_CaseData::SetFail ( )

    Sets <me> as Fail.

    ◆ SetName()

    void MoniTool_CaseData::SetName ( const char *const name)

    Sets a Name.

    ◆ SetReplace()

    void MoniTool_CaseData::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.

    ◆ SetWarning()

    void MoniTool_CaseData::SetWarning ( )

    Sets <me> as Warning.

    ◆ Shape()

    TopoDS_Shape MoniTool_CaseData::Shape ( const int nd) const

    Returns a data as a shape, Null if not a shape.

    ◆ Text()

    bool MoniTool_CaseData::Text ( const int nd,
    const char *& text ) const

    Returns a text (stored in TCollection_HAsciiString).

    ◆ XY()

    bool MoniTool_CaseData::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.

    ◆ XYZ()

    bool MoniTool_CaseData::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.


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