X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FOBJECT%2FSMESH_DeviceActor.cxx;h=337aba6483d5bceb36398e573d1c371553a48bbc;hp=21bf977b2972ac1b3959137a08b72dd617d5e908;hb=1eea5485d119de1f044c0bb06c4bfd557a9572b1;hpb=7411bcf53c885c39859a769c4adbc2a256448d75 diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index 21bf977b2..337aba648 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -21,10 +21,10 @@ // // // -// File : SMESH_Actor.cxx -// Author : Nicolas REJNERI +// File : SMESH_DeviceActor.cxx +// Author : // Module : SMESH -// $Header$Header: /home/server/cvs/SMESH/SMESH_SRC/src/OBJECT/SMESH_DeviceActor.cxx,v 1.7 2005/02/02 12:17:51 apo Exp $ +// $Header$ #include "SMESH_DeviceActor.h" @@ -76,7 +76,6 @@ vtkStandardNewMacro(SMESH_DeviceActor); SMESH_DeviceActor::SMESH_DeviceActor(){ - if(MYDEBUG) MESSAGE("SMESH_DeviceActor"); myIsShrunk = false; myIsShrinkable = false; myRepresentation = eSurface; @@ -93,7 +92,9 @@ SMESH_DeviceActor::SMESH_DeviceActor(){ myShrinkFilter = vtkShrinkFilter::New(); myExtractGeometry = SMESH_ExtractGeometry::New(); + myExtractGeometry->SetReleaseDataFlag(true); myExtractGeometry->SetStoreMapping(true); + myIsImplicitFunctionUsed = false; myExtractUnstructuredGrid = SALOME_ExtractUnstructuredGrid::New(); myExtractUnstructuredGrid->SetStoreMapping(true); @@ -160,6 +161,23 @@ void SMESH_DeviceActor::Init(TVisualObjPtr theVisualObj, } +void +SMESH_DeviceActor:: +SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed) +{ + if(myIsImplicitFunctionUsed == theIsImplicitFunctionUsed) + return; + + int anId = 0; + if(theIsImplicitFunctionUsed) + myPassFilter[ anId ]->SetInput( myExtractGeometry->GetOutput() ); + else + myPassFilter[ anId ]->SetInput( myMergeFilter->GetOutput() ); + + myIsImplicitFunctionUsed = theIsImplicitFunctionUsed; +} + + void SMESH_DeviceActor::SetUnstructuredGrid(vtkUnstructuredGrid* theGrid){ if(theGrid){ //myIsShrinkable = theGrid->GetNumberOfCells() > 10; @@ -172,7 +190,7 @@ void SMESH_DeviceActor::SetUnstructuredGrid(vtkUnstructuredGrid* theGrid){ myExtractGeometry->SetInput(myMergeFilter->GetOutput()); int anId = 0; - myPassFilter[ anId ]->SetInput( myExtractGeometry->GetOutput() ); + myPassFilter[ anId ]->SetInput( myMergeFilter->GetOutput() ); myPassFilter[ anId + 1]->SetInput( myPassFilter[ anId ]->GetOutput() ); anId++; // 1 @@ -513,9 +531,9 @@ void SMESH_DeviceActor::UnShrink() { } -void SMESH_DeviceActor::SetRepresentation(EReperesent theMode){ +void SMESH_DeviceActor::SetRepresentation(EReperesent theMode){ switch(theMode){ - case ePoint: + case ePoint: myGeomFilter->SetInside(true); GetProperty()->SetRepresentation(0); break; @@ -524,8 +542,8 @@ void SMESH_DeviceActor::SetRepresentation(EReperesent theMode){ GetProperty()->SetRepresentation(1); break; default : - GetProperty()->SetRepresentation(theMode); myGeomFilter->SetInside(false); + GetProperty()->SetRepresentation(theMode); } myRepresentation = theMode; GetProperty()->Modified(); @@ -552,14 +570,18 @@ int SMESH_DeviceActor::GetVisibility(){ int SMESH_DeviceActor::GetNodeObjId(int theVtkID){ - vtkIdType anID = myExtractGeometry->GetNodeObjId(theVtkID); + vtkIdType anID = theVtkID; + + if(IsImplicitFunctionUsed()) + anID = myExtractGeometry->GetNodeObjId(theVtkID); + vtkIdType aRetID = myVisualObj->GetNodeObjId(anID); if(MYDEBUG) MESSAGE("GetNodeObjId - theVtkID = "<