9 #include "imstkComponent.h" 10 #include "imstkEventObject.h" 14 #include <unordered_map> 30 VisualModel(
const std::string& name =
"VisualModel");
40 std::shared_ptr<Geometry>
getGeometry()
const {
return m_geometry; }
41 void setGeometry(std::shared_ptr<Geometry> geometry) { m_geometry = geometry; }
47 const std::string&
getName()
const {
return m_name; }
48 void setName(std::string name) { m_name = name; }
56 void setDelegateHint(
const std::string& name) { m_delegateHint = name; }
63 std::shared_ptr<RenderMaterial> getRenderMaterial()
const {
return m_renderMaterial; }
69 void show() { setIsVisible(
true); }
70 void hide() { setIsVisible(
false); }
72 void setIsVisible(
const bool visible);
79 void setRenderDelegateCreated(
Renderer* ren,
bool created) { m_renderDelegateCreated[ren] = created; }
82 void postModified() { this->
postEvent(
Event(VisualModel::modified())); }
85 std::string m_delegateHint;
87 std::shared_ptr<Geometry> m_geometry;
88 std::shared_ptr<RenderMaterial> m_renderMaterial;
91 std::unordered_map<Renderer*, bool> m_renderDelegateCreated;
Base class for events which contain a type, priority, and data priority defaults to 0 and uses a grea...
const std::string getDelegateHint() const
Get/Set the delegate hint, which helps indicate how to render this VisualModel.
Rendering window manager and contains user API to configure the rendering with various backends...
const std::string & getName() const
Get/Set name.
bool m_isVisible
true if mesh is shown, false if mesh is hidden
void setRenderMaterial(std::shared_ptr< RenderMaterial > renderMaterial)
Set/Get render material.
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.
Represents a part of an entity, involved in a system. The component system is doubly linked meaning t...
void postEvent(const T &e)
Emits the event Direct observers will be immediately called, in sync Queued observers will receive th...
bool getRenderDelegateCreated(Renderer *ren)
Get/Set whether the delegate has been created.
void show()
Visibility functions.
std::shared_ptr< Geometry > getGeometry() const
Get/Set geometry.
Contains geometric, material, and render information.