SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Create and synchronize smtk manager instances on the client and server. More...
#include <pqSMTKBehavior.h>
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< pqSMTKResource > | getPVResource (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. | |
void | updateWrapperMap () |
Update the map from servers to SMTK wrappers. More... | |
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 pqSMTKBehavior * | instance (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 | |
Internal * | m_p |
bool | m_postProcessingMode { false } |
Friends | |
class | pqSMTKAppComponentsAutoStart |
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.
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).
|
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.
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.
|
virtualslot |
Set whether post-processing mode is enabled (true) or disabled (false; default).
The return value indicates whether the value changed.
void pqSMTKBehavior::updateWrapperMap | ( | ) |
Update the map from servers to SMTK wrappers.
In the ModelBuilder application, if the Python Shell panel is started after the application has started, the builtin client will not have an entry in m_p->Remotes
yet. This function will ensure the active server has an entry so that Python methods on the behavior (such as activeWrapperCommonManagers()) do not return a null object.
|
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.
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.