Open CASCADE Technology  6.9.0
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 Standard_CString longname, const Standard_CString shortname)
 Changes names if a name is empty, the formerly set one remains Remark : Does not call Record or AutoRecord. More...
 
void AutoRecord () const
 Records <me> is a general dictionary under Short and Long Names (see method Name) More...
 
void Record (const Standard_CString name) const
 Records <me> in a general dictionary under a name Error if <name> already used for another one. More...
 
Standard_CString Name (const Standard_Boolean rsc=Standard_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 ressource set (i.e. short name) More...
 
Handle< IFSelect_ProfileProfile () const
 Returns the Profile It starts with a first configuration Base (empty) and the following options : protocol for the Protocol sign-type for the SignType (Default Signature for Type) access for the WorkLibrary tr-read for ActorRead (import processor) tr-write for ActorWrite (export processor) More...
 
void DefineProfile (const Standard_CString confname)
 Considers the current state of the Controller as defining a configuration, newly created or already existing. More...
 
Standard_Boolean SetProfile (const Standard_CString confname)
 Sets the Controller in a given Configuration of its Profile Calls SettingProfile (which can be redefined) More...
 
virtual Standard_Boolean SettingProfile (const Standard_CString confname)
 This method is called by SetProfile, it can be redefined for specific sub-class of Controller The default does nothing. More...
 
Standard_Boolean ApplyProfile (const Handle< XSControl_WorkSession > &WS, const Standard_CString confname)
 Applies a Configuration of the Profile to the WorkSession I.E. calls SetProfile then fills WorkSession with definitions. More...
 
virtual Standard_Boolean ApplyingProfile (const Handle< XSControl_WorkSession > &WS, const Standard_CString confname)
 Called by ApplyProfile, can be redefined for specific sub-class of Controller The default does nothing. More...
 
Handle< Interface_ProtocolProtocol () const
 Returns the Protocol attached to the Norm (from field) More...
 
Handle< IFSelect_SignatureSignType () const
 Returns the SignType attached to the norm (from field) More...
 
Handle< IFSelect_WorkLibraryWorkLibrary () const
 Returns the WorkLibrary attached to the Norm. Remark that it has to be in phase with the Protocol (read from field) More...
 
virtual Handle
< Interface_InterfaceModel
NewModel () const =0
 Creates a new empty Model ready to receive data of the Norm Used to write data from Imagine to an interface file. More...
 
virtual Handle
< Transfer_ActorOfTransientProcess
ActorRead (const Handle< Interface_InterfaceModel > &model) const =0
 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. More...
 
virtual Handle
< Transfer_ActorOfFinderProcess
ActorWrite () const
 Returns the Actor for Write attached to the pair (norm,appli) Read from field. Can be redefined. More...
 
virtual void UpdateStatics (const Standard_Integer mode, const Standard_CString criter="") const
 Updates static values <mode> precises the kind of updating : (see Items from Static) -1 : a precise static item : criter = its name 0 : all items of a family : criter = the family name 1 : all items which match regexp name : criter = regexp name By default (criter empty) should consider all relevant statics If <name> is defined, can consider only this static item The provided default method does nothing, to be redefined. More...
 
void SetModeWrite (const Standard_Integer modemin, const Standard_Integer modemax, const Standard_Boolean shape=Standard_True)
 Sets mininum 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. More...
 
void SetModeWriteHelp (const Standard_Integer modetrans, const Standard_CString help, const Standard_Boolean shape=Standard_True)
 Attaches a short line of help to a value of modetrans (write) More...
 
Standard_Boolean ModeWriteBounds (Standard_Integer &modemin, Standard_Integer &modemax, const Standard_Boolean shape=Standard_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) More...
 
Standard_Boolean IsModeWrite (const Standard_Integer modetrans, const Standard_Boolean shape=Standard_True) const
 Tells if a value of <modetrans> is a good value(within bounds) Actually only for shapes. More...
 
Standard_CString ModeWriteHelp (const Standard_Integer modetrans, const Standard_Boolean shape=Standard_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. More...
 
virtual Standard_Boolean RecognizeWriteTransient (const Handle< Standard_Transient > &obj, const Standard_Integer 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. More...
 
virtual IFSelect_ReturnStatus TransferWriteTransient (const Handle< Standard_Transient > &obj, const Handle< Transfer_FinderProcess > &FP, const Handle< Interface_InterfaceModel > &model, const Standard_Integer modetrans=0) 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. More...
 
virtual Standard_Boolean RecognizeWriteShape (const TopoDS_Shape &shape, const Standard_Integer modetrans=0) const
 Tells if a shape is valid for a transfer to a model Asks the ActorWrite (through a ShapeMapper) More...
 
virtual IFSelect_ReturnStatus TransferWriteShape (const TopoDS_Shape &shape, const Handle< Transfer_FinderProcess > &FP, const Handle< Interface_InterfaceModel > &model, const Standard_Integer modetrans=0) 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 Resolution of file clusters According to each norm, there can (or not) be files of which definition is not complete but refers to other files : this defines a file cluster. It can then be resolved by two calls : More...
 
virtual Handle
< Standard_Transient
ClusterContext (const Handle< XSControl_WorkSession > &WS) const
 Prepares and returns a context to resolve a cluster All data to be used are detained by the WorkSession The definition of this context is free and proper to each case remark that it is aimed to be used in ResolveCluster. More...
 
virtual Interface_CheckIterator ResolveCluster (const Handle< XSControl_WorkSession > &WS, const Handle< Standard_Transient > &context) const
 Performs the resolution itself, from the starting data and the cluster context. More...
 
void AddControlItem (const Handle< Standard_Transient > &item, const Standard_CString name)
 Adds an item in the control list A control item of a controller is accessed by its name which is specific of a kind of item (i.e. a kind of functionnality) Adds or replaces if <name> is already recorded. More...
 
Handle< Standard_TransientControlItem (const Standard_CString name) const
 Returns a control item from its name, Null if <name> unknown To be used then, it just remains to be down-casted. More...
 
void TraceStatic (const Standard_CString name, const Standard_Integer use)
 Records the name of a Static to be traced for a given use. More...
 
void AddSessionItem (const Handle< Standard_Transient > &item, const Standard_CString name, const Standard_CString setapplied="")
 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 to which hook list it will be applied, if not empty (else, not applied to any hook list) ACTUAL : only one hook list is managed : "send" 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. More...
 
Handle< Standard_TransientSessionItem (const Standard_CString name) const
 Returns an item given its name to record in a Session If <name> is unknown, returns a Null Handle. More...
 
Standard_Boolean IsApplied (const Handle< Standard_Transient > &item) const
 Returns True if is recorded as <setapplied = True> More...
 
virtual void Customise (Handle< XSControl_WorkSession > &WS)
 Customises a WorkSession, by adding to it the recorded items (by AddSessionItem), then by calling a specific method Customising, set by default to do nothing. More...
 
void Customising (Handle< XSControl_WorkSession > &WS)
 Specific customisation method, which can be redefined Default does nothing. More...
 
Handle
< Dico_DictionaryOfTransient
AdaptorSession () const
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual const
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const 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. More...
 
Standard_Boolean IsKind (const Standard_CString 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. More...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Static Public Member Functions

static Handle
< XSControl_Controller
Recorded (const Standard_CString name)
 Returns the Controller attached to a given name Returns a Null Handle if <name> is unknown. More...
 
static Handle
< TColStd_HSequenceOfHAsciiString
ListRecorded (const Standard_Integer mode=0)
 Returns the list of names of recorded norms, according to mode = 0 (D) : all the recorded names < 0 : for each distinct norm, its resource (short) name

0 : for each distinct norm, its complete (long) name

More...
 

Protected Member Functions

 XSControl_Controller (const Standard_CString longname, const Standard_CString shortname)
 Initializing with names <longname> is for the complete, official, long name <shortname> is for the short name used for resources. More...
 

Protected Attributes

TCollection_AsciiString theShortName
 
TCollection_AsciiString theLongName
 
Handle< IFSelect_WorkLibrarytheAdaptorLibrary
 
Handle< Interface_ProtocoltheAdaptorProtocol
 
Handle< IFSelect_SignaturetheSignType
 
Handle
< Transfer_ActorOfTransientProcess
theAdaptorRead
 
Handle
< Transfer_ActorOfFinderProcess
theAdaptorWrite
 
Handle
< Dico_DictionaryOfTransient
theAdaptorSession
 

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

A Controller brings a Profile, this allows to have several variants on the same basic definition, for instance keep the norm definition but give several transfer actors, etc

Finally, Controller can be gathered in a general dictionary then retreived 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 ( const Standard_CString  longname,
const Standard_CString  shortname 
)
protected

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

Member Function Documentation

virtual Handle< Transfer_ActorOfTransientProcess > XSControl_Controller::ActorRead ( const Handle< Interface_InterfaceModel > &  model) const
pure 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.

Implemented in IGESControl_Controller, and STEPControl_Controller.

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

Handle< Dico_DictionaryOfTransient > XSControl_Controller::AdaptorSession ( ) const
void XSControl_Controller::AddControlItem ( const Handle< Standard_Transient > &  item,
const Standard_CString  name 
)

Adds an item in the control list A control item of a controller is accessed by its name which is specific of a kind of item (i.e. a kind of functionnality) Adds or replaces if <name> is already recorded.

void XSControl_Controller::AddSessionItem ( const Handle< Standard_Transient > &  item,
const Standard_CString  name,
const Standard_CString  setapplied = "" 
)

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 to which hook list it will be applied, if not empty (else, not applied to any hook list) ACTUAL : only one hook list is managed : "send" 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.

virtual Standard_Boolean XSControl_Controller::ApplyingProfile ( const Handle< XSControl_WorkSession > &  WS,
const Standard_CString  confname 
)
virtual

Called by ApplyProfile, can be redefined for specific sub-class of Controller The default does nothing.

Standard_Boolean XSControl_Controller::ApplyProfile ( const Handle< XSControl_WorkSession > &  WS,
const Standard_CString  confname 
)

Applies a Configuration of the Profile to the WorkSession I.E. calls SetProfile then fills WorkSession with definitions.

void XSControl_Controller::AutoRecord ( ) const

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

virtual Handle< Standard_Transient > XSControl_Controller::ClusterContext ( const Handle< XSControl_WorkSession > &  WS) const
virtual

Prepares and returns a context to resolve a cluster All data to be used are detained by the WorkSession The definition of this context is free and proper to each case remark that it is aimed to be used in ResolveCluster.

The context must be prepared, but resolution must not have began

If no cluster has to be resolved, should return a null handle This is the default case, which can be redefined

Handle< Standard_Transient > XSControl_Controller::ControlItem ( const Standard_CString  name) const

Returns a control item from its name, Null if <name> unknown To be used then, it just remains to be down-casted.

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

Customises a WorkSession, by adding to it the recorded items (by AddSessionItem), then by calling a specific method Customising, set by default to do nothing.

Reimplemented in IGESControl_Controller, and STEPControl_Controller.

void XSControl_Controller::Customising ( Handle< XSControl_WorkSession > &  WS)

Specific customisation method, which can be redefined Default does nothing.

void XSControl_Controller::DefineProfile ( const Standard_CString  confname)

Considers the current state of the Controller as defining a configuration, newly created or already existing.

Standard_Boolean XSControl_Controller::IsApplied ( const Handle< Standard_Transient > &  item) const

Returns True if is recorded as <setapplied = True>

Standard_Boolean XSControl_Controller::IsModeWrite ( const Standard_Integer  modetrans,
const Standard_Boolean  shape = Standard_True 
) const

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

static Handle< TColStd_HSequenceOfHAsciiString > XSControl_Controller::ListRecorded ( const Standard_Integer  mode = 0)
static

Returns the list of names of recorded norms, according to mode = 0 (D) : all the recorded names < 0 : for each distinct norm, its resource (short) name

0 : for each distinct norm, its complete (long) name

Standard_Boolean XSControl_Controller::ModeWriteBounds ( Standard_Integer modemin,
Standard_Integer modemax,
const Standard_Boolean  shape = Standard_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)

Standard_CString XSControl_Controller::ModeWriteHelp ( const Standard_Integer  modetrans,
const Standard_Boolean  shape = Standard_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.

Standard_CString XSControl_Controller::Name ( const Standard_Boolean  rsc = Standard_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 ressource set (i.e. short name)

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

Handle< IFSelect_Profile > XSControl_Controller::Profile ( ) const

Returns the Profile It starts with a first configuration Base (empty) and the following options : protocol for the Protocol sign-type for the SignType (Default Signature for Type) access for the WorkLibrary tr-read for ActorRead (import processor) tr-write for ActorWrite (export processor)

Handle< Interface_Protocol > XSControl_Controller::Protocol ( ) const

Returns the Protocol attached to the Norm (from field)

virtual Standard_Boolean XSControl_Controller::RecognizeWriteShape ( const TopoDS_Shape shape,
const Standard_Integer  modetrans = 0 
) const
virtual

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

virtual Standard_Boolean XSControl_Controller::RecognizeWriteTransient ( const Handle< Standard_Transient > &  obj,
const Standard_Integer  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.

void XSControl_Controller::Record ( const Standard_CString  name) const

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

static Handle< XSControl_Controller > XSControl_Controller::Recorded ( const Standard_CString  name)
static

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

virtual Interface_CheckIterator XSControl_Controller::ResolveCluster ( const Handle< XSControl_WorkSession > &  WS,
const Handle< Standard_Transient > &  context 
) const
virtual

Performs the resolution itself, from the starting data and the cluster context.

Can fill a CheckList as necessary (especially when one or more references remain unresolved)

Default does nothing and returns an empty CheckList

Handle< Standard_Transient > XSControl_Controller::SessionItem ( const Standard_CString  name) const

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

void XSControl_Controller::SetModeWrite ( const Standard_Integer  modemin,
const Standard_Integer  modemax,
const Standard_Boolean  shape = Standard_True 
)

Sets mininum 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 XSControl_Controller::SetModeWriteHelp ( const Standard_Integer  modetrans,
const Standard_CString  help,
const Standard_Boolean  shape = Standard_True 
)

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

void XSControl_Controller::SetNames ( const Standard_CString  longname,
const Standard_CString  shortname 
)

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

Standard_Boolean XSControl_Controller::SetProfile ( const Standard_CString  confname)

Sets the Controller in a given Configuration of its Profile Calls SettingProfile (which can be redefined)

Returns True if done, False if <confname> unknown

virtual Standard_Boolean XSControl_Controller::SettingProfile ( const Standard_CString  confname)
virtual

This method is called by SetProfile, it can be redefined for specific sub-class of Controller The default does nothing.

Handle< IFSelect_Signature > XSControl_Controller::SignType ( ) const

Returns the SignType attached to the norm (from field)

void XSControl_Controller::TraceStatic ( const Standard_CString  name,
const Standard_Integer  use 
)

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

virtual IFSelect_ReturnStatus XSControl_Controller::TransferWriteShape ( const TopoDS_Shape shape,
const Handle< Transfer_FinderProcess > &  FP,
const Handle< Interface_InterfaceModel > &  model,
const Standard_Integer  modetrans = 0 
) 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 Resolution of file clusters According to each norm, there can (or not) be files of which definition is not complete but refers to other files : this defines a file cluster. It can then be resolved by two calls :

  • ClusterContext prepares the resolution, specific of each case
  • ResolveCluster performs the resolution, its result consists in having all data gathered in one final model

Reimplemented in IGESControl_Controller, and STEPControl_Controller.

virtual IFSelect_ReturnStatus XSControl_Controller::TransferWriteTransient ( const Handle< Standard_Transient > &  obj,
const Handle< Transfer_FinderProcess > &  FP,
const Handle< Interface_InterfaceModel > &  model,
const Standard_Integer  modetrans = 0 
) 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

virtual void XSControl_Controller::UpdateStatics ( const Standard_Integer  mode,
const Standard_CString  criter = "" 
) const
virtual

Updates static values <mode> precises the kind of updating : (see Items from Static) -1 : a precise static item : criter = its name 0 : all items of a family : criter = the family name 1 : all items which match regexp name : criter = regexp name By default (criter empty) should consider all relevant statics If <name> is defined, can consider only this static item The provided default method does nothing, to be redefined.

Handle< IFSelect_WorkLibrary > XSControl_Controller::WorkLibrary ( ) const

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

Field Documentation

Handle< IFSelect_WorkLibrary > XSControl_Controller::theAdaptorLibrary
protected
Handle< Interface_Protocol > XSControl_Controller::theAdaptorProtocol
protected
Handle< Transfer_ActorOfTransientProcess > XSControl_Controller::theAdaptorRead
protected
Handle< Dico_DictionaryOfTransient > XSControl_Controller::theAdaptorSession
protected
Handle< Transfer_ActorOfFinderProcess > XSControl_Controller::theAdaptorWrite
protected
TCollection_AsciiString XSControl_Controller::theLongName
protected
TCollection_AsciiString XSControl_Controller::theShortName
protected
Handle< IFSelect_Signature > XSControl_Controller::theSignType
protected

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