paraview运行时解释器:vtkClientServerInterpreter

本文详细解读了VTK库中的Client-Server组件,包括vtkClientServerID用于标识对象,vtkClientServerInterpreter负责运行时解释和消息处理,以及vtkSMSession核心会话类。还介绍了vtkPVSessionBase和相关子类,如vtkSMReaderFactory用于创建文件读取器,以及Proxy管理与远程对象交互。
摘要由CSDN通过智能技术生成

目录

vtkClientServerID 

vtkClientServerInterpreter

vtkClientServerInterpreterInitializer

vtkClientServerStream

vtkClientServerStreamInstantiator 

 

vtkSMSession相关

vtkPVSessionBase

vtkSMSession 

vtkSIObject 

 vtkPVSessionCore

vtkSMPipelineState 

vtkSMReaderFactory 

vtkSMRemoteObject 

 vtkSMServerStateLocator 

vtkSMSessionObject 

vtkSMSessionProxyManager 


vtkClientServerID 

/**
 * @class   vtkClientServerID
 * @brief   Identifier for a ClientServer object.
 *
 * vtkClientServerID identifies an object managed by a
 * vtkClientServerInterpreter.  Although the identifier is simply an
 * integer, this class allows vtkClientServerStream to identify the
 * integer as an object identifier.
*/

vtkClientServerID由vtkClientServerInterpreter管理。

ClientServer object的ID.

vtkClientServerInterpreter

/**
 * @class   vtkClientServerInterpreter
 * @brief   Run-time VTK interpreter.
 *
 * vtkClientServerInterpreter will process messages stored in a
 * vtkClientServerStream.  This allows run-time creation and execution
 * of VTK programs.
*/

运行时解释器

vtkClientServerInterpreterInitializer

/**
 * @class   vtkClientServerInterpreterInitializer
 *
 * vtkClientServerInterpreterInitializer initializes and maintains the global
 * vtkClientServerInterpreter instance for the processes. Use RegisterCallback()
 * to register initialization routines for the interpreter. Use GetInterpreter()
 * to access the interpreter.
 *
 * This class was originally designed to support and maintain multiple
 * interpreter instances. However ParaView no longer has need for that and hence
 * that functionality is no longer made public.
*/

初始化并维护进程的全局vtkClientServerInterpreter实例。使用RegisterCallback()为解释器注册初始化例程。使用GetInterpreter()访问解释器。

RegisterCallback

GetInterpreter

vtkClientServerStream

/**
 * @class   vtkClientServerStream
 * @brief   Store messages for the interpreter.
 *
 * vtkClientServerStream will store zero or more almost arbitrary
 * messages in a platform-independent manner.  The stream's data may
 * be copied from one platform to another via GetData/SetData methods,
 * and the message represented will remain unchanged.  Messages are
 * used to represent both commands and results for
 * vtkClientServerInterpreter, but they may be used for any purpose.
*/

vtkClientServerStreamInstantiator 

/**
 * @class vtkClientServerStreamInstantiator
 * @brief creates instances of vtkObjectBase subclasses given the name.
 *
 * vtkClientServerStreamInstantiator uses vtkClientServerStream and global
 * vtkClientServerInterpreter to create new instances of vtkObjectBase subclasses
 * given the string name.
 *
 */

 

vtkSMSession相关

vtkPVSessionBase

/**
 * @class   vtkPVSessionBase
 *
 * Abstract class used to provide the main implementation of the ParaView
 * session methods for the following classes: vtkSMSession,
 *                                            vtkSMSessionClient,
 *                                            vtkSMSessionServer
*/

vtkSMSession 

/**
 * @class   vtkSMSession
 *
 * vtkSMSession is the default ParaView session. This class can be used as the
 * session for non-client-server configurations eg. builtin mode or batch.
*/

 

vtkSMSession : public vtkPVSessionBase

vtkSIObject 

/**
 * @class   vtkSIObject
 *
 * Object that is managed by vtkPVSessionCore which wrap concrete class such as
 * the vtk ones.
*/

该对象由包装具体类(如vtk类)的vtkPVSessionCore管理。

 vtkPVSessionCore

/**
 * @class   vtkPVSessionCore
 *
 * vtkPVSessionCore is used by vtkSMSession.
 * vtkPVSessionCore handle the communication to MPI satellites and
 * ServerImplementation code instantiation and execution.
 * On the other hand, the vtkSMSession dispatch the request to the right
 * process and therefore to the right vtkPVSessionCore instance.
*/

vtkPVSessionCore处理与MPI卫星和服务器的通信,实现代码实例化和执行。

另一方面,vtkSMSession将请求分派到正确的进程,从而分派到正确的vtkPVSessionCore实例。

vtkSMPipelineState 

/**
 * @class   vtkSMPipelineState
 * @brief   class that manage the state of the processing
 * pipeline
 *
 * This class is used to provide a RemoteObject API to the vtkSMProxyManager
 * which allow Undo/Redo and state sharing across several ParaView clients.
 * Basically, we expose the state management API of RemoteObject to handle
 * registration and unregistration of proxies.
*/

vtkSMReaderFactory 

