]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
To introduce ids mapping for mesh nodes V3_2_6pre4
authorapo <apo@opencascade.com>
Wed, 11 Apr 2007 08:56:41 +0000 (08:56 +0000)
committerapo <apo@opencascade.com>
Wed, 11 Apr 2007 08:56:41 +0000 (08:56 +0000)
(In context of fix for Bug NPAL14169 - EDF VISU 256 : No continuum on a scalarmap)

src/VTKViewer/VTKViewer_AppendFilter.cxx
src/VTKViewer/VTKViewer_AppendFilter.h

index b5aea6697d9131ff1b3abc1e699ba91d46a4db23..f1ffea23919df7af985118954ad3061a17005478 100644 (file)
@@ -78,28 +78,28 @@ VTKViewer_AppendFilter
 
 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();
@@ -122,7 +122,7 @@ VTKViewer_AppendFilter
   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;
@@ -158,7 +158,7 @@ VTKViewer_AppendFilter
 ::GetPointOutputID(vtkIdType theInputID,
                   vtkIdType theInputDataSetID)
 {
-  if(myPoints.GetPointer())
+  if(GetSharedPointsDataSet())
     return theInputID;
 
   return GetOutputID(theInputID,theInputDataSetID,myNodeRanges);
@@ -170,7 +170,7 @@ VTKViewer_AppendFilter
 ::GetCellOutputID(vtkIdType theInputID,
                   vtkIdType theInputDataSetID)
 {
-  if(myPoints.GetPointer())
+  if(GetSharedPointsDataSet())
     return theInputID;
 
   return GetOutputID(theInputID,theInputDataSetID,myCellRanges);
@@ -217,7 +217,7 @@ VTKViewer_AppendFilter
                  vtkIdType& theStartID,
                  vtkIdType& theInputDataSetID)
 {
-  if(myPoints.GetPointer()) {
+  if(GetSharedPointsDataSet()) {
     theStartID = theInputDataSetID = 0;
     theInputID = theOutputID;
     return;
@@ -257,7 +257,8 @@ VTKViewer_AppendFilter
   vtkDataSet *ds;
   vtkUnstructuredGrid *output = this->GetOutput();
 
-  numPts = myPoints->GetNumberOfPoints();
+  vtkPoints* aPoints = GetSharedPointsDataSet()->GetPoints();
+  numPts = aPoints->GetNumberOfPoints();
   if (numPts < 1) {
     return;
   }
@@ -303,7 +304,9 @@ VTKViewer_AppendFilter
   // 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]);
index c9a756381b9b5a16d6460f29a33ba349d8764cc7..c61d318b89cf32aa73bacbfccfa3eee058d81e4f 100644 (file)
@@ -27,7 +27,7 @@
 #include <vector>
 #include <map>
 
-class vtkPoints;
+class vtkPointSet;
 
 /*! \brief This class used same as vtkAppendFilter. See documentation on VTK for more information.
  */
@@ -48,10 +48,10 @@ public:
   bool DoMappingFlag() const;
 
   void
-  SetPoints(vtkPoints* thePoints);
+  SetSharedPointsDataSet(vtkPointSet* thePointsDataSet);
 
-  vtkPoints*
-  GetPoints();
+  vtkPointSet*
+  GetSharedPointsDataSet();
 
   vtkIdType
   GetPointOutputID(vtkIdType theInputID,
@@ -98,7 +98,7 @@ protected:
   bool myDoMappingFlag;
   TVectorIds myNodeRanges;
   TVectorIds myCellRanges;
-  vtkSmartPointer<vtkPoints> myPoints;
+  vtkSmartPointer<vtkPointSet> mySharedPointsDataSet;
 };
 
 #endif