Changeset 5822
- Timestamp:
- Aug 20, 2015, 3:27:14 PM (9 years ago)
- Location:
- vtkvis/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
vtkvis/trunk
- Property svn:mergeinfo changed
/vtkvis/branches/1.8 merged: 5819
- Property svn:mergeinfo changed
-
vtkvis/trunk/Contour2D.cpp
r5753 r5822 12 12 #include <vtkPointData.h> 13 13 #include <vtkCellData.h> 14 #include <vtkTrivialProducer.h> 14 15 #include <vtkCellDataToPointData.h> 15 16 #include <vtkContourFilter.h> … … 124 125 125 126 if (!_pipelineInitialized) { 127 vtkAlgorithmOutput *dsOutput = NULL; 126 128 vtkSmartPointer<vtkCellDataToPointData> cellToPtData; 129 vtkSmartPointer<vtkTrivialProducer> prod; 127 130 128 131 if (ds->GetPointData() == NULL || … … 139 142 #endif 140 143 cellToPtData->PassCellDataOn(); 141 cellToPtData->Update(); 142 ds = cellToPtData->GetOutput(); 144 dsOutput = cellToPtData->GetOutputPort(); 143 145 } else { 144 146 USER_ERROR("No scalar field was found in the data set"); 145 147 } 148 } else { 149 prod = vtkSmartPointer<vtkTrivialProducer>::New(); 150 prod->SetOutput(ds); 151 dsOutput = prod->GetOutputPort(); 146 152 } 147 153 … … 172 178 mesher->SetTransform(trans); 173 179 } 174 #ifdef USE_VTK6 175 mesher->SetInputData(ds); 176 #else 177 mesher->SetInput(ds); 178 #endif 180 mesher->SetInputConnection(dsOutput); 179 181 _contourFilter->SetInputConnection(mesher->GetOutputPort()); 180 182 } else { 181 183 vtkSmartPointer<vtkDelaunay3D> mesher = vtkSmartPointer<vtkDelaunay3D>::New(); 182 #ifdef USE_VTK6 183 mesher->SetInputData(ds); 184 #else 185 mesher->SetInput(ds); 186 #endif 184 mesher->SetInputConnection(dsOutput); 187 185 vtkSmartPointer<vtkDataSetSurfaceFilter> gf = vtkSmartPointer<vtkDataSetSurfaceFilter>::New(); 188 186 gf->SetInputConnection(mesher->GetOutputPort()); … … 191 189 } else if (vtkPolyData::SafeDownCast(ds) != NULL) { 192 190 // DataSet is a vtkPolyData with lines and/or polygons 193 #ifdef USE_VTK6 194 _contourFilter->SetInputData(ds); 195 #else 196 _contourFilter->SetInput(ds); 197 #endif 191 _contourFilter->SetInputConnection(dsOutput); 198 192 } else { 199 193 TRACE("Generating surface for data set"); 200 194 // DataSet is NOT a vtkPolyData 201 195 vtkSmartPointer<vtkDataSetSurfaceFilter> gf = vtkSmartPointer<vtkDataSetSurfaceFilter>::New(); 202 #ifdef USE_VTK6 203 gf->SetInputData(ds); 204 #else 205 gf->SetInput(ds); 206 #endif 196 gf->SetInputConnection(dsOutput); 207 197 _contourFilter->SetInputConnection(gf->GetOutputPort()); 208 198 } -
vtkvis/trunk/Contour3D.cpp
r5753 r5822 12 12 #include <vtkPointData.h> 13 13 #include <vtkCellData.h> 14 #include <vtkTrivialProducer.h> 14 15 #include <vtkCellDataToPointData.h> 15 16 #include <vtkContourFilter.h> … … 119 120 120 121 if (!_pipelineInitialized) { 122 vtkAlgorithmOutput *dsOutput = NULL; 121 123 vtkSmartPointer<vtkCellDataToPointData> cellToPtData; 124 vtkSmartPointer<vtkTrivialProducer> prod; 122 125 123 126 if (ds->GetPointData() == NULL || … … 134 137 #endif 135 138 cellToPtData->PassCellDataOn(); 136 cellToPtData->Update(); 137 ds = cellToPtData->GetOutput(); 139 dsOutput = cellToPtData->GetOutputPort(); 138 140 } else { 139 141 USER_ERROR("No scalar field was found in the data set."); 140 142 } 143 } else { 144 prod = vtkSmartPointer<vtkTrivialProducer>::New(); 145 prod->SetOutput(ds); 146 dsOutput = prod->GetOutputPort(); 141 147 } 142 148 … … 145 151 // Generate a 3D unstructured grid 146 152 vtkSmartPointer<vtkDelaunay3D> mesher = vtkSmartPointer<vtkDelaunay3D>::New(); 147 #ifdef USE_VTK6 148 mesher->SetInputData(ds); 149 #else 150 mesher->SetInput(ds); 151 #endif 153 mesher->SetInputConnection(dsOutput); 152 154 _contourFilter->SetInputConnection(mesher->GetOutputPort()); 153 155 } else { … … 155 157 // (e.g. polydata or ugrid with 2D cells), we will 156 158 // generate lines instead of surfaces 157 #ifdef USE_VTK6 158 _contourFilter->SetInputData(ds); 159 #else 160 _contourFilter->SetInput(ds); 161 #endif 159 _contourFilter->SetInputConnection(dsOutput); 162 160 } 163 161 }
Note: See TracChangeset
for help on using the changeset viewer.