]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fixed bug with incorrect parameters of Outside Cursor Gauss Points
authorouv <ouv@opencascade.com>
Fri, 7 Oct 2005 13:11:05 +0000 (13:11 +0000)
committerouv <ouv@opencascade.com>
Fri, 7 Oct 2005 13:11:05 +0000 (13:11 +0000)
src/OBJECT/VISU_GaussPtsAct.cxx
src/OBJECT/VISU_GaussPtsDeviceActor.cxx
src/OBJECT/VISU_GaussPtsDeviceActor.h

index a37e9389073935495ea62c50f86baee8068020ea..9520e3cc418090f28dc85a9aee74eebc0008ad07 100644 (file)
@@ -843,6 +843,12 @@ VISU_GaussPtsAct1
   VISU_GaussPointsPL* aPipeLine = dynamic_cast<VISU_GaussPointsPL*>(thePipeLine);
 
   myInsideDeviceActor->ShallowCopyPL(aPipeLine);
+
+  // Restore implicit function
+  if(myWidget){
+    vtkImplicitFunction* aFunction = myWidget->ImplicitFunction();
+    myInsideDeviceActor->GetPipeLine()->SetImplicitFunction(aFunction);
+  }
 }
 
 //----------------------------------------------------------------------------
@@ -977,15 +983,14 @@ void
 VISU_GaussPtsAct1
 ::UpdateOutsideCursorSettings()
 {
-  VISU_OpenGLPointSpriteMapper* aMapper = myOutsideDeviceActor->GetPSMapper();
-
-  aMapper->SetImageData(myOutsideCursorSettings->GetTexture());
+  VISU_GaussPointsPL* aPipeline = myOutsideDeviceActor->GetPipeLine();
 
-  aMapper->SetPointSpriteResults(false);
-  aMapper->SetPointSpriteClamp(myOutsideCursorSettings->GetClamp());
-  aMapper->SetPointSpriteAlphaThreshold(myOutsideCursorSettings->GetAlphaThreshold());
-  aMapper->SetPointSpriteSize(myOutsideCursorSettings->GetSize());
+  aPipeline->SetClamp( myOutsideCursorSettings->GetClamp() );
+  aPipeline->SetImageData( myOutsideCursorSettings->GetTexture() );
+  aPipeline->SetAlphaThreshold( myOutsideCursorSettings->GetAlphaThreshold() );
+  aPipeline->SetSize( myOutsideCursorSettings->GetSize() );
 
+  myOutsideDeviceActor->GetPSMapper()->SetPointSpriteResults(false);
   myOutsideDeviceActor->GetProperty()->SetColor(myOutsideCursorSettings->GetColor());
 
   Update();
index 22667349e5a4e921537851df8425d59286405c01..49471bcf443e84b054fbebf07d9fd939660b9fff 100644 (file)
@@ -57,13 +57,11 @@ vtkStandardNewMacro(VISU_GaussPtsDeviceActor);
 
 VISU_GaussPtsDeviceActor
 ::VISU_GaussPtsDeviceActor():
-  myMapper(VISU_OpenGLPointSpriteMapper::New()),
   myGeomFilter(VTKViewer_GeometryFilter::New()),
   myTransformFilter(VTKViewer_TransformFilter::New())
 {
   if(MYDEBUG) MESSAGE("VISU_GaussPtsDeviceActor - "<<this);
 
-  myMapper->Delete();
   myGeomFilter->Delete();
   myTransformFilter->Delete();
 
@@ -97,27 +95,6 @@ VISU_GaussPtsDeviceActor
   theRenderer->RemoveActor(this);
 }
 
-
-//----------------------------------------------------------------
-void
-VISU_GaussPtsDeviceActor
-::SetDataSet(vtkPolyData* theDataSet)
-{
-  int anId = 0;
-  myPassFilter[ anId ]->SetInput( theDataSet ); 
-  myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
-  
-  anId++;
-  myTransformFilter->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() );
-  
-  anId++;
-  myPassFilter[ anId ]->SetInput( myTransformFilter->GetOutput() );
-  
-  myMapper->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() );
-  
-  vtkLODActor::SetMapper( myMapper.GetPointer() );
-}
-
 void
 VISU_GaussPtsDeviceActor
 ::SetTransform(VTKViewer_Transform* theTransform)
@@ -139,7 +116,22 @@ VISU_GaussPtsDeviceActor
 ::SetPipeLine(VISU_GaussPointsPL* thePipeLine) 
 {
   myPipeLine = thePipeLine;
-  SetDataSet(thePipeLine->GetPSMapper()->GetInput());
+  myMapper = thePipeLine->GetPSMapper();
+  vtkPolyData* aDataSet = myMapper->GetInput();
+
+  int anId = 0;
+  myPassFilter[ anId ]->SetInput( aDataSet ); 
+  myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
+  
+  anId++;
+  myTransformFilter->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() );
+  
+  anId++;
+  myPassFilter[ anId ]->SetInput( myTransformFilter->GetOutput() );
+  
+  myMapper->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() );
+  
+  vtkLODActor::SetMapper( myMapper.GetPointer() );
 }
 
 VISU_GaussPointsPL* 
@@ -154,10 +146,6 @@ VISU_GaussPtsDeviceActor
 ::ShallowCopyPL(VISU_GaussPointsPL* thePipeLine)
 {
   myPipeLine->ShallowCopy(thePipeLine);
-  GetPSMapper()->ShallowCopy(thePipeLine->GetMapper());
-
-  // To restore mapper input from pipeline
-  SetDataSet(myPipeLine->GetPSMapper()->GetInput());
 }
 
 
index 2dd699fac59ab4aa0d0e4b75ae1a7a822dae2175..8661a16624c95f61393cd9557cf577618c7a7bad 100644 (file)
@@ -77,9 +77,6 @@ class VISU_GaussPtsDeviceActor: public vtkLODActor
 
  protected:
   //----------------------------------------------------------------------------
-  void
-  SetDataSet(vtkPolyData* theDataSet);
-
   vtkSmartPointer<VISU_GaussPointsPL> myPipeLine;
   vtkSmartPointer<VISU_OpenGLPointSpriteMapper> myMapper;
   vtkSmartPointer<VTKViewer_GeometryFilter> myGeomFilter;