object.h
#pragma once
// C++
#include <map>
#include <mutex>
#include <set>
#include <string>
// VTK
#include <vtkActor.h>
#include <vtkActorCollection.h>
#include <vtkRenderer.h>
#include <vtkSmartPointer.h>
//Forward Declaration
class Scene;
class Object
{
public:
// Operators
// -----------------------------------------------------------------------------
Object (std::string name);
virtual
~Object () { }
// Accessors
// -----------------------------------------------------------------------------
std::string
getName () const;
void
setName (std::string name);
virtual void
render (vtkRenderer* renderer);
bool
hasActor (vtkActor *actor);
void
addActor (vtkActor *actor);
void
removeActor (vtkActor *actor);
vtkSmartPointer<vtkActorCollection>
getActors ();
protected:
vtkSmartPointer<vtkActorCollection> actors_;
std::mutex actors_mutex_;
private:
// Members
// -----------------------------------------------------------------------------
std::string name_;
std::map<vtkActor*, std::set<vtkRenderer*> > associated_renderers_;
};
Object::hasActor
bool hasActor(vtkActor *actor)
Object::~Object
virtual ~Object()
Definition: object.h:27
Object::getName
std::string getName() const
Object::addActor
void addActor(vtkActor *actor)
Scene
Definition: scene.h:11
Object::actors_mutex_
std::mutex actors_mutex_
Definition: object.h:55
Object
Definition: object.h:18
Object::Object
Object(std::string name)
Object::render
virtual void render(vtkRenderer *renderer)
Object::actors_
vtkSmartPointer< vtkActorCollection > actors_
Definition: object.h:54
Object::removeActor
void removeActor(vtkActor *actor)
Object::getActors
vtkSmartPointer< vtkActorCollection > getActors()
Object::setName
void setName(std::string name)
vtkSmartPointer< vtkActorCollection >