ParaView
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
vtkSMSession Class Reference

vtkSMSession is the default ParaView session. More...

#include <vtkSMSession.h>

Inheritance diagram for vtkSMSession:
Inheritance graph
[legend]
Collaboration diagram for vtkSMSession:
Collaboration graph
[legend]

Public Types

enum  RenderingMode { RENDERING_NOT_AVAILABLE = 0x00, RENDERING_UNIFIED = 0x01, RENDERING_SPLIT = 0x02 }
 
typedef vtkPVSessionBase Superclass
 
- Public Types inherited from vtkPVSessionBase
enum  EventIds { RegisterRemoteObjectEvent = 1234, UnRegisterRemoteObjectEvent = 4321, ProcessingRemoteEnd = 2143, ConnectionLost = 6789 }
 
typedef vtkPVSession Superclass
 
- Public Types inherited from vtkPVSession
enum  ServerFlags {
  NONE = 0, DATA_SERVER = 0x01, DATA_SERVER_ROOT = 0x02, RENDER_SERVER = 0x04,
  RENDER_SERVER_ROOT = 0x08, SERVERS = DATA_SERVER | RENDER_SERVER, CLIENT = 0x10, CLIENT_AND_SERVERS = DATA_SERVER | CLIENT | RENDER_SERVER
}
 
typedef vtkSession Superclass
 
- Public Types inherited from vtkSession
typedef vtkObject Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual vtkSMCollaborationManagerGetCollaborationManager ()
 Return the instance of vtkSMCollaborationManager that will be lazy created at the first call. More...
 
virtual const char * GetURI ()
 Return the URL that define where the session is connected to. More...
 
virtual int GetNumberOfProcesses (vtkTypeUInt32 servers)
 Returns the number of processes on the given server/s. More...
 
virtual bool IsMPIInitialized (vtkTypeUInt32 servers)
 Returns whether or not MPI is initialized on the specified server/s. More...
 
virtual vtkSMProxyLocatorGetProxyLocator ()
 
virtual unsigned int GetRenderClientMode ()
 Convenient method to determine if the rendering is done in a pvrenderer or not. More...
 
virtual bool GetIsAlive ()
 Builtin session is always alive. More...
 
virtual ServerFlags GetProcessRoles ()
 Returns a ServerFlags indicate the nature of the current processes. More...
 
virtual void PushState (vtkSMMessage *msg)
 Push the state message. More...
 
virtual void NotifyAllClients (const vtkSMMessage *msg)
 Sends the message to all clients. More...
 
virtual void NotifyOtherClients (const vtkSMMessage *)
 Sends the message to all but the active client-session. More...
 
virtual void PreDisconnection ()
 
virtual vtkSMSessionProxyManagerGetSessionProxyManager ()
 Returns the vtkSMSessionProxyManager associated with this session. More...
 
virtual vtkSMStateLocatorGetStateLocator ()
 Provide an access to the session state locator that can provide the last state of a given remote object that have been pushed. More...
 
virtual bool GetIsAutoMPI ()
 This flag if set indicates that the current session module has automatically started "pvservers" as MPI processes as default pipeline. More...
 
- Public Member Functions inherited from vtkPVSessionBase
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual vtkPVServerInformationGetServerInformation ()
 vtkPVServerInformation is an information-object that provides information about the server processes. More...
 
virtual vtkMPIMToNSocketConnectionGetMPIMToNSocketConnection ()
 This is socket connection, if any to communicate between the data-server and render-server nodes. More...
 
virtual void PullState (vtkSMMessage *msg)
 Pull the state message. More...
 
virtual void ExecuteStream (vtkTypeUInt32 location, const vtkClientServerStream &stream, bool ignore_errors=false)
 Execute a command on the given processes. More...
 
virtual const vtkClientServerStreamGetLastResult (vtkTypeUInt32 location)
 Returns the response of the ExecuteStream() call from the location. More...
 
virtual bool GatherInformation (vtkTypeUInt32 location, vtkPVInformation *information, vtkTypeUInt32 globalid)
 Gather information about an object referred by the globalid. More...
 
vtkSIProxyDefinitionManagerGetProxyDefinitionManager ()
 Get the ProxyDefinitionManager. More...
 
vtkSIObjectGetSIObject (vtkTypeUInt32 globalid)
 Returns a vtkSIObject or subclass given its global id, if any. More...
 
virtual void UnRegisterSIObject (vtkSMMessage *msg)
 Unregister server side object. More...
 
virtual void RegisterSIObject (vtkSMMessage *msg)
 Register server side object. More...
 
