]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To introduce a transparent way for ELNO data processing
authorapo <apo@opencascade.com>
Sat, 3 May 2008 07:38:26 +0000 (07:38 +0000)
committerapo <apo@opencascade.com>
Sat, 3 May 2008 07:38:26 +0000 (07:38 +0000)
12 files changed:
src/PIPELINE/VISUPipeLine.cxx
src/PIPELINE/VISU_ColoredPL.cxx
src/PIPELINE/VISU_CutPlanesPL.cxx
src/PIPELINE/VISU_DataSetMapperHolder.cxx
src/PIPELINE/VISU_DataSetMapperHolder.hxx
src/PIPELINE/VISU_DeformedShapePL.cxx
src/PIPELINE/VISU_ElnoAssembleFilter.cxx
src/PIPELINE/VISU_ElnoAssembleFilter.hxx
src/PIPELINE/VISU_ElnoDisassembleFilter.cxx
src/PIPELINE/VISU_IsoSurfacesPL.cxx
src/PIPELINE/VISU_ScalarMapPL.cxx
src/PIPELINE/VISU_ScalarMapPL.hxx

index d870f0e1cfd0d90a08314d38abc8b8e93c831eb6..56a9349dd3d68c4d856f26ee95d6b0d0ab882c74 100644 (file)
@@ -28,6 +28,7 @@
 // Salome includes
 #include "VISU_Convertor.hxx"
 #include "VISU_ConvertorUtils.hxx"
+
 #include "VISU_MeshPL.hxx"
 #include "VISU_ScalarMapPL.hxx"
 #include "VISU_IsoSurfacesPL.hxx"
@@ -342,8 +343,10 @@ main(int argc, char** argv)
 
              TPresent* aPresent = TPresent::New();
              aPresent->SetUnstructuredGridIDMapper( anUnstructuredGridIDMapper );
+             //aPresent->SetOrientation( VISU_CutPlanesPL::ZX, 0.0, 0.0, 0 );
              aPresent->Update();
 
+             aPresent->GetMapper()->InterpolateScalarsBeforeMappingOn();
              anActor->SetMapper( aPresent->GetMapper() );
              
               vtkScalarBarActor* aScalarBar = vtkScalarBarActor::New();
index 49600e845e7c9a7d0b2bf8a039fe72602e98fa18..25e055ad7426a1b4bf4f4cc72fa2583ed5c97b0c 100644 (file)
@@ -238,6 +238,7 @@ VISU_ColoredPL
   myFieldTransform->SetInput(myExtractor->GetOutput());
 
   GetMapperHolder()->SetLookupTable(GetMapperTable());
+  GetMapper()->InterpolateScalarsBeforeMappingOn();
   GetMapper()->SetUseLookupTableScalarRange(true);
   GetMapper()->SetColorModeToMapScalars();
   GetMapper()->ScalarVisibilityOn();
index 22493a104f8b33e3ceb508f0d4579ff7479ce4af..6928b49875f6adf5df5e73acebc18d1090623444 100644 (file)
@@ -47,6 +47,8 @@ VISU_CutPlanesPL
 {
   SetIsShrinkable(false);
 
+  SetElnoDisassembleState( true );
+
   myAppendPolyData = vtkAppendPolyData::New();
 
   myNbParts = 10;
index 7766a56a66bbf81415a01e379a697a86d96b7560..476a5b764a2fff70c2db4d7326eed5bfe8dbf515 100644 (file)
@@ -100,6 +100,19 @@ VISU_DataSetMapperHolder
 }
 
 
+//----------------------------------------------------------------------------
+void
+VISU_DataSetMapperHolder
+::SetElnoDisassembleState( bool theIsShrunk )
+{
+  vtkFloatingPointType aShrinkFactor = std::abs( myElnoDisassembleFilter->GetShrinkFactor() );
+  if ( theIsShrunk )
+    myElnoDisassembleFilter->SetShrinkFactor( aShrinkFactor );
+  else
+    myElnoDisassembleFilter->SetShrinkFactor( -aShrinkFactor );
+}
+
+
 //----------------------------------------------------------------------------
 unsigned long int
 VISU_DataSetMapperHolder
index 87f9168283f34bc6fbea65e342fdf98c95db1def..6588abd9b14b6987d3508b66d91fe7ba1ffb1924 100644 (file)
@@ -51,6 +51,9 @@ public:
   ShallowCopy(VISU_MapperHolder *theMapperHolder,
              bool theIsCopyInput);
 
+  void
+  SetElnoDisassembleState( bool theIsShrunk );
+
   //! Gets memory size used by the instance (bytes).
   virtual
   unsigned long int
index 6631af081dda168fcf1ec15b0334ffc25b797cec..fe4599207d387ca43dc3b545de5708f556455f1a 100644 (file)
@@ -171,10 +171,10 @@ VISU_DeformedShapePL
 ::Update()
 {
   Superclass::Update();
-  //{
-  //  std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myWarpVector.vtk";
-  //  VISU::WriteToFile(myWarpVector->GetUnstructuredGridOutput(), aFileName);
-  //}
+  {
+    std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myWarpVector.vtk";
+    VISU::WriteToFile(myWarpVector->GetUnstructuredGridOutput(), aFileName);
+  }
 }
 
 
