9 #include "imstkEventObject.h" 10 #include "imstkMacros.h" 11 #include "imstkTextureManager.h" 12 #include "imstkVTKTextureDelegate.h" 14 #include <vtkSmartPointer.h> 16 class vtkAbstractMapper;
40 static std::shared_ptr<VTKRenderDelegate>
makeDelegate(std::shared_ptr<VisualModel> visualModel);
45 void initialize(std::shared_ptr<VisualModel> model);
55 vtkSmartPointer<vtkProp>
getVtkActor()
const {
return m_actor; }
81 virtual void init() = 0;
93 vtkSmartPointer<vtkTexture> getVTKTexture(std::shared_ptr<Texture> texture);
95 vtkSmartPointer<vtkTransform> m_transform;
98 vtkSmartPointer<vtkProp> m_actor;
99 vtkSmartPointer<vtkAbstractMapper> m_mapper;
102 std::shared_ptr<RenderMaterial> m_material;
104 std::weak_ptr<TextureManager<VTKTextureDelegate>> m_textureManager;
void update()
Update render delegate.
void initialize(std::shared_ptr< VisualModel > model)
Setup the VTKRenderDelegate with given model.
std::shared_ptr< VisualModel > m_visualModel
imstk visual model (contains data (geometry) and render specification (render material)) ...
Base class for events which contain a type, priority, and data priority defaults to 0 and uses a grea...
void visualModelModified(Event *e)
Callback for visual model modifications.
static std::shared_ptr< VTKRenderDelegate > makeDelegate(std::shared_ptr< VisualModel > visualModel)
Instantiate proper render delegate.
Base class for VTK render delegates.
std::shared_ptr< VisualModel > getVisualModel() const
Return geometry to render.
EventObject is the base class for all objects in iMSTK that can receive and emit events. It supports direct and queued observer functions. Direct observers receive events immediately on the same thread This can either be posted on an object or be a function pointer Queued observers receive events within their queue which they can process whenever they like. These can be connected with the connect/queuedConnect/disconnect functions Lambda recievers cannot be disconnected unless all receivers to a signal are removed.
The TextureManager provides delegates for textures, it will create new ones and cache old ones...
void materialModified(Event *imstkNotUsed(e))
Callback for updating render properties.
virtual void updateRenderProperties()=0
Updates the actor and mapper properties from the currently set VisualModel.
vtkSmartPointer< vtkProp > getVtkActor() const
Get VTK actor.
virtual void processEvents()
Process the event queue, default implementation processes visualModel events and its RenderMaterial e...
void setTextureManager(std::weak_ptr< TextureManager< VTKTextureDelegate >> textureManager)
Set the TextureManager.