-// 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
#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"
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;
}
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
+ aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
//Definition 1D device of the actor
//---------------------------------
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);
{
if(MYDEBUG) MESSAGE("~SMESH_ActorDef - "<<this);
+#ifndef DISABLE_PLOT2DVIEWER
+ if(my2dHistogram) {
+ SMESH::ProcessIn2DViewers(this,SMESH::RemoveFrom2dViewer);
+ delete my2dHistogram;
+ }
+#endif
+
// caught by SMESHGUI::ProcessEvents() static method
this->InvokeEvent( SMESH::DeleteActorEvent, NULL );
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();
-#ifndef DISABLE_PLOT2DVIEWER
- if(my2dHistogram)
- delete my2dHistogram;
-#endif
}
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();
}
if(myIsCellsLabeled)
myCellsLabels->VisibilityOn();
- }
+ }
+#ifndef DISABLE_PLOT2DVIEWER
+ else
+ SMESH::ProcessIn2DViewers(this,SMESH::RemoveFrom2dViewer);
+#endif
UpdateHighlight();
Modified();
}