Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
XSControl_Controller Class Referenceabstract

This class allows a general X-STEP engine to run generic functions on any interface norm, in the same way. It includes the transfer operations. I.e. it gathers the already available general modules, the engine has just to know it. More...

#include <XSControl_Controller.hxx>

Inheritance diagram for XSControl_Controller:
Inheritance graph
[legend]

Public Member Functions

void SetNames (const char *const theLongName, const char *const theShortName)
 Changes names if a name is empty, the formerly set one remains Remark : Does not call Record or AutoRecord.
 
void AutoRecord () const
 Records <me> is a general dictionary under Short and Long Names (see method Name)
 
void Record (const char *const name) const
 Records <me> in a general dictionary under a name Error if <name> already used for another one.
 
const charName (const bool rsc=false) const
 Returns a name, as given when initializing : rsc = False (D) : True Name attached to the Norm (long name) rsc = True : Name of the resource set (i.e. short name)
 
const occ::handle< Interface_Protocol > & Protocol () const
 Returns the Protocol attached to the Norm (from field)
 
const occ::handle< IFSelect_WorkLibrary > & WorkLibrary () const
 Returns the SignType attached to the norm (from field)
 
virtual occ::handle< Interface_InterfaceModelNewModel () const =0
 Creates a new empty Model ready to receive data of the Norm Used to write data from Imagine to an interface file.
 
virtual occ::handle< Transfer_ActorOfTransientProcessActorRead (const occ::handle< Interface_InterfaceModel > &model) const
 Returns the Actor for Read attached to the pair (norm,appli) It can be adapted for data of the input Model, as required Can be read from field then adapted with Model as required.
 
virtual occ::handle< Transfer_ActorOfFinderProcessActorWrite () const
 Returns the Actor for Write attached to the pair (norm,appli) Read from field. Can be redefined.
 
void SetModeWrite (const int modemin, const int modemax, const bool shape=true)
 Sets minimum and maximum values for modetrans (write) Erases formerly recorded bounds and values Actually only for shape Then, for each value a little help can be attached.
 
void SetModeWriteHelp (const int modetrans, const char *const help, const bool shape=true)
 Attaches a short line of help to a value of modetrans (write)
 
bool ModeWriteBounds (int &modemin, int &modemax, const bool shape=true) const
 Returns recorded min and max values for modetrans (write) Actually only for shapes Returns True if bounds are set, False else (then, free value)
 
bool IsModeWrite (const int modetrans, const bool shape=true) const
 Tells if a value of <modetrans> is a good value(within bounds) Actually only for shapes.
 
const charModeWriteHelp (const int modetrans, const bool shape=true) const
 Returns the help line recorded for a value of modetrans empty if help not defined or not within bounds or if values are free.
 
virtual bool RecognizeWriteTransient (const occ::handle< Standard_Transient > &obj, const int modetrans=0) const
 Tells if <obj> (an application object) is a valid candidate for a transfer to a Model. By default, asks the ActorWrite if known (through a TransientMapper). Can be redefined.
 
virtual IFSelect_ReturnStatus TransferWriteTransient (const occ::handle< Standard_Transient > &obj, const occ::handle< Transfer_FinderProcess > &FP, const occ::handle< Interface_InterfaceModel > &model, const int modetrans=0, const Message_ProgressRange &theProgress=Message_ProgressRange()) const
 Takes one Transient Object and transfers it to an InterfaceModel (already created, e.g. by NewModel) (result is recorded in the model by AddWithRefs) FP records produced results and checks.
 
virtual bool RecognizeWriteShape (const TopoDS_Shape &shape, const int modetrans=0) const
 Tells if a shape is valid for a transfer to a model Asks the ActorWrite (through a ShapeMapper)
 
virtual IFSelect_ReturnStatus TransferWriteShape (const TopoDS_Shape &shape, const occ::handle< Transfer_FinderProcess > &FP, const occ::handle< Interface_InterfaceModel > &model, const int modetrans=0, const Message_ProgressRange &theProgress=Message_ProgressRange()) const
 Takes one Shape and transfers it to an InterfaceModel (already created, e.g. by NewModel) Default uses ActorWrite; can be redefined as necessary Returned value is a status, as follows : Done OK , Void : No Result , Fail : Fail (e.g. exception) Error : bad conditions , bad model or null model.
 
void AddSessionItem (const occ::handle< Standard_Transient > &theItem, const char *const theName, const bool toApply=false)
 Records a Session Item, to be added for customisation of the Work Session. It must have a specific name. <setapplied> is used if is a GeneralModifier, to decide If set to true, will be applied to the hook list "send". Else, it is not applied to any hook list. Remark : this method is to be called at Create time, the recorded items will be used by Customise Warning : if <name> conflicts, the last recorded item is kept.
 
occ::handle< Standard_TransientSessionItem (const char *const theName) const
 Returns an item given its name to record in a Session If <name> is unknown, returns a Null Handle.
 
virtual void Customise (occ::handle< XSControl_WorkSession > &WS)
 Customises a WorkSession, by adding to it the recorded items (by AddSessionItem)
 
