using namespace VISU;
+ void CopyVectorsOnCells(vtkDataSet *theVectorsDataSet,
+ vtkDataSet *theOutput)
+ {
+ vtkDataArray *anInputVectors = theVectorsDataSet->GetCellData()->GetVectors();
+ vtkDataArray *anOutputVectors = vtkDataArray::CreateDataArray(anInputVectors->GetDataType());
+
+ //Clear output vector data
+ theOutput->GetCellData()->SetVectors(NULL);
+
+ //Copy vectors data
+ vtkIntArray* anOutputIDMapper = GetIDMapper(theOutput,
+ TGetCellData(),
+ "VISU_CELLS_MAPPER");
+
+ vtkIntArray* anInputIDMapper = GetIDMapper(theVectorsDataSet,
+ TGetCellData(),
+ "VISU_CELLS_MAPPER");
+
+ TObjectIdArray anIntersection;
+ GetIntersection(anOutputIDMapper,
+ anInputIDMapper,
+ anIntersection);
+
+ vtkIdType aNbTuples = anIntersection.size();
+ anOutputVectors->SetNumberOfComponents(anInputVectors->GetNumberOfComponents());
+ anOutputVectors->SetNumberOfTuples(aNbTuples);
+ theOutput->GetCellData()->SetVectors(anOutputVectors);
+ anOutputVectors->Delete();
+
+ TObjectId2TupleIdMap anOutputObjectId2TupleIdMap;
+ GetObjectId2TupleIdMap(anOutputIDMapper, anOutputObjectId2TupleIdMap);
+
+ TObjectId2TupleIdMap anInputObjectId2TupleIdMap;
+ GetObjectId2TupleIdMap(anInputIDMapper, anInputObjectId2TupleIdMap);
+
+ for(vtkIdType iTupleId = 0; iTupleId < aNbTuples; iTupleId++ ){
+ TObjectId &anObjectId = anIntersection[iTupleId];
+ vtkIdType anOutputCellId = anOutputObjectId2TupleIdMap[anObjectId];
+ vtkIdType anInputCellId = anInputObjectId2TupleIdMap[anObjectId];
+ anOutputVectors->SetTuple(anOutputCellId,anInputVectors->GetTuple(anInputCellId));
+ }
+ }
+
+ void CopyVectorsOnPoints(vtkDataSet *theVectorsDataSet,
+ vtkDataSet *theOutput)
+ {
+ vtkDataArray *anInputVectors = theVectorsDataSet->GetPointData()->GetVectors();
+
+ //Clear output vector data
+ theOutput->GetPointData()->SetVectors(NULL);
+
+ vtkDataArray *anOutputVectors = vtkDataArray::CreateDataArray(anInputVectors->GetDataType());
+
+ //Copy vectors data
+ vtkIntArray* anOutputIDMapper = GetIDMapper(theOutput,
+ TGetPointData(),
+ "VISU_POINTS_MAPPER");
+
+ vtkIntArray* anInputIDMapper = GetIDMapper(theVectorsDataSet,
+ TGetPointData(),
+ "VISU_POINTS_MAPPER");
+ TObjectIdArray anIntersection;
+
+ GetIntersection(anOutputIDMapper,
+ anInputIDMapper,
+ anIntersection);
+
+ vtkIdType aNbTuples = anIntersection.size();
+ anOutputVectors->SetNumberOfComponents(anInputVectors->GetNumberOfComponents());
+ anOutputVectors->SetNumberOfTuples(aNbTuples);
+
+
+
+ TObjectId2TupleIdMap anOutputObjectId2TupleIdMap;
+ GetObjectId2TupleIdMap(anOutputIDMapper, anOutputObjectId2TupleIdMap);
+
+ TObjectId2TupleIdMap anInputObjectId2TupleIdMap;
+ GetObjectId2TupleIdMap(anInputIDMapper, anInputObjectId2TupleIdMap);
+
+ for(vtkIdType iTupleId = 0; iTupleId < aNbTuples; iTupleId++ ){
+ TObjectId& anObjectId = anIntersection[iTupleId];
+ vtkIdType anOutputPointId = anOutputObjectId2TupleIdMap[anObjectId];
+ vtkIdType anInputPointId = anInputObjectId2TupleIdMap[anObjectId];
+ anOutputVectors->SetTuple(anOutputPointId,anInputVectors->GetTuple(anInputPointId));
+ }
+
+ theOutput->GetPointData()->SetVectors(anOutputVectors);
+ anOutputVectors->Delete();
+ }
+
+
//---------------------------------------------------------------
template<class TDataSet>
-
void
CopyDataOnCells(TDataSet *theInput,
vtkIntArray *theGeometryCellMapper,
}
}
- void CopyVectorsOnCells(vtkDataSet *theVectorsDataSet,
- vtkDataSet *theOutput)
- {
- vtkDataArray *anInputVectors = theVectorsDataSet->GetCellData()->GetVectors();
- vtkDataArray *anOutputVectors = vtkDataArray::CreateDataArray(anInputVectors->GetDataType());
-
- //Clear output vector data
- theOutput->GetCellData()->SetVectors(NULL);
-
- //Copy vectors data
- vtkIntArray* anOutputIDMapper = GetIDMapper(theOutput,
- TGetCellData(),
- "VISU_CELLS_MAPPER");
-
- vtkIntArray* anInputIDMapper = GetIDMapper(theVectorsDataSet,
- TGetCellData(),
- "VISU_CELLS_MAPPER");
-
- TObjectIdArray anIntersection;
- GetIntersection(anOutputIDMapper,
- anInputIDMapper,
- anIntersection);
-
- vtkIdType aNbTuples = anIntersection.size();
- anOutputVectors->SetNumberOfComponents(anInputVectors->GetNumberOfComponents());
- anOutputVectors->SetNumberOfTuples(aNbTuples);
- theOutput->GetCellData()->SetVectors(anOutputVectors);
- anOutputVectors->Delete();
-
- TObjectId2TupleIdMap anOutputObjectId2TupleIdMap;
- GetObjectId2TupleIdMap(anOutputIDMapper, anOutputObjectId2TupleIdMap);
-
- TObjectId2TupleIdMap anInputObjectId2TupleIdMap;
- GetObjectId2TupleIdMap(anInputIDMapper, anInputObjectId2TupleIdMap);
-
- for(vtkIdType iTupleId = 0; iTupleId < aNbTuples; iTupleId++ ){
- TObjectId &anObjectId = anIntersection[iTupleId];
- vtkIdType anOutputCellId = anOutputObjectId2TupleIdMap[anObjectId];
- vtkIdType anInputCellId = anInputObjectId2TupleIdMap[anObjectId];
- anOutputVectors->SetTuple(anOutputCellId,anInputVectors->GetTuple(anInputCellId));
- }
- }
-
//---------------------------------------------------------------
template<class TDataSet>
void
}
}
}
-
- void CopyVectorsOnPoints(vtkDataSet *theVectorsDataSet,
- vtkDataSet *theOutput)
- {
- vtkDataArray *anInputVectors = theVectorsDataSet->GetPointData()->GetVectors();
-
- //Clear output vector data
- theOutput->GetPointData()->SetVectors(NULL);
-
- vtkDataArray *anOutputVectors = vtkDataArray::CreateDataArray(anInputVectors->GetDataType());
-
- //Copy vectors data
- vtkIntArray* anOutputIDMapper = GetIDMapper(theOutput,
- TGetPointData(),
- "VISU_POINTS_MAPPER");
-
- vtkIntArray* anInputIDMapper = GetIDMapper(theVectorsDataSet,
- TGetPointData(),
- "VISU_POINTS_MAPPER");
- TObjectIdArray anIntersection;
-
- GetIntersection(anOutputIDMapper,
- anInputIDMapper,
- anIntersection);
-
- vtkIdType aNbTuples = anIntersection.size();
- anOutputVectors->SetNumberOfComponents(anInputVectors->GetNumberOfComponents());
- anOutputVectors->SetNumberOfTuples(aNbTuples);
-
-
-
- TObjectId2TupleIdMap anOutputObjectId2TupleIdMap;
- GetObjectId2TupleIdMap(anOutputIDMapper, anOutputObjectId2TupleIdMap);
-
- TObjectId2TupleIdMap anInputObjectId2TupleIdMap;
- GetObjectId2TupleIdMap(anInputIDMapper, anInputObjectId2TupleIdMap);
-
- for(vtkIdType iTupleId = 0; iTupleId < aNbTuples; iTupleId++ ){
- TObjectId& anObjectId = anIntersection[iTupleId];
- vtkIdType anOutputPointId = anOutputObjectId2TupleIdMap[anObjectId];
- vtkIdType anInputPointId = anInputObjectId2TupleIdMap[anObjectId];
- anOutputVectors->SetTuple(anOutputPointId,anInputVectors->GetTuple(anInputPointId));
- }
-
- theOutput->GetPointData()->SetVectors(anOutputVectors);
- anOutputVectors->Delete();
- }
-
//---------------------------------------------------------------
typedef vtkDataArray* (vtkDataSetAttributes::* TGetAttribute)();