Changeset 2269 for trunk/packages/vizservers/vtkvis/RpHeightMap.cpp
- Timestamp:
- Jun 2, 2011, 2:21:08 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/RpHeightMap.cpp
r2263 r2269 9 9 10 10 #include <vtkDataSet.h> 11 #include <vtkPointData.h> 12 #include <vtkCellData.h> 13 #include <vtkCellDataToPointData.h> 11 14 #include <vtkDataSetMapper.h> 12 15 #include <vtkPolyDataMapper.h> 13 16 #include <vtkUnstructuredGrid.h> 14 17 #include <vtkProperty.h> 15 #include <vtkPointData.h>16 18 #include <vtkImageData.h> 17 19 #include <vtkLookupTable.h> … … 30 32 using namespace Rappture::VtkVis; 31 33 32 #define MESH_POINTS34 //#define MESH_POINTS 33 35 34 36 HeightMap::HeightMap() : … … 112 114 113 115 if (_transformedData == NULL) { 116 vtkSmartPointer<vtkCellDataToPointData> cellToPtData; 117 118 if (ds->GetPointData() == NULL || 119 ds->GetPointData()->GetScalars() == NULL) { 120 ERROR("No scalar point data in dataset %s", _dataSet->getName().c_str()); 121 if (ds->GetCellData() != NULL && 122 ds->GetCellData()->GetScalars() != NULL) { 123 cellToPtData = 124 vtkSmartPointer<vtkCellDataToPointData>::New(); 125 cellToPtData->SetInput(ds); 126 ds = cellToPtData->GetOutput(); 127 } else { 128 ERROR("No scalar cell data in dataset %s", _dataSet->getName().c_str()); 129 } 130 } 131 114 132 vtkPolyData *pd = vtkPolyData::SafeDownCast(ds); 115 133 if (pd != NULL) { … … 214 232 gf->SetInput(_volumeSlicer->GetOutput()); 215 233 } else { 216 // structured grid, unstructured grid, or rectilinear grid234 // 2D image data, structured grid, unstructured grid, or rectilinear grid 217 235 gf->SetInput(ds); 218 236 } … … 243 261 if (lut) 244 262 _lut = lut; 245 else 263 else { 246 264 _lut = vtkSmartPointer<vtkLookupTable>::New(); 265 } 247 266 } 248 267 }
Note: See TracChangeset
for help on using the changeset viewer.