const NCollection_DataMap< TCollection_AsciiString, occ::handle< Standard_Transient > > & AdaptorSession () const
 
- 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 occ::handle< XSControl_ControllerRecorded (const char *const name)
 Returns the Controller attached to a given name Returns a Null Handle if <name> is unknown.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_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.
 

Protected Member Functions

 XSControl_Controller (const char *const theLongName, const char *const theShortName)
 Initializing with names <theLongName> is for the complete, official, long name <theShortName> is for the short name used for resources.
 
void TraceStatic (const char *const theName, const int theUse)
 Records the name of a Static to be traced for a given use.
 

Protected Attributes

TCollection_AsciiString myShortName
 
TCollection_AsciiString myLongName
 
occ::handle< IFSelect_WorkLibrarymyAdaptorLibrary
 
occ::handle< Interface_ProtocolmyAdaptorProtocol
 
occ::handle< Transfer_ActorOfTransientProcessmyAdaptorRead
 
occ::handle< Transfer_ActorOfFinderProcessmyAdaptorWrite
 
NCollection_DataMap< TCollection_AsciiString, occ::handle< Standard_Transient > > myAdaptorSession
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 

Detailed Description

This class allows a general X-STEP engine to run generic functions on any interface norm, in the same way. It includes the transfer operations. I.e. it gathers the already available general modules, the engine has just to know it.

The important point is that a given X-STEP Controller is attached to a given couple made of an Interface Norm (such as IGES-5.1) and an application data model (CasCade Shapes for instance).

Finally, Controller can be gathered in a general dictionary then retrieved later by a general call (method Recorded)

It does not manage the produced data, but the Actors make the link between the norm and the application

Constructor & Destructor Documentation

◆ XSControl_Controller()

XSControl_Controller::XSControl_Controller ( const char *const theLongName,
const char *const theShortName )
protected

Initializing with names <theLongName> is for the complete, official, long name <theShortName> is for the short name used for resources.

Member Function Documentation

◆ ActorRead()

virtual occ::handle< Transfer_ActorOfTransientProcess > XSControl_Controller::ActorRead ( const occ::handle< Interface_InterfaceModel > & model) const
virtual

Returns the Actor for Read attached to the pair (norm,appli) It can be adapted for data of the input Model, as required Can be read from field then adapted with Model as required.

Reimplemented in IGESControl_Controller, and STEPControl_Controller.

◆ ActorWrite()

virtual occ::handle< Transfer_ActorOfFinderProcess > XSControl_Controller::ActorWrite ( ) const
virtual

Returns the Actor for Write attached to the pair (norm,appli) Read from field. Can be redefined.

◆ AdaptorSession()

const NCollection_DataMap< TCollection_AsciiString, occ::handle< Standard_Transient > > & XSControl_Controller::AdaptorSession ( ) const
inline

◆ AddSessionItem()

void XSControl_Controller::AddSessionItem ( const occ::handle< Standard_Transient > & theItem,
const char *const theName,
const bool toApply = false )

Records a Session Item, to be added for customisation of the Work Session. It must have a specific name. <setapplied> is used if is a GeneralModifier, to decide If set to true, will be applied to the hook list "send". Else, it is not applied to any hook list. Remark : this method is to be called at Create time, the recorded items will be used by Customise Warning : if <name> conflicts, the last recorded item is kept.

◆ AutoRecord()

void XSControl_Controller::AutoRecord ( ) const
inline

Records <me> is a general dictionary under Short and Long Names (see method Name)

◆ Customise()

virtual void XSControl_Controller::Customise ( occ::handle< XSControl_WorkSession > & WS)
virtual

Customises a WorkSession, by adding to it the recorded items (by AddSessionItem)

Reimplemented in IGESControl_Controller, and STEPControl_Controller.

◆ IsModeWrite()

bool XSControl_Controller::IsModeWrite ( const int modetrans,
const bool shape = true ) const

Tells if a value of <modetrans> is a good value(within bounds) Actually only for shapes.

◆ ModeWriteBounds()

bool XSControl_Controller::ModeWriteBounds ( int & modemin,
int & modemax,
const bool shape = true ) const

Returns recorded min and max values for modetrans (write) Actually only for shapes Returns True if bounds are set, False else (then, free value)

◆ ModeWriteHelp()

const char * XSControl_Controller::ModeWriteHelp ( const int modetrans,
const bool shape = true ) const

Returns the help line recorded for a value of modetrans empty if help not defined or not within bounds or if values are free.

◆ Name()

const char * XSControl_Controller::Name ( const bool rsc = false) const
inline

Returns a name, as given when initializing : rsc = False (D) : True Name attached to the Norm (long name) rsc = True : Name of the resource set (i.e. short name)

◆ NewModel()

virtual occ::handle< Interface_InterfaceModel > XSControl_Controller::NewModel ( ) const
pure virtual

Creates a new empty Model ready to receive data of the Norm Used to write data from Imagine to an interface file.

Implemented in IGESControl_Controller, and STEPControl_Controller.