vtkObject * GetRemoteObject (vtkTypeUInt32 globalid)
 Return a vtkSMRemoteObject given its global id if any otherwise return NULL;. More...
 
virtual void GetAllRemoteObjects (vtkCollection *collection)
 Allow the user to fill its vtkCollection with all RemoteObject This could be usefull when you want to hold a reference to them to prevent any deletion across several method call. More...
 
virtual vtkTypeUInt32 GetNextGlobalUniqueIdentifier ()
 Provides the next available identifier. More...
 
virtual vtkTypeUInt32 GetNextChunkGlobalUniqueIdentifier (vtkTypeUInt32 chunkSize)
 Return the first Id of the requested chunk. More...
 
virtual bool IsProcessingRemoteNotification ()
 This propertie is used to discard ignore_synchronization proxy property when we load protobuf states. More...
 
virtual void UseSessionCoreOf (vtkPVSessionBase *other)
 Update internal session core in order to use the one used in another session. More...
 
virtual vtkPVSessionCoreGetSessionCore ()
 Provides access to the session core. More...
 
- Public Member Functions inherited from vtkPVSession
void PrintSelf (ostream &os, vtkIndent indent)
 
bool HasProcessRole (vtkTypeUInt32 flag)
 Convenience method that returns true if the current session is serving the indicated role on this process. More...
 
virtual vtkMultiProcessController * GetController (ServerFlags processType)
 Returns the controller used to communicate with the process. More...
 
virtual bool IsMultiClients ()
 Allow anyone to know easily if the current session is involved in collaboration or not. More...
 
bool GetPendingProgress ()
 Returns true if the session is within a PrepareProgress() and CleanupPendingProgress() block. More...
 
virtual vtkPVProgressHandlerGetProgressHandler ()
 Provides access to the progress handler. More...
 
void PrepareProgress ()
 Should be called to begin/end receiving progresses on this session. More...
 
void CleanupPendingProgress ()
 Should be called to begin/end receiving progresses on this session. More...
 
- Public Member Functions inherited from vtkSession
void PrintSelf (ostream &os, vtkIndent indent)
 

Static Public Member Functions

static vtkSMSessionNew ()
 
static vtkSMSessionNew (vtkPVSessionBase *otherSession)
 
static vtkSMSessionNew (vtkPVSessionCore *otherSessionCore)
 
static int IsTypeOf (const char *type)
 
static vtkSMSessionSafeDownCast (vtkObject *o)
 
static vtkIdType ConnectToCatalyst ()
 These are static helper methods that help create Catalyst ParaView sessions. More...
 
static vtkIdType ConnectToSelf ()
 These are static helper methods that help create standard ParaView sessions. More...
 
static vtkIdType ConnectToRemote (const char *hostname, int port)
 These are static helper methods that help create standard ParaView sessions. More...
 
static vtkIdType ReverseConnectToRemote (int port)
 Same as ConnectToRemote() except that it waits for a reverse connection. More...
 
static vtkIdType ReverseConnectToRemote (int port, bool(*callback)())
 
static vtkIdType ConnectToRemote (const char *dshost, int dsport, const char *rshost, int rsport)
 These are static helper methods that help create standard ParaView sessions. More...
 
static vtkIdType ReverseConnectToRemote (int dsport, int rsport)
 Same as ConnectToRemote() except that it waits for a reverse connection. More...
 
static vtkIdType ReverseConnectToRemote (int dsport, int rsport, bool(*callback)())
 
static void Disconnect (vtkIdType sessionid)
 Use this method to disconnect from a session. More...
 
static void Disconnect (vtkSMSession *session)
 Use this method to disconnect from a session. More...
 
- Static Public Member Functions inherited from vtkPVSessionBase
static int IsTypeOf (const char *type)
 
static vtkPVSessionBaseSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkPVSession
static int IsTypeOf (const char *type)
 
static vtkPVSessionSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkSession
static int IsTypeOf (const char *type)
 
static vtkSessionSafeDownCast (vtkObject *o)
 

Protected Member Functions

 vtkSMSession (bool initialize_during_constructor=true, vtkPVSessionCore *preExistingSessionCore=NULL)
 
 ~vtkSMSession ()
 
virtual void ProcessNotification (const vtkSMMessage *)
 Process the Notifation message sent using API to communicate from server-to-client. More...
 
virtual void Initialize ()
 Initialize various internal classes after the session has been setup correctly. More...
 
void UpdateStateHistory (vtkSMMessage *msg)
 This method has been externalized so classes that heritate from vtkSMSession and override PushState could easily keep track of the StateHistory and maintain the UndoRedo mecanisme. More...
 
