void
VTKViewer_AppendFilter
-::SetPoints(vtkPoints* thePoints)
+::SetSharedPointsDataSet(vtkPointSet* thePointsDataSet)
{
- if(GetPoints() == thePoints)
+ if(GetSharedPointsDataSet() == thePointsDataSet)
return;
- myPoints = thePoints;
+ mySharedPointsDataSet = thePointsDataSet;
- this->Modified();
+ Modified();
}
-vtkPoints*
+vtkPointSet*
VTKViewer_AppendFilter
-::GetPoints()
+::GetSharedPointsDataSet()
{
- return myPoints.GetPointer();
+ return mySharedPointsDataSet.GetPointer();
}
void
VTKViewer_AppendFilter
::Execute()
{
- if(myPoints.GetPointer())
+ if(GetSharedPointsDataSet())
MakeOutput();
else
Superclass::Execute();
for(vtkIdType aDataSetId = 0; aDataSetId < this->NumberOfInputs; ++aDataSetId){
vtkDataSet* aDataSet = (vtkDataSet *)(this->Inputs[aDataSetId]);
// Do mapping of the nodes
- if(!myPoints.GetPointer()){
+ if(!GetSharedPointsDataSet()){
vtkIdType aNbPnts = aDataSet->GetNumberOfPoints();
myNodeRanges.push_back(aPntStartId + aNbPnts);
aPntStartId += aNbPnts;
::GetPointOutputID(vtkIdType theInputID,
vtkIdType theInputDataSetID)
{
- if(myPoints.GetPointer())
+ if(GetSharedPointsDataSet())
return theInputID;
return GetOutputID(theInputID,theInputDataSetID,myNodeRanges);
::GetCellOutputID(vtkIdType theInputID,
vtkIdType theInputDataSetID)
{
- if(myPoints.GetPointer())
+ if(GetSharedPointsDataSet())
return theInputID;
return GetOutputID(theInputID,theInputDataSetID,myCellRanges);
vtkIdType& theStartID,
vtkIdType& theInputDataSetID)
{
- if(myPoints.GetPointer()) {
+ if(GetSharedPointsDataSet()) {
theStartID = theInputDataSetID = 0;
theInputID = theOutputID;
return;
vtkDataSet *ds;
vtkUnstructuredGrid *output = this->GetOutput();
- numPts = myPoints->GetNumberOfPoints();
+ vtkPoints* aPoints = GetSharedPointsDataSet()->GetPoints();
+ numPts = aPoints->GetNumberOfPoints();
if (numPts < 1) {
return;
}
// Append each input dataset together
//
// 1.points
- output->SetPoints(myPoints.GetPointer());
+ output->SetPoints(GetSharedPointsDataSet()->GetPoints());
+ output->GetPointData()->PassData(GetSharedPointsDataSet()->GetPointData());
+
// 2.cells
for (idx = 0; idx < this->NumberOfInputs; ++idx) {
ds = (vtkDataSet *)(this->Inputs[idx]);
#include <vector>
#include <map>
-class vtkPoints;
+class vtkPointSet;
/*! \brief This class used same as vtkAppendFilter. See documentation on VTK for more information.
*/
bool DoMappingFlag() const;
void
- SetPoints(vtkPoints* thePoints);
+ SetSharedPointsDataSet(vtkPointSet* thePointsDataSet);
- vtkPoints*
- GetPoints();
+ vtkPointSet*
+ GetSharedPointsDataSet();
vtkIdType
GetPointOutputID(vtkIdType theInputID,
bool myDoMappingFlag;
TVectorIds myNodeRanges;
TVectorIds myCellRanges;
- vtkSmartPointer<vtkPoints> myPoints;
+ vtkSmartPointer<vtkPointSet> mySharedPointsDataSet;
};
#endif