]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Merge with BR_Dev_For_4_0 (initial version)
authorapo <apo@opencascade.com>
Wed, 25 Apr 2007 11:24:01 +0000 (11:24 +0000)
committerapo <apo@opencascade.com>
Wed, 25 Apr 2007 11:24:01 +0000 (11:24 +0000)
src/PIPELINE/VISU_ColoredPL.cxx
src/PIPELINE/VISU_ScalarMapPL.cxx
src/PIPELINE/VISU_ScalarMapPL.hxx

index f41c4a3f687264e64f766be500f60536b78468c8..c2cabcdf56c38032d1aeba581a2cb66ed5e0c044 100644 (file)
@@ -211,7 +211,7 @@ VISU_ColoredPL
   myMapperTable->Build();
   myBarTable->Build();
 
-  VISU_PipeLine::Update();
+  Superclass::Update();
 }
 
 
index 1153b5d325ad4915f2a4993a20b74502a059c70a..44c0216dd9b9081e0ffc0b8daf87a3678849508a 100644 (file)
 
 #include "VISU_ScalarMapPL.hxx"
 #include "VISU_DataSetMapperHolder.hxx"
+#include "VISU_FieldTransform.hxx"
+
+#include "VISU_AppendFilter.hxx"
+#include "VISU_MergeFilter.hxx"
+
+#include <vtkDataSet.h>
+#include <vtkUnstructuredGrid.h>
 
 #include <vtkDataSetMapper.h>
 #include <vtkObjectFactory.h>
@@ -40,8 +47,16 @@ vtkStandardNewMacro(VISU_ScalarMapPL);
 //----------------------------------------------------------------------------
 VISU_ScalarMapPL
 ::VISU_ScalarMapPL():
-  VISU_UnstructuredGridPL(this)
-{}
+  VISU_UnstructuredGridPL(this),
+  myAppendFilter(VISU_AppendFilter::New()),
+  myMergeFilter(VISU_MergeFilter::New())
+{
+  myAppendFilter->SetMergingInputs(true);
+  myAppendFilter->Delete();
+
+  myMergeFilter->SetMergingInputs(true);
+  myMergeFilter->Delete();
+}
 
 
 //----------------------------------------------------------------------------
@@ -70,4 +85,49 @@ VISU_ScalarMapPL
 }
 
 
+//----------------------------------------------------------------------------
+void
+VISU_ScalarMapPL
+::AddGeometry(vtkDataSet* theGeometry)
+{
+  myAppendFilter->AddInput(theGeometry);
+}
+
+//----------------------------------------------------------------------------
+int
+VISU_ScalarMapPL
+::GetNumberOfGeometry()
+{
+  return myAppendFilter->GetNumberOfInputConnections(0);
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_ScalarMapPL
+::ClearGeometry()
+{
+  myAppendFilter->RemoveAllInputs();
+}
+
+//----------------------------------------------------------------------------
+vtkDataSet* 
+VISU_ScalarMapPL
+::InsertCustomPL()
+{
+  vtkDataSet* aDataSet = Superclass::InsertCustomPL();
+  myMergeFilter->SetGeometry(myAppendFilter->GetOutput());
+  myAppendFilter->SetSharedPointSet(GetFieldTransformFilter()->GetUnstructuredGridOutput());
+
+  myMergeFilter->SetScalars(aDataSet);
+  myMergeFilter->SetVectors(aDataSet);
+
+  myMergeFilter->RemoveFields();
+  myMergeFilter->AddField("VISU_FIELD", aDataSet);
+  myMergeFilter->AddField("VISU_CELLS_MAPPER", aDataSet);
+  myMergeFilter->AddField("VISU_POINTS_MAPPER", aDataSet);
+    
+  return myMergeFilter->GetOutput();
+}
+
+
 //----------------------------------------------------------------------------
index 0a6bd876c86aea6974b399eebb0bc8a2ca4a5b6e..de035fbadd0c7d06fd3513df4f3dbf0d84c52d9e 100644 (file)
@@ -33,6 +33,8 @@
 #include "VISU_UnstructuredGridPL.hxx"
 
 class VISU_DataSetMapperHolder;
+class VISU_AppendFilter;
+class VISU_MergeFilter;
 
 
 //----------------------------------------------------------------------------
@@ -46,6 +48,18 @@ public:
   VISU_ScalarMapPL* 
   New();
 
+  virtual
+  void
+  AddGeometry(vtkDataSet* theGeometry);
+
+  virtual
+  int
+  GetNumberOfGeometry();
+
+  virtual
+  void
+  ClearGeometry();
+
 protected:
   //----------------------------------------------------------------------------
   VISU_ScalarMapPL();
@@ -58,9 +72,17 @@ protected:
   void
   OnCreateMapperHolder();
 
+  virtual
+  vtkDataSet* 
+  InsertCustomPL();
+
   virtual
   void
   Build();
+
+private:
+  vtkSmartPointer<VISU_AppendFilter> myAppendFilter;
+  vtkSmartPointer<VISU_MergeFilter> myMergeFilter;
 };
   
 #endif