X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOBJECT%2FSMESH_DeviceActor.cxx;h=fe08178a9e272619c1757d78c3879ab9ca8e3ef3;hb=2c607013a23bd4e7ba07e72e0c04dee2c1209cff;hp=600a4987cfb05e19059e9309cc6d9443c45c7dca;hpb=d8f644ca3d4ce62f2ef41d4aacb52f5bb1221df3;p=modules%2Fsmesh.git diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index 600a4987c..fe08178a9 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -1,23 +1,23 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // SMESH OBJECT : interactive object for SMESH visualization @@ -310,12 +310,6 @@ SMESH_DeviceActor double aValue = aNumericalFunctor->GetValue(anObjId); aScalars->SetValue(i,aValue); } - int nbIntervals = theScalarBarActor->GetMaximumNumberOfColors(); - std::vector nbEvents; - std::vector funValues; - aNumericalFunctor->GetHistogram(nbIntervals, nbEvents, funValues); - theScalarBarActor->SetDistribution(nbEvents); - }else if(Predicate* aPredicate = dynamic_cast(theFunctor.get())){ for(vtkIdType i = 0; i < aNbCells; i++){ vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i); @@ -475,16 +469,6 @@ SMESH_DeviceActor myMergeFilter->SetScalars(aDataSet); aDataSet->Delete(); } - - //Set Distribution - if(NumericalFunctor* aNumericalFunctor = dynamic_cast(theFunctor.get())){ - int nbIntervals = theScalarBarActor->GetMaximumNumberOfColors(); - std::vector nbEvents; - std::vector funValues; - aNumericalFunctor->GetHistogram(nbIntervals, nbEvents, funValues); - theScalarBarActor->SetDistribution(nbEvents); - } - } GetMapper()->SetScalarVisibility(anIsInitialized); theScalarBarActor->SetVisibility(anIsInitialized); @@ -500,8 +484,13 @@ SMESH_DeviceActor myVisualObj->UpdateFunctor(theFunctor); using namespace SMESH::Controls; - if ( dynamic_cast(theFunctor.get()) || - dynamic_cast(theFunctor.get()) ) { + if ( dynamic_cast(theFunctor.get()) || + dynamic_cast(theFunctor.get()) || + dynamic_cast(theFunctor.get()) || + dynamic_cast(theFunctor.get()) || + dynamic_cast(theFunctor.get()) || + dynamic_cast(theFunctor.get())) + { Predicate* aFreePredicate = dynamic_cast(theFunctor.get()); myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding); vtkUnstructuredGrid* aGrid = myVisualObj->GetUnstructuredGrid(); @@ -514,7 +503,9 @@ SMESH_DeviceActor if(!myExtractUnstructuredGrid->IsCellsRegistered()) myExtractUnstructuredGrid->RegisterCell(-1); SetUnstructuredGrid(myVisualObj->GetUnstructuredGrid()); - }else if(FreeEdges* aFreeEdges = dynamic_cast(theFunctor.get())){ + } + else if(FreeEdges* aFreeEdges = dynamic_cast(theFunctor.get())) + { SMESH::Controls::FreeEdges::TBorders aBorders; aFreeEdges->GetBoreders(aBorders); vtkUnstructuredGrid* aDataSet = vtkUnstructuredGrid::New(); @@ -561,7 +552,9 @@ SMESH_DeviceActor SetUnstructuredGrid(aDataSet); aDataSet->Delete(); - }else if(FreeNodes* aFreeNodes = dynamic_cast(theFunctor.get())){ + } + else if(FreeNodes* aFreeNodes = dynamic_cast(theFunctor.get())) + { myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding); vtkIdType aNbNodes = myVisualObj->GetNbEntities(SMDSAbs_Node); for( vtkIdType i = 0; i < aNbNodes; i++ ){