From: ouv Date: Fri, 7 Oct 2005 13:11:05 +0000 (+0000) Subject: Fixed bug with incorrect parameters of Outside Cursor Gauss Points X-Git-Tag: BR-D5-38-2003_D2005-12-10~34 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1f64cc8e06d6d365e406e5b4dc975f2e92dedd8c;p=modules%2Fvisu.git Fixed bug with incorrect parameters of Outside Cursor Gauss Points --- diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index a37e9389..9520e3cc 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -843,6 +843,12 @@ VISU_GaussPtsAct1 VISU_GaussPointsPL* aPipeLine = dynamic_cast(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(); diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx index 22667349..49471bcf 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx @@ -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 - "<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()); } diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.h b/src/OBJECT/VISU_GaussPtsDeviceActor.h index 2dd699fa..8661a166 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.h +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.h @@ -77,9 +77,6 @@ class VISU_GaussPtsDeviceActor: public vtkLODActor protected: //---------------------------------------------------------------------------- - void - SetDataSet(vtkPolyData* theDataSet); - vtkSmartPointer myPipeLine; vtkSmartPointer myMapper; vtkSmartPointer myGeomFilter;