]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
VTK-4.4.2 porting
authorakl <akl@opencascade.com>
Wed, 19 Sep 2007 07:50:48 +0000 (07:50 +0000)
committerakl <akl@opencascade.com>
Wed, 19 Sep 2007 07:50:48 +0000 (07:50 +0000)
src/PIPELINE/VISU_CellDataToPointData.cxx
src/VISU_I/VISU_PrsMerger_i.cc

index 30532952f63762ba7246280ec617d8ed5cc7d617..68552417ed0ac30e614f4bf6eb9855684f4347dc 100644 (file)
@@ -50,8 +50,8 @@ void VISU_CellDataToPointData::Execute()
   vtkCellData *inPD=input->GetCellData();
   vtkPointData *outPD=output->GetPointData();
   vtkIdList *cellIds;
-  float weight;
-  float *weights;
+  vtkFloatingPointType weight;
+  vtkFloatingPointType *weights;
 
   vtkDebugMacro(<<"Mapping cell data to point data");
 
@@ -67,7 +67,7 @@ void VISU_CellDataToPointData::Execute()
     cellIds->Delete();
     return;
     }
-  weights = new float[VTK_MAX_CELLS_PER_POINT];
+  weights = new vtkFloatingPointType[VTK_MAX_CELLS_PER_POINT];
   
   outPD->CopyAllocate(inPD,numPts);
 
index 57397049f0f7a2e99f51ce6dca11ee5372fa0b5d..878cd2ed1f25907cffb6cb2f6e7c3bf19dd51327 100644 (file)
@@ -65,7 +65,24 @@ int VISU::PrsMerger_i::IsCompatibleCellTypes(Result_i* theResult, const char* th
   vtkUnsignedCharArray* cellTypes = vtkUnsignedCharArray::New();
   VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
   aDataSet->Update();
-  aDataSet->GetListOfUniqueCellTypes(cellTypes);
+
+// Fills cellTypes with list of unique cell types
+  unsigned char type;
+  vtkUnsignedCharArray *typesArray = aDataSet->GetCellTypesArray();
+  if (typesArray){
+    type = typesArray->GetValue(0);
+    cellTypes->InsertNextValue(type);
+    for (int cellId = 0; cellId < aDataSet->GetNumberOfCells(); cellId++){
+      type = typesArray->GetValue(cellId);
+      for (int i = 0; i < cellTypes->GetMaxId()+1; i++){
+        if (type != cellTypes->GetValue(i))
+          cellTypes->InsertNextValue(type);
+        else
+          break; //cell is not unique, return control to outer loop
+      }
+    }
+  }
+
   for(vtkIdType anId = 0; anId < cellTypes->GetNumberOfTuples(); anId++){
     const vtkIdType aType = (const vtkIdType)cellTypes->GetValue(anId);
     if(aType == VTK_QUADRATIC_EDGE ||