NaviNIBS.util.pyvista.RemotePlotting.RemotePlotterProxy module¶
- class NaviNIBS.util.pyvista.RemotePlotting.RemotePlotterProxy.RemoteActorProxy(actorID, plotter)[source]¶
Bases:
object
- Parameters:
_actorID
_plotter
- _actorID: str¶
- _plotter: RemotePlotterProxyBase¶
- property actorID¶
- property plotter¶
- property mapper¶
- class NaviNIBS.util.pyvista.RemotePlotting.RemotePlotterProxy.RemoteCameraProxy(plotter)[source]¶
Bases:
object
- Parameters:
_plotter
- _plotter: RemotePlotterProxyBase¶
- property position¶
- property focal_point¶
- property up¶
- property clipping_range¶
- property parallel_scale¶
- property view_angle¶
- class NaviNIBS.util.pyvista.RemotePlotting.RemotePlotterProxy.RemotePlotterProxyBase[source]¶
Bases:
object
- class CallbackRegistry(callbacks=NOTHING)[source]¶
Bases:
object
- Parameters:
_callbacks
- _callbacks: dict[str, Callable]¶
- property picked_point¶
- property camera¶
- property mapper¶
- allowNonblockingCalls()[source]¶
Within this context, most commands will be pushed out to remote for execution, and we won’t wait for the return value (i.e. we will immediately return None).
Some commands may still block.
Multiple calls are guaranteed to be executed in order by the remote plotter. If multiple non-blocking calls are made right before a blocking call, the blocking call will block until all preceding non-blocking calls are complete before starting.
- class NaviNIBS.util.pyvista.RemotePlotting.RemotePlotterProxy.RemotePlotterProxy(parent=None, **kwargs)[source]¶
Bases:
RemotePlotterProxyBase
,QWidget
There are issues with instantiating multiple pyvista BackgroundPlotters in the same process, related to opengl window binding and threaded render contexts. To work around this, we create a separate process for each plotter, embed it in the primary Qt process using QWidget.createWindowContainer(), and communicate with it via zmq sockets. This is
- very inefficient (due to multiprocesing overhead), but has the side benefit of
parallelizing some of the rendering workload.
Note that this requires serializing / deserializing communication between the main process and the plotter. Only a limited subset of plotter methods are currently supported, and code working with the results of plotter calls (e.g. actors) may need to be further
adapted by the caller.
- property isReadyEvent¶
- render(self, painter: PySide6.QtGui.QPainter, targetOffset: PySide6.QtCore.QPoint, sourceRegion: PySide6.QtGui.QRegion | PySide6.QtGui.QBitmap | PySide6.QtGui.QPolygon | PySide6.QtCore.QRect = Default(QRegion), renderFlags: PySide6.QtWidgets.QWidget.RenderFlag = Instance(QWidget.RenderFlags(QWidget.RenderFlag.DrawWindowBackground | QWidget.RenderFlag.DrawChildren))) → None[source]¶
- render(self, target: PySide6.QtGui.QPaintDevice, targetOffset: PySide6.QtCore.QPoint = Default(QPoint), sourceRegion: PySide6.QtGui.QRegion | PySide6.QtGui.QBitmap | PySide6.QtGui.QPolygon | PySide6.QtCore.QRect = Default(QRegion), renderFlags: PySide6.QtWidgets.QWidget.RenderFlag = Instance(QWidget.RenderFlags(QWidget.RenderFlag.DrawWindowBackground | QWidget.RenderFlag.DrawChildren))) → None
- staticMetaObject = PySide6.QtCore.QMetaObject("RemotePlotterProxy" inherits "QWidget": )¶
- class NaviNIBS.util.pyvista.RemotePlotting.RemotePlotterProxy.RemoteMapper(parentActor=None, parentPlotter=None)[source]¶
Bases:
object
- Parameters:
_parentActor
_parentPlotter
- _parentActor: RemoteActorProxy | None¶
- _parentPlotter: RemotePlotterProxy | None¶
- property scalar_range¶