/**
 * @class   vtkSMReaderFactory
 * @brief   is a factory for creating a reader
 * proxy based on the filename/extension.
 *
 * vtkSMReaderFactory is a factory for creating a reader that reads a particular
 * file. The reader factory needs to be configured to register the reader
 * prototypes supported by the application. This is done automatically when
 * the reader's proxy definition is registered AND if it has the extensions
 * specified in the Hints section of the XML proxy definition. It is done
 * with the following format:
 * \verbatim
 * <ReaderFactory extensions="[list of expected extensions]"
 *     file_description="[description of the file]" />
 * \endverbatim
 *
 * Once the factory has been configured, the API to create readers, get
 * available readers etc. can be used.
*/

vtkSMRemoteObject 

/**
 * @class   vtkSMRemoteObject
 * @brief   baseclass for all proxy-objects that have counter
 * parts on server as well as client processes.
 *
 * Abstract class involved in ServerManager class hierarchy that has a
 * corresponding SIObject which can be local or remote.
*/

 vtkSMServerStateLocator 

/**
 * @class   vtkSMServerStateLocator
 * @brief   Class used to retrieve a given message state based
 * on its GlobalID from the DataServer.
 *
 * Retrieve a given state from the server.
*/

vtkSMSessionObject 

/**
 * @class   vtkSMSessionObject
 * @brief   superclass for any server manager classes
 *                            that are related to a session
 *
 * vtkSMSessionObject provides methods to set and get the relative session
*/

vtkSMSessionProxyManager 

/**
 * @class   vtkSMSessionProxyManager
 *  The vtkSMSessionProxyManager is esponsible for creating and
 *  managing proxies for a given session.
 *
 *
 * vtkSMSessionProxyManager is an instance that creates and manages proxies
 * for a given session/server.
 * It maintains a map of XML elements (populated by the XML parser) from
 * which it can create and initialize proxies and properties.
 * Once a proxy is created, it can either be managed by the user code or
 * the proxy manager. In the latter case, pass the control of the proxy to the
 * manager with RegisterProxy() and unregister it. At destruction, proxy
 * manager deletes all managed proxies.
 *
 * vtkSMSessionProxyManager is designed to work with only one session. When
 * the session on which it is attached closes, it has no role and should be
 * deleted right away.
 * @sa
 * vtkSMProxyDefinitionManager
 *
 * @sa
 * Basic XML Proxy definition documentation:
 *
 * @sa
 * ------------- Proxy definition -------------
 * \code{.xml}
 *  <SourceProxy                   => Will create vtkSM + SourceProxy class.
 *         name="SphereSource"     => Key used to create the proxy.
 *         class="vtkSphereSource" => Concrete VTK class that does the real job.
 *         label="Sphere">         => Nice name used in menu and python shell.
 * \endcode
 *
 * @sa
 * ----------- Property definition -----------
 * \code{.xml}
 *    <DoubleVectorProperty        => Will create vtkSM + DoubleVectorProperty
 *                                    and vtkSI + DoubleVectorProperty class by
 *                                    default.
 *         name="Center"           => Name of the property:
 *                                    Example usage: vtkSMPropertyHelper(proxy, "Center").Set(0,1,2)
 *         command="SetCenter"     => Real method name that will be called on
 *                                    vtkObject when the property is updated.
 *         number_of_elements="3"  => Size of the vector.
 *         animateable="1"         => Tell the animation view that property
 *                                    can be used as an evolving property.
 *         default_values="0 0 0"> => The value that will be set at the
 *    </DoubleVectorProperty>         construction to the VTK object.
 *  </SourceProxy>
 * \endcode
 *
 * @sa
 * For custom behaviour the user can add some extra attributes:
 *
 *  - We can specify a custom SIProperty class to handle in a custom way the
 *    data on the server:
 * \code{.xml}
 *      <StringVectorProperty          => vtkSMStringVectorProperty class.
 *         name="ElementBlocksInfo"    => Property name.
 *         information_only="1"        => Can only be used to fetch data.
 *         si_class="vtkSISILProperty" => Class name to instantiate on the other side.
 *         subtree="Blocks"/>          => Extra attribute used by vtkSISILProperty.
 * \endcode
 *
 * @sa
 *  - We can trigger after any update a command to be executed:
 * \code{.xml}
 *      <Proxy name="LookupTable"
 *             class="vtkLookupTable"
 *             post_push="Build"       => The method Build() will be called each
 *                                        time a new property value is pushed to
 *                                        the VTK object.
 *             processes="dataserver|renderserver|client" >
 * </pre>
 *
 * @sa
 *  - We can force any property to push its value as soon as it is changed:
 * \code{.xml}
 *          <Property name="ResetFieldCriteria"
 *             command="ResetFieldCriteria"
 *             immediate_update="1">     => Modifying the property will result
 *                                          in an immediate push of it and the
 *                                          execution of the command on the vtkObject.
 * \endcode
 *
 * @sa
 *  - To show a source proxy or a filter inside the menu of ParaView we use a hint:
 * \code{.xml}
 *       <SourceProxy ...>
 *           <Hints>
 *              <ShowInMenu                  => The category attribute enables
 *                  category="PersoFilter"/>    specification of the sub-menu in which
 *                                              this proxy should be listed. (optional)
 *           </Hints>
 *       </SourceProxy>
 * \endcode
*/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

haimianjie2012

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值