X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_VTKUtils.cxx;h=6562da87a3a4c19ba8d4e4c470f7e8823e009bef;hb=5d017835afccd044ee9f9e5176d2f2f943691c31;hp=11b6204b02eec865b8a3a60a9345275510420978;hpb=2c607013a23bd4e7ba07e72e0c04dee2c1209cff;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index 11b6204b0..6562da87a 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -610,14 +610,17 @@ namespace SMESH SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( aSObj )); if(!CORBA::is_nil(aGroup) && anActor) { + QColor c; + int deltaF, deltaV; + SMESH::GetColor( "SMESH", "fill_color", c, deltaF, "0,170,255|-100" ); + SMESH::GetColor( "SMESH", "volume_color", c, deltaV, "255,0,170|-100" ); + SMESH::GetColor( "SMESH", "default_grp_color", c ); SALOMEDS::Color aColor = aGroup->GetColor(); - if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) ) + if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 )) { - int r = 0, g = 0, b = 0; - SMESH::GetColor( "SMESH", "fill_color", r, g, b, QColor( 0, 170, 255 ) ); - aColor.R = (float)r / 255.0; - aColor.G = (float)g / 255.0; - aColor.B = (float)b / 255.0; + aColor.R = c.redF(); + aColor.G = c.greenF(); + aColor.B = c.blueF(); aGroup->SetColor( aColor ); } if( aGroup->GetType() == SMESH::NODE ) @@ -626,8 +629,12 @@ namespace SMESH anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); else if( aGroup->GetType() == SMESH::ELEM0D ) anActor->Set0DColor( aColor.R, aColor.G, aColor.B ); + else if( aGroup->GetType() == SMESH::BALL ) + anActor->SetBallColor( aColor.R, aColor.G, aColor.B ); + else if( aGroup->GetType() == SMESH::VOLUME ) + anActor->SetVolumeColor( aColor.R, aColor.G, aColor.B, deltaV ); else - anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); + anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, deltaF ); } } } @@ -896,16 +903,13 @@ namespace SMESH aSelColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow ), aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan ); - int SW = mgr->integerValue( "SMESH", "selection_width", 5 ), - PW = mgr->integerValue( "SMESH", "highlight_width", 5 ); - - // adjust highlight_width to the width of mesh entities int aElem0DSize = mgr->integerValue("SMESH", "elem0d_size", 5); + int aBallSize = mgr->integerValue("SMESH", "ball_elem_size", 5); int aLineWidth = mgr->integerValue("SMESH", "element_width", 1); int maxSize = aElem0DSize; if (aElem0DSize > maxSize) maxSize = aElem0DSize; if (aLineWidth > maxSize) maxSize = aLineWidth; - if (PW < maxSize + 2) PW = maxSize + 2; + if (aBallSize > maxSize) maxSize = aBallSize; double SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ), SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ), @@ -917,16 +921,14 @@ namespace SMESH // mesh element selection aVtkView->SetSelectionProp(aSelColor.red()/255., aSelColor.green()/255., - aSelColor.blue()/255., - SW ); + aSelColor.blue()/255.); // tolerances aVtkView->SetSelectionTolerance(SP1, SP2, SP3); // pre-selection aVtkView->SetPreselectionProp(aPreColor.red()/255., aPreColor.green()/255., - aPreColor.blue()/255., - PW); + aPreColor.blue()/255.); // update actors vtkRenderer* aRenderer = aVtkView->getRenderer(); VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); @@ -1340,7 +1342,7 @@ namespace SMESH if( !anIsOk ) return false; - + DistanceToPosition( theBounds, theNormal, theDist, theOrigin ); return true; }