- Protected Member Functions inherited from vtkPVSessionBase
 vtkPVSessionBase ()
 
 vtkPVSessionBase (vtkPVSessionCore *coreToUse)
 
 ~vtkPVSessionBase ()
 
void RegisterRemoteObject (vtkTypeUInt32 globalid, vtkTypeUInt32 location, vtkObject *obj)
 Register a remote object. More...
 
void UnRegisterRemoteObject (vtkTypeUInt32 globalid, vtkTypeUInt32 location)
 Unregister a remote object. More...
 
vtkPVSessionCoreGetSessionCore () const
 Method used to migrate from one Session type to another by keeping the same vtkPVSessionCore. More...
 
void SetSessionCore (vtkPVSessionCore *)
 Method used to migrate from one Session type to another by keeping the same vtkPVSessionCore. More...
 
virtual void PrepareProgressInternal ()
 Should be called to begin/end receiving progresses on this session. More...
 
virtual void CleanupPendingProgressInternal ()
 Should be called to begin/end receiving progresses on this session. More...
 
virtual bool StartProcessingRemoteNotification ()
 Methods used to monitor if we are currently processing a server notification Only vtkSMSessionClient use the flag to disable ignore_synchronization properties from beeing updated. More...
 
virtual void StopProcessingRemoteNotification (bool previousValue)
 Methods used to monitor if we are currently processing a server notification Only vtkSMSessionClient use the flag to disable ignore_synchronization properties from beeing updated. More...
 
- Protected Member Functions inherited from vtkPVSession
 vtkPVSession ()
 
 ~vtkPVSession ()
 
virtual bool OnWrongTagEvent (vtkObject *caller, unsigned long eventid, void *calldata)
 Callback when any vtkMultiProcessController subclass fires a WrongTagEvent. More...
 
- Protected Member Functions inherited from vtkSession
 vtkSession ()
 
 ~vtkSession ()
 
virtual void Activate ()
 Subclasses must call this to mark the session active. More...
 
virtual void DeActivate ()
 Subclasses must call this to mark the session inactive. More...
 

Static Protected Member Functions

static vtkIdType ConnectToRemoteInternal (const char *hostname, int port, bool is_auto_mpi)
 Internal method used by ConnectToRemote(). More...
 

Protected Attributes

vtkSMSessionProxyManagerSessionProxyManager
 
vtkSMStateLocatorStateLocator
 
vtkSMProxyLocatorProxyLocator
 
bool IsAutoMPI
 
- Protected Attributes inherited from vtkPVSessionBase
vtkPVSessionCoreSessionCore
 
bool ProcessingRemoteNotification
 Methods used to monitor if we are currently processing a server notification Only vtkSMSessionClient use the flag to disable ignore_synchronization properties from beeing updated. More...
 
- Protected Attributes inherited from vtkPVSession
vtkPVProgressHandlerProgressHandler
 

Additional Inherited Members

- Protected Types inherited from vtkPVSession
enum  { EXCEPTION_EVENT_TAG = 31416 }
 

Detailed Description

vtkSMSession is the default ParaView session.

This class can be used as the session for non-client-server configurations eg. builtin mode or batch.

Definition at line 35 of file vtkSMSession.h.

Member Typedef Documentation

§ Superclass

Definition at line 41 of file vtkSMSession.h.

Member Enumeration Documentation

§ RenderingMode

Enumerator
RENDERING_NOT_AVAILABLE 
RENDERING_UNIFIED 
RENDERING_SPLIT 

Definition at line 94 of file vtkSMSession.h.

Constructor & Destructor Documentation

§ vtkSMSession()

vtkSMSession::vtkSMSession ( bool  initialize_during_constructor = true,
vtkPVSessionCore preExistingSessionCore = NULL 
)
protected

§ ~vtkSMSession()

vtkSMSession::~vtkSMSession ( )
protected

Member Function Documentation

§ New() [1/3]

static vtkSMSession* vtkSMSession::New ( )
static

§ New() [2/3]

static vtkSMSession* vtkSMSession::New ( vtkPVSessionBase otherSession)
static

§ New() [3/3]

static vtkSMSession* vtkSMSession::New ( vtkPVSessionCore otherSessionCore)
static

§ GetClassName()

virtual const char* vtkSMSession::GetClassName ( )
virtual

Reimplemented from vtkPVSessionBase.

Reimplemented in vtkSMSessionClient.

§ IsTypeOf()

static int vtkSMSession::IsTypeOf ( const char *  type)
static

§ IsA()

virtual int vtkSMSession::IsA ( const char *  type)
virtual

Reimplemented from vtkPVSessionBase.

Reimplemented in vtkSMSessionClient.

§ SafeDownCast()

static vtkSMSession* vtkSMSession::SafeDownCast ( vtkObject *  o)
static

§ PrintSelf()

void vtkSMSession::PrintSelf ( ostream &  os,
vtkIndent  indent 
)

§ GetCollaborationManager()

virtual vtkSMCollaborationManager* vtkSMSession::GetCollaborationManager ( )
inlinevirtual

Return the instance of vtkSMCollaborationManager that will be lazy created at the first call.

By default we return NULL

Reimplemented in vtkSMSessionClient.

Definition at line 53 of file vtkSMSession.h.

§ GetURI()

virtual const char* vtkSMSession::GetURI ( )
inlinevirtual

Return the URL that define where the session is connected to.

URI has enough information to know the type of connection, server hosts and ports.

Reimplemented in vtkSMSessionClient.

Definition at line 63 of file vtkSMSession.h.

§ GetSessionProxyManager()

virtual vtkSMSessionProxyManager* vtkSMSession::GetSessionProxyManager ( )
virtual

Returns the vtkSMSessionProxyManager associated with this session.

§ GetNumberOfProcesses()

virtual int vtkSMSession::GetNumberOfProcesses ( vtkTypeUInt32  servers)
virtual

Returns the number of processes on the given server/s.

If more than 1 server is identified, then it returns the maximum number of processes e.g. is servers = DATA_SERVER | RENDER_SERVER and there are 3 data-server nodes and 2 render-server nodes, then this method will return 3. Implementation provided simply returns the number of local processes.

Reimplemented in vtkSMSessionClient.

§ IsMPIInitialized()

virtual bool vtkSMSession::IsMPIInitialized ( vtkTypeUInt32  servers)
virtual

Returns whether or not MPI is initialized on the specified server/s.

If more than 1 server is identified it will return true only if all of the servers have MPI initialized.

Reimplemented in vtkSMSessionClient.

§ GetProxyLocator()

virtual vtkSMProxyLocator* vtkSMSession::GetProxyLocator ( )
virtual

§ GetRenderClientMode()

virtual unsigned int vtkSMSession::GetRenderClientMode ( )
virtual

Convenient method to determine if the rendering is done in a pvrenderer or not.

For built-in or pvserver you will get RENDERING_UNIFIED and for a setting with a pvrenderer you will get RENDERING_SPLIT. If the session is something else it should reply RENDERING_NOT_AVAILABLE.

§ GetStateLocator()

virtual vtkSMStateLocator* vtkSMSession::GetStateLocator ( )
virtual

Provide an access to the session state locator that can provide the last state of a given remote object that have been pushed.

That locator will be filled by RemoteObject state only if the UndoStackBuilder in vtkSMProxyManager is non-null.

§ GetIsAlive()

virtual bool vtkSMSession::GetIsAlive ( )
inlinevirtual

Builtin session is always alive.

Implements vtkSession.

Reimplemented in vtkSMSessionClient.

Definition at line 131 of file vtkSMSession.h.

§ GetProcessRoles()

virtual ServerFlags vtkSMSession::GetProcessRoles ( )
virtual

Returns a ServerFlags indicate the nature of the current processes.

e.g. if the current processes acts as a data-server and a render-server, it returns DATA_SERVER | RENDER_SERVER. The implementation provided by this class returns vtkPVSession::CLIENT_AND_SERVERS suitable for builtin-mode.

Reimplemented from vtkPVSessionBase.

Reimplemented in vtkSMSessionClient.

§ PushState()

virtual void vtkSMSession::PushState ( vtkSMMessage msg)
virtual

Push the state message.

Overridden to ensure that the information in the undo-redo state manager is updated.

Reimplemented from vtkPVSessionBase.

Reimplemented in vtkSMSessionClient.

§ NotifyAllClients()

virtual void vtkSMSession::NotifyAllClients ( const vtkSMMessage msg)
inlinevirtual

Sends the message to all clients.

Implements vtkPVSessionBase.

Definition at line 151 of file vtkSMSession.h.

§ NotifyOtherClients()

virtual void vtkSMSession::NotifyOtherClients ( const vtkSMMessage )
inlinevirtual

Sends the message to all but the active client-session.

Implements vtkPVSessionBase.

Definition at line 156 of file vtkSMSession.h.

§ PreDisconnection()

virtual void vtkSMSession::PreDisconnection ( )
inlinevirtual

Reimplemented in vtkSMSessionClient.

Definition at line 163 of file vtkSMSession.h.

§ ConnectToCatalyst()

static vtkIdType vtkSMSession::ConnectToCatalyst ( )
static

These are static helper methods that help create Catalyst ParaView sessions.

They register the session with the process module and return the session id. Returns 0 on failure. This overload is used to create a catalyst built-in session.

§ ConnectToSelf()

static vtkIdType vtkSMSession::ConnectToSelf ( )
static

These are static helper methods that help create standard ParaView sessions.

They register the session with the process module and return the session id. Returns 0 on failure. This overload is used to create a built-in session.

§ ConnectToRemote() [1/2]

static vtkIdType vtkSMSession::ConnectToRemote ( const char *  hostname,
int  port 
)
static

These are static helper methods that help create standard ParaView sessions.

They register the session with the process module and return the session id. Returns 0 on failure. This overload is used to create a client-server session on client.

§ ReverseConnectToRemote() [1/4]

static vtkIdType vtkSMSession::ReverseConnectToRemote ( int  port)
inlinestatic

Same as ConnectToRemote() except that it waits for a reverse connection.

This is a blocking call. One can optionally provide a callback that can be called periodically while this call is blocked. The callback should return true, if the connection should continue waiting, else return false to abort the wait.

Definition at line 200 of file vtkSMSession.h.

§ ReverseConnectToRemote() [2/4]

static vtkIdType vtkSMSession::ReverseConnectToRemote ( int  port,
bool(*)()  callback 
)
static

§ ConnectToRemote() [2/2]

static vtkIdType vtkSMSession::ConnectToRemote ( const char *  dshost,
int  dsport,
const char *  rshost,
int  rsport 
)
static

These are static helper methods that help create standard ParaView sessions.

They register the session with the process module and return the session id. Returns 0 on failure. This overload is used to create a client-dataserver-renderserver session on client.

§ ReverseConnectToRemote() [3/4]

static vtkIdType vtkSMSession::ReverseConnectToRemote ( int  dsport,
int  rsport 
)
inlinestatic

Same as ConnectToRemote() except that it waits for a reverse connection.

This is a blocking call. One can optionally provide a callback that can be called periodically while this call is blocked. The callback should return true, if the connection should continue waiting, else return false to abort the wait.

Definition at line 222 of file vtkSMSession.h.

§ ReverseConnectToRemote() [4/4]

static vtkIdType vtkSMSession::ReverseConnectToRemote ( int  dsport,
int  rsport,
bool(*)()  callback 
)
static

§ Disconnect() [1/2]

static void vtkSMSession::Disconnect ( vtkIdType  sessionid)
static

Use this method to disconnect from a session.

This ensures that appropriate cleanup happens before the disconnect such as unregistering proxies. It also ensures that if in collaboration mode, the proxy unregistering doesn't affect other connected clients.

§ Disconnect() [2/2]

static void vtkSMSession::Disconnect ( vtkSMSession session)
static

Use this method to disconnect from a session.

This ensures that appropriate cleanup happens before the disconnect such as unregistering proxies. It also ensures that if in collaboration mode, the proxy unregistering doesn't affect other connected clients.

§ GetIsAutoMPI()

virtual bool vtkSMSession::GetIsAutoMPI ( )
virtual

This flag if set indicates that the current session module has automatically started "pvservers" as MPI processes as default pipeline.

§ ConnectToRemoteInternal()

static vtkIdType vtkSMSession::ConnectToRemoteInternal ( const char *  hostname,
int  port,
bool  is_auto_mpi 
)
staticprotected

Internal method used by ConnectToRemote().

§ ProcessNotification()

virtual void vtkSMSession::ProcessNotification ( const vtkSMMessage )
protectedvirtual

Process the Notifation message sent using API to communicate from server-to-client.

§ Initialize()

virtual void vtkSMSession::Initialize ( )
protectedvirtual

Initialize various internal classes after the session has been setup correctly.

Reimplemented in vtkSMSessionClient.

§ UpdateStateHistory()

void vtkSMSession::UpdateStateHistory ( vtkSMMessage msg)
protected

This method has been externalized so classes that heritate from vtkSMSession and override PushState could easily keep track of the StateHistory and maintain the UndoRedo mecanisme.

Member Data Documentation

§ SessionProxyManager

vtkSMSessionProxyManager* vtkSMSession::SessionProxyManager
protected

Definition at line 280 of file vtkSMSession.h.

§ StateLocator

vtkSMStateLocator* vtkSMSession::StateLocator
protected

Definition at line 281 of file vtkSMSession.h.

§ ProxyLocator

vtkSMProxyLocator* vtkSMSession::ProxyLocator
protected

Definition at line 282 of file vtkSMSession.h.

§ IsAutoMPI

bool vtkSMSession::IsAutoMPI
protected

Definition at line 284 of file vtkSMSession.h.


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