9 #include "fwRenderVTK/config.hpp" 11 #include <fwCom/helper/SigSlotConnection.hpp> 13 #include <fwRender/IRender.hpp> 15 #include <fwRuntime/ConfigurationElement.hpp> 17 #include <fwServices/helper/Config.hpp> 21 class vtkRenderWindow;
23 class vtkAbstractPropPicker;
30 class TransformationMatrix3D;
42 class IVtkRenderWindowInteractorManager;
106 typedef std::string RendererIdType;
107 typedef std::string PickerIdType;
108 typedef std::string ObjectIdType;
109 typedef std::string AdaptorIdType;
110 typedef std::string VtkObjectIdType;
111 typedef std::map< std::string, ::fwData::Object::csptr > ConstObjectMapType;
113 FWRENDERVTK_API
static const ::fwCom::Slots::SlotKeyType s_RENDER_SLOT;
114 FWRENDERVTK_API
static const ::fwCom::Slots::SlotKeyType s_REQUEST_RENDER_SLOT;
115 FWRENDERVTK_API
static const ::fwCom::Slots::SlotKeyType s_TOGGLE_AUTO_RENDER_SLOT;
117 FWRENDERVTK_API
static const ::fwCom::Signals::SignalKeyType s_DROPPED_SIG;
120 FWRENDERVTK_API
SRender() noexcept;
122 FWRENDERVTK_API virtual ~
SRender() noexcept;
125 FWRENDERVTK_API vtkRenderer* getRenderer(RendererIdType rendererId);
128 bool isShownOnScreen();
131 FWRENDERVTK_API vtkAbstractPropPicker* getPicker(PickerIdType pickerId);
134 FWRENDERVTK_API vtkObject* getVtkObject(const VtkObjectIdType& objectId) const;
137 FWRENDERVTK_API vtkTransform* getOrAddVtkTransform( const VtkObjectIdType& _id );
139 bool getPendingRenderRequest() const;
141 void setPendingRenderRequest(
bool b);
143 enum class RenderMode
152 RenderMode getRenderMode()
const;
155 FWRENDERVTK_API
bool isOffScreen()
const;
158 FWRENDERVTK_API
void setOffScreenRenderSize(
unsigned int _width,
unsigned int _height);
163 FWRENDERVTK_API
void render();
166 FWRENDERVTK_API
virtual void starting()
override;
169 FWRENDERVTK_API
virtual void stopping()
override;
172 FWRENDERVTK_API
virtual void configuring()
override;
175 FWRENDERVTK_API
virtual void updating()
override;
178 FWRENDERVTK_API
void addVtkObject(
const VtkObjectIdType& _id, vtkObject* _vtkObj );
183 void requestRender();
186 void toggleAutoRender();
195 void configurePicker (
const ConfigType& pickerConf );
198 void configureRenderer (
const ConfigType& rendererConf );
201 void configureVtkObject(
const ConfigType& vtkObjectConf );
204 vtkTransform* createVtkTransform(
const ConfigType& vtkObjectConf );
210 typedef
std::map< RendererIdType, vtkRenderer* > RenderersMapType;
213 typedef
std::map< PickerIdType, vtkAbstractPropPicker* > PickersMapType;
216 typedef
std::map< VtkObjectIdType, vtkObject* > VtkObjectMapType;
218 RenderersMapType m_renderers;
219 PickersMapType m_pickers;
220 VtkObjectMapType m_vtkObjects;
222 bool m_pendingRenderRequest;
226 RenderMode m_renderMode;
228 unsigned int m_width;
229 unsigned int m_height;
237 ConfigType m_sceneConf;
242 inline
bool SRender::getPendingRenderRequest()
const 244 return m_pendingRenderRequest;
249 inline void SRender::setPendingRenderRequest(
bool b)
251 m_pendingRenderRequest = b;
256 inline SRender::RenderMode SRender::getRenderMode()
const
Defines the service interface managing the rendering service for object.
The generic scene service shows adaptors in a 3D VTK scene.
Defines a class to manage vtkRenderWindowInteractor in a window.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
The namespace fwRenderVTK contains classes for rendering with VTK.
Contains the representation of the data objects used in the framework.
This namespace fwThread provides few tools to execute asynchronous tasks on different threads...