38 #include "vtkPolyData.h"
39 #include "vtkCellArray.h"
41 #include "vtkMapper.h"
42 #include "vtkDoubleArray.h"
43 #include "vtkPointData.h"
44 #include "vtkLookupTable.h"
48 ActorXY(NULL), ActorXZ(NULL), ActorYZ(NULL), ActorXYZ(NULL), Nodes(NULL),
49 Highlighted(false), Visible(false)
61 const unsigned int & iTraceID,
62 const unsigned int & iCollectionID,
63 std::vector< vtkActor * > iActors,
65 const bool & iHighlighted,
66 const bool & iVisible,
70 const double & alpha) :
71 TraceID(iTraceID), CollectionID(iCollectionID),
72 Nodes(iNodes), Highlighted(iHighlighted), Visible(iVisible)
74 if ( iActors.size() == 4 )
83 std::cerr <<
"iActors.size() != 4" << std::endl;
89 this->
rgba[3] = alpha;
96 const unsigned int & iCollectionID,
97 std::vector< vtkActor * > iActors,
99 const bool & iHighlighted,
100 const bool & iVisible,
102 TraceID(iTraceID), CollectionID(iCollectionID),
103 Nodes(iNodes), Highlighted(iHighlighted), Visible(iVisible)
105 if ( iActors.size() == 4 )
114 std::cout <<
"iActors.size() != 4" << std::endl;
117 this->
rgba[0] = iRgba[0];
118 this->
rgba[1] = iRgba[1];
119 this->
rgba[2] = iRgba[2];
120 this->
rgba[3] = iRgba[3];
127 const unsigned int & iCollectionID,
133 const bool & iHighlighted,
134 const bool & iVisible,
138 const double & alpha) :
139 TraceID(iTraceID), CollectionID(iCollectionID),
140 ActorXY(iActorXY), ActorXZ(iActorXZ),
141 ActorYZ(iActorYZ), ActorXYZ(iActorXYZ), Nodes(iNodes),
142 Highlighted(iHighlighted), Visible(iVisible)
147 this->
rgba[3] = alpha;
154 TraceID(iE.TraceID), CollectionID(iE.CollectionID), ActorXY(iE.ActorXY),
155 ActorXZ(iE.ActorXZ), ActorYZ(iE.ActorYZ), ActorXYZ(iE.ActorXYZ),
156 Nodes(iE.Nodes), Highlighted(iE.Highlighted), Visible(iE.Visible)
158 for (
int i = 0; i < 4; i++ )
181 this->
ActorXY->SetProperty(iProperty);
185 this->
ActorXZ->SetProperty(iProperty);
189 this->
ActorYZ->SetProperty(iProperty);
193 this->
ActorXYZ->SetProperty(iProperty);
205 this->
ActorXY->SetVisibility(iVisible);
209 this->
ActorXZ->SetVisibility(iVisible);
213 this->
ActorYZ->SetVisibility(iVisible);
217 this->
ActorXYZ->SetVisibility(iVisible);
224 const double & iValue)
const
228 vtkIdType NbOfPoints = this->
Nodes->GetNumberOfPoints();
229 vtkSmartPointer<vtkDoubleArray> data =
230 vtkSmartPointer<vtkDoubleArray>::New();
231 data->SetNumberOfComponents(1);
232 data->SetName( iName.c_str() );
234 for ( vtkIdType i = 0; i < NbOfPoints; ++i )
236 data->InsertNextValue(iValue);
239 this->
Nodes->GetPointData()->SetScalars(data);
240 this->
Nodes->GetPointData()->SetActiveScalars( iName.c_str() );
252 this->
ActorXY->GetMapper()->SetScalarRange(iMin, iMax);
253 this->
ActorXY->GetMapper()->SetScalarVisibility(
true);
257 this->
ActorXZ->GetMapper()->SetScalarRange(iMin, iMax);
258 this->
ActorXZ->GetMapper()->SetScalarVisibility(
true);
262 this->
ActorYZ->GetMapper()->SetScalarRange(iMin, iMax);
263 this->
ActorYZ->GetMapper()->SetScalarVisibility(
true);
267 this->
ActorXYZ->GetMapper()->SetScalarRange(iMin, iMax);
268 this->
ActorXYZ->GetMapper()->SetScalarVisibility(
true);
280 this->
Nodes->GetPointData()->SetActiveScalars(NULL);
285 this->
ActorXY->GetMapper()->SetScalarVisibility(
false);
289 this->
ActorXZ->GetMapper()->SetScalarVisibility(
false);
293 this->
ActorYZ->GetMapper()->SetScalarVisibility(
false);
297 this->
ActorXYZ->GetMapper()->SetScalarVisibility(
false);
311 this->
ActorXY->GetMapper()->SetLookupTable(
312 const_cast<vtkLookupTable*>(iLut));
316 this->
ActorXZ->GetMapper()->SetLookupTable(
317 const_cast<vtkLookupTable*>(iLut));
321 this->
ActorYZ->GetMapper()->SetLookupTable(
322 const_cast<vtkLookupTable*>(iLut));
326 this->
ActorXYZ->GetMapper()->SetLookupTable(
327 const_cast<vtkLookupTable*>(iLut));
356 this->
Nodes->Delete();
368 if ( this->
Nodes->GetPointData() )
370 this->
Nodes->GetPointData()->Reset();
372 if ( this->
Nodes->GetPoints() )
374 this->
Nodes->GetPoints()->Reset();
376 if ( this->
Nodes->GetLines() )
378 this->
Nodes->GetLines()->Reset();
382 this->
Nodes->Reset();
void SetActorVisibility(const bool &iVisible) const
Set Visibility for all actors.
virtual void ReleaseData() const
virtual ~TraceStructure()
void SetLookupTable(const vtkLookupTable *iLut) const
Set the lookup table.
void SetActorProperties(vtkProperty *iProperty) const
Set Property for all actors.
void SetScalarRange(const double &iMin, const double &iMax) const
Set the scalar range (use for color coding)
void SetScalarData(const std::string &iName, const double &iValue) const
Set Scalar Data associated to the elements (use for color coding)
void RenderWithOriginalColors() const
Render with original colors (Remove the active scalars data).
Structure which represent a trace (contour, mesh, track, lineage), and used for interaction between V...