index 70c41ac9a5fdd31715ce83af7d41e446b23b0e96..be843ed3b8ecb0b059709c893b916f2c774fe340 100644 (file)
@@ -43,6 +43,8 @@ VISU_ElnoAssembleFilter::VISU_ElnoAssembleFilter()
                                0, // connection
                                vtkDataObject::FIELD_ASSOCIATION_POINTS, // field association
                                "ELNO_POINT_COORDS" ); // name
+
+  this->myIsRestorePoints = false;
 }
 
 
@@ -51,6 +53,16 @@ VISU_ElnoAssembleFilter::~VISU_ElnoAssembleFilter()
 {}
 
 
+//----------------------------------------------------------------------------
+void VISU_ElnoAssembleFilter::SetElnoAssembleState( bool theIsRestorePoints )
+{
+  if ( myIsRestorePoints == theIsRestorePoints )
+    return;
+    
+  myIsRestorePoints = theIsRestorePoints;
+  this->Modified();
+}
+
 //----------------------------------------------------------------------------
 namespace
 {
@@ -133,7 +145,7 @@ int VISU_ElnoAssembleFilter::RequestData( vtkInformation *vtkNotUsed(request),
 
   vtkDataArray *anElnoPointCoords = this->GetInputArrayToProcess( 0, inputVector );
 
-  if ( !anElnoPointCoords ) {
+  if ( !myIsRestorePoints || !anElnoPointCoords ) {
     anOutput->ShallowCopy( anInput );
     return 1;
   }
index 4aca5d5bc6b4f58c9382c10bd6546eac7c4331bd..8f586c66d8d9694386210cd6b381a627566824d3 100644 (file)
@@ -29,12 +29,16 @@ public:
 
   static VISU_ElnoAssembleFilter *New();
 
+  void SetElnoAssembleState( bool theIsRestorePoints );
+
 protected:
   VISU_ElnoAssembleFilter();
   ~VISU_ElnoAssembleFilter();
 
   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
 
+  bool myIsRestorePoints;
+
 private:
   VISU_ElnoAssembleFilter(const VISU_ElnoAssembleFilter&);  // Not implemented.
   void operator=(const VISU_ElnoAssembleFilter&);  // Not implemented.
index 3be929466beadbc24982712a3fab82dfe6784ab6..a1d17d6bb9137d536a6d2480dd1eb9ef78a5d489 100644 (file)
@@ -50,7 +50,7 @@ VISU_ElnoDisassembleFilter::VISU_ElnoDisassembleFilter()
                                vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association
                                "ELNO_COMPONENT_MAPPER" ); // name
 
-  this->myShrinkFactor = -1.0;
+  this->myShrinkFactor = -0.999;
 }
 
 
index bea9854f35cfe9ffd5ba52774d85447d5dcf67e6..b81dc88aa6dd3a6b2908a69f19883a24c9da1191 100644 (file)
@@ -44,6 +44,8 @@ VISU_IsoSurfacesPL
 {
   SetIsShrinkable(false);
 
+  SetElnoDisassembleState( true );
+
   myContourFilter = vtkContourFilter::New();
 
   myCellDataToPointData = vtkCellDataToPointData::New();
index d679ad2eb7f81721e6a24d2a44976ec760012f62..ee04a98375cb58101dbdced989916b094506209d 100644 (file)
@@ -57,6 +57,8 @@ VISU_ScalarMapPL
 {
   SetIsShrinkable(true);
 
+  SetElnoDisassembleState( false );
+
   myElnoAssembleFilter->Delete();
 
   myAppendFilter->SetMergingInputs(true);
@@ -155,6 +157,15 @@ VISU_ScalarMapPL
 }
 
 
+//----------------------------------------------------------------------------
+void
+VISU_ScalarMapPL
+::SetElnoDisassembleState( bool theIsShrunk )
+{
+  GetDataSetMapperHolder()->SetElnoDisassembleState( theIsShrunk );
+  myElnoAssembleFilter->SetElnoAssembleState( theIsShrunk );
+}
+
 //----------------------------------------------------------------------------
 void
 VISU_ScalarMapPL
index 5962c4a6799a28a9fa9b4975f8579dff0949c897..fdb4ef9449caff9872e9ed6349221fe05790a795 100644 (file)
@@ -112,6 +112,9 @@ protected:
   DoShallowCopy(VISU_PipeLine *thePipeLine,
                bool theIsCopyInput);
 
+  void
+  SetElnoDisassembleState( bool theIsShrunk );
+
 private:
   VISU_ScalarMapPL(const VISU_ScalarMapPL&);  // Not implemented.
   void operator=(const VISU_ScalarMapPL&);  // Not implemented.