◆ Protocol()

const occ::handle< Interface_Protocol > & XSControl_Controller::Protocol ( ) const
inline

Returns the Protocol attached to the Norm (from field)

◆ RecognizeWriteShape()

virtual bool XSControl_Controller::RecognizeWriteShape ( const TopoDS_Shape & shape,
const int modetrans = 0 ) const
virtual

Tells if a shape is valid for a transfer to a model Asks the ActorWrite (through a ShapeMapper)

◆ RecognizeWriteTransient()

virtual bool XSControl_Controller::RecognizeWriteTransient ( const occ::handle< Standard_Transient > & obj,
const int modetrans = 0 ) const
virtual

Tells if <obj> (an application object) is a valid candidate for a transfer to a Model. By default, asks the ActorWrite if known (through a TransientMapper). Can be redefined.

◆ Record()

void XSControl_Controller::Record ( const char *const name) const

Records <me> in a general dictionary under a name Error if <name> already used for another one.

◆ Recorded()

static occ::handle< XSControl_Controller > XSControl_Controller::Recorded ( const char *const name)
static

Returns the Controller attached to a given name Returns a Null Handle if <name> is unknown.

◆ SessionItem()

occ::handle< Standard_Transient > XSControl_Controller::SessionItem ( const char *const theName) const

Returns an item given its name to record in a Session If <name> is unknown, returns a Null Handle.

◆ SetModeWrite()

void XSControl_Controller::SetModeWrite ( const int modemin,
const int modemax,
const bool shape = true )

Sets minimum and maximum values for modetrans (write) Erases formerly recorded bounds and values Actually only for shape Then, for each value a little help can be attached.

◆ SetModeWriteHelp()

void XSControl_Controller::SetModeWriteHelp ( const int modetrans,
const char *const help,
const bool shape = true )

Attaches a short line of help to a value of modetrans (write)

◆ SetNames()

void XSControl_Controller::SetNames ( const char *const theLongName,
const char *const theShortName )

Changes names if a name is empty, the formerly set one remains Remark : Does not call Record or AutoRecord.

◆ TraceStatic()

void XSControl_Controller::TraceStatic ( const char *const theName,
const int theUse )
protected

Records the name of a Static to be traced for a given use.

◆ TransferWriteShape()

virtual IFSelect_ReturnStatus XSControl_Controller::TransferWriteShape ( const TopoDS_Shape & shape,
const occ::handle< Transfer_FinderProcess > & FP,
const occ::handle< Interface_InterfaceModel > & model,
const int modetrans = 0,
const Message_ProgressRange & theProgress = Message_ProgressRange() ) const
virtual

Takes one Shape and transfers it to an InterfaceModel (already created, e.g. by NewModel) Default uses ActorWrite; can be redefined as necessary Returned value is a status, as follows : Done OK , Void : No Result , Fail : Fail (e.g. exception) Error : bad conditions , bad model or null model.

Reimplemented in IGESControl_Controller, and STEPControl_Controller.

◆ TransferWriteTransient()

virtual IFSelect_ReturnStatus XSControl_Controller::TransferWriteTransient ( const occ::handle< Standard_Transient > & obj,
const occ::handle< Transfer_FinderProcess > & FP,
const occ::handle< Interface_InterfaceModel > & model,
const int modetrans = 0,
const Message_ProgressRange & theProgress = Message_ProgressRange() ) const
virtual

Takes one Transient Object and transfers it to an InterfaceModel (already created, e.g. by NewModel) (result is recorded in the model by AddWithRefs) FP records produced results and checks.

Default uses ActorWrite; can be redefined as necessary Returned value is a status, as follows : 0 OK , 1 No Result , 2 Fail (e.g. exception raised) -1 bad conditions , -2 bad model or null model For type of object not recognized : should return 1

◆ WorkLibrary()

const occ::handle< IFSelect_WorkLibrary > & XSControl_Controller::WorkLibrary ( ) const
inline

Returns the SignType attached to the norm (from field)

Returns the WorkLibrary attached to the Norm. Remark that it has to be in phase with the Protocol (read from field)

Field Documentation

◆ myAdaptorLibrary

occ::handle<IFSelect_WorkLibrary> XSControl_Controller::myAdaptorLibrary
protected

◆ myAdaptorProtocol

occ::handle<Interface_Protocol> XSControl_Controller::myAdaptorProtocol
protected

◆ myAdaptorRead

occ::handle<Transfer_ActorOfTransientProcess> XSControl_Controller::myAdaptorRead
protected

◆ myAdaptorSession

NCollection_DataMap<TCollection_AsciiString, occ::handle<Standard_Transient> > XSControl_Controller::myAdaptorSession
protected

◆ myAdaptorWrite

occ::handle<Transfer_ActorOfFinderProcess> XSControl_Controller::myAdaptorWrite
protected

◆ myLongName

TCollection_AsciiString XSControl_Controller::myLongName
protected

◆ myShortName

TCollection_AsciiString XSControl_Controller::myShortName
protected

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