From: apo Date: Mon, 27 Dec 2004 12:49:55 +0000 (+0000) Subject: Bug PAL7334 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7fd19e46767de024b53e27bef3fb83452ee885c5;p=modules%2Fsmesh.git Bug PAL7334 DEVELOPMENT : Control Improvement --- diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index f29273b4c..41b7668f2 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -826,6 +826,8 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj, my3DActor->Init(myVisualObj,myImplicitBoolean); my1DActor->GetMapper()->SetLookupTable(myLookupTable); + my1DExtActor->GetMapper()->SetLookupTable(myLookupTable); + my2DActor->GetMapper()->SetLookupTable(myLookupTable); my3DActor->GetMapper()->SetLookupTable(myLookupTable); @@ -1136,11 +1138,6 @@ void SMESH_ActorDef::SetRepresentation(int theMode){ if(myRepresentation != ePoint) aReperesent = SMESH_DeviceActor::eInsideframe; break; - case eLength2D: - case eFreeEdges: - case eFreeBorders: - my1DExtActor->SetVisibility(true); - break; } my1DActor->SetProperty(aProp); diff --git a/src/OBJECT/SMESH_ActorUtils.cxx b/src/OBJECT/SMESH_ActorUtils.cxx index a5823c66f..fdaa86c25 100644 --- a/src/OBJECT/SMESH_ActorUtils.cxx +++ b/src/OBJECT/SMESH_ActorUtils.cxx @@ -23,6 +23,9 @@ #include "QAD_Config.h" #include "utilities.h" +#include +#include + #ifdef _DEBUG_ static int MYDEBUG = 1; #else @@ -30,10 +33,22 @@ static int MYDEBUG = 0; #endif namespace SMESH{ + float GetFloat(const QString& theValue, float theDefault){ if(theValue.isEmpty()) return theDefault; QString aValue = QAD_CONFIG->getSetting(theValue); if(aValue.isEmpty()) return theDefault; return aValue.toFloat(); } + + void WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, const char* theFileName){ + vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New(); + aWriter->SetFileName(theFileName); + aWriter->SetInput(theGrid); + if(theGrid->GetNumberOfCells()){ + aWriter->Write(); + } + aWriter->Delete(); + } + } diff --git a/src/OBJECT/SMESH_ActorUtils.h b/src/OBJECT/SMESH_ActorUtils.h index 459549524..b9a01e003 100644 --- a/src/OBJECT/SMESH_ActorUtils.h +++ b/src/OBJECT/SMESH_ActorUtils.h @@ -22,10 +22,14 @@ #include +class vtkUnstructuredGrid; namespace SMESH{ + float GetFloat(const QString& theValue, float theDefault = 0); -} + void WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, const char* theFileName); + +} #endif diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index 9670ad3d0..c46bbe224 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -30,6 +30,7 @@ #include "SMESH_DeviceActor.h" #include "SMESH_ExtractGeometry.h" #include "SMESH_ControlsDef.hxx" +#include "SMESH_ActorUtils.h" #include "SALOME_Transform.h" #include "SALOME_TransformFilter.h" @@ -331,8 +332,6 @@ void SMESH_DeviceActor::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor theLookupTable->SetRange(aScalars->GetRange()); theLookupTable->Build(); - SetUnstructuredGrid(aDataSet); - myMergeFilter->SetScalars(aDataSet); aDataSet->Delete(); } diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index e4d4a9107..c640f6764 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -26,6 +26,7 @@ // Module : SMESH #include "SMESH_ObjectDef.h" +#include "SMESH_ActorUtils.h" #include "SMDS_Mesh.hxx" #include "SMESH_Actor.h" @@ -41,8 +42,6 @@ #include #include -#include -#include #include #include @@ -70,17 +69,6 @@ static int MYDEBUGWITHFILES = 0; #endif -void WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, const char* theFileName){ - vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New(); - aWriter->SetFileName(theFileName); - aWriter->SetInput(theGrid); - if(theGrid->GetNumberOfCells()){ - aWriter->Write(); - } - aWriter->Delete(); -} - - namespace{ inline const SMDS_MeshNode* FindNode(const SMDS_Mesh* theMesh, int theId){ @@ -393,7 +381,7 @@ void SMESH_VisualObjDef::buildPrs() } if( MYDEBUG ) MESSAGE( "Update - myGrid->GetNumberOfCells() = "<GetNumberOfCells() ); - if( MYDEBUGWITHFILES ) WriteUnstructuredGrid( myGrid,"/tmp/buildPrs" ); + if( MYDEBUGWITHFILES ) SMESH::WriteUnstructuredGrid( myGrid,"/tmp/buildPrs" ); } //================================================================================= diff --git a/src/OBJECT/SMESH_ObjectDef.h b/src/OBJECT/SMESH_ObjectDef.h index eabede8b3..16cda5518 100644 --- a/src/OBJECT/SMESH_ObjectDef.h +++ b/src/OBJECT/SMESH_ObjectDef.h @@ -201,7 +201,4 @@ protected: }; -extern void WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, const char* theFileName); - - #endif