/[ff3d]/ff3d/graphics/VTKDriver.cpp
ViewVC logotype

Diff of /ff3d/graphics/VTKDriver.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by delpinux, Tue Feb 25 09:58:01 2003 UTC revision 1.3 by delpinux, Sun Apr 27 20:47:00 2003 UTC
# Line 29  Line 29 
29  #include <VTKDriver.hpp>  #include <VTKDriver.hpp>
30    
31  #include <vtkPointData.h>  #include <vtkPointData.h>
32  #include <vtkActor.h>  #include <vtkCellData.h>
33    #include <vtkLODActor.h>
34  #include <vtkRenderer.h>  #include <vtkRenderer.h>
35  #include <vtkPolyDataMapper.h>  #include <vtkPolyDataMapper.h>
36  #include <vtkRenderWindow.h>  #include <vtkRenderWindow.h>
# Line 90  void VTKDriver::__plotMesh(const MeshOfT Line 91  void VTKDriver::__plotMesh(const MeshOfT
91    // the graphics primitives for a mapper. We set this actor's mapper to be    // the graphics primitives for a mapper. We set this actor's mapper to be
92    // coneMapper which we created above.    // coneMapper which we created above.
93    //    //
94    vtkActor *anActor = vtkActor::New();    vtkLODActor *anActor = vtkLODActor::New();
95    anActor->SetMapper( mapper );    anActor->SetMapper( mapper );
96      anActor->SetNumberOfCloudPoints(1000);
97    
98    // Create the Renderer and assign actors to it. A renderer is like a    // Create the Renderer and assign actors to it. A renderer is like a
99    // viewport. It is part or all of a window on the screen and it is    // viewport. It is part or all of a window on the screen and it is
# Line 176  void VTKDriver::__plotMesh(const MeshOfH Line 178  void VTKDriver::__plotMesh(const MeshOfH
178    // the graphics primitives for a mapper. We set this actor's mapper to be    // the graphics primitives for a mapper. We set this actor's mapper to be
179    // coneMapper which we created above.    // coneMapper which we created above.
180    //    //
181    vtkActor *anActor = vtkActor::New();    vtkLODActor *anActor = vtkLODActor::New();
182    anActor->SetMapper( mapper );    anActor->SetMapper( mapper );
183      anActor->SetNumberOfCloudPoints(1000);
184    
185    // Create the Renderer and assign actors to it. A renderer is like a    // Create the Renderer and assign actors to it. A renderer is like a
186    // viewport. It is part or all of a window on the screen and it is    // viewport. It is part or all of a window on the screen and it is
# Line 244  void VTKDriver::__plotMesh(const Surface Line 247  void VTKDriver::__plotMesh(const Surface
247    aTriangleGrid->SetPoints(vertices);    aTriangleGrid->SetPoints(vertices);
248    
249    vtkDoubleArray* values = vtkDoubleArray::New();    vtkDoubleArray* values = vtkDoubleArray::New();
250    values->Resize(s.numberOfVertices());    values->Resize(s.numberOfCells());
251    for (size_t i=0; i<s.numberOfVertices(); ++i) {    for (size_t i=0; i<s.numberOfCells(); ++i) {
252      values->InsertNextValue(s.vertex(i)[0]);      values->InsertNextValue(s.cell(i).reference());
253    }    }
254    
255    aTriangleGrid->GetPointData()->SetScalars(values);    aTriangleGrid->GetCellData()->SetScalars(values);
256    
257    // We create an instance of vtkPolyDataMapper to map the polygonal data    // We create an instance of vtkPolyDataMapper to map the polygonal data
258    // into graphics primitives. We connect the output of the cone souece    // into graphics primitives. We connect the output of the cone souece
# Line 263  void VTKDriver::__plotMesh(const Surface Line 266  void VTKDriver::__plotMesh(const Surface
266    // the graphics primitives for a mapper. We set this actor's mapper to be    // the graphics primitives for a mapper. We set this actor's mapper to be
267    // coneMapper which we created above.    // coneMapper which we created above.
268    //    //
269    vtkActor *anActor = vtkActor::New();    vtkLODActor *anActor = vtkLODActor::New();
270    anActor->SetMapper( mapper );    anActor->SetMapper( mapper );
271      anActor->SetNumberOfCloudPoints(10000);
272    
273    
274    // Create the Renderer and assign actors to it. A renderer is like a    // Create the Renderer and assign actors to it. A renderer is like a
275    // viewport. It is part or all of a window on the screen and it is    // viewport. It is part or all of a window on the screen and it is

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26