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
    XSDRAW Class Reference

    Basic package to work functions of X-STEP (IFSelect & Co) under control of DRAW. More...

    #include <XSDRAW.hxx>

    Static Public Member Functions

    static void ChangeCommand (const char *const oldname, const char *const newname)
     Takes variables to/from the DRAW session Implements ProgressIndicator for DRAW Changes the name under which a command of xstep is known by Draw. This allows to avoid collisions To be called before LoadDraw or any other xstep initialisation.
    static void RemoveCommand (const char *const oldname)
     Removes a command from the interpretation list of Draw To be called before LoadDraw or any other xstep initialisation.
    static bool LoadSession ()
     Defines the basic context to work with a X-STEP Session : it performs the basic inits, also records the Controller If the Controller is not yet set, it must be set after (call to SetController) LoadSession is called by LoadDraw Returns True the first time, False if already called.
    static void LoadDraw (Draw_Interpretor &theCommands)
     Defines the context for using a X-STEP Session under DRAW Once the various INITs have been done, a call to LoadDraw records the defined commands for the X-STEP SessionPilot, into the DRAW interpretation list. "Set" commands are accessed under command xset SDS>xset name command ... Other commands can be accessed directly or under command xstep SDS>command ... and SDS>xstep command ... are equivalent.
    static int Execute (const char *const command, const char *const var="")
     Allows to execute a xstep-draw command from C++ program Fixed form: Execute("command args..."); Form with a variable text part : add s for the variable : Execute ("command args %s args..",var) [var is a CString] Returns the same value as returned by call from DRAW.
    static occ::handle< IFSelect_SessionPilotPilot ()
     Returns the SessionPilot (can be used for direct call).
    static void SetSession (const occ::handle< XSControl_WorkSession > &theSession)
     Updates the WorkSession defined in AddDraw (through Pilot) It is from XSControl, it brings functionalities for Transfers.
    static const occ::handle< XSControl_WorkSessionSession ()
     Returns the WorkSession defined in AddDraw (through Pilot) It is from XSControl, it brings functionalities for Transfers.
    static void SetController (const occ::handle< XSControl_Controller > &control)
     Defines a Controller for the command "xinit" and applies it (i.e. calls its method Customise).
    static occ::handle< XSControl_ControllerController ()
     Returns the Controller, a Null Handle if not yet defined.
    static bool SetNorm (const char *const normname)
     Sets a norm by its name (controller recorded as <normname> ) Returns True if done, False if this norm is unknown.
    static occ::handle< Interface_ProtocolProtocol ()
     Returns the actually defined Protocol.
    static occ::handle< Interface_InterfaceModelModel ()
     Returns the Model of the Session (it is Session()->Model() ).
    static void SetModel (const occ::handle< Interface_InterfaceModel > &model, const char *const file="")
     Sets a Model in session (it is Session()->SetModel(model) ) If <file> is defined, SetLoadedFile is also done.
    static occ::handle< Interface_InterfaceModelNewModel ()
     Produces a new model (from the Controller), can be Null Does not set it in the session.
    static occ::handle< Standard_TransientEntity (const int numnum)
     Returns the entity n0 <num> of the Model of the Session (it is StartingEntity) Null Handle if <num> is not suitable.
    static int Number (const occ::handle< Standard_Transient > &ent)
     Returns the number of an entity in the Model (StartingNumber) 0 if <ent> unknown in the model, or null.
    static void SetTransferProcess (const occ::handle< Standard_Transient > &TP)
     Sets a TransferProcess in order to analyse it (see Activator) It can be either a FinderProcess or a TransientProcess, in that case a new TransferReader is created on it.
    static occ::handle< Transfer_TransientProcessTransientProcess ()
     Returns the TransferProcess : TransientProcess detained by the TransferReader.
    static occ::handle< Transfer_FinderProcessFinderProcess ()
     Returns the FinderProcess, detained by the TransferWriter.
    static void InitTransferReader (const int modemode)
     Initialises a TransferReader, according to mode: 0 nullifies it, 1 clears it (not nullify) 2 sets it with TransientProcess & Model 3 idem plus roots of TransientProcess Remark : called with 0 at least at each SetModel/NewModel.
    static occ::handle< XSControl_TransferReaderTransferReader ()
     Returns the current TransferReader, can be null It detains the TransientProcess.
    static occ::handle< Standard_TransientGetEntity (const char *const namename="")
     Takes the name of an entity, either as argument, or (if <name> is empty) on keyboard, and returns the entity name can be a label or a number (in alphanumeric), it is searched by NumberFromLabel from WorkSession. If <name> doesn't match en entity, a Null Handle is returned.
    static int GetEntityNumber (const char *const namename="")
     Same as GetEntity, but returns the number in the model of the entity. Returns 0 for null handle.
    static occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > GetList (const char *const firstfirst="", const char *const second="")
     Evaluates and returns a list of entity, from : keyboard if <first> and <second> are empty, see below first if second is empty : can be a number/label of an entity or the name of a selection to be evaluated (standard) first : name of a selection, evaluated from a list defined by second In case of failure, returns a Null Handle.
    static bool FileAndVar (const char *const file, const char *const var, const char *const def, TCollection_AsciiString &resfile, TCollection_AsciiString &resvar)
     Analyses given file name and variable name, with a default name for variables. Returns resulting file name and variable name plus status "file to read"(True) or "already read"(False) In the latter case, empty resfile means no file available.
    static int MoreShapes (occ::handle< NCollection_HSequence< TopoDS_Shape > > &list, const char *const namename)
     Analyses a name as designating Shapes from DRAW variables or XSTEP transfer (last Transfer on Reading). <name> can be : "*" : all the root shapes produced by last Transfer (Read) i.e. considers roots of the TransientProcess a name : a name of a variable DRAW.
    static double GetLengthUnit (const occ::handle< TDocStd_Document > &theDoc=nullptr)
     Extracts length unit from the static interface or document. Document unit has the highest priority.
    static XSControl_WorkSessionMapWorkSessionList ()
     Returns available work sessions with their associated files.
    static void CollectActiveWorkSessions (const occ::handle< XSControl_WorkSession > &theWS, const TCollection_AsciiString &theName, XSControl_WorkSessionMap &theMap)
     Binds session and name into map recursively. Recursively means extract sub-sessions from main session.
    static void CollectActiveWorkSessions (const TCollection_AsciiString &theName)
     Binds current session with input name.
    static void Factory (Draw_Interpretor &theDI)
     Loads all Draw commands of XSDRAW. Used for plugin.

    Detailed Description

    Basic package to work functions of X-STEP (IFSelect & Co) under control of DRAW.

    Works with some "static" data : a SessionPilot (used to run) with its WorkSession and Model and TransferReader, a FinderProcess

    Member Function Documentation

    ◆ ChangeCommand()

    void XSDRAW::ChangeCommand ( const char *const oldname,
    const char *const newname )
    static

    Takes variables to/from the DRAW session Implements ProgressIndicator for DRAW Changes the name under which a command of xstep is known by Draw. This allows to avoid collisions To be called before LoadDraw or any other xstep initialisation.

    ◆ CollectActiveWorkSessions() [1/2]

    void XSDRAW::CollectActiveWorkSessions ( const occ::handle< XSControl_WorkSession > & theWS,
    const TCollection_AsciiString & theName,
    XSControl_WorkSessionMap & theMap )
    static

    Binds session and name into map recursively. Recursively means extract sub-sessions from main session.

    Parameters
    [in]theWSthe session object
    [in]theNamethe session file name
    [out]theMapcollection to keep session info

    ◆ CollectActiveWorkSessions() [2/2]

    void XSDRAW::CollectActiveWorkSessions ( const TCollection_AsciiString & theName)
    static

    Binds current session with input name.

    Parameters
    [in]theNamethe session file name

    ◆ Controller()

    occ::handle< XSControl_Controller > XSDRAW::Controller ( )
    static

    Returns the Controller, a Null Handle if not yet defined.

    ◆ Entity()

    occ::handle< Standard_Transient > XSDRAW::Entity ( const int num)
    static

    Returns the entity n0 <num> of the Model of the Session (it is StartingEntity) Null Handle if <num> is not suitable.

    ◆ Execute()

    int XSDRAW::Execute ( const char *const command,
    const char *const var = "" )
    static

    Allows to execute a xstep-draw command from C++ program Fixed form: Execute("command args..."); Form with a variable text part : add s for the variable : Execute ("command args %s args..",var) [var is a CString] Returns the same value as returned by call from DRAW.

    ◆ Factory()

    void XSDRAW::Factory ( Draw_Interpretor & theDI)
    static

    Loads all Draw commands of XSDRAW. Used for plugin.

    ◆ FileAndVar()

    bool XSDRAW::FileAndVar ( const char *const file,
    const char *const var,
    const char *const def,
    TCollection_AsciiString & resfile,
    TCollection_AsciiString & resvar )
    static

    Analyses given file name and variable name, with a default name for variables. Returns resulting file name and variable name plus status "file to read"(True) or "already read"(False) In the latter case, empty resfile means no file available.

    If <file> is null or empty or equates ".", considers Session and returned status is False Else, returns resfile = file and status is True If is neither null nor empty, resvar = var Else, the root part of <resfile> is considered, if defined Else, <def> is taken

    ◆ FinderProcess()

    occ::handle< Transfer_FinderProcess > XSDRAW::FinderProcess ( )
    static

    Returns the FinderProcess, detained by the TransferWriter.

    ◆ GetEntity()

    occ::handle< Standard_Transient > XSDRAW::GetEntity ( const char *const name = "")
    static

    Takes the name of an entity, either as argument, or (if <name> is empty) on keyboard, and returns the entity name can be a label or a number (in alphanumeric), it is searched by NumberFromLabel from WorkSession. If <name> doesn't match en entity, a Null Handle is returned.

    ◆ GetEntityNumber()

    int XSDRAW::GetEntityNumber ( const char *const name = "")
    static

    Same as GetEntity, but returns the number in the model of the entity. Returns 0 for null handle.

    ◆ GetLengthUnit()

    double XSDRAW::GetLengthUnit ( const occ::handle< TDocStd_Document > & theDoc = nullptr)
    static

    Extracts length unit from the static interface or document. Document unit has the highest priority.

    Returns
    length unit in MM. 1.0 by default

    ◆ GetList()

    occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > XSDRAW::GetList ( const char *const first = "",
    const char *const second = "" )
    static

    Evaluates and returns a list of entity, from : keyboard if <first> and <second> are empty, see below first if second is empty : can be a number/label of an entity or the name of a selection to be evaluated (standard) first : name of a selection, evaluated from a list defined by second In case of failure, returns a Null Handle.

    ◆ InitTransferReader()

    void XSDRAW::InitTransferReader ( const int mode)
    static

    Initialises a TransferReader, according to mode: 0 nullifies it, 1 clears it (not nullify) 2 sets it with TransientProcess & Model 3 idem plus roots of TransientProcess Remark : called with 0 at least at each SetModel/NewModel.

    ◆ LoadDraw()

    void XSDRAW::LoadDraw ( Draw_Interpretor & theCommands)
    static

    Defines the context for using a X-STEP Session under DRAW Once the various INITs have been done, a call to LoadDraw records the defined commands for the X-STEP SessionPilot, into the DRAW interpretation list. "Set" commands are accessed under command xset SDS>xset name command ... Other commands can be accessed directly or under command xstep SDS>command ... and SDS>xstep command ... are equivalent.

    Only the command xinit is accessed directly only: SDS>xinit (from the already defined Controller) SDS>xinit iges (first defines the Controller as for "iges")

    It also records the function to be called by DRAW (not declared because specific). And it defines the context variables, i.e. a WorkSession, then it calls SetController with the currently defined Controller Remark : at least, the standard commands are recorded

    See also Controller : it is part of the Context, but it must be precised separately

    ◆ LoadSession()

    bool XSDRAW::LoadSession ( )
    static

    Defines the basic context to work with a X-STEP Session : it performs the basic inits, also records the Controller If the Controller is not yet set, it must be set after (call to SetController) LoadSession is called by LoadDraw Returns True the first time, False if already called.

    ◆ Model()

    occ::handle< Interface_InterfaceModel > XSDRAW::Model ( )
    static

    Returns the Model of the Session (it is Session()->Model() ).

    ◆ MoreShapes()

    int XSDRAW::MoreShapes ( occ::handle< NCollection_HSequence< TopoDS_Shape > > & list,
    const char *const name )
    static

    Analyses a name as designating Shapes from DRAW variables or XSTEP transfer (last Transfer on Reading). <name> can be : "*" : all the root shapes produced by last Transfer (Read) i.e. considers roots of the TransientProcess a name : a name of a variable DRAW.

    Returns the count of designated Shapes. Their list is put in

    If

    null, it is firstly created. Then it is completed (Append without Clear) by the Shapes found Returns 0 if no Shape could be found

    ◆ NewModel()

    occ::handle< Interface_InterfaceModel > XSDRAW::NewModel ( )
    static

    Produces a new model (from the Controller), can be Null Does not set it in the session.

    ◆ Number()

    int XSDRAW::Number ( const occ::handle< Standard_Transient > & ent)
    static

    Returns the number of an entity in the Model (StartingNumber) 0 if <ent> unknown in the model, or null.

    ◆ Pilot()

    occ::handle< IFSelect_SessionPilot > XSDRAW::Pilot ( )
    static

    Returns the SessionPilot (can be used for direct call).

    ◆ Protocol()

    occ::handle< Interface_Protocol > XSDRAW::Protocol ( )
    static

    Returns the actually defined Protocol.

    ◆ RemoveCommand()

    void XSDRAW::RemoveCommand ( const char *const oldname)
    static

    Removes a command from the interpretation list of Draw To be called before LoadDraw or any other xstep initialisation.

    ◆ Session()

    const occ::handle< XSControl_WorkSession > XSDRAW::Session ( )
    static

    Returns the WorkSession defined in AddDraw (through Pilot) It is from XSControl, it brings functionalities for Transfers.

    ◆ SetController()

    void XSDRAW::SetController ( const occ::handle< XSControl_Controller > & control)
    static

    Defines a Controller for the command "xinit" and applies it (i.e. calls its method Customise).

    ◆ SetModel()

    void XSDRAW::SetModel ( const occ::handle< Interface_InterfaceModel > & model,
    const char *const file = "" )
    static

    Sets a Model in session (it is Session()->SetModel(model) ) If <file> is defined, SetLoadedFile is also done.

    ◆ SetNorm()

    bool XSDRAW::SetNorm ( const char *const normname)
    static

    Sets a norm by its name (controller recorded as <normname> ) Returns True if done, False if this norm is unknown.

    ◆ SetSession()

    void XSDRAW::SetSession ( const occ::handle< XSControl_WorkSession > & theSession)
    static

    Updates the WorkSession defined in AddDraw (through Pilot) It is from XSControl, it brings functionalities for Transfers.

    ◆ SetTransferProcess()

    void XSDRAW::SetTransferProcess ( const occ::handle< Standard_Transient > & TP)
    static

    Sets a TransferProcess in order to analyse it (see Activator) It can be either a FinderProcess or a TransientProcess, in that case a new TransferReader is created on it.

    ◆ TransferReader()

    occ::handle< XSControl_TransferReader > XSDRAW::TransferReader ( )
    static

    Returns the current TransferReader, can be null It detains the TransientProcess.

    ◆ TransientProcess()

    occ::handle< Transfer_TransientProcess > XSDRAW::TransientProcess ( )
    static

    Returns the TransferProcess : TransientProcess detained by the TransferReader.

    ◆ WorkSessionList()

    XSControl_WorkSessionMap & XSDRAW::WorkSessionList ( )
    static

    Returns available work sessions with their associated files.


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