2012-08-09 16:03:55 +06:00
|
|
|
// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
|
2009-02-17 10:27:49 +05:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
|
|
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
2003-07-10 15:42:33 +06:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// 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.
|
2003-07-10 15:42:33 +06:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// 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.
|
2003-07-10 15:42:33 +06:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// 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
|
2003-07-10 15:42:33 +06:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
2009-02-17 10:27:49 +05:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SMESH OBJECT : interactive object for SMESH visualization
|
2003-07-10 15:42:33 +06:00
|
|
|
// File : SMESH_Actor.cxx
|
|
|
|
// Author : Nicolas REJNERI
|
|
|
|
// Module : SMESH
|
2012-08-09 16:03:55 +06:00
|
|
|
//
|
2005-01-20 11:25:54 +05:00
|
|
|
#include "SMESH_ActorDef.h"
|
2004-12-01 15:48:31 +05:00
|
|
|
#include "SMESH_ActorUtils.h"
|
2004-06-18 14:34:31 +06:00
|
|
|
#include "SMESH_DeviceActor.h"
|
2012-08-09 16:03:55 +06:00
|
|
|
#include "SMESH_NodeLabelActor.h"
|
|
|
|
#include "SMESH_CellLabelActor.h"
|
|
|
|
#include "SMESH_ObjectDef.h"
|
2005-01-20 11:25:54 +05:00
|
|
|
#include "SMESH_ControlsDef.hxx"
|
2012-08-09 16:03:55 +06:00
|
|
|
#include "SMDS_UnstructuredGrid.hxx"
|
|
|
|
#include "SMESH_ScalarBarActor.h"
|
2006-02-07 20:01:11 +05:00
|
|
|
#include "VTKViewer_ExtractUnstructuredGrid.h"
|
2012-08-09 16:03:55 +06:00
|
|
|
#include "VTKViewer_FramedTextActor.h"
|
2009-02-17 10:27:49 +05:00
|
|
|
#include "SALOME_InteractiveObject.hxx"
|
2012-10-08 17:56:59 +06:00
|
|
|
#include "SMESH_SVTKActor.h"
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-06-08 16:45:19 +06:00
|
|
|
#include "SUIT_Session.h"
|
|
|
|
#include "SUIT_ResourceMgr.h"
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
#include <Qtx.h>
|
|
|
|
|
|
|
|
#ifndef DISABLE_PLOT2DVIEWER
|
|
|
|
#include <SPlot2d_Histogram.h>
|
|
|
|
#endif
|
|
|
|
|
2006-02-07 20:01:11 +05:00
|
|
|
#include <vtkProperty.h>
|
2004-12-01 15:48:31 +05:00
|
|
|
#include <vtkTimeStamp.h>
|
2003-05-19 20:07:00 +06:00
|
|
|
#include <vtkObjectFactory.h>
|
2004-06-18 14:34:31 +06:00
|
|
|
#include <vtkShrinkPolyData.h>
|
|
|
|
#include <vtkMergeFilter.h>
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
#include <vtkMatrix4x4.h>
|
|
|
|
#include <vtkUnstructuredGrid.h>
|
|
|
|
#include <vtkPointData.h>
|
|
|
|
#include <vtkCellData.h>
|
|
|
|
|
|
|
|
#include <vtkMapper.h>
|
|
|
|
#include <vtkRenderer.h>
|
|
|
|
|
|
|
|
#include <vtkCell.h>
|
|
|
|
#include <vtkIdList.h>
|
|
|
|
#include <vtkIntArray.h>
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
#include <vtkActor2D.h>
|
2004-12-01 15:48:31 +05:00
|
|
|
#include <vtkProperty2D.h>
|
2004-06-18 14:34:31 +06:00
|
|
|
#include <vtkPolyData.h>
|
|
|
|
#include <vtkTextProperty.h>
|
|
|
|
|
|
|
|
#include <vtkLookupTable.h>
|
2004-12-01 15:48:31 +05:00
|
|
|
|
|
|
|
#include <vtkMath.h>
|
|
|
|
#include <vtkPlane.h>
|
|
|
|
#include <vtkImplicitBoolean.h>
|
2005-03-22 15:32:59 +05:00
|
|
|
#include <vtkImplicitFunctionCollection.h>
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
#include <vtkConfigure.h>
|
|
|
|
#if !defined(VTK_XVERSION)
|
|
|
|
#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION)
|
|
|
|
#endif
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
#include "utilities.h"
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
#ifdef _DEBUG_
|
2005-06-07 19:22:20 +06:00
|
|
|
static int MYDEBUG = 1;
|
2004-06-18 14:34:31 +06:00
|
|
|
#else
|
2012-08-09 16:03:55 +06:00
|
|
|
static int MYDEBUG = 1;
|
2004-06-18 14:34:31 +06:00
|
|
|
#endif
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
static int aLineWidthInc = 2;
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
SMESH_ActorDef* SMESH_ActorDef::New(){
|
|
|
|
return new SMESH_ActorDef();
|
2004-06-18 14:34:31 +06:00
|
|
|
}
|
2003-05-19 20:07:00 +06:00
|
|
|
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
SMESH_Actor* SMESH_Actor::New(TVisualObjPtr theVisualObj,
|
2012-08-09 16:03:55 +06:00
|
|
|
const char* theEntry,
|
|
|
|
const char* theName,
|
|
|
|
int theIsClear)
|
2004-06-18 14:34:31 +06:00
|
|
|
{
|
2012-08-09 16:03:55 +06:00
|
|
|
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();
|
2004-12-01 15:48:31 +05:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
return anActor;
|
|
|
|
}
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2003-11-12 16:40:21 +05:00
|
|
|
|
2005-03-30 20:06:25 +06:00
|
|
|
SMESH_ActorDef::SMESH_ActorDef()
|
|
|
|
{
|
2012-08-09 16:03:55 +06:00
|
|
|
if(MYDEBUG) MESSAGE("SMESH_ActorDef - "<<this);
|
|
|
|
myBaseActor = SMESH_DeviceActor::New();
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
myTimeStamp = vtkTimeStamp::New();
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
myIsPointsVisible = false;
|
2012-08-09 16:03:55 +06:00
|
|
|
myIsEntityModeCache = false;
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-10-08 17:56:59 +06:00
|
|
|
myHighlightActor = SMESH_SVTKActor::New();
|
|
|
|
myHighlightActor->Initialize();
|
|
|
|
|
|
|
|
myPreHighlightActor = SMESH_SVTKActor::New();
|
|
|
|
myPreHighlightActor->Initialize();
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
myIsShrinkable = false;
|
|
|
|
myIsShrunk = false;
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
myIsFacesOriented = false;
|
|
|
|
|
2005-08-30 16:04:41 +06:00
|
|
|
myControlsPrecision = -1;
|
|
|
|
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
|
2012-08-09 16:03:55 +06:00
|
|
|
|
2005-08-30 16:04:41 +06:00
|
|
|
if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
|
2009-02-17 10:27:49 +05:00
|
|
|
myControlsPrecision = mgr->integerValue( "SMESH", "controls_precision", -1);
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
vtkFloatingPointType aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5);
|
|
|
|
vtkFloatingPointType aBallElemSize = SMESH::GetFloat("SMESH:ball_elem_size",10);
|
|
|
|
vtkFloatingPointType aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
|
2012-10-08 17:56:59 +06:00
|
|
|
vtkFloatingPointType aOutlineWidth = SMESH::GetFloat("SMESH:outline_width",1);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
|
2005-06-07 19:22:20 +06:00
|
|
|
VTKViewer_ExtractUnstructuredGrid* aFilter = NULL;
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
//Definition 2D and 3D devices of the actor
|
2004-06-18 14:34:31 +06:00
|
|
|
//-----------------------------------------
|
2006-05-06 14:51:48 +06:00
|
|
|
vtkFloatingPointType anRGB[3] = {1,1,1};
|
2004-06-18 14:34:31 +06:00
|
|
|
mySurfaceProp = vtkProperty::New();
|
2012-08-09 16:03:55 +06:00
|
|
|
QColor ffc, bfc;
|
|
|
|
int delta;
|
|
|
|
SMESH::GetColor( "SMESH", "fill_color", ffc, delta, "0,170,255|-100" ) ;
|
|
|
|
mySurfaceProp->SetColor( ffc.red() / 255. , ffc.green() / 255. , ffc.blue() / 255. );
|
|
|
|
myDeltaBrightness = delta;
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
myBackSurfaceProp = vtkProperty::New();
|
2012-08-09 16:03:55 +06:00
|
|
|
bfc = Qtx::mainColorToSecondary(ffc, delta);
|
|
|
|
myBackSurfaceProp->SetColor( bfc.red() / 255. , bfc.green() / 255. , bfc.blue() / 255. );
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-10-08 17:56:59 +06:00
|
|
|
myNormalVProp = vtkProperty::New();
|
|
|
|
SMESH::GetColor( "SMESH", "volume_color", ffc, delta, "255,0,170|-100" );
|
|
|
|
myNormalVProp->SetColor( ffc.redF(), ffc.greenF(), ffc.blueF() );
|
|
|
|
myDeltaVBrightness = delta;
|
|
|
|
|
|
|
|
myReversedVProp = vtkProperty::New();
|
|
|
|
bfc = Qtx::mainColorToSecondary(ffc, delta);
|
|
|
|
myReversedVProp->SetColor( bfc.red() / 255. , bfc.green() / 255. , bfc.blue() / 255. );
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
my2DActor = SMESH_CellLabelActor::New();
|
|
|
|
my2DActor->SetStoreGemetryMapping(true);
|
2004-06-18 14:34:31 +06:00
|
|
|
my2DActor->SetUserMatrix(aMatrix);
|
|
|
|
my2DActor->PickableOff();
|
|
|
|
my2DActor->SetProperty(mySurfaceProp);
|
|
|
|
my2DActor->SetBackfaceProperty(myBackSurfaceProp);
|
|
|
|
my2DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
|
|
|
|
aFilter = my2DActor->GetExtractUnstructuredGrid();
|
2005-06-07 19:22:20 +06:00
|
|
|
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
2004-06-18 14:34:31 +06:00
|
|
|
aFilter->RegisterCellsWithType(VTK_TRIANGLE);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_POLYGON);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_QUAD);
|
2006-03-13 20:29:49 +05:00
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
|
2012-08-09 16:03:55 +06:00
|
|
|
aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DExtProp = vtkProperty::New();
|
|
|
|
my2DExtProp->DeepCopy(mySurfaceProp);
|
|
|
|
SMESH::GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
|
|
|
|
anRGB[0] = 1 - anRGB[0];
|
|
|
|
anRGB[1] = 1 - anRGB[1];
|
|
|
|
anRGB[2] = 1 - anRGB[2];
|
|
|
|
my2DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
|
|
|
|
|
|
|
my2DExtActor = SMESH_DeviceActor::New();
|
|
|
|
my2DExtActor->SetUserMatrix(aMatrix);
|
|
|
|
my2DExtActor->PickableOff();
|
|
|
|
my2DExtActor->SetProperty(my2DExtProp);
|
|
|
|
my2DExtActor->SetBackfaceProperty(my2DExtProp);
|
|
|
|
my2DExtActor->SetRepresentation(SMESH_DeviceActor::eInsideframe);
|
|
|
|
aFilter = my2DExtActor->GetExtractUnstructuredGrid();
|
|
|
|
aFilter->RegisterCellsWithType(VTK_TRIANGLE);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_POLYGON);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_QUAD);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
|
2012-08-09 16:03:55 +06:00
|
|
|
aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
|
2009-02-17 10:27:49 +05:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DActor = SMESH_CellLabelActor::New();
|
|
|
|
my3DActor->SetStoreGemetryMapping(true);
|
2004-06-18 14:34:31 +06:00
|
|
|
my3DActor->SetUserMatrix(aMatrix);
|
|
|
|
my3DActor->PickableOff();
|
2012-10-08 17:56:59 +06:00
|
|
|
my3DActor->SetProperty(myNormalVProp);
|
|
|
|
my3DActor->SetBackfaceProperty(myReversedVProp);
|
2004-06-18 14:34:31 +06:00
|
|
|
my3DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DActor->SetCoincident3DAllowed(true);
|
2004-06-18 14:34:31 +06:00
|
|
|
aFilter = my3DActor->GetExtractUnstructuredGrid();
|
2005-06-07 19:22:20 +06:00
|
|
|
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
2004-06-18 14:34:31 +06:00
|
|
|
aFilter->RegisterCellsWithType(VTK_TETRA);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_VOXEL);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_WEDGE);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_PYRAMID);
|
2012-08-09 16:03:55 +06:00
|
|
|
aFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
|
|
|
//#ifdef VTK_HAVE_POLYHEDRON
|
|
|
|
MESSAGE("RegisterCellsWithType(VTK_POLYHEDRON)");
|
|
|
|
aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
|
|
|
//#endif
|
|
|
|
|
2012-10-08 17:56:59 +06:00
|
|
|
my3DExtProp = vtkProperty::New();
|
|
|
|
my3DExtProp->DeepCopy(myNormalVProp);
|
|
|
|
SMESH::GetColor( "SMESH", "volume_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 0, 170 ) );
|
|
|
|
anRGB[0] = 1 - anRGB[0];
|
|
|
|
anRGB[1] = 1 - anRGB[1];
|
|
|
|
anRGB[2] = 1 - anRGB[2];
|
|
|
|
my3DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DExtActor = SMESH_DeviceActor::New();
|
|
|
|
my3DExtActor->SetUserMatrix(aMatrix);
|
|
|
|
my3DExtActor->PickableOff();
|
2012-10-08 17:56:59 +06:00
|
|
|
my3DExtActor->SetProperty(my3DExtProp);
|
|
|
|
my3DExtActor->SetBackfaceProperty(my3DExtProp);
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DExtActor->SetRepresentation(SMESH_DeviceActor::eSurface);
|
|
|
|
my3DExtActor->SetCoincident3DAllowed(true);
|
|
|
|
aFilter = my3DExtActor->GetExtractUnstructuredGrid();
|
|
|
|
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_TETRA);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_VOXEL);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_WEDGE);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_PYRAMID);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
|
2006-03-13 20:29:49 +05:00
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
|
2012-08-09 16:03:55 +06:00
|
|
|
aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
|
2009-02-17 10:27:49 +05:00
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
|
2012-08-09 16:03:55 +06:00
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
|
2005-06-07 19:22:20 +06:00
|
|
|
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
2012-08-09 16:03:55 +06:00
|
|
|
aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
//Definition 1D device of the actor
|
2004-06-18 14:34:31 +06:00
|
|
|
//---------------------------------
|
|
|
|
myEdgeProp = vtkProperty::New();
|
|
|
|
myEdgeProp->SetAmbient(1.0);
|
|
|
|
myEdgeProp->SetDiffuse(0.0);
|
|
|
|
myEdgeProp->SetSpecular(0.0);
|
2012-08-09 16:03:55 +06:00
|
|
|
SMESH::GetColor( "SMESH", "wireframe_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
|
2004-06-18 14:34:31 +06:00
|
|
|
myEdgeProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
|
|
|
myEdgeProp->SetLineWidth(aLineWidth);
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
my1DActor = SMESH_CellLabelActor::New();
|
|
|
|
my1DActor->SetStoreGemetryMapping(true);
|
2004-06-18 14:34:31 +06:00
|
|
|
my1DActor->SetUserMatrix(aMatrix);
|
|
|
|
my1DActor->PickableOff();
|
2004-12-01 15:48:31 +05:00
|
|
|
my1DActor->SetHighlited(true);
|
2004-06-18 14:34:31 +06:00
|
|
|
my1DActor->SetProperty(myEdgeProp);
|
|
|
|
my1DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
|
|
|
|
aFilter = my1DActor->GetExtractUnstructuredGrid();
|
2005-06-07 19:22:20 +06:00
|
|
|
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
2004-06-18 14:34:31 +06:00
|
|
|
aFilter->RegisterCellsWithType(VTK_LINE);
|
2006-03-13 20:29:49 +05:00
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
my1DProp = vtkProperty::New();
|
|
|
|
my1DProp->DeepCopy(myEdgeProp);
|
2004-12-01 15:48:31 +05:00
|
|
|
my1DProp->SetLineWidth(aLineWidth + aLineWidthInc);
|
2012-08-09 16:03:55 +06:00
|
|
|
my1DProp->SetPointSize(aElem0DSize);
|
2009-02-17 10:27:49 +05:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
my1DExtProp = vtkProperty::New();
|
|
|
|
my1DExtProp->DeepCopy(myEdgeProp);
|
|
|
|
anRGB[0] = 1 - anRGB[0];
|
|
|
|
anRGB[1] = 1 - anRGB[1];
|
|
|
|
anRGB[2] = 1 - anRGB[2];
|
|
|
|
my1DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
2004-12-01 15:48:31 +05:00
|
|
|
my1DExtProp->SetLineWidth(aLineWidth + aLineWidthInc);
|
2012-08-09 16:03:55 +06:00
|
|
|
my1DExtProp->SetPointSize(aElem0DSize);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
my1DExtActor = SMESH_DeviceActor::New();
|
|
|
|
my1DExtActor->SetUserMatrix(aMatrix);
|
|
|
|
my1DExtActor->PickableOff();
|
2004-12-01 15:48:31 +05:00
|
|
|
my1DExtActor->SetHighlited(true);
|
2004-06-18 14:34:31 +06:00
|
|
|
my1DExtActor->SetVisibility(false);
|
|
|
|
my1DExtActor->SetProperty(my1DExtProp);
|
|
|
|
my1DExtActor->SetRepresentation(SMESH_DeviceActor::eInsideframe);
|
|
|
|
aFilter = my1DExtActor->GetExtractUnstructuredGrid();
|
2005-06-07 19:22:20 +06:00
|
|
|
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
2004-06-18 14:34:31 +06:00
|
|
|
aFilter->RegisterCellsWithType(VTK_LINE);
|
2006-03-13 20:29:49 +05:00
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
//Definition 0D device of the actor (0d elements)
|
|
|
|
//-----------------------------------------------
|
|
|
|
my0DProp = vtkProperty::New();
|
|
|
|
SMESH::GetColor( "SMESH", "elem0d_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 0 ) );
|
|
|
|
my0DProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
|
|
|
my0DProp->SetPointSize(aElem0DSize);
|
|
|
|
|
|
|
|
my0DActor = SMESH_CellLabelActor::New();
|
|
|
|
my0DActor->SetUserMatrix(aMatrix);
|
|
|
|
my0DActor->SetStoreGemetryMapping(true);
|
|
|
|
my0DActor->PickableOff();
|
|
|
|
my0DActor->SetVisibility(false);
|
|
|
|
my0DActor->SetProperty(my0DProp);
|
|
|
|
my0DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
|
|
|
|
aFilter = my0DActor->GetExtractUnstructuredGrid();
|
|
|
|
//aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
|
|
|
|
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_VERTEX);
|
|
|
|
|
|
|
|
//Definition 0D device of the actor (ball elements)
|
|
|
|
//-----------------------------------------------
|
|
|
|
myBallProp = vtkProperty::New();
|
2012-10-08 17:56:59 +06:00
|
|
|
SMESH::GetColor( "SMESH", "ball_elem_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 85, 255 ) );
|
2012-08-09 16:03:55 +06:00
|
|
|
myBallProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
|
|
|
myBallProp->SetPointSize(aBallElemSize);
|
|
|
|
|
|
|
|
myBallActor = SMESH_CellLabelActor::New();
|
|
|
|
myBallActor->SetUserMatrix(aMatrix);
|
|
|
|
myBallActor->SetStoreGemetryMapping(true);
|
|
|
|
myBallActor->PickableOff();
|
|
|
|
myBallActor->SetVisibility(false);
|
|
|
|
myBallActor->SetProperty(myBallProp);
|
|
|
|
myBallActor->SetRepresentation(SMESH_DeviceActor::eSurface);
|
|
|
|
aFilter = myBallActor->GetExtractUnstructuredGrid();
|
|
|
|
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
|
|
|
|
|
|
|
|
//my0DExtProp = vtkProperty::New();
|
|
|
|
//my0DExtProp->DeepCopy(my0DProp);
|
|
|
|
//anRGB[0] = 1 - anRGB[0];
|
|
|
|
//anRGB[1] = 1 - anRGB[1];
|
|
|
|
//anRGB[2] = 1 - anRGB[2];
|
|
|
|
//my0DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
|
|
|
//my0DExtProp->SetPointSize(aElem0DSize);
|
|
|
|
//
|
|
|
|
//my0DExtActor = SMESH_DeviceActor::New();
|
|
|
|
//my0DExtActor->SetUserMatrix(aMatrix);
|
|
|
|
//my0DExtActor->SetStoreClippingMapping(true);
|
|
|
|
//my0DExtActor->PickableOff();
|
|
|
|
//my0DExtActor->SetHighlited(true);
|
|
|
|
//my0DExtActor->SetVisibility(false);
|
|
|
|
//my0DExtActor->SetProperty(my0DExtProp);
|
|
|
|
//my0DExtActor->SetRepresentation(SMESH_DeviceActor::eInsideframe);
|
|
|
|
//aFilter = my0DExtActor->GetExtractUnstructuredGrid();
|
|
|
|
////aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
|
|
|
|
//aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
|
|
|
//aFilter->RegisterCellsWithType(VTK_VERTEX);
|
|
|
|
|
|
|
|
|
|
|
|
//Definition 0D device of the actor (nodes)
|
|
|
|
//-----------------------------------------
|
2004-06-18 14:34:31 +06:00
|
|
|
myNodeProp = vtkProperty::New();
|
2005-06-27 17:29:58 +06:00
|
|
|
SMESH::GetColor( "SMESH", "node_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 0, 0 ) );
|
2004-06-18 14:34:31 +06:00
|
|
|
myNodeProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
myNodeActor = SMESH_NodeLabelActor::New();
|
2004-06-18 14:34:31 +06:00
|
|
|
myNodeActor->SetUserMatrix(aMatrix);
|
2005-03-30 20:06:25 +06:00
|
|
|
myNodeActor->SetStoreClippingMapping(true);
|
2004-06-18 14:34:31 +06:00
|
|
|
myNodeActor->PickableOff();
|
|
|
|
myNodeActor->SetVisibility(false);
|
|
|
|
myNodeActor->SetProperty(myNodeProp);
|
|
|
|
myNodeActor->SetRepresentation(SMESH_DeviceActor::ePoint);
|
|
|
|
aFilter = myNodeActor->GetExtractUnstructuredGrid();
|
2005-06-07 19:22:20 +06:00
|
|
|
aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
|
2009-02-17 10:27:49 +05:00
|
|
|
|
|
|
|
myNodeExtProp = vtkProperty::New();
|
|
|
|
myNodeExtProp->DeepCopy(myNodeProp);
|
|
|
|
anRGB[0] = 1 - anRGB[0];
|
|
|
|
anRGB[1] = 1 - anRGB[1];
|
|
|
|
anRGB[2] = 1 - anRGB[2];
|
|
|
|
myNodeExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
|
|
|
|
|
|
|
myNodeExtActor = SMESH_DeviceActor::New();
|
|
|
|
myNodeExtActor->SetUserMatrix(aMatrix);
|
|
|
|
myNodeExtActor->SetStoreClippingMapping(true);
|
|
|
|
myNodeExtActor->PickableOff();
|
|
|
|
myNodeExtActor->SetHighlited(true);
|
|
|
|
myNodeExtActor->SetVisibility(false);
|
|
|
|
myNodeExtActor->SetProperty(myNodeExtProp);
|
|
|
|
myNodeExtActor->SetRepresentation(SMESH_DeviceActor::ePoint);
|
|
|
|
aFilter = myNodeExtActor->GetExtractUnstructuredGrid();
|
|
|
|
aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_VERTEX);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
//Definition of Pickable and Highlitable engines
|
|
|
|
//----------------------------------------------
|
|
|
|
|
|
|
|
myBaseActor->SetUserMatrix(aMatrix);
|
2005-03-30 20:06:25 +06:00
|
|
|
myBaseActor->SetStoreGemetryMapping(true);
|
2004-06-18 14:34:31 +06:00
|
|
|
myBaseActor->GetProperty()->SetOpacity(0.0);
|
|
|
|
myPickableActor = myBaseActor;
|
2005-03-22 15:32:59 +05:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
myHighlightProp = vtkProperty::New();
|
|
|
|
myHighlightProp->SetAmbient(1.0);
|
|
|
|
myHighlightProp->SetDiffuse(0.0);
|
|
|
|
myHighlightProp->SetSpecular(0.0);
|
2005-06-27 17:29:58 +06:00
|
|
|
SMESH::GetColor( "SMESH", "selection_object_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
|
2004-06-18 14:34:31 +06:00
|
|
|
myHighlightProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
2012-08-09 16:03:55 +06:00
|
|
|
myHighlightProp->SetPointSize(aElem0DSize); // ??
|
|
|
|
myHighlightProp->SetLineWidth(aLineWidth);
|
2004-06-18 14:34:31 +06:00
|
|
|
myHighlightProp->SetRepresentation(1);
|
2012-08-09 16:03:55 +06:00
|
|
|
|
2012-10-08 17:56:59 +06:00
|
|
|
myBallHighlightProp = vtkProperty::New();
|
|
|
|
myBallHighlightProp->DeepCopy(myHighlightProp);
|
|
|
|
myBallHighlightProp->SetPointSize(aBallElemSize);
|
|
|
|
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
myOutLineProp = vtkProperty::New();
|
|
|
|
myOutLineProp->SetAmbient(1.0);
|
|
|
|
myOutLineProp->SetDiffuse(0.0);
|
|
|
|
myOutLineProp->SetSpecular(0.0);
|
|
|
|
SMESH::GetColor( "SMESH", "outline_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 70, 0 ) );
|
|
|
|
myOutLineProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
2012-10-08 17:56:59 +06:00
|
|
|
myOutLineProp->SetLineWidth(aOutlineWidth);
|
2012-08-09 16:03:55 +06:00
|
|
|
myOutLineProp->SetRepresentation(1);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
myPreselectProp = vtkProperty::New();
|
|
|
|
myPreselectProp->SetAmbient(1.0);
|
|
|
|
myPreselectProp->SetDiffuse(0.0);
|
|
|
|
myPreselectProp->SetSpecular(0.0);
|
2005-06-27 17:29:58 +06:00
|
|
|
SMESH::GetColor( "SMESH", "highlight_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 255 ) );
|
2004-06-18 14:34:31 +06:00
|
|
|
myPreselectProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
2012-08-09 16:03:55 +06:00
|
|
|
myPreselectProp->SetPointSize(aElem0DSize); // ??
|
|
|
|
myPreselectProp->SetLineWidth(aLineWidth);
|
2004-06-18 14:34:31 +06:00
|
|
|
myPreselectProp->SetRepresentation(1);
|
|
|
|
|
2012-10-08 17:56:59 +06:00
|
|
|
myBallPreselectProp = vtkProperty::New();
|
|
|
|
myBallPreselectProp->DeepCopy(myPreselectProp);
|
|
|
|
myBallPreselectProp->SetPointSize(aBallElemSize);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
myHighlitableActor = SMESH_DeviceActor::New();
|
|
|
|
myHighlitableActor->SetUserMatrix(aMatrix);
|
|
|
|
myHighlitableActor->PickableOff();
|
|
|
|
myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
|
2012-08-09 16:03:55 +06:00
|
|
|
myHighlitableActor->SetCoincident3DAllowed(true);
|
|
|
|
|
|
|
|
aMatrix->Delete();
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2003-05-19 20:07:00 +06:00
|
|
|
myName = "";
|
2004-06-18 14:34:31 +06:00
|
|
|
myIO = NULL;
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
myControlMode = eNone;
|
2004-06-18 14:34:31 +06:00
|
|
|
myControlActor = my2DActor;
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
//Definition of myScalarBarActor
|
|
|
|
//------------------------------
|
|
|
|
myLookupTable = vtkLookupTable::New();
|
|
|
|
//Fix for Bug PAL5195 - SMESH764:
|
|
|
|
//Controls - Aspect Ratio: incorrect colors of the best and worst values
|
|
|
|
myLookupTable->SetHueRange(0.667,0.0);
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
myScalarBarActor = SMESH_ScalarBarActor::New();
|
2004-06-18 14:34:31 +06:00
|
|
|
myScalarBarActor->SetVisibility(false);
|
|
|
|
myScalarBarActor->SetLookupTable(myLookupTable);
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
//Fix for Bug 13314:
|
|
|
|
//Incorrect "Min value" in Scalar Bar in Mesh:
|
2009-02-17 10:27:49 +05:00
|
|
|
// myScalarBarActor->SetLabelFormat("%.4g");
|
|
|
|
// changes was commented because of regression bug IPAL 19981
|
2008-03-07 12:47:05 +05:00
|
|
|
|
2005-08-30 16:04:41 +06:00
|
|
|
mgr = SUIT_Session::session()->resourceMgr();
|
2005-06-08 16:45:19 +06:00
|
|
|
if( !mgr )
|
|
|
|
return;
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
myEntityMode = eAllEntity;
|
2012-08-09 16:03:55 +06:00
|
|
|
myEntityModeCache = eAllEntity;
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
// Clipping planes
|
|
|
|
myImplicitBoolean = vtkImplicitBoolean::New();
|
|
|
|
myImplicitBoolean->SetOperationTypeToIntersection();
|
2012-08-09 16:03:55 +06:00
|
|
|
|
|
|
|
//Quadratic 2D elements representation
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
int aQuadratic2DMode = mgr->integerValue( "SMESH", "quadratic_mode", 0);
|
|
|
|
if(aQuadratic2DMode == 0){
|
|
|
|
myHighlitableActor->SetQuadraticArcMode(false);
|
|
|
|
my2DActor->SetQuadraticArcMode(false);
|
|
|
|
my1DActor->SetQuadraticArcMode(false);
|
|
|
|
}
|
|
|
|
else if(aQuadratic2DMode == 1){
|
|
|
|
myHighlitableActor->SetQuadraticArcMode(true);
|
|
|
|
my2DActor->SetQuadraticArcMode(true);
|
|
|
|
my1DActor->SetQuadraticArcMode(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
int aQuadraticAngle = mgr->integerValue( "SMESH", "max_angle", 2);
|
|
|
|
myHighlitableActor->SetQuadraticArcAngle(aQuadraticAngle);
|
|
|
|
my2DActor->SetQuadraticArcAngle(aQuadraticAngle);
|
|
|
|
|
|
|
|
// Set colors of the name actor
|
2012-10-08 17:56:59 +06:00
|
|
|
SMESH::GetColor( "SMESH", "default_grp_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
|
2012-08-09 16:03:55 +06:00
|
|
|
myNameActor->SetBackgroundColor(anRGB[0], anRGB[1], anRGB[2]);
|
|
|
|
SMESH::GetColor( "SMESH", "group_name_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
|
|
|
|
myNameActor->SetForegroundColor(anRGB[0], anRGB[1], anRGB[2]);
|
|
|
|
|
|
|
|
#ifndef DISABLE_PLOT2DVIEWER
|
|
|
|
my2dHistogram = 0;
|
|
|
|
#endif
|
|
|
|
|
2012-10-08 17:56:59 +06:00
|
|
|
SetBallSize(aBallElemSize);
|
|
|
|
Set0DSize(aElem0DSize);
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-03-30 20:06:25 +06:00
|
|
|
SMESH_ActorDef::~SMESH_ActorDef()
|
|
|
|
{
|
|
|
|
if(MYDEBUG) MESSAGE("~SMESH_ActorDef - "<<this);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
#ifndef DISABLE_PLOT2DVIEWER
|
|
|
|
if(my2dHistogram) {
|
|
|
|
SMESH::ProcessIn2DViewers(this,SMESH::RemoveFrom2dViewer);
|
|
|
|
delete my2dHistogram;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
myScalarBarActor->Delete();
|
|
|
|
myLookupTable->Delete();
|
|
|
|
|
|
|
|
mySurfaceProp->Delete();
|
|
|
|
myBackSurfaceProp->Delete();
|
2012-10-08 17:56:59 +06:00
|
|
|
myNormalVProp->Delete();
|
|
|
|
myReversedVProp->Delete();
|
2012-08-09 16:03:55 +06:00
|
|
|
myOutLineProp->Delete();
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
myEdgeProp->Delete();
|
|
|
|
myHighlightProp->Delete();
|
|
|
|
myPreselectProp->Delete();
|
|
|
|
|
|
|
|
myNodeProp->Delete();
|
2009-02-17 10:27:49 +05:00
|
|
|
myNodeExtProp->Delete();
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
my0DProp->Delete();
|
|
|
|
my0DActor->Delete();
|
|
|
|
myBallActor->Delete();
|
|
|
|
|
|
|
|
//my0DExtProp->Delete();
|
|
|
|
//my0DExtActor->Delete();
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
my1DProp->Delete();
|
|
|
|
my1DActor->Delete();
|
|
|
|
|
|
|
|
my1DExtProp->Delete();
|
|
|
|
my1DExtActor->Delete();
|
|
|
|
|
|
|
|
my2DActor->Delete();
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DExtProp->Delete();
|
|
|
|
my2DExtActor->Delete();
|
2004-06-18 14:34:31 +06:00
|
|
|
my3DActor->Delete();
|
2012-10-08 17:56:59 +06:00
|
|
|
my3DExtProp->Delete();
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DExtActor->Delete();
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
myNodeActor->Delete();
|
|
|
|
myBaseActor->Delete();
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
myNodeExtActor->Delete();
|
2004-06-18 14:34:31 +06:00
|
|
|
myHighlitableActor->Delete();
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
myImplicitBoolean->Delete();
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
myTimeStamp->Delete();
|
2012-10-08 17:56:59 +06:00
|
|
|
myBallHighlightProp->Delete();
|
|
|
|
myBallPreselectProp->Delete();
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
void SMESH_ActorDef::Delete()
|
|
|
|
{
|
|
|
|
// This is just to guarantee that the DeleteActorEvent (which was previously invoked
|
|
|
|
// from the actor's destructor) will be thrown before removing the actor's observers,
|
|
|
|
// that is done inside the Superclass::Delete() method but before the destructor itself
|
|
|
|
// (see the issue 0021562: EDF SMESH: clipping and delete mesh clipped leads to crash).
|
|
|
|
// The event is caught by SMESHGUI::ProcessEvents() static method.
|
|
|
|
this->InvokeEvent( SMESH::DeleteActorEvent, NULL );
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
Superclass::Delete();
|
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
void SMESH_ActorDef::SetPointsLabeled( bool theIsPointsLabeled )
|
|
|
|
{
|
|
|
|
if(myNodeActor) {
|
|
|
|
myNodeActor->SetPointsLabeled(theIsPointsLabeled);
|
|
|
|
SetRepresentation(GetRepresentation());
|
|
|
|
myTimeStamp->Modified();
|
|
|
|
}
|
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
bool SMESH_ActorDef::GetPointsLabeled() {
|
|
|
|
return myNodeActor && myNodeActor->GetPointsLabeled();
|
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
void SMESH_ActorDef::SetCellsLabeled(bool theIsCellsLabeled)
|
|
|
|
{
|
|
|
|
if(my3DActor)
|
|
|
|
my3DActor->SetCellsLabeled(theIsCellsLabeled);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(my2DActor)
|
|
|
|
my2DActor->SetCellsLabeled(theIsCellsLabeled);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(my1DActor)
|
|
|
|
my1DActor->SetCellsLabeled(theIsCellsLabeled);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(my0DActor)
|
|
|
|
my0DActor->SetCellsLabeled(theIsCellsLabeled);
|
|
|
|
|
|
|
|
if(myBallActor)
|
|
|
|
myBallActor->SetCellsLabeled(theIsCellsLabeled);
|
|
|
|
|
|
|
|
myTimeStamp->Modified();
|
|
|
|
}
|
2004-12-01 15:48:31 +05:00
|
|
|
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
bool SMESH_ActorDef::GetCellsLabeled() {
|
|
|
|
bool result = false;
|
|
|
|
if(my3DActor)
|
|
|
|
result = result || my3DActor->GetCellsLabeled();
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(my2DActor)
|
|
|
|
result = result || my2DActor->GetCellsLabeled();
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(my1DActor)
|
|
|
|
result = result || my1DActor->GetCellsLabeled();
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(my0DActor)
|
|
|
|
result = result || my0DActor->GetCellsLabeled();
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(myBallActor)
|
|
|
|
result = result || myBallActor->GetCellsLabeled();
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
return result;
|
2004-06-18 14:34:31 +06:00
|
|
|
}
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
void SMESH_ActorDef::SetFacesOriented(bool theIsFacesOriented)
|
|
|
|
{
|
|
|
|
myIsFacesOriented = theIsFacesOriented;
|
|
|
|
|
|
|
|
my2DActor->SetFacesOriented(theIsFacesOriented);
|
|
|
|
my3DActor->SetFacesOriented(theIsFacesOriented);
|
|
|
|
|
|
|
|
myTimeStamp->Modified();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SMESH_ActorDef::GetFacesOriented()
|
|
|
|
{
|
|
|
|
return myIsFacesOriented;
|
|
|
|
}
|
|
|
|
|
2012-10-08 17:56:59 +06:00
|
|
|
void SMESH_ActorDef::SetFacesOrientationColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b)
|
2012-08-09 16:03:55 +06:00
|
|
|
{
|
2012-10-08 17:56:59 +06:00
|
|
|
my2DActor->SetFacesOrientationColor( r, g, b );
|
|
|
|
my3DActor->SetFacesOrientationColor( r, g, b );
|
2012-08-09 16:03:55 +06:00
|
|
|
}
|
|
|
|
|
2012-10-08 17:56:59 +06:00
|
|
|
void SMESH_ActorDef::GetFacesOrientationColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b)
|
2012-08-09 16:03:55 +06:00
|
|
|
{
|
2012-10-08 17:56:59 +06:00
|
|
|
my3DActor->GetFacesOrientationColor( r, g, b );
|
2012-08-09 16:03:55 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
void SMESH_ActorDef::SetFacesOrientationScale(vtkFloatingPointType theScale)
|
|
|
|
{
|
|
|
|
my2DActor->SetFacesOrientationScale( theScale );
|
|
|
|
my3DActor->SetFacesOrientationScale( theScale );
|
|
|
|
}
|
|
|
|
|
|
|
|
vtkFloatingPointType SMESH_ActorDef::GetFacesOrientationScale()
|
|
|
|
{
|
|
|
|
return my3DActor->GetFacesOrientationScale();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SMESH_ActorDef::SetFacesOrientation3DVectors(bool theState)
|
|
|
|
{
|
|
|
|
my2DActor->SetFacesOrientation3DVectors( theState );
|
|
|
|
my3DActor->SetFacesOrientation3DVectors( theState );
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SMESH_ActorDef::GetFacesOrientation3DVectors()
|
|
|
|
{
|
|
|
|
return my3DActor->GetFacesOrientation3DVectors();
|
|
|
|
}
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
|
2005-03-30 20:06:25 +06:00
|
|
|
void
|
|
|
|
SMESH_ActorDef::
|
|
|
|
SetControlMode(eControl theMode)
|
|
|
|
{
|
|
|
|
SetControlMode(theMode,true);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
SMESH_ActorDef::
|
|
|
|
SetControlMode(eControl theMode,
|
2012-08-09 16:03:55 +06:00
|
|
|
bool theCheckEntityMode)
|
2005-03-30 20:06:25 +06:00
|
|
|
{
|
2005-06-08 16:45:19 +06:00
|
|
|
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
|
|
|
|
if( !mgr )
|
|
|
|
return;
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
myControlMode = eNone;
|
2005-06-27 17:29:58 +06:00
|
|
|
theCheckEntityMode &= mgr->booleanValue( "SMESH", "display_entity", false );
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
my0DActor->GetMapper()->SetScalarVisibility(false);
|
2004-06-18 14:34:31 +06:00
|
|
|
my1DActor->GetMapper()->SetScalarVisibility(false);
|
|
|
|
my2DActor->GetMapper()->SetScalarVisibility(false);
|
|
|
|
my3DActor->GetMapper()->SetScalarVisibility(false);
|
2012-08-09 16:03:55 +06:00
|
|
|
myBallActor->GetMapper()->SetScalarVisibility(false);
|
2004-06-18 14:34:31 +06:00
|
|
|
myScalarBarActor->SetVisibility(false);
|
|
|
|
|
|
|
|
bool anIsScalarVisible = theMode > eNone;
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(anIsScalarVisible) {
|
|
|
|
switch(theMode) {
|
2005-01-20 11:25:54 +05:00
|
|
|
case eLength:
|
2004-12-01 15:48:31 +05:00
|
|
|
{
|
|
|
|
SMESH::Controls::Length* aControl = new SMESH::Controls::Length();
|
|
|
|
aControl->SetPrecision( myControlsPrecision );
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset( aControl );
|
2004-06-18 14:34:31 +06:00
|
|
|
myControlActor = my1DActor;
|
|
|
|
break;
|
2004-12-01 15:48:31 +05:00
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
case eLength2D:
|
|
|
|
{
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset(new SMESH::Controls::Length2D());
|
2005-01-20 11:25:54 +05:00
|
|
|
myControlActor = my2DActor;
|
|
|
|
break;
|
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
case eFreeBorders:
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset(new SMESH::Controls::FreeBorders());
|
2004-06-18 14:34:31 +06:00
|
|
|
myControlActor = my1DActor;
|
|
|
|
break;
|
2004-12-01 15:48:31 +05:00
|
|
|
case eFreeEdges:
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset(new SMESH::Controls::FreeEdges());
|
2004-12-01 15:48:31 +05:00
|
|
|
myControlActor = my2DActor;
|
|
|
|
break;
|
2009-02-17 10:27:49 +05:00
|
|
|
case eFreeNodes:
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset(new SMESH::Controls::FreeNodes());
|
2009-02-17 10:27:49 +05:00
|
|
|
myControlActor = myNodeActor;
|
|
|
|
break;
|
|
|
|
case eFreeFaces:
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset(new SMESH::Controls::FreeFaces());
|
|
|
|
myControlActor = my2DActor;
|
|
|
|
break;
|
|
|
|
case eCoincidentNodes:
|
|
|
|
{
|
|
|
|
SMESH::Controls::CoincidentNodes* cn = new SMESH::Controls::CoincidentNodes();
|
|
|
|
double tol = mgr->doubleValue( "SMESH", "equal_nodes_tolerance", 1e-7 );
|
|
|
|
cn->SetTolerance( tol );
|
|
|
|
myFunctor.reset(cn);
|
|
|
|
myControlActor = myNodeActor;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case eCoincidentElems1D:
|
|
|
|
myFunctor.reset(new SMESH::Controls::CoincidentElements1D());
|
|
|
|
myControlActor = my1DActor;
|
|
|
|
break;
|
|
|
|
case eCoincidentElems2D:
|
|
|
|
myFunctor.reset(new SMESH::Controls::CoincidentElements2D());
|
|
|
|
myControlActor = my2DActor;
|
|
|
|
break;
|
|
|
|
case eCoincidentElems3D:
|
|
|
|
myFunctor.reset(new SMESH::Controls::CoincidentElements3D());
|
|
|
|
myControlActor = my3DActor;
|
|
|
|
break;
|
|
|
|
case eBareBorderFace:
|
|
|
|
myFunctor.reset(new SMESH::Controls::BareBorderFace());
|
|
|
|
myControlActor = my2DActor;
|
|
|
|
break;
|
|
|
|
case eOverConstrainedFace:
|
|
|
|
myFunctor.reset(new SMESH::Controls::OverConstrainedFace());
|
2009-02-17 10:27:49 +05:00
|
|
|
myControlActor = my2DActor;
|
|
|
|
break;
|
2004-06-18 14:34:31 +06:00
|
|
|
case eMultiConnection:
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset(new SMESH::Controls::MultiConnection());
|
2004-06-18 14:34:31 +06:00
|
|
|
myControlActor = my1DActor;
|
|
|
|
break;
|
2005-01-20 11:25:54 +05:00
|
|
|
case eMultiConnection2D:
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset(new SMESH::Controls::MultiConnection2D());
|
2005-01-20 11:25:54 +05:00
|
|
|
myControlActor = my2DActor;
|
|
|
|
break;
|
2004-06-18 14:34:31 +06:00
|
|
|
case eArea:
|
2004-12-01 15:48:31 +05:00
|
|
|
{
|
|
|
|
SMESH::Controls::Area* aControl = new SMESH::Controls::Area();
|
|
|
|
aControl->SetPrecision( myControlsPrecision );
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset( aControl );
|
2004-06-18 14:34:31 +06:00
|
|
|
myControlActor = my2DActor;
|
|
|
|
break;
|
2004-12-01 15:48:31 +05:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
case eTaper:
|
2004-12-01 15:48:31 +05:00
|
|
|
{
|
|
|
|
SMESH::Controls::Taper* aControl = new SMESH::Controls::Taper();
|
|
|
|
aControl->SetPrecision( myControlsPrecision );
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset( aControl );
|
2004-06-18 14:34:31 +06:00
|
|
|
myControlActor = my2DActor;
|
|
|
|
break;
|
2004-12-01 15:48:31 +05:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
case eAspectRatio:
|
2004-12-01 15:48:31 +05:00
|
|
|
{
|
|
|
|
SMESH::Controls::AspectRatio* aControl = new SMESH::Controls::AspectRatio();
|
|
|
|
aControl->SetPrecision( myControlsPrecision );
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset( aControl );
|
2004-06-18 14:34:31 +06:00
|
|
|
myControlActor = my2DActor;
|
|
|
|
break;
|
2004-12-01 15:48:31 +05:00
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
case eAspectRatio3D:
|
|
|
|
{
|
|
|
|
SMESH::Controls::AspectRatio3D* aControl = new SMESH::Controls::AspectRatio3D();
|
|
|
|
aControl->SetPrecision( myControlsPrecision );
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset( aControl );
|
2005-01-20 11:25:54 +05:00
|
|
|
myControlActor = my3DActor;
|
|
|
|
break;
|
|
|
|
}
|
2005-10-10 20:45:35 +06:00
|
|
|
case eVolume3D:
|
|
|
|
{
|
|
|
|
SMESH::Controls::Volume* aControl = new SMESH::Controls::Volume();
|
|
|
|
aControl->SetPrecision( myControlsPrecision );
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset( aControl );
|
|
|
|
myControlActor = my3DActor;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case eMaxElementLength2D:
|
|
|
|
{
|
|
|
|
SMESH::Controls::MaxElementLength2D* aControl = new SMESH::Controls::MaxElementLength2D();
|
|
|
|
aControl->SetPrecision( myControlsPrecision );
|
|
|
|
myFunctor.reset( aControl );
|
|
|
|
myControlActor = my2DActor;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case eMaxElementLength3D:
|
|
|
|
{
|
|
|
|
SMESH::Controls::MaxElementLength3D* aControl = new SMESH::Controls::MaxElementLength3D();
|
|
|
|
aControl->SetPrecision( myControlsPrecision );
|
|
|
|
myFunctor.reset( aControl );
|
|
|
|
myControlActor = my3DActor;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case eBareBorderVolume:
|
|
|
|
{
|
|
|
|
myFunctor.reset(new SMESH::Controls::BareBorderVolume());
|
|
|
|
myControlActor = my3DActor;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case eOverConstrainedVolume:
|
|
|
|
{
|
|
|
|
myFunctor.reset(new SMESH::Controls::OverConstrainedVolume());
|
2005-10-10 20:45:35 +06:00
|
|
|
myControlActor = my3DActor;
|
|
|
|
break;
|
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
case eMinimumAngle:
|
2004-12-01 15:48:31 +05:00
|
|
|
{
|
|
|
|
SMESH::Controls::MinimumAngle* aControl = new SMESH::Controls::MinimumAngle();
|
|
|
|
aControl->SetPrecision( myControlsPrecision );
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset( aControl );
|
2004-06-18 14:34:31 +06:00
|
|
|
myControlActor = my2DActor;
|
|
|
|
break;
|
2004-12-01 15:48:31 +05:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
case eWarping:
|
2004-12-01 15:48:31 +05:00
|
|
|
{
|
|
|
|
SMESH::Controls::Warping* aControl = new SMESH::Controls::Warping();
|
|
|
|
aControl->SetPrecision( myControlsPrecision );
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset( aControl );
|
2004-06-18 14:34:31 +06:00
|
|
|
myControlActor = my2DActor;
|
|
|
|
break;
|
2004-12-01 15:48:31 +05:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
case eSkew:
|
2004-12-01 15:48:31 +05:00
|
|
|
{
|
|
|
|
SMESH::Controls::Skew* aControl = new SMESH::Controls::Skew();
|
|
|
|
aControl->SetPrecision( myControlsPrecision );
|
2012-08-09 16:03:55 +06:00
|
|
|
myFunctor.reset( aControl );
|
2004-06-18 14:34:31 +06:00
|
|
|
myControlActor = my2DActor;
|
|
|
|
break;
|
2004-12-01 15:48:31 +05:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
vtkUnstructuredGrid* aGrid = myControlActor->GetUnstructuredGrid();
|
|
|
|
vtkIdType aNbCells = aGrid->GetNumberOfCells();
|
|
|
|
if(aNbCells){
|
2005-01-20 11:25:54 +05:00
|
|
|
myControlMode = theMode;
|
|
|
|
switch(myControlMode){
|
2009-02-17 10:27:49 +05:00
|
|
|
case eFreeNodes:
|
2012-08-09 16:03:55 +06:00
|
|
|
case eCoincidentNodes:
|
|
|
|
myNodeExtActor->SetExtControlMode(myFunctor);
|
|
|
|
break;
|
2005-01-20 11:25:54 +05:00
|
|
|
case eFreeEdges:
|
|
|
|
case eFreeBorders:
|
2012-08-09 16:03:55 +06:00
|
|
|
case eCoincidentElems1D:
|
|
|
|
my1DExtActor->SetExtControlMode(myFunctor);
|
|
|
|
break;
|
2009-02-17 10:27:49 +05:00
|
|
|
case eFreeFaces:
|
2012-08-09 16:03:55 +06:00
|
|
|
case eBareBorderFace:
|
|
|
|
case eOverConstrainedFace:
|
|
|
|
case eCoincidentElems2D:
|
|
|
|
my2DExtActor->SetExtControlMode(myFunctor);
|
|
|
|
break;
|
|
|
|
case eBareBorderVolume:
|
|
|
|
case eOverConstrainedVolume:
|
|
|
|
case eCoincidentElems3D:
|
|
|
|
my3DExtActor->SetExtControlMode(myFunctor);
|
|
|
|
break;
|
2005-01-20 11:25:54 +05:00
|
|
|
case eLength2D:
|
|
|
|
case eMultiConnection2D:
|
2012-08-09 16:03:55 +06:00
|
|
|
my1DExtActor->SetExtControlMode(myFunctor,myScalarBarActor,myLookupTable);
|
|
|
|
UpdateDistribution();
|
|
|
|
break;
|
2005-01-20 11:25:54 +05:00
|
|
|
default:
|
2012-08-09 16:03:55 +06:00
|
|
|
myControlActor->SetControlMode(myFunctor,myScalarBarActor,myLookupTable);
|
|
|
|
UpdateDistribution();
|
2004-06-18 14:34:31 +06:00
|
|
|
}
|
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(theCheckEntityMode) {
|
|
|
|
if(myControlActor == my1DActor) {
|
|
|
|
if (!myIsEntityModeCache){
|
|
|
|
myEntityModeCache = GetEntityMode();
|
|
|
|
myIsEntityModeCache=true;
|
|
|
|
}
|
|
|
|
SetEntityMode(eEdges);
|
|
|
|
}
|
|
|
|
else if(myControlActor == my2DActor) {
|
|
|
|
switch(myControlMode) {
|
|
|
|
case eLength2D:
|
|
|
|
case eFreeEdges:
|
|
|
|
case eFreeFaces:
|
|
|
|
case eMultiConnection2D:
|
|
|
|
if (!myIsEntityModeCache){
|
|
|
|
myEntityModeCache = GetEntityMode();
|
|
|
|
myIsEntityModeCache=true;
|
|
|
|
}
|
|
|
|
SetEntityMode(eFaces);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (!myIsEntityModeCache){
|
|
|
|
myEntityModeCache = GetEntityMode();
|
|
|
|
myIsEntityModeCache=true;
|
|
|
|
}
|
|
|
|
SetEntityMode(eFaces);
|
|
|
|
}
|
|
|
|
}else if(myControlActor == my3DActor) {
|
|
|
|
if (!myIsEntityModeCache){
|
|
|
|
myEntityModeCache = GetEntityMode();
|
|
|
|
myIsEntityModeCache=true;
|
|
|
|
}
|
|
|
|
SetEntityMode(eVolumes);
|
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if(theCheckEntityMode){
|
|
|
|
myEntityMode = myEntityModeCache;
|
|
|
|
myIsEntityModeCache = false;
|
|
|
|
}
|
|
|
|
myFunctor.reset();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
SetRepresentation(GetRepresentation());
|
2004-12-01 15:48:31 +05:00
|
|
|
|
|
|
|
myTimeStamp->Modified();
|
2004-06-18 14:34:31 +06:00
|
|
|
Modified();
|
2012-08-09 16:03:55 +06:00
|
|
|
Update();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer){
|
2012-10-08 17:56:59 +06:00
|
|
|
|
|
|
|
//myHighlightActor->AddToRender(theRenderer);
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
theRenderer->AddActor(myBaseActor);
|
2009-02-17 10:27:49 +05:00
|
|
|
theRenderer->AddActor(myNodeExtActor);
|
2012-08-09 16:03:55 +06:00
|
|
|
theRenderer->AddActor(my1DExtActor);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DActor ->AddToRender(theRenderer);
|
|
|
|
my3DExtActor->AddToRender(theRenderer);
|
|
|
|
my2DActor ->AddToRender(theRenderer);
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DExtActor->AddToRender(theRenderer);
|
2012-08-09 16:03:55 +06:00
|
|
|
myNodeActor ->AddToRender(theRenderer);
|
|
|
|
my1DActor ->AddToRender(theRenderer);
|
|
|
|
my0DActor ->AddToRender(theRenderer);
|
|
|
|
myBallActor ->AddToRender(theRenderer);
|
|
|
|
//theRenderer->AddActor(my0DExtActor);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
theRenderer->AddActor(myHighlitableActor);
|
2009-02-17 10:27:49 +05:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
theRenderer->AddActor2D(myScalarBarActor);
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
// the superclass' method should be called at the end
|
|
|
|
// (in particular, for correct work of selection)
|
|
|
|
SALOME_Actor::AddToRender(theRenderer);
|
2004-06-18 14:34:31 +06:00
|
|
|
}
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::RemoveFromRender(vtkRenderer* theRenderer){
|
2004-06-18 14:34:31 +06:00
|
|
|
SALOME_Actor::RemoveFromRender(theRenderer);
|
|
|
|
|
|
|
|
theRenderer->RemoveActor(myBaseActor);
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
theRenderer->RemoveActor(myNodeExtActor);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
theRenderer->RemoveActor(myHighlitableActor);
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
//theRenderer->RemoveActor(my0DExtActor);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
theRenderer->RemoveActor(my1DExtActor);
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DActor->RemoveFromRender(theRenderer);
|
|
|
|
my2DExtActor->RemoveFromRender(theRenderer);
|
|
|
|
my3DActor->RemoveFromRender(theRenderer);
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DExtActor->RemoveFromRender(theRenderer);
|
|
|
|
myNodeActor->RemoveFromRender(theRenderer);
|
|
|
|
my0DActor->RemoveFromRender(theRenderer);
|
|
|
|
myBallActor->RemoveFromRender(theRenderer);
|
|
|
|
my1DActor->RemoveFromRender(theRenderer);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
theRenderer->RemoveActor(myScalarBarActor);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
|
2012-08-09 16:03:55 +06:00
|
|
|
const char* theEntry,
|
|
|
|
const char* theName,
|
|
|
|
int theIsClear)
|
2003-05-19 20:07:00 +06:00
|
|
|
{
|
2004-12-01 15:48:31 +05:00
|
|
|
Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(theEntry,"SMESH",theName);
|
2004-06-18 14:34:31 +06:00
|
|
|
setIO(anIO);
|
2004-12-01 15:48:31 +05:00
|
|
|
setName(theName);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
myVisualObj = theVisualObj;
|
|
|
|
myVisualObj->Update(theIsClear);
|
2004-12-01 15:48:31 +05:00
|
|
|
|
|
|
|
myNodeActor->Init(myVisualObj,myImplicitBoolean);
|
|
|
|
myBaseActor->Init(myVisualObj,myImplicitBoolean);
|
2009-02-17 10:27:49 +05:00
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
myHighlitableActor->Init(myVisualObj,myImplicitBoolean);
|
2009-02-17 10:27:49 +05:00
|
|
|
|
|
|
|
myNodeExtActor->Init(myVisualObj,myImplicitBoolean);
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
my0DActor->Init(myVisualObj,myImplicitBoolean);
|
|
|
|
myBallActor->Init(myVisualObj,myImplicitBoolean);
|
|
|
|
//my0DExtActor->Init(myVisualObj,myImplicitBoolean);
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
my1DActor->Init(myVisualObj,myImplicitBoolean);
|
|
|
|
my1DExtActor->Init(myVisualObj,myImplicitBoolean);
|
|
|
|
|
|
|
|
my2DActor->Init(myVisualObj,myImplicitBoolean);
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DExtActor->Init(myVisualObj,myImplicitBoolean);
|
2004-12-01 15:48:31 +05:00
|
|
|
my3DActor->Init(myVisualObj,myImplicitBoolean);
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DExtActor->Init(myVisualObj,myImplicitBoolean);
|
|
|
|
|
|
|
|
my0DActor->GetMapper()->SetLookupTable(myLookupTable);
|
|
|
|
myBallActor->GetMapper()->SetLookupTable(myLookupTable);
|
|
|
|
//my0DExtActor->GetMapper()->SetLookupTable(myLookupTable);
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
my1DActor->GetMapper()->SetLookupTable(myLookupTable);
|
2005-01-20 11:25:54 +05:00
|
|
|
my1DExtActor->GetMapper()->SetLookupTable(myLookupTable);
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
my2DActor->GetMapper()->SetLookupTable(myLookupTable);
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DExtActor->GetMapper()->SetLookupTable(myLookupTable);
|
2004-12-01 15:48:31 +05:00
|
|
|
my3DActor->GetMapper()->SetLookupTable(myLookupTable);
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DExtActor->GetMapper()->SetLookupTable(myLookupTable);
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
vtkFloatingPointType aFactor, aUnits;
|
2004-12-01 15:48:31 +05:00
|
|
|
my2DActor->GetPolygonOffsetParameters(aFactor,aUnits);
|
|
|
|
my2DActor->SetPolygonOffsetParameters(aFactor,aUnits*0.75);
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DExtActor->SetPolygonOffsetParameters(aFactor,aUnits*0.5);
|
2012-10-08 17:56:59 +06:00
|
|
|
my3DActor->SetPolygonOffsetParameters(2*aFactor,aUnits);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-06-08 16:45:19 +06:00
|
|
|
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
|
|
|
|
if( !mgr )
|
|
|
|
return false;
|
|
|
|
|
2006-03-13 20:29:49 +05:00
|
|
|
//SetIsShrunkable(theGrid->GetNumberOfCells() > 10);
|
|
|
|
SetIsShrunkable(true);
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
SetShrinkFactor( SMESH::GetFloat( "SMESH:shrink_coeff", 75 ) / 100. );
|
2006-03-13 20:29:49 +05:00
|
|
|
|
2005-08-30 16:04:41 +06:00
|
|
|
int aMode = mgr->integerValue( "SMESH", "display_mode" );
|
2004-06-18 14:34:31 +06:00
|
|
|
SetRepresentation(-1);
|
2005-06-08 16:45:19 +06:00
|
|
|
|
2005-08-30 16:04:41 +06:00
|
|
|
if(aMode == 0){
|
2004-06-18 14:34:31 +06:00
|
|
|
SetRepresentation(eEdge);
|
2005-08-30 16:04:41 +06:00
|
|
|
}else if(aMode == 1){
|
2004-06-18 14:34:31 +06:00
|
|
|
SetRepresentation(eSurface);
|
2005-08-30 16:04:41 +06:00
|
|
|
}else if(aMode == 2){
|
2004-06-18 14:34:31 +06:00
|
|
|
SetRepresentation(ePoint);
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
2005-06-08 16:45:19 +06:00
|
|
|
|
2005-08-30 16:04:41 +06:00
|
|
|
if(aMode == 3){
|
2004-06-18 14:34:31 +06:00
|
|
|
SetShrink();
|
2005-06-08 16:45:19 +06:00
|
|
|
}
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if( dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
|
|
|
|
SetIsDisplayNameActor( true );
|
|
|
|
|
|
|
|
int aMarkerType = mgr->integerValue( "SMESH", "type_of_marker", 1 ); // dot
|
|
|
|
int aMarkerScale = mgr->integerValue( "SMESH", "marker_scale", 9 ); // 5 pixels
|
|
|
|
SetMarkerStd( (VTK::MarkerType)aMarkerType, (VTK::MarkerScale)aMarkerScale );
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
myTimeStamp->Modified();
|
2004-06-18 14:34:31 +06:00
|
|
|
Modified();
|
2004-12-01 15:48:31 +05:00
|
|
|
return true;
|
2004-06-18 14:34:31 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
vtkFloatingPointType* SMESH_ActorDef::GetBounds(){
|
2004-12-01 15:48:31 +05:00
|
|
|
return myNodeActor->GetBounds();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
vtkDataSet* SMESH_ActorDef::GetInput(){
|
2004-12-01 15:48:31 +05:00
|
|
|
return GetUnstructuredGrid();
|
2004-06-18 14:34:31 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-07 19:22:20 +06:00
|
|
|
void SMESH_ActorDef::SetTransform(VTKViewer_Transform* theTransform){
|
2006-02-07 20:01:11 +05:00
|
|
|
Superclass::SetTransform(theTransform);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
myNodeActor->SetTransform(theTransform);
|
|
|
|
myBaseActor->SetTransform(theTransform);
|
2009-02-17 10:27:49 +05:00
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
myHighlitableActor->SetTransform(theTransform);
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
myNodeExtActor->SetTransform(theTransform);
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
my0DActor->SetTransform(theTransform);
|
|
|
|
myBallActor->SetTransform(theTransform);
|
|
|
|
//my0DExtActor->SetTransform(theTransform);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
my1DActor->SetTransform(theTransform);
|
|
|
|
my1DExtActor->SetTransform(theTransform);
|
|
|
|
|
|
|
|
my2DActor->SetTransform(theTransform);
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DExtActor->SetTransform(theTransform);
|
2004-06-18 14:34:31 +06:00
|
|
|
my3DActor->SetTransform(theTransform);
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DExtActor->SetTransform(theTransform);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
Modified();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::SetMapper(vtkMapper* theMapper){
|
2004-06-18 14:34:31 +06:00
|
|
|
vtkLODActor::SetMapper(theMapper);
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::ShallowCopy(vtkProp *prop){
|
2004-06-18 14:34:31 +06:00
|
|
|
SALOME_Actor::ShallowCopy(prop);
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
vtkMapper* SMESH_ActorDef::GetMapper(){
|
2004-06-18 14:34:31 +06:00
|
|
|
return myPickableActor->GetMapper();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
vtkUnstructuredGrid* SMESH_ActorDef::GetUnstructuredGrid(){
|
2004-06-18 14:34:31 +06:00
|
|
|
return myVisualObj->GetUnstructuredGrid();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
bool SMESH_ActorDef::IsInfinitive(){
|
2004-06-18 14:34:31 +06:00
|
|
|
vtkDataSet *aDataSet = myPickableActor->GetUnstructuredGrid();
|
|
|
|
aDataSet->Update();
|
2004-12-01 15:48:31 +05:00
|
|
|
myIsInfinite = aDataSet->GetNumberOfCells() == 0 ||
|
2012-08-09 16:03:55 +06:00
|
|
|
( aDataSet->GetNumberOfCells() == 1 &&
|
|
|
|
aDataSet->GetCell(0)->GetCellType() == VTK_VERTEX );
|
2004-06-18 14:34:31 +06:00
|
|
|
return SALOME_Actor::IsInfinitive();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::SetIsShrunkable(bool theShrunkable){
|
2006-03-13 20:29:49 +05:00
|
|
|
if ( myIsShrinkable == theShrunkable )
|
|
|
|
return;
|
2004-06-18 14:34:31 +06:00
|
|
|
myIsShrinkable = theShrunkable;
|
|
|
|
Modified();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
vtkFloatingPointType SMESH_ActorDef::GetShrinkFactor(){
|
2004-06-18 14:34:31 +06:00
|
|
|
return myBaseActor->GetShrinkFactor();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
void SMESH_ActorDef::SetShrinkFactor(vtkFloatingPointType theValue){
|
2004-06-18 14:34:31 +06:00
|
|
|
myBaseActor->SetShrinkFactor(theValue);
|
|
|
|
|
|
|
|
my1DActor->SetShrinkFactor(theValue);
|
|
|
|
my1DExtActor->SetShrinkFactor(theValue);
|
|
|
|
|
|
|
|
my2DActor->SetShrinkFactor(theValue);
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DExtActor->SetShrinkFactor(theValue);
|
2004-06-18 14:34:31 +06:00
|
|
|
my3DActor->SetShrinkFactor(theValue);
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DExtActor->SetShrinkFactor(theValue);
|
|
|
|
my3DExtActor->SetShrinkFactor(theValue);
|
|
|
|
myHighlitableActor->SetShrinkFactor(theValue);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
Modified();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::SetShrink(){
|
2004-06-18 14:34:31 +06:00
|
|
|
if(!myIsShrinkable) return;
|
|
|
|
|
|
|
|
myBaseActor->SetShrink();
|
|
|
|
|
|
|
|
my1DActor->SetShrink();
|
|
|
|
my1DExtActor->SetShrink();
|
|
|
|
|
|
|
|
my2DActor->SetShrink();
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DExtActor->SetShrink();
|
2004-06-18 14:34:31 +06:00
|
|
|
my3DActor->SetShrink();
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DExtActor->SetShrink();
|
|
|
|
myHighlitableActor->SetShrink();
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
myIsShrunk = true;
|
|
|
|
Modified();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::UnShrink(){
|
2004-06-18 14:34:31 +06:00
|
|
|
if(!myIsShrunk) return;
|
|
|
|
|
|
|
|
myBaseActor->UnShrink();
|
|
|
|
|
|
|
|
my1DActor->UnShrink();
|
|
|
|
my1DExtActor->UnShrink();
|
|
|
|
|
|
|
|
my2DActor->UnShrink();
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DExtActor->UnShrink();
|
2004-06-18 14:34:31 +06:00
|
|
|
my3DActor->UnShrink();
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DExtActor->UnShrink();
|
|
|
|
myHighlitableActor->UnShrink();
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
myIsShrunk = false;
|
|
|
|
Modified();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
int SMESH_ActorDef::GetNodeObjId(int theVtkID){
|
2004-06-18 14:34:31 +06:00
|
|
|
return myPickableActor->GetNodeObjId(theVtkID);
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
vtkFloatingPointType* SMESH_ActorDef::GetNodeCoord(int theObjID){
|
2004-12-01 15:48:31 +05:00
|
|
|
return myPickableActor->GetNodeCoord(theObjID);
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
int SMESH_ActorDef::GetElemObjId(int theVtkID){
|
2004-06-18 14:34:31 +06:00
|
|
|
return myPickableActor->GetElemObjId(theVtkID);
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
vtkCell* SMESH_ActorDef::GetElemCell(int theObjID){
|
2004-12-01 15:48:31 +05:00
|
|
|
return myPickableActor->GetElemCell(theObjID);
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::SetVisibility(int theMode){
|
2004-12-01 15:48:31 +05:00
|
|
|
SetVisibility(theMode,true);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
|
2004-06-18 14:34:31 +06:00
|
|
|
SALOME_Actor::SetVisibility(theMode);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
myNodeActor->VisibilityOff();
|
|
|
|
myBaseActor->VisibilityOff();
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
myNodeExtActor->VisibilityOff();
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
my0DActor->VisibilityOff();
|
|
|
|
myBallActor->VisibilityOff();
|
|
|
|
//my0DExtActor->VisibilityOff();
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
my1DActor->VisibilityOff();
|
|
|
|
my1DExtActor->VisibilityOff();
|
|
|
|
|
|
|
|
my2DActor->VisibilityOff();
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DExtActor->VisibilityOff();
|
2005-01-20 11:25:54 +05:00
|
|
|
my3DActor->VisibilityOff();
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DExtActor->VisibilityOff();
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
myScalarBarActor->VisibilityOff();
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
if(GetVisibility()){
|
2004-12-01 15:48:31 +05:00
|
|
|
if(theIsUpdateRepersentation)
|
|
|
|
SetRepresentation(GetRepresentation());
|
2009-02-17 10:27:49 +05:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
if(myControlMode != eNone){
|
|
|
|
switch(myControlMode){
|
2009-02-17 10:27:49 +05:00
|
|
|
case eFreeNodes:
|
2012-08-09 16:03:55 +06:00
|
|
|
case eCoincidentNodes:
|
|
|
|
myNodeExtActor->VisibilityOn();
|
|
|
|
break;
|
2005-01-20 11:25:54 +05:00
|
|
|
case eFreeEdges:
|
|
|
|
case eFreeBorders:
|
2012-08-09 16:03:55 +06:00
|
|
|
case eCoincidentElems1D:
|
|
|
|
my1DExtActor->VisibilityOn();
|
|
|
|
break;
|
2009-02-17 10:27:49 +05:00
|
|
|
case eFreeFaces:
|
2012-08-09 16:03:55 +06:00
|
|
|
case eBareBorderFace:
|
|
|
|
case eOverConstrainedFace:
|
|
|
|
case eCoincidentElems2D:
|
|
|
|
my2DExtActor->VisibilityOn();
|
|
|
|
break;
|
|
|
|
case eBareBorderVolume:
|
|
|
|
case eOverConstrainedVolume:
|
|
|
|
case eCoincidentElems3D:
|
|
|
|
my3DExtActor->VisibilityOn();
|
|
|
|
break;
|
2005-01-20 11:25:54 +05:00
|
|
|
case eLength2D:
|
|
|
|
case eMultiConnection2D:
|
2012-08-09 16:03:55 +06:00
|
|
|
my1DExtActor->VisibilityOn();
|
2005-01-20 11:25:54 +05:00
|
|
|
default:
|
2012-08-09 16:03:55 +06:00
|
|
|
if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
|
|
|
|
myScalarBarActor->VisibilityOn();
|
2005-01-20 11:25:54 +05:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
if(myRepresentation != ePoint)
|
|
|
|
myPickableActor->VisibilityOn();
|
2005-02-07 15:45:26 +05:00
|
|
|
else {
|
|
|
|
myNodeActor->VisibilityOn();
|
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-10-08 17:56:59 +06:00
|
|
|
if(myEntityMode & e0DElements && GetRepresentation() != ePoint ){
|
2012-08-09 16:03:55 +06:00
|
|
|
my0DActor->VisibilityOn();
|
|
|
|
}
|
2012-10-08 17:56:59 +06:00
|
|
|
if(myEntityMode & eBallElem && GetRepresentation() != ePoint ){
|
2012-08-09 16:03:55 +06:00
|
|
|
myBallActor->VisibilityOn();
|
|
|
|
}
|
|
|
|
|
|
|
|
if(myEntityMode & eEdges && GetRepresentation() != ePoint){
|
2005-01-20 11:25:54 +05:00
|
|
|
my1DActor->VisibilityOn();
|
2005-02-07 15:45:26 +05:00
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(myEntityMode & eFaces && GetRepresentation() != ePoint){
|
2005-01-20 11:25:54 +05:00
|
|
|
my2DActor->VisibilityOn();
|
2005-02-07 15:45:26 +05:00
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(myEntityMode & eVolumes && GetRepresentation() != ePoint){
|
2005-01-20 11:25:54 +05:00
|
|
|
my3DActor->VisibilityOn();
|
2005-02-07 15:45:26 +05:00
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(myNodeActor->GetPointsLabeled()){
|
2005-02-08 15:04:57 +05:00
|
|
|
myNodeActor->VisibilityOn();
|
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(my0DActor)
|
|
|
|
my0DActor->UpdateLabels();
|
|
|
|
|
|
|
|
if(myBallActor)
|
|
|
|
myBallActor->UpdateLabels();
|
|
|
|
|
|
|
|
if(my1DActor)
|
|
|
|
my1DActor->UpdateLabels();
|
|
|
|
|
|
|
|
if(my2DActor)
|
|
|
|
my2DActor->UpdateLabels();
|
|
|
|
|
|
|
|
if(my3DActor)
|
|
|
|
my3DActor->UpdateLabels();
|
|
|
|
}
|
|
|
|
#ifndef DISABLE_PLOT2DVIEWER
|
|
|
|
else
|
|
|
|
SMESH::ProcessIn2DViewers(this,SMESH::RemoveFrom2dViewer);
|
|
|
|
#endif
|
2008-03-07 12:47:05 +05:00
|
|
|
UpdateHighlight();
|
2005-01-20 11:25:54 +05:00
|
|
|
Modified();
|
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
|
|
|
|
{
|
2005-03-30 20:06:25 +06:00
|
|
|
myEntityState = eAllEntity;
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(!myVisualObj->GetNbEntities(SMDSAbs_0DElement)) {
|
|
|
|
myEntityState &= ~e0DElements;
|
|
|
|
theMode &= ~e0DElements;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!myVisualObj->GetNbEntities(SMDSAbs_Ball)) {
|
|
|
|
myEntityState &= ~eBallElem;
|
|
|
|
theMode &= ~eBallElem;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!myVisualObj->GetNbEntities(SMDSAbs_Edge)) {
|
2005-03-30 20:06:25 +06:00
|
|
|
myEntityState &= ~eEdges;
|
2005-01-20 11:25:54 +05:00
|
|
|
theMode &= ~eEdges;
|
2005-03-30 20:06:25 +06:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(!myVisualObj->GetNbEntities(SMDSAbs_Face)) {
|
2005-03-30 20:06:25 +06:00
|
|
|
myEntityState &= ~eFaces;
|
2005-01-20 11:25:54 +05:00
|
|
|
theMode &= ~eFaces;
|
2005-03-30 20:06:25 +06:00
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(!myVisualObj->GetNbEntities(SMDSAbs_Volume)) {
|
2005-03-30 20:06:25 +06:00
|
|
|
myEntityState &= ~eVolumes;
|
2005-01-20 11:25:54 +05:00
|
|
|
theMode &= ~eVolumes;
|
2005-03-30 20:06:25 +06:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if (!theMode) {
|
|
|
|
if(myVisualObj->GetNbEntities(SMDSAbs_0DElement))
|
|
|
|
theMode |= e0DElements;
|
|
|
|
|
|
|
|
if(myVisualObj->GetNbEntities(SMDSAbs_Ball))
|
|
|
|
theMode |= eBallElem;
|
|
|
|
|
2005-02-11 17:34:57 +05:00
|
|
|
if(myVisualObj->GetNbEntities(SMDSAbs_Edge))
|
|
|
|
theMode |= eEdges;
|
|
|
|
|
|
|
|
if(myVisualObj->GetNbEntities(SMDSAbs_Face))
|
|
|
|
theMode |= eFaces;
|
|
|
|
|
|
|
|
if(myVisualObj->GetNbEntities(SMDSAbs_Volume))
|
|
|
|
theMode |= eVolumes;
|
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-03-30 20:06:25 +06:00
|
|
|
myBaseActor->myGeomFilter->SetInside(myEntityMode != myEntityState);
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
myEntityMode = theMode;
|
2005-06-07 19:22:20 +06:00
|
|
|
VTKViewer_ExtractUnstructuredGrid* aFilter = NULL;
|
2005-02-11 17:34:57 +05:00
|
|
|
aFilter = myBaseActor->GetExtractUnstructuredGrid();
|
|
|
|
aFilter->ClearRegisteredCellsWithType();
|
2005-06-07 19:22:20 +06:00
|
|
|
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
2012-08-09 16:03:55 +06:00
|
|
|
|
|
|
|
VTKViewer_ExtractUnstructuredGrid* aHightFilter = myHighlitableActor->GetExtractUnstructuredGrid();
|
|
|
|
aHightFilter->ClearRegisteredCellsWithType();
|
|
|
|
aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
|
|
|
|
|
|
|
|
if (myEntityMode & e0DElements) {
|
|
|
|
if (MYDEBUG) MESSAGE("0D ELEMENTS");
|
|
|
|
aFilter->RegisterCellsWithType(VTK_VERTEX);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_VERTEX);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (myEntityMode & eBallElem) {
|
|
|
|
aFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_POLY_VERTEX);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (myEntityMode & eEdges) {
|
2005-02-11 17:34:57 +05:00
|
|
|
if (MYDEBUG) MESSAGE("EDGES");
|
|
|
|
aFilter->RegisterCellsWithType(VTK_LINE);
|
2006-03-13 20:29:49 +05:00
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
|
2012-08-09 16:03:55 +06:00
|
|
|
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_LINE);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
|
2005-02-11 17:34:57 +05:00
|
|
|
}
|
2005-01-20 11:25:54 +05:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if (myEntityMode & eFaces) {
|
2005-02-11 17:34:57 +05:00
|
|
|
if (MYDEBUG) MESSAGE("FACES");
|
|
|
|
aFilter->RegisterCellsWithType(VTK_TRIANGLE);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_POLYGON);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_QUAD);
|
2006-03-13 20:29:49 +05:00
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
|
2012-08-09 16:03:55 +06:00
|
|
|
aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
|
|
|
|
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_TRIANGLE);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_POLYGON);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_QUAD);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
|
2005-02-11 17:34:57 +05:00
|
|
|
}
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if (myEntityMode & eVolumes) {
|
2005-02-11 17:34:57 +05:00
|
|
|
if (MYDEBUG) MESSAGE("VOLUMES");
|
|
|
|
aFilter->RegisterCellsWithType(VTK_TETRA);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_VOXEL);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_WEDGE);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_PYRAMID);
|
2012-08-09 16:03:55 +06:00
|
|
|
aFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
|
2006-03-13 20:29:49 +05:00
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
|
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
|
2012-08-09 16:03:55 +06:00
|
|
|
aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
|
2009-02-17 10:27:49 +05:00
|
|
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
|
2005-02-11 17:34:57 +05:00
|
|
|
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
2012-08-09 16:03:55 +06:00
|
|
|
//#ifdef VTK_HAVE_POLYHEDRON
|
|
|
|
aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
|
|
|
//#endif
|
|
|
|
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_TETRA);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_VOXEL);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_WEDGE);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_PYRAMID);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
|
|
|
//#ifdef VTK_HAVE_POLYHEDRON
|
|
|
|
aHightFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
|
|
|
//#endif
|
2005-02-11 17:34:57 +05:00
|
|
|
}
|
|
|
|
aFilter->Update();
|
|
|
|
if (MYDEBUG) MESSAGE(aFilter->GetOutput()->GetNumberOfCells());
|
2005-01-20 11:25:54 +05:00
|
|
|
SetVisibility(GetVisibility(),false);
|
|
|
|
}
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
void SMESH_ActorDef::SetRepresentation (int theMode)
|
|
|
|
{
|
2005-01-20 11:25:54 +05:00
|
|
|
int aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge);
|
|
|
|
int aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face);
|
|
|
|
int aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume);
|
2012-10-08 17:56:59 +06:00
|
|
|
int aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement);
|
|
|
|
int aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball);
|
2012-08-09 16:03:55 +06:00
|
|
|
|
|
|
|
if (theMode < 0) {
|
2004-06-18 14:34:31 +06:00
|
|
|
myRepresentation = eSurface;
|
2012-08-09 16:03:55 +06:00
|
|
|
if (!aNbFaces && !aNbVolumes && aNbEdges) {
|
2004-06-18 14:34:31 +06:00
|
|
|
myRepresentation = eEdge;
|
2012-08-09 16:03:55 +06:00
|
|
|
} else if (!aNbFaces && !aNbVolumes && !aNbEdges) {
|
2004-06-18 14:34:31 +06:00
|
|
|
myRepresentation = ePoint;
|
|
|
|
}
|
2012-08-09 16:03:55 +06:00
|
|
|
} else {
|
|
|
|
switch (theMode) {
|
2004-06-18 14:34:31 +06:00
|
|
|
case eEdge:
|
2012-10-08 17:56:59 +06:00
|
|
|
if (!aNbFaces && !aNbVolumes && !aNbEdges && !aNb0Ds && !aNbBalls) return;
|
2004-06-18 14:34:31 +06:00
|
|
|
break;
|
|
|
|
case eSurface:
|
2012-10-08 17:56:59 +06:00
|
|
|
if (!aNbFaces && !aNbVolumes && !aNb0Ds && !aNbBalls) return;
|
2004-06-18 14:34:31 +06:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
myRepresentation = theMode;
|
|
|
|
}
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if (!GetUnstructuredGrid()->GetNumberOfCells())
|
2004-06-18 14:34:31 +06:00
|
|
|
myRepresentation = ePoint;
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if (myIsShrunk) {
|
|
|
|
if (myRepresentation == ePoint) {
|
2004-06-18 14:34:31 +06:00
|
|
|
UnShrink();
|
|
|
|
myIsShrunk = true;
|
2012-08-09 16:03:55 +06:00
|
|
|
} else {
|
2004-06-18 14:34:31 +06:00
|
|
|
SetShrink();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
myPickableActor = myBaseActor;
|
|
|
|
myNodeActor->SetVisibility(false);
|
2009-02-17 10:27:49 +05:00
|
|
|
myNodeExtActor->SetVisibility(false);
|
2004-06-18 14:34:31 +06:00
|
|
|
vtkProperty *aProp = NULL, *aBackProp = NULL;
|
2012-10-08 17:56:59 +06:00
|
|
|
vtkProperty *aPropVN = NULL, *aPropVR = NULL;
|
2004-06-18 14:34:31 +06:00
|
|
|
SMESH_DeviceActor::EReperesent aReperesent = SMESH_DeviceActor::EReperesent(-1);
|
2012-08-09 16:03:55 +06:00
|
|
|
SMESH_Actor::EQuadratic2DRepresentation aQuadraticMode = GetQuadratic2DRepresentation();
|
|
|
|
switch (myRepresentation) {
|
2005-02-07 15:45:26 +05:00
|
|
|
case ePoint:
|
2004-06-18 14:34:31 +06:00
|
|
|
myPickableActor = myNodeActor;
|
2004-12-01 15:48:31 +05:00
|
|
|
myNodeActor->SetVisibility(true);
|
2012-08-09 16:03:55 +06:00
|
|
|
aQuadraticMode = SMESH_Actor::eLines;
|
2012-10-08 17:56:59 +06:00
|
|
|
aProp = aBackProp = aPropVN = aPropVR = myNodeProp;
|
2004-06-18 14:34:31 +06:00
|
|
|
aReperesent = SMESH_DeviceActor::ePoint;
|
|
|
|
break;
|
|
|
|
case eEdge:
|
2012-10-08 17:56:59 +06:00
|
|
|
aProp = aBackProp = aPropVN = aPropVR = myEdgeProp;
|
2004-06-18 14:34:31 +06:00
|
|
|
aReperesent = SMESH_DeviceActor::eInsideframe;
|
|
|
|
break;
|
|
|
|
case eSurface:
|
|
|
|
aProp = mySurfaceProp;
|
|
|
|
aBackProp = myBackSurfaceProp;
|
2012-10-08 17:56:59 +06:00
|
|
|
aPropVN = myNormalVProp;
|
|
|
|
aPropVR = myReversedVProp;
|
2004-06-18 14:34:31 +06:00
|
|
|
aReperesent = SMESH_DeviceActor::eSurface;
|
|
|
|
break;
|
2012-08-09 16:03:55 +06:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
my2DActor->SetProperty(aProp);
|
|
|
|
my2DActor->SetBackfaceProperty(aBackProp);
|
|
|
|
my2DActor->SetRepresentation(aReperesent);
|
2009-02-17 10:27:49 +05:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(aQuadraticMode == SMESH_Actor::eLines)
|
|
|
|
my2DActor->SetQuadraticArcMode(false);
|
|
|
|
else if(aQuadraticMode == SMESH_Actor::eArcs)
|
|
|
|
my2DActor->SetQuadraticArcMode(true);
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DExtActor->SetRepresentation(aReperesent);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-10-08 17:56:59 +06:00
|
|
|
my3DActor->SetProperty(aPropVN);
|
|
|
|
my3DActor->SetBackfaceProperty(aPropVR);
|
2004-06-18 14:34:31 +06:00
|
|
|
my3DActor->SetRepresentation(aReperesent);
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
//my0DExtActor->SetVisibility(false);
|
2004-06-18 14:34:31 +06:00
|
|
|
my1DExtActor->SetVisibility(false);
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DExtActor->SetVisibility(false);
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DExtActor->SetVisibility(false);
|
|
|
|
|
|
|
|
// ???
|
|
|
|
//my0DActor->SetProperty(aProp);
|
|
|
|
//my0DActor->SetBackfaceProperty(aBackProp);
|
|
|
|
my0DActor->SetRepresentation(aReperesent);
|
|
|
|
myBallActor->SetRepresentation(aReperesent);
|
|
|
|
//my0DExtActor->SetRepresentation(aReperesent);
|
2005-01-20 11:25:54 +05:00
|
|
|
|
|
|
|
switch(myControlMode){
|
|
|
|
case eLength:
|
|
|
|
case eMultiConnection:
|
2004-06-18 14:34:31 +06:00
|
|
|
aProp = aBackProp = my1DProp;
|
|
|
|
if(myRepresentation != ePoint)
|
|
|
|
aReperesent = SMESH_DeviceActor::eInsideframe;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
if(aQuadraticMode == SMESH_Actor::eLines)
|
|
|
|
my1DActor->SetQuadraticArcMode(false);
|
|
|
|
else if(aQuadraticMode == SMESH_Actor::eArcs)
|
|
|
|
my1DActor->SetQuadraticArcMode(true);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
my1DActor->SetProperty(aProp);
|
|
|
|
my1DActor->SetBackfaceProperty(aBackProp);
|
|
|
|
my1DActor->SetRepresentation(aReperesent);
|
2004-12-01 15:48:31 +05:00
|
|
|
|
|
|
|
my1DExtActor->SetRepresentation(aReperesent);
|
2012-08-09 16:03:55 +06:00
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
if(myIsPointsVisible)
|
2004-06-18 14:34:31 +06:00
|
|
|
myPickableActor = myNodeActor;
|
2004-12-01 15:48:31 +05:00
|
|
|
if(GetPointRepresentation())
|
2004-06-18 14:34:31 +06:00
|
|
|
myNodeActor->SetVisibility(true);
|
|
|
|
|
|
|
|
SetMapper(myPickableActor->GetMapper());
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
SetVisibility(GetVisibility(),false);
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
Modified();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::SetPointRepresentation(bool theIsPointsVisible){
|
2006-03-13 20:29:49 +05:00
|
|
|
if ( myIsPointsVisible == theIsPointsVisible )
|
|
|
|
return;
|
2004-06-18 14:34:31 +06:00
|
|
|
myIsPointsVisible = theIsPointsVisible;
|
|
|
|
SetRepresentation(GetRepresentation());
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
bool SMESH_ActorDef::GetPointRepresentation(){
|
2012-08-09 16:03:55 +06:00
|
|
|
return myIsPointsVisible || myNodeActor->GetPointsLabeled();
|
2004-12-01 15:48:31 +05:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::UpdateHighlight(){
|
2004-12-01 15:48:31 +05:00
|
|
|
myHighlitableActor->SetHighlited(false);
|
2012-08-09 16:03:55 +06:00
|
|
|
myHighlitableActor->SetVisibility(false);
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-03-30 20:06:25 +06:00
|
|
|
bool anIsVisible = GetVisibility();
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
switch(myRepresentation){
|
|
|
|
case SMESH_DeviceActor::eSurface:
|
|
|
|
case SMESH_DeviceActor::eWireframe:
|
|
|
|
{
|
|
|
|
if(myIsHighlighted) {
|
|
|
|
myHighlitableActor->SetProperty(myHighlightProp);
|
2012-10-08 17:56:59 +06:00
|
|
|
myBallActor->SetProperty(myBallHighlightProp);
|
2012-08-09 16:03:55 +06:00
|
|
|
}else if(myIsPreselected){
|
|
|
|
myHighlitableActor->SetProperty(myPreselectProp);
|
2012-10-08 17:56:59 +06:00
|
|
|
myBallActor->SetProperty(myBallPreselectProp);
|
2012-08-09 16:03:55 +06:00
|
|
|
} else if(anIsVisible){
|
2012-10-08 17:56:59 +06:00
|
|
|
myBallActor->SetProperty(myBallProp);
|
2012-08-09 16:03:55 +06:00
|
|
|
(myRepresentation == eSurface) ?
|
|
|
|
myHighlitableActor->SetProperty(myOutLineProp) : myHighlitableActor->SetProperty(myEdgeProp);
|
|
|
|
}
|
|
|
|
if(GetUnstructuredGrid()->GetNumberOfCells()) {
|
|
|
|
myHighlitableActor->SetHighlited(anIsVisible);
|
|
|
|
myHighlitableActor->GetExtractUnstructuredGrid()->
|
|
|
|
SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::eCells);
|
|
|
|
myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
|
|
|
|
}
|
2008-03-07 12:47:05 +05:00
|
|
|
myHighlitableActor->SetVisibility(anIsVisible);
|
2012-08-09 16:03:55 +06:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SMESH_DeviceActor::ePoint:
|
|
|
|
{
|
|
|
|
if(myIsHighlighted) {
|
|
|
|
myNodeActor->SetProperty(myHighlightProp);
|
|
|
|
}else if(myIsPreselected) {
|
|
|
|
myNodeActor->SetProperty(myPreselectProp);
|
|
|
|
} else if(anIsVisible) {
|
|
|
|
myNodeActor->SetProperty(myNodeProp);
|
|
|
|
}
|
|
|
|
myNodeActor->SetRepresentation(SMESH_DeviceActor::ePoint);
|
|
|
|
myNodeActor->GetExtractUnstructuredGrid()->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
|
|
|
|
break;
|
2004-06-18 14:34:31 +06:00
|
|
|
}
|
|
|
|
}
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::highlight(bool theHighlight){
|
2006-03-13 20:29:49 +05:00
|
|
|
if ( myIsHighlighted == theHighlight )
|
|
|
|
return;
|
2004-12-01 15:48:31 +05:00
|
|
|
myIsHighlighted = theHighlight;
|
2004-06-18 14:34:31 +06:00
|
|
|
UpdateHighlight();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::SetPreSelected(bool thePreselect){
|
2006-03-13 20:29:49 +05:00
|
|
|
if ( myIsPreselected == thePreselect )
|
|
|
|
return;
|
2004-12-01 15:48:31 +05:00
|
|
|
myIsPreselected = thePreselect;
|
2004-06-18 14:34:31 +06:00
|
|
|
UpdateHighlight();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
// From vtkFollower
|
2005-01-20 11:25:54 +05:00
|
|
|
int SMESH_ActorDef::RenderOpaqueGeometry(vtkViewport *vp)
|
2003-05-19 20:07:00 +06:00
|
|
|
{
|
2004-06-18 14:34:31 +06:00
|
|
|
if (myPickableActor->GetIsOpaque())
|
|
|
|
{
|
|
|
|
vtkRenderer *ren = static_cast<vtkRenderer *>(vp);
|
|
|
|
this->Render(ren);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
int SMESH_ActorDef::RenderTranslucentGeometry(vtkViewport *vp)
|
2003-05-19 20:07:00 +06:00
|
|
|
{
|
2004-06-18 14:34:31 +06:00
|
|
|
if (!myPickableActor->GetIsOpaque())
|
|
|
|
{
|
|
|
|
vtkRenderer *ren = static_cast<vtkRenderer *>(vp);
|
|
|
|
this->Render(ren);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::Render(vtkRenderer *ren){
|
|
|
|
unsigned long aTime = myTimeStamp->GetMTime();
|
2004-12-01 15:48:31 +05:00
|
|
|
unsigned long anObjTime = myVisualObj->GetUnstructuredGrid()->GetMTime();
|
2005-01-20 11:25:54 +05:00
|
|
|
unsigned long aClippingTime = myImplicitBoolean->GetMTime();
|
|
|
|
if(anObjTime > aTime || aClippingTime > aTime)
|
2004-12-01 15:48:31 +05:00
|
|
|
Update();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::Update(){
|
|
|
|
if(MYDEBUG) MESSAGE("SMESH_ActorDef::Update");
|
2004-12-01 15:48:31 +05:00
|
|
|
|
|
|
|
if(GetControlMode() != eNone) {
|
2005-02-02 18:35:49 +05:00
|
|
|
unsigned long aTime = myTimeStamp->GetMTime();
|
|
|
|
unsigned long anObjTime = myVisualObj->GetUnstructuredGrid()->GetMTime();
|
|
|
|
if (anObjTime > aTime)
|
2005-03-30 20:06:25 +06:00
|
|
|
SetControlMode(GetControlMode(),false);
|
2004-12-01 15:48:31 +05:00
|
|
|
}
|
2012-08-09 16:03:55 +06:00
|
|
|
|
|
|
|
if(myNodeActor)
|
|
|
|
myNodeActor->UpdateLabels();
|
|
|
|
|
|
|
|
if(my0DActor)
|
|
|
|
my0DActor->UpdateLabels();
|
|
|
|
|
|
|
|
if(myBallActor)
|
|
|
|
myBallActor->UpdateLabels();
|
|
|
|
|
|
|
|
if(my1DActor)
|
|
|
|
my1DActor->UpdateLabels();
|
|
|
|
|
|
|
|
if(my2DActor)
|
|
|
|
my2DActor->UpdateLabels();
|
|
|
|
|
|
|
|
if(my3DActor)
|
|
|
|
my3DActor->UpdateLabels();
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
if(myIsFacesOriented){
|
|
|
|
SetFacesOriented(myIsFacesOriented);
|
|
|
|
}
|
2012-08-09 16:03:55 +06:00
|
|
|
|
|
|
|
if(myVisualObj->GetEntitiesFlag()) {
|
|
|
|
myEntityMode |= myVisualObj->GetEntitiesState();
|
|
|
|
}
|
|
|
|
|
2005-02-11 17:34:57 +05:00
|
|
|
SetEntityMode(GetEntityMode());
|
2005-01-20 11:25:54 +05:00
|
|
|
SetVisibility(GetVisibility());
|
|
|
|
|
2004-12-01 15:48:31 +05:00
|
|
|
myTimeStamp->Modified();
|
|
|
|
Modified();
|
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
void SMESH_ActorDef::ReleaseGraphicsResources(vtkWindow *renWin){
|
2004-06-18 14:34:31 +06:00
|
|
|
SALOME_Actor::ReleaseGraphicsResources(renWin);
|
|
|
|
|
|
|
|
myPickableActor->ReleaseGraphicsResources(renWin);
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
static void GetColor(vtkProperty *theProperty, vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){
|
|
|
|
vtkFloatingPointType* aColor = theProperty->GetColor();
|
2004-06-18 14:34:31 +06:00
|
|
|
r = aColor[0];
|
|
|
|
g = aColor[1];
|
|
|
|
b = aColor[2];
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
void SMESH_ActorDef::SetOpacity(vtkFloatingPointType theValue){
|
2004-06-18 14:34:31 +06:00
|
|
|
mySurfaceProp->SetOpacity(theValue);
|
|
|
|
myBackSurfaceProp->SetOpacity(theValue);
|
2012-10-08 17:56:59 +06:00
|
|
|
myNormalVProp->SetOpacity(theValue);
|
|
|
|
myReversedVProp->SetOpacity(theValue);
|
2004-06-18 14:34:31 +06:00
|
|
|
myEdgeProp->SetOpacity(theValue);
|
2012-10-08 17:56:59 +06:00
|
|
|
myOutLineProp->SetOpacity(theValue);
|
2004-06-18 14:34:31 +06:00
|
|
|
myNodeProp->SetOpacity(theValue);
|
|
|
|
|
|
|
|
my1DProp->SetOpacity(theValue);
|
2012-10-08 17:56:59 +06:00
|
|
|
my0DProp->SetOpacity(theValue);
|
|
|
|
myBallProp->SetOpacity(theValue);
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
vtkFloatingPointType SMESH_ActorDef::GetOpacity(){
|
2004-06-18 14:34:31 +06:00
|
|
|
return mySurfaceProp->GetOpacity();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
void SMESH_ActorDef::SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b, int delta){
|
2004-06-18 14:34:31 +06:00
|
|
|
mySurfaceProp->SetColor(r,g,b);
|
2012-10-08 17:56:59 +06:00
|
|
|
my2DExtProp->SetColor(1.0-r,1.0-g,1.0-b);
|
2012-08-09 16:03:55 +06:00
|
|
|
if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
|
2012-10-08 17:56:59 +06:00
|
|
|
if( aGroupObj->GetElementType() == SMDSAbs_Face )
|
2012-08-09 16:03:55 +06:00
|
|
|
myNameActor->SetBackgroundColor(r,g,b);
|
|
|
|
|
|
|
|
myDeltaBrightness = delta;
|
|
|
|
QColor bfc = Qtx::mainColorToSecondary(QColor(int(r*255),int(g*255),int(b*255)), delta);
|
|
|
|
myBackSurfaceProp->SetColor( bfc.red() / 255. , bfc.green() / 255. , bfc.blue() / 255. );
|
2004-06-18 14:34:31 +06:00
|
|
|
Modified();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
void SMESH_ActorDef::GetSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b, int& delta){
|
2004-06-18 14:34:31 +06:00
|
|
|
::GetColor(mySurfaceProp,r,g,b);
|
2012-08-09 16:03:55 +06:00
|
|
|
delta = myDeltaBrightness;
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2012-10-08 17:56:59 +06:00
|
|
|
void SMESH_ActorDef::SetVolumeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b, int delta){
|
|
|
|
myNormalVProp->SetColor(r,g,b);
|
|
|
|
my3DExtProp->SetColor(1.0-r,1.0-g,1.0-b);
|
|
|
|
if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
|
|
|
|
if( aGroupObj->GetElementType() == SMDSAbs_Volume )
|
|
|
|
myNameActor->SetBackgroundColor(r,g,b);
|
|
|
|
|
|
|
|
myDeltaVBrightness = delta;
|
|
|
|
QColor bfc = Qtx::mainColorToSecondary(QColor(int(r*255),int(g*255),int(b*255)), delta);
|
|
|
|
myReversedVProp->SetColor( bfc.red() / 255. , bfc.green() / 255. , bfc.blue() / 255. );
|
|
|
|
Modified();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SMESH_ActorDef::GetVolumeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b, int& delta){
|
|
|
|
::GetColor(myNormalVProp,r,g,b);
|
|
|
|
delta = myDeltaVBrightness;
|
|
|
|
}
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
void SMESH_ActorDef::SetEdgeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
|
2004-06-18 14:34:31 +06:00
|
|
|
myEdgeProp->SetColor(r,g,b);
|
|
|
|
my1DProp->SetColor(r,g,b);
|
|
|
|
my1DExtProp->SetColor(1.0-r,1.0-g,1.0-b);
|
2012-08-09 16:03:55 +06:00
|
|
|
if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
|
|
|
|
if( aGroupObj->GetElementType() == SMDSAbs_Edge )
|
|
|
|
myNameActor->SetBackgroundColor(r,g,b);
|
2004-06-18 14:34:31 +06:00
|
|
|
Modified();
|
|
|
|
}
|
2003-05-19 20:07:00 +06:00
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
void SMESH_ActorDef::GetEdgeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){
|
2004-06-18 14:34:31 +06:00
|
|
|
::GetColor(myEdgeProp,r,g,b);
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
void SMESH_ActorDef::SetOutlineColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
|
|
|
|
myOutLineProp->SetColor(r,g,b);
|
|
|
|
Modified();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SMESH_ActorDef::GetOutlineColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){
|
|
|
|
::GetColor(myOutLineProp,r,g,b);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
void SMESH_ActorDef::SetNodeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
|
2004-06-18 14:34:31 +06:00
|
|
|
myNodeProp->SetColor(r,g,b);
|
2009-02-17 10:27:49 +05:00
|
|
|
myNodeExtProp->SetColor(1.0-r,1.0-g,1.0-b);
|
2012-08-09 16:03:55 +06:00
|
|
|
if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
|
|
|
|
if( aGroupObj->GetElementType() == SMDSAbs_Node )
|
|
|
|
myNameActor->SetBackgroundColor(r,g,b);
|
2004-06-18 14:34:31 +06:00
|
|
|
Modified();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
void SMESH_ActorDef::GetNodeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){
|
2004-06-18 14:34:31 +06:00
|
|
|
::GetColor(myNodeProp,r,g,b);
|
|
|
|
}
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
void SMESH_ActorDef::Set0DColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
|
|
|
|
my0DProp->SetColor(r,g,b);
|
|
|
|
if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
|
|
|
|
if( aGroupObj->GetElementType() == SMDSAbs_0DElement )
|
|
|
|
myNameActor->SetBackgroundColor(r,g,b);
|
|
|
|
Modified();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SMESH_ActorDef::Get0DColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){
|
|
|
|
::GetColor(my0DProp,r,g,b);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SMESH_ActorDef::SetBallColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
|
|
|
|
myBallProp->SetColor(r,g,b);
|
|
|
|
if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
|
|
|
|
if( aGroupObj->GetElementType() == SMDSAbs_Ball )
|
|
|
|
myNameActor->SetBackgroundColor(r,g,b);
|
|
|
|
Modified();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SMESH_ActorDef::GetBallColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){
|
|
|
|
::GetColor(myBallProp,r,g,b);
|
|
|
|
}
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
void SMESH_ActorDef::SetHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
|
2004-06-18 14:34:31 +06:00
|
|
|
myHighlightProp->SetColor(r,g,b);
|
2012-10-08 17:56:59 +06:00
|
|
|
myBallHighlightProp->SetColor(r,g,b);
|
2004-06-18 14:34:31 +06:00
|
|
|
Modified();
|
|
|
|
}
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
void SMESH_ActorDef::GetHighlightColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){
|
2004-06-18 14:34:31 +06:00
|
|
|
::GetColor(myHighlightProp,r,g,b);
|
|
|
|
}
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
void SMESH_ActorDef::SetPreHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
|
2004-06-18 14:34:31 +06:00
|
|
|
myPreselectProp->SetColor(r,g,b);
|
2012-10-08 17:56:59 +06:00
|
|
|
myBallPreselectProp->SetColor(r,g,b);
|
2004-06-18 14:34:31 +06:00
|
|
|
Modified();
|
2003-05-19 20:07:00 +06:00
|
|
|
}
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
void SMESH_ActorDef::GetPreHighlightColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){
|
2004-06-18 14:34:31 +06:00
|
|
|
::GetColor(myPreselectProp,r,g,b);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
vtkFloatingPointType SMESH_ActorDef::GetLineWidth(){
|
2004-06-18 14:34:31 +06:00
|
|
|
return myEdgeProp->GetLineWidth();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
void SMESH_ActorDef::SetLineWidth(vtkFloatingPointType theVal){
|
2004-06-18 14:34:31 +06:00
|
|
|
myEdgeProp->SetLineWidth(theVal);
|
2004-12-01 15:48:31 +05:00
|
|
|
|
|
|
|
my1DProp->SetLineWidth(theVal + aLineWidthInc);
|
2012-08-09 16:03:55 +06:00
|
|
|
my1DExtProp->SetLineWidth(theVal + aLineWidthInc);
|
|
|
|
my2DExtProp->SetLineWidth(theVal + aLineWidthInc);
|
2012-10-08 17:56:59 +06:00
|
|
|
my3DExtProp->SetLineWidth(theVal + aLineWidthInc);
|
2012-08-09 16:03:55 +06:00
|
|
|
myOutLineProp->SetLineWidth(theVal);
|
|
|
|
myHighlightProp->SetLineWidth(theVal);
|
|
|
|
myPreselectProp->SetLineWidth(theVal);
|
2004-06-18 14:34:31 +06:00
|
|
|
Modified();
|
|
|
|
}
|
|
|
|
|
2012-10-08 17:56:59 +06:00
|
|
|
vtkFloatingPointType SMESH_ActorDef::GetOutlineWidth()
|
|
|
|
{
|
|
|
|
return myOutLineProp->GetLineWidth();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SMESH_ActorDef::SetOutlineWidth(vtkFloatingPointType theVal)
|
|
|
|
{
|
|
|
|
myOutLineProp->SetLineWidth(theVal);
|
|
|
|
Modified();
|
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
void SMESH_ActorDef::Set0DSize(vtkFloatingPointType theVal){
|
|
|
|
my0DProp->SetPointSize(theVal);
|
2012-10-08 17:56:59 +06:00
|
|
|
myHighlightProp->SetPointSize(theVal);
|
|
|
|
myPreselectProp->SetPointSize(theVal);
|
|
|
|
|
|
|
|
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) {
|
|
|
|
aCustom->Set0DSize(theVal);
|
|
|
|
}
|
|
|
|
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myPreHighlightActor )) {
|
|
|
|
aCustom->Set0DSize(theVal);
|
|
|
|
}
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
Modified();
|
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
vtkFloatingPointType SMESH_ActorDef::Get0DSize(){
|
|
|
|
return my0DProp->GetPointSize();
|
|
|
|
}
|
2004-06-18 14:34:31 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
void SMESH_ActorDef::SetBallSize(vtkFloatingPointType theVal){
|
|
|
|
myBallProp->SetPointSize(theVal);
|
2012-10-08 17:56:59 +06:00
|
|
|
myBallHighlightProp->SetPointSize(theVal);
|
|
|
|
myBallPreselectProp->SetPointSize(theVal);
|
|
|
|
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) {
|
|
|
|
aCustom->SetBallSize(theVal);
|
|
|
|
}
|
|
|
|
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myPreHighlightActor )) {
|
|
|
|
aCustom->SetBallSize(theVal);
|
|
|
|
}
|
|
|
|
|
2004-06-18 14:34:31 +06:00
|
|
|
Modified();
|
|
|
|
}
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
vtkFloatingPointType SMESH_ActorDef::GetBallSize(){
|
|
|
|
return myBallProp->GetPointSize();
|
2004-06-18 14:34:31 +06:00
|
|
|
}
|
|
|
|
|
2005-01-20 11:25:54 +05:00
|
|
|
int SMESH_ActorDef::GetObjDimension( const int theObjId )
|
2004-06-18 14:34:31 +06:00
|
|
|
{
|
|
|
|
return myVisualObj->GetElemDimension( theObjId );
|
|
|
|
}
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2005-03-22 15:32:59 +05:00
|
|
|
bool
|
|
|
|
SMESH_ActorDef::
|
|
|
|
IsImplicitFunctionUsed() const
|
|
|
|
{
|
|
|
|
return myBaseActor->IsImplicitFunctionUsed();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-08-09 16:03:55 +06:00
|
|
|
SMESH_ActorDef::SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed)
|
2005-03-22 15:32:59 +05:00
|
|
|
{
|
|
|
|
myNodeActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
|
|
|
|
myBaseActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
|
2012-08-09 16:03:55 +06:00
|
|
|
|
2005-03-22 15:32:59 +05:00
|
|
|
myHighlitableActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
|
2009-02-17 10:27:49 +05:00
|
|
|
|
|
|
|
myNodeExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
|
2012-08-09 16:03:55 +06:00
|
|
|
|
|
|
|
my0DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
|
|
|
|
myBallActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
|
|
|
|
//my0DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
|
|
|
|
|
2005-03-22 15:32:59 +05:00
|
|
|
my1DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
|
|
|
|
my1DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
|
2012-08-09 16:03:55 +06:00
|
|
|
|
2005-03-22 15:32:59 +05:00
|
|
|
my2DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
|
2009-02-17 10:27:49 +05:00
|
|
|
my2DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
|
2005-03-22 15:32:59 +05:00
|
|
|
my3DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
|
2012-08-09 16:03:55 +06:00
|
|
|
my3DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
|
2005-03-22 15:32:59 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
vtkIdType
|
2012-08-09 16:03:55 +06:00
|
|
|
SMESH_ActorDef::AddClippingPlane(vtkPlane* thePlane)
|
2005-03-22 15:32:59 +05:00
|
|
|
{
|
|
|
|
if(thePlane){
|
|
|
|
myImplicitBoolean->GetFunction()->AddItem(thePlane);
|
|
|
|
myCippingPlaneCont.push_back(thePlane);
|
|
|
|
if(!IsImplicitFunctionUsed())
|
|
|
|
SetImplicitFunctionUsed(true);
|
2012-08-09 16:03:55 +06:00
|
|
|
myNodeActor->UpdateLabels();
|
2005-03-22 15:32:59 +05:00
|
|
|
}
|
|
|
|
return myCippingPlaneCont.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SMESH_ActorDef::
|
|
|
|
RemoveAllClippingPlanes()
|
|
|
|
{
|
|
|
|
myImplicitBoolean->GetFunction()->RemoveAllItems();
|
|
|
|
myImplicitBoolean->GetFunction()->Modified(); // VTK bug
|
|
|
|
myCippingPlaneCont.clear();
|
|
|
|
SetImplicitFunctionUsed(false);
|
2012-08-09 16:03:55 +06:00
|
|
|
myNodeActor->UpdateLabels();
|
2005-03-22 15:32:59 +05:00
|
|
|
}
|
2004-12-01 15:48:31 +05:00
|
|
|
|
2005-03-22 15:32:59 +05:00
|
|
|
vtkIdType
|
|
|
|
SMESH_ActorDef::
|
|
|
|
GetNumberOfClippingPlanes()
|
|
|
|
{
|
|
|
|
return myCippingPlaneCont.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
vtkPlane*
|
|
|
|
SMESH_ActorDef::
|
|
|
|
GetClippingPlane(vtkIdType theID)
|
|
|
|
{
|
|
|
|
if(theID >= myCippingPlaneCont.size())
|
|
|
|
return NULL;
|
|
|
|
return myCippingPlaneCont[theID].Get();
|
2004-12-01 15:48:31 +05:00
|
|
|
}
|
|
|
|
|
2005-07-25 10:36:37 +06:00
|
|
|
void SMESH_ActorDef::UpdateScalarBar()
|
|
|
|
{
|
|
|
|
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
|
|
|
|
if( !mgr )
|
|
|
|
return;
|
|
|
|
|
|
|
|
vtkTextProperty* aScalarBarTitleProp = vtkTextProperty::New();
|
|
|
|
|
|
|
|
QColor aTColor = mgr->colorValue( "SMESH", "scalar_bar_title_color", QColor( 255, 255, 255 ) );
|
|
|
|
aScalarBarTitleProp->SetColor( aTColor.red()/255., aTColor.green()/255., aTColor.blue()/255. );
|
|
|
|
|
|
|
|
aScalarBarTitleProp->SetFontFamilyToArial();
|
|
|
|
|
|
|
|
if ( mgr->hasValue( "SMESH", "scalar_bar_title_font" ) )
|
|
|
|
{
|
|
|
|
QFont f = mgr->fontValue( "SMESH", "scalar_bar_title_font" );
|
|
|
|
if ( f.family() == "Arial" )
|
|
|
|
aScalarBarTitleProp->SetFontFamilyToArial();
|
|
|
|
else if ( f.family() == "Courier" )
|
|
|
|
aScalarBarTitleProp->SetFontFamilyToCourier();
|
|
|
|
else if ( f.family() == "Times" )
|
|
|
|
aScalarBarTitleProp->SetFontFamilyToTimes();
|
|
|
|
|
|
|
|
if ( f.bold() )
|
|
|
|
aScalarBarTitleProp->BoldOn();
|
|
|
|
else
|
|
|
|
aScalarBarTitleProp->BoldOff();
|
|
|
|
|
|
|
|
if ( f.italic() )
|
|
|
|
aScalarBarTitleProp->ItalicOn();
|
|
|
|
else
|
|
|
|
aScalarBarTitleProp->ItalicOff();
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
if ( f.overline() )
|
2005-07-25 10:36:37 +06:00
|
|
|
aScalarBarTitleProp->ShadowOn();
|
|
|
|
else
|
|
|
|
aScalarBarTitleProp->ShadowOff();
|
|
|
|
}
|
|
|
|
|
|
|
|
myScalarBarActor->SetTitleTextProperty( aScalarBarTitleProp );
|
|
|
|
aScalarBarTitleProp->Delete();
|
|
|
|
|
|
|
|
vtkTextProperty* aScalarBarLabelProp = vtkTextProperty::New();
|
|
|
|
|
|
|
|
aTColor = mgr->colorValue( "SMESH", "scalar_bar_label_color", QColor( 255, 255, 255 ) );
|
|
|
|
aScalarBarLabelProp->SetColor( aTColor.red()/255., aTColor.green()/255., aTColor.blue()/255. );
|
|
|
|
|
|
|
|
aScalarBarLabelProp->SetFontFamilyToArial();
|
|
|
|
if( mgr->hasValue( "SMESH", "scalar_bar_label_font" ) )
|
|
|
|
{
|
2008-03-07 12:47:05 +05:00
|
|
|
QFont f = mgr->fontValue( "SMESH", "scalar_bar_label_font" );
|
2005-07-25 10:36:37 +06:00
|
|
|
if( f.family() == "Arial" )
|
|
|
|
aScalarBarLabelProp->SetFontFamilyToArial();
|
|
|
|
else if( f.family() == "Courier" )
|
|
|
|
aScalarBarLabelProp->SetFontFamilyToCourier();
|
|
|
|
else if( f.family() == "Times" )
|
|
|
|
aScalarBarLabelProp->SetFontFamilyToTimes();
|
|
|
|
|
|
|
|
if ( f.bold() )
|
|
|
|
aScalarBarLabelProp->BoldOn();
|
|
|
|
else
|
|
|
|
aScalarBarLabelProp->BoldOff();
|
|
|
|
|
|
|
|
if ( f.italic() )
|
|
|
|
aScalarBarLabelProp->ItalicOn();
|
|
|
|
else
|
|
|
|
aScalarBarLabelProp->ItalicOff();
|
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
if( f.overline() )
|
2005-07-25 10:36:37 +06:00
|
|
|
aScalarBarLabelProp->ShadowOn();
|
|
|
|
else
|
|
|
|
aScalarBarLabelProp->ShadowOff();
|
|
|
|
}
|
|
|
|
|
|
|
|
myScalarBarActor->SetLabelTextProperty( aScalarBarLabelProp );
|
|
|
|
aScalarBarLabelProp->Delete();
|
|
|
|
|
|
|
|
bool horiz = ( mgr->integerValue( "SMESH", "scalar_bar_orientation" ) == 1 );
|
|
|
|
QString name = QString( "scalar_bar_%1_" ).arg( horiz ? "horizontal" : "vertical" );
|
|
|
|
if( horiz )
|
|
|
|
myScalarBarActor->SetOrientationToHorizontal();
|
|
|
|
else
|
|
|
|
myScalarBarActor->SetOrientationToVertical();
|
|
|
|
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
vtkFloatingPointType aXVal = horiz ? 0.20 : 0.01;
|
2005-07-25 10:36:37 +06:00
|
|
|
if( mgr->hasValue( "SMESH", name + "x" ) )
|
|
|
|
aXVal = mgr->doubleValue( "SMESH", name + "x", aXVal );
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
vtkFloatingPointType aYVal = horiz ? 0.01 : 0.1;
|
2005-07-25 10:36:37 +06:00
|
|
|
if( mgr->hasValue( "SMESH", name + "y" ) )
|
|
|
|
aYVal = mgr->doubleValue( "SMESH", name + "y", aYVal );
|
|
|
|
myScalarBarActor->SetPosition( aXVal, aYVal );
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
vtkFloatingPointType aWVal = horiz ? 0.60 : 0.10;
|
2005-07-25 10:36:37 +06:00
|
|
|
if( mgr->hasValue( "SMESH", name + "width" ) )
|
|
|
|
aWVal = mgr->doubleValue( "SMESH", name + "width", aWVal );
|
|
|
|
myScalarBarActor->SetWidth( aWVal );
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
vtkFloatingPointType aHVal = horiz ? 0.12 : 0.80;
|
2005-07-25 10:36:37 +06:00
|
|
|
if( mgr->hasValue( "SMESH", name + "height" ) )
|
|
|
|
aHVal = mgr->doubleValue( "SMESH", name + "height", aHVal );
|
|
|
|
myScalarBarActor->SetHeight( aHVal );
|
|
|
|
|
|
|
|
int anIntVal = 5;
|
|
|
|
if( mgr->hasValue( "SMESH", "scalar_bar_num_labels" ) )
|
|
|
|
anIntVal = mgr->integerValue( "SMESH", "scalar_bar_num_labels", anIntVal );
|
|
|
|
myScalarBarActor->SetNumberOfLabels( anIntVal == 0 ? 5: anIntVal );
|
|
|
|
|
|
|
|
anIntVal = 64;
|
|
|
|
if( mgr->hasValue( "SMESH", "scalar_bar_num_colors" ) )
|
|
|
|
anIntVal = mgr->integerValue( "SMESH", "scalar_bar_num_colors", anIntVal );
|
|
|
|
myScalarBarActor->SetMaximumNumberOfColors( anIntVal == 0 ? 64 : anIntVal );
|
2012-08-09 16:03:55 +06:00
|
|
|
|
|
|
|
bool distributionVisibility = mgr->booleanValue("SMESH","distribution_visibility");
|
|
|
|
myScalarBarActor->SetDistributionVisibility(distributionVisibility);
|
|
|
|
|
|
|
|
int coloringType = mgr->integerValue("SMESH", "distribution_coloring_type", 0);
|
|
|
|
myScalarBarActor->SetDistributionColoringType(coloringType);
|
2005-07-25 10:36:37 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
QColor distributionColor = mgr->colorValue("SMESH", "distribution_color",
|
|
|
|
QColor(255, 255, 255));
|
|
|
|
double rgb[3];
|
|
|
|
rgb[0]= distributionColor.red()/255.;
|
|
|
|
rgb[1]= distributionColor.green()/255.;
|
|
|
|
rgb[2]= distributionColor.blue()/255.;
|
|
|
|
myScalarBarActor->SetDistributionColor(rgb);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void SMESH_ActorDef::UpdateDistribution()
|
|
|
|
{
|
|
|
|
if(SMESH::Controls::NumericalFunctor* fun =
|
|
|
|
dynamic_cast<SMESH::Controls::NumericalFunctor*>(myFunctor.get()))
|
|
|
|
{
|
|
|
|
int nbIntervals = myScalarBarActor->GetMaximumNumberOfColors();
|
|
|
|
std::vector<int> nbEvents;
|
|
|
|
std::vector<double> funValues;
|
|
|
|
SMESH_VisualObjDef::TEntityList elems;
|
|
|
|
if ( ! dynamic_cast<SMESH_MeshObj*>(myVisualObj.get()))
|
|
|
|
dynamic_cast<SMESH_VisualObjDef*>(myVisualObj.get())->GetEntities( fun->GetType(), elems );
|
|
|
|
std::vector<int> elemIds;
|
|
|
|
for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e)
|
|
|
|
elemIds.push_back( (*e)->GetID());
|
|
|
|
vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
|
|
|
|
double * range = lookupTable->GetRange();
|
|
|
|
fun->GetHistogram(nbIntervals, nbEvents, funValues, elemIds, range);
|
|
|
|
myScalarBarActor->SetDistribution(nbEvents);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SMESH_ActorDef::SetQuadratic2DRepresentation(EQuadratic2DRepresentation theMode)
|
|
|
|
{
|
|
|
|
switch(theMode) {
|
|
|
|
case SMESH_Actor::eLines :
|
|
|
|
myHighlitableActor->SetQuadraticArcMode(false);
|
|
|
|
my2DActor->SetQuadraticArcMode(false);
|
|
|
|
my1DActor->SetQuadraticArcMode(false);
|
|
|
|
break;
|
|
|
|
case SMESH_Actor::eArcs :
|
|
|
|
myHighlitableActor->SetQuadraticArcMode(true);
|
|
|
|
if(GetRepresentation() != SMESH_Actor::ePoint) {
|
|
|
|
my2DActor->SetQuadraticArcMode(true);
|
|
|
|
my1DActor->SetQuadraticArcMode(true);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SMESH_Actor::EQuadratic2DRepresentation SMESH_ActorDef::GetQuadratic2DRepresentation()
|
|
|
|
{
|
|
|
|
if(myHighlitableActor->GetQuadraticArcMode())
|
|
|
|
return SMESH_Actor::eArcs;
|
|
|
|
else
|
|
|
|
return SMESH_Actor::eLines;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SMESH_ActorDef::SetMarkerStd( VTK::MarkerType theMarkerType, VTK::MarkerScale theMarkerScale )
|
|
|
|
{
|
|
|
|
SALOME_Actor::SetMarkerStd( theMarkerType, theMarkerScale );
|
|
|
|
myNodeActor->SetMarkerStd( theMarkerType, theMarkerScale );
|
|
|
|
myNodeExtActor->SetMarkerStd( theMarkerType, theMarkerScale );
|
2005-07-25 10:36:37 +06:00
|
|
|
}
|
2012-08-09 16:03:55 +06:00
|
|
|
|
|
|
|
void SMESH_ActorDef::SetMarkerTexture( int theMarkerId, VTK::MarkerTexture theMarkerTexture )
|
|
|
|
{
|
|
|
|
SALOME_Actor::SetMarkerTexture( theMarkerId, theMarkerTexture );
|
|
|
|
myNodeActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
|
|
|
|
myNodeExtActor->SetMarkerTexture( theMarkerId, theMarkerTexture );
|
|
|
|
myMarkerTexture = theMarkerTexture; // for deferred update of myHighlightActor
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifndef DISABLE_PLOT2DVIEWER
|
|
|
|
SPlot2d_Histogram* SMESH_ActorDef::UpdatePlot2Histogram() {
|
|
|
|
|
|
|
|
if(my2dHistogram)
|
|
|
|
my2dHistogram->clearAllPoints();
|
|
|
|
|
|
|
|
if(SMESH::Controls::NumericalFunctor* fun =
|
|
|
|
dynamic_cast<SMESH::Controls::NumericalFunctor*>(myFunctor.get()))
|
|
|
|
{
|
|
|
|
|
|
|
|
if(!my2dHistogram) {
|
|
|
|
my2dHistogram = new SPlot2d_Histogram();
|
|
|
|
Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(getIO()->getEntry(),"SMESH",getName());
|
|
|
|
my2dHistogram->setIO(anIO);
|
|
|
|
}
|
|
|
|
|
|
|
|
int nbIntervals = myScalarBarActor->GetMaximumNumberOfColors();
|
|
|
|
std::vector<int> nbEvents;
|
|
|
|
std::vector<double> funValues;
|
|
|
|
SMESH_VisualObjDef::TEntityList elems;
|
|
|
|
if ( ! dynamic_cast<SMESH_MeshObj*>(myVisualObj.get()))
|
|
|
|
dynamic_cast<SMESH_VisualObjDef*>(myVisualObj.get())->GetEntities( fun->GetType(), elems );
|
|
|
|
std::vector<int> elemIds;
|
|
|
|
|
|
|
|
for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e)
|
|
|
|
elemIds.push_back( (*e)->GetID());
|
|
|
|
|
|
|
|
vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
|
|
|
|
double * range = lookupTable->GetRange();
|
|
|
|
fun->GetHistogram(nbIntervals, nbEvents, funValues, elemIds, range);
|
|
|
|
|
|
|
|
for ( int i = 0; i < std::min( nbEvents.size(), funValues.size() -1 ); i++ )
|
|
|
|
my2dHistogram->addPoint(funValues[i] + (funValues[i+1] - funValues[i])/2.0, static_cast<double>(nbEvents[i]));
|
|
|
|
|
|
|
|
if(funValues.size() >= 2)
|
|
|
|
my2dHistogram->setWidth((funValues[1] - funValues[0]) * 0.8) ;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//Color of the histogram
|
|
|
|
if(myScalarBarActor->GetDistributionColoringType() == SMESH_MULTICOLOR_TYPE)
|
|
|
|
my2dHistogram->setAutoAssign(true);
|
|
|
|
else {
|
|
|
|
double rgb[3];
|
|
|
|
myScalarBarActor->GetDistributionColor(rgb);
|
|
|
|
QColor aColor = QColor( (int)( rgb[0]*255 ), (int)( rgb[1]*255 ), (int)( rgb[2]*255 ) );
|
|
|
|
my2dHistogram->setColor(aColor);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return my2dHistogram;
|
|
|
|
}
|
|
|
|
#endif
|