SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Classes | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Friends | List of all members
pqSMTKBehavior Class Reference

Create and synchronize smtk manager instances on the client and server. More...

#include <pqSMTKBehavior.h>

Inheritance diagram for pqSMTKBehavior:
[legend]
Collaboration diagram for pqSMTKBehavior:
[legend]

Classes

class  Internal
 

Public Slots

virtual bool setPostProcessingMode (bool inPost)
 Set whether post-processing mode is enabled (true) or disabled (false; default). More...
 

Signals

void addedManagerOnServer (vtkSMSMTKWrapperProxy *mgr, pqServer *server)
 Called from within addManagerOnServer (in response to server becoming ready)
 
void addedManagerOnServer (pqSMTKWrapper *mgr, pqServer *server)
 
void removingManagerFromServer (vtkSMSMTKWrapperProxy *mgr, pqServer *server)
 Called from within removeManagerFromServer (in response to server disconnect prep)
 
void removingManagerFromServer (pqSMTKWrapper *mgr, pqServer *server)
 
void postProcessingModeChanged (bool isPostProcessing)
 Called from within setPostProcessingMode.
 
void pipelineSourceCreated (smtk::resource::ResourcePtr smtkResource, pqSMTKResource *pipelineSource)
 Connected in pqSMTKAppComponentsAutoStart::startup()
 
void aboutToDestroyPipelineSource (smtk::resource::ResourcePtr smtkResource, pqSMTKResource *pipelineSource)
 Connected in pqSMTKAppComponentsAutoStart::startup()
 

Public Member Functions

virtual void addPQProxy (pqSMTKWrapper *rsrcMgr)
 
pqSMTKWrapper * getPVResourceManager (smtk::resource::ManagerPtr rsrcMgr)
 Return the pqSMTKWrapper for a given smtk::resource::ManagerPtr.
 
QPointer< pqSMTKResourcegetPVResource (const smtk::resource::ResourcePtr &rsrc) const
 Return the pqSMTKResource for a given smtk::resource::ResourcePtr. More...
 
vtkSMProxy * getPVResourceProxy (const smtk::resource::ResourcePtr &rsrc) const
 Return the vtkSMProxy for a given smtk::resource::ResourcePtr.
 
virtual void visitResourceManagersOnServers (const std::function< bool(pqSMTKWrapper *, pqServer *)> &fn) const
 Call a visitor function fn on each existing resource manager/server pair. More...
 
bool createRepresentation (pqSMTKResource *pvr, pqView *view)
 Create a pqDataRepresentation and set its default visibility value.
 
pqSMTKWrapper * builtinOrActiveWrapper () const
 Return the SMTK wrapper serving the client process, or, failing that, the active server's wrapper (or null if none can be located).
 
bool postProcessingMode () const
 Return whether SMTK is in "post-processing" mode or not.
 
vtkSMSMTKWrapperProxy * wrapperProxy (pqServer *server=nullptr) const
 Return the server-side container of counterparts for the managers above. More...
 
pqSMTKWrapper * resourceManagerForServer (pqServer *server=nullptr) const
 Return the server-side container of counterparts for the managers above. More...
 

Static Public Member Functions

static pqSMTKBehaviorinstance (QObject *parent=nullptr)
 
static void processEvents ()
 process non-user QT events
 
static void importPythonOperationsForModule (const std::string &moduleName, const std::string &operationName)
 Register operations from the named module after the event loop starts. More...
 

Protected Slots

virtual void addManagerOnServer (pqServer *)
 Called whenever a PV server becomes ready.
 
virtual void removeManagerFromServer (pqServer *)
 Called whenever a PV server is about to be disconnected.
 
virtual void handleNewSMTKProxies (pqProxy *pxy)
 Track when SMTK proxies are added (not all pxy may cast to SMTK objects but some may)
 
virtual void handleOldSMTKProxies (pqPipelineSource *pxy)
 Track when resources are removed (not all pxy may cast to SMTK objects but some may)
 
virtual void updateResourceProxyMap (const std::shared_ptr< smtk::resource::Resource > &resource)
 Track when SMTK proxy resources are changed.
 

Protected Member Functions

 pqSMTKBehavior (QObject *parent=nullptr)
 
void setupSelectionManager ()
 
void setDefaultRepresentationVisibility (pqOutputPort *pqPort, pqView *view)
 Make a representation visible through a ControllerWithRendering instance.
 

Protected Attributes

Internalm_p
 
bool m_postProcessingMode { false }
 

Friends

class pqSMTKAppComponentsAutoStart
 

Detailed Description

Create and synchronize smtk manager instances on the client and server.

This instance will watch for server connection/disconnection events. When a new server is connected, it will have the server-manager instantiate an smtk::resource::Manager there. When a server is disconnected, it will remove information from the client about that server's resources.

At the moment, all this class does is create a resource manager and expose it. It should eventually deal with synchronization issues as stated above, but SMTK's resource manager doesn't deal with remote resources yet.

Member Function Documentation

◆ getPVResource()

QPointer< pqSMTKResource > pqSMTKBehavior::getPVResource ( const smtk::resource::ResourcePtr rsrc) const

Return the pqSMTKResource for a given smtk::resource::ResourcePtr.

Note that this is an O(N) operation (linear in the number of resources loaded across all servers).

◆ importPythonOperationsForModule()

void pqSMTKBehavior::importPythonOperationsForModule ( const std::string &  moduleName,
const std::string &  operationName 
)
static

Register operations from the named module after the event loop starts.

ParaView loads plugins (including python plugins) before a server connection is established. This method queues a function to run after the event loop starts to register Python operations to the active server's operation manager.

◆ resourceManagerForServer()

pqSMTKWrapper * pqSMTKBehavior::resourceManagerForServer ( pqServer *  server = nullptr) const

Return the server-side container of counterparts for the managers above.

If server is null, a random server's proxy is chosen. Since most apps connect to a single server, this is usually well-defined.

◆ setPostProcessingMode

bool pqSMTKBehavior::setPostProcessingMode ( bool  inPost)
virtualslot

Set whether post-processing mode is enabled (true) or disabled (false; default).

The return value indicates whether the value changed.

◆ visitResourceManagersOnServers()

void pqSMTKBehavior::visitResourceManagersOnServers ( const std::function< bool(pqSMTKWrapper *, pqServer *)> &  fn) const
virtual

Call a visitor function fn on each existing resource manager/server pair.

This method has the same signature as the addedManagerOnServer signal, so you can pass a simple lambda that invokes your class's slot to the signal. This way, you can attach signals to resource managers already in existence in addition to those created after your class's initialization.

If the function returns true, then iteration should terminate.

◆ wrapperProxy()

vtkSMSMTKWrapperProxy * pqSMTKBehavior::wrapperProxy ( pqServer *  server = nullptr) const

Return the server-side container of counterparts for the managers above.

If server is null, a random server's proxy is chosen. Since most apps connect to a single server, this is usually well-defined.


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