Evita  0.16
evVisualizerProp.h
Go to the documentation of this file.
1 /*
2  *
3  * EVITA: Efficient Visualization of Terascale Datasets
4  * Copyright (C) 2000-2016 Team Evita
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
19  * MA 02139, USA.
20  *
21  */
22 
23 
24 #ifndef __evVisualizerProp_h
25 #define __evVisualizerProp_h
26 
27 
28 #include "vtkDataSet.h"
29 #include "vtkProp.h"
30 
31 
33 {
34 public:
35  void Initialize(void);
36  evVisualizerProp(void);
37  virtual ~evVisualizerProp(void);
38 
39  virtual const evString GetClassName(void) const
40  {
41  return(evString("evVisualizerProp"));
42  }
43 
44  void SetProp(vtkProp *prop);
45  vtkProp *GetProp(void) const;
46  void SetData(vtkDataSet *data);
47  vtkDataSet *GetData(void) const;
48  void SetCurrentLOD(int current_lod);
49  int GetCurrentLOD(void) const;
50 
51 protected:
52 
53 private:
54  vtkProp *Prop;
55  vtkDataSet *Data;
57 };
58 
59 
61 {
62  this->Prop = NULL;
63  this->Data = NULL;
64  this->CurrentLOD = -1;
65 }
66 
67 
69 {
70  this->Initialize();
71 }
72 
73 
75 {
76  if (this->Prop)
77  this->Prop->Delete();
78  if (this->Data)
79  this->Data->Delete();
80 }
81 
82 
83 inline void evVisualizerProp::SetProp(vtkProp *prop)
84 {
85  if (this->Prop != prop)
86  {
87  if (this->Prop != NULL)
88  this->Prop->UnRegister((vtkObjectBase *)this);
89  this->Prop = prop;
90  if (this->Prop != NULL)
91  this->Prop->Register((vtkObjectBase *)this);
92  }
93 }
94 
95 
96 inline vtkProp *evVisualizerProp::GetProp(void) const
97 {
98  return(this->Prop);
99 }
100 
101 
102 inline void evVisualizerProp::SetData(vtkDataSet *data)
103 {
104  if (this->Data != data)
105  {
106  if (this->Data != NULL)
107  this->Data->UnRegister((vtkObjectBase *)this);
108  this->Data = data;
109  if (this->Data != NULL)
110  this->Data->Register((vtkObjectBase *)this);
111  }
112 }
113 
114 
115 inline vtkDataSet *evVisualizerProp::GetData(void) const
116 {
117  return(this->Data);
118 }
119 
120 
121 inline void evVisualizerProp::SetCurrentLOD(int current_lod)
122 {
123  this->CurrentLOD = current_lod;
124 }
125 
126 
127 inline int evVisualizerProp::GetCurrentLOD(void) const
128 {
129  return(this->CurrentLOD);
130 }
131 
132 
133 #endif
int CurrentLOD
Definition: evVisualizerProp.h:56
vtkProp * GetProp(void) const
Definition: evVisualizerProp.h:96
virtual const evString GetClassName(void) const
Definition: evVisualizerProp.h:39
vtkDataSet * GetData(void) const
Definition: evVisualizerProp.h:115
Definition: evVisualizerProp.h:32
virtual ~evVisualizerProp(void)
Definition: evVisualizerProp.h:74
Definition: evDataObject.h:31
vtkDataSet * Data
Definition: evVisualizerProp.h:55
vtkProp * Prop
Definition: evVisualizerProp.h:54
void Initialize(void)
Definition: evVisualizerProp.h:60
void SetCurrentLOD(int current_lod)
Definition: evVisualizerProp.h:121
evVisualizerProp(void)
Definition: evVisualizerProp.h:68
void SetProp(vtkProp *prop)
Definition: evVisualizerProp.h:83
Definition: evString.h:30
int GetCurrentLOD(void) const
Definition: evVisualizerProp.h:127
void SetData(vtkDataSet *data)
Definition: evVisualizerProp.h:102