X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FOBJECT%2FSMESH_Actor.cxx;h=a998576e9db9f2790eea10f4aeb0956e6349f7c1;hp=d392cbe0d6e28dce3bd24e5442094f88cb5514c1;hb=13c60ab0d120a652dfd832d5ac791d515d36e9d3;hpb=904e9a8802b91a65017254fb20e9c69aa1cd4066 diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index d392cbe0d..a998576e9 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.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 @@ -33,6 +33,7 @@ #include "SMDS_UnstructuredGrid.hxx" #include "SMESH_ScalarBarActor.h" #include "VTKViewer_CellCenters.h" +#include "VTKViewer_DataSetMapper.h" #include "VTKViewer_ExtractUnstructuredGrid.h" #include "VTKViewer_FramedTextActor.h" #include "SALOME_InteractiveObject.hxx" @@ -103,13 +104,16 @@ SMESH_Actor* SMESH_Actor::New(TVisualObjPtr theVisualObj, const char* theName, int theIsClear) { - SMESH_ActorDef* anActor = SMESH_ActorDef::New(); - if(!anActor->Init(theVisualObj,theEntry,theName,theIsClear)){ - anActor->Delete(); - anActor = NULL; + SMESH_ActorDef* anActor = NULL; + if(theVisualObj->IsValid() ) { + anActor = SMESH_ActorDef::New(); + if(!anActor->Init(theVisualObj,theEntry,theName,theIsClear)){ + anActor->Delete(); + anActor = NULL; + } + if( anActor ) + anActor->UpdateScalarBar(); } - if( anActor ) - anActor->UpdateScalarBar(); return anActor; } @@ -362,6 +366,11 @@ SMESH_ActorDef::SMESH_ActorDef() myPickableActor = myBaseActor; + // VSR 13/07/2011: Revert back previous fix for issue 0020749 since it causes regressions, see issues 0021322, 0021323 + // To be removed later or fix to be improved + //myMapper = VTKViewer_DataSetMapper::New(); + //myMapper->SetInput( myPickableActor->GetUnstructuredGrid() ); + myHighlightProp = vtkProperty::New(); myHighlightProp->SetAmbient(1.0); myHighlightProp->SetDiffuse(0.0); @@ -624,6 +633,10 @@ SMESH_ActorDef::~SMESH_ActorDef() myImplicitBoolean->Delete(); + // VSR 13/07/2011: Revert back previous fix for issue 0020749 since it causes regressions, see issues 0021322, 0021323 + // To be removed later or fix to be improved + //myMapper->Delete(); + myTimeStamp->Delete(); } @@ -1162,6 +1175,9 @@ void SMESH_ActorDef::ShallowCopy(vtkProp *prop){ vtkMapper* SMESH_ActorDef::GetMapper(){ + // VSR 13/07/2011: Revert back previous fix for issue 0020749 since it causes regressions, see issues 0021322, 0021323 + // To be removed later or fix to be improved + //return myMapper; return myPickableActor->GetMapper(); }