PeriDyno 1.0.0
Loading...
Searching...
No Matches
VtkVisualModule.cpp
Go to the documentation of this file.
1#include "VtkVisualModule.h"
2
3#include <vtkActor.h>
4#include <vtkVolume.h>
5#include <vtkProperty.h>
6
7using namespace dyno;
8
10{
11 this->setName("GLVisualModule");
12}
13
15{
16 if (m_actor != NULL)
17 {
18 m_actor->Delete();
19 m_actor = NULL;
20 }
21
22 if (m_volume != NULL)
23 {
24 m_volume->Delete();
25 m_volume = NULL;
26 }
27
28}
29
30void VtkVisualModule::setColor(float r, float g, float b, float a )
31{
32 if (m_actor != NULL)
33 {
34 m_actor->GetProperty()->SetColor(r, g, b);
35 m_actor->GetProperty()->SetOpacity(a);
36 }
37}
38
40{
41 return m_actor;
42}
43
45{
46 return m_volume;
47}
48
50{
51 // DO NOTHING!
52}
53
55{
56 m_sceneTime.Modified();
57
58 if(m_actor)
59 m_actor->Modified();
60 if (m_volume)
61 m_volume->Modified();
62}
63
65{
66 bool b = m_updateTime < m_sceneTime;
67
68 if (update)
69 m_updateTime.Modified();
70
71 return b;
72}
void setName(std::string name)
Definition Module.cpp:187
void update()
Definition Module.cpp:47
virtual void display() final
virtual void updateRenderingContext() final
void setColor(float r, float g, float b, float a=1.f)
bool isDirty(bool update=true)
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25