mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-23 14:30:32 +05:00
Implementation of the "21046: EDF 1610 GUI: To be able to change the width of the lines" issue.
This commit is contained in:
parent
b0aa026c95
commit
ed191931f2
@ -48,8 +48,6 @@
|
|||||||
<parameter name="selection_precision_element" value="0.005"/>
|
<parameter name="selection_precision_element" value="0.005"/>
|
||||||
<parameter name="selection_precision_node" value="0.005"/>
|
<parameter name="selection_precision_node" value="0.005"/>
|
||||||
<parameter name="selection_precision_object" value="0.005"/>
|
<parameter name="selection_precision_object" value="0.005"/>
|
||||||
<parameter name="selection_width" value="5"/>
|
|
||||||
<parameter name="highlight_width" value="5"/>
|
|
||||||
<parameter name="controls_precision" value="0"/>
|
<parameter name="controls_precision" value="0"/>
|
||||||
<parameter name="equal_nodes_tolerance" value="1e-7"/>
|
<parameter name="equal_nodes_tolerance" value="1e-7"/>
|
||||||
<parameter name="scalar_bar_horizontal_height" value="0.08"/>
|
<parameter name="scalar_bar_horizontal_height" value="0.08"/>
|
||||||
|
@ -384,6 +384,7 @@ SMESH_ActorDef::SMESH_ActorDef()
|
|||||||
SMESH::GetColor( "SMESH", "selection_object_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
|
SMESH::GetColor( "SMESH", "selection_object_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
|
||||||
myHighlightProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
myHighlightProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
||||||
myHighlightProp->SetPointSize(aElem0DSize); // ??
|
myHighlightProp->SetPointSize(aElem0DSize); // ??
|
||||||
|
myHighlightProp->SetLineWidth(aLineWidth);
|
||||||
myHighlightProp->SetRepresentation(1);
|
myHighlightProp->SetRepresentation(1);
|
||||||
|
|
||||||
myOutLineProp = vtkProperty::New();
|
myOutLineProp = vtkProperty::New();
|
||||||
@ -393,6 +394,7 @@ SMESH_ActorDef::SMESH_ActorDef()
|
|||||||
SMESH::GetColor( "SMESH", "outline_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 70, 0 ) );
|
SMESH::GetColor( "SMESH", "outline_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 70, 0 ) );
|
||||||
myOutLineProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
myOutLineProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
||||||
myOutLineProp->SetPointSize(aElem0DSize); // ??
|
myOutLineProp->SetPointSize(aElem0DSize); // ??
|
||||||
|
myOutLineProp->SetLineWidth(aLineWidth);
|
||||||
myOutLineProp->SetRepresentation(1);
|
myOutLineProp->SetRepresentation(1);
|
||||||
|
|
||||||
myPreselectProp = vtkProperty::New();
|
myPreselectProp = vtkProperty::New();
|
||||||
@ -402,6 +404,7 @@ SMESH_ActorDef::SMESH_ActorDef()
|
|||||||
SMESH::GetColor( "SMESH", "highlight_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 255 ) );
|
SMESH::GetColor( "SMESH", "highlight_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 255 ) );
|
||||||
myPreselectProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
myPreselectProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
|
||||||
myPreselectProp->SetPointSize(aElem0DSize); // ??
|
myPreselectProp->SetPointSize(aElem0DSize); // ??
|
||||||
|
myPreselectProp->SetLineWidth(aLineWidth);
|
||||||
myPreselectProp->SetRepresentation(1);
|
myPreselectProp->SetRepresentation(1);
|
||||||
|
|
||||||
myHighlitableActor = SMESH_DeviceActor::New();
|
myHighlitableActor = SMESH_DeviceActor::New();
|
||||||
@ -1813,7 +1816,10 @@ void SMESH_ActorDef::SetLineWidth(vtkFloatingPointType theVal){
|
|||||||
|
|
||||||
my1DProp->SetLineWidth(theVal + aLineWidthInc);
|
my1DProp->SetLineWidth(theVal + aLineWidthInc);
|
||||||
my1DExtProp->SetLineWidth(theVal + aLineWidthInc);
|
my1DExtProp->SetLineWidth(theVal + aLineWidthInc);
|
||||||
|
my2DExtProp->SetLineWidth(theVal + aLineWidthInc);
|
||||||
|
myOutLineProp->SetLineWidth(theVal);
|
||||||
|
myHighlightProp->SetLineWidth(theVal);
|
||||||
|
myPreselectProp->SetLineWidth(theVal);
|
||||||
Modified();
|
Modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4699,19 +4699,11 @@ void SMESHGUI::createPreferences()
|
|||||||
|
|
||||||
addPreference( tr( "PREF_OBJECT_COLOR" ), selGroup, LightApp_Preferences::Color, "SMESH", "selection_object_color" );
|
addPreference( tr( "PREF_OBJECT_COLOR" ), selGroup, LightApp_Preferences::Color, "SMESH", "selection_object_color" );
|
||||||
addPreference( tr( "PREF_ELEMENT_COLOR" ), selGroup, LightApp_Preferences::Color, "SMESH", "selection_element_color" );
|
addPreference( tr( "PREF_ELEMENT_COLOR" ), selGroup, LightApp_Preferences::Color, "SMESH", "selection_element_color" );
|
||||||
int selW = addPreference( tr( "PREF_WIDTH" ), selGroup, LightApp_Preferences::IntSpin, "SMESH", "selection_width" );
|
|
||||||
|
|
||||||
setPreferenceProperty( selW, "min", 1 );
|
|
||||||
setPreferenceProperty( selW, "max", 5 );
|
|
||||||
|
|
||||||
int preGroup = addPreference( tr( "PREF_GROUP_PRESELECTION" ), selTab );
|
int preGroup = addPreference( tr( "PREF_GROUP_PRESELECTION" ), selTab );
|
||||||
setPreferenceProperty( preGroup, "columns", 2 );
|
setPreferenceProperty( preGroup, "columns", 2 );
|
||||||
|
|
||||||
addPreference( tr( "PREF_HIGHLIGHT_COLOR" ), preGroup, LightApp_Preferences::Color, "SMESH", "highlight_color" );
|
addPreference( tr( "PREF_HIGHLIGHT_COLOR" ), preGroup, LightApp_Preferences::Color, "SMESH", "highlight_color" );
|
||||||
int preW = addPreference( tr( "PREF_WIDTH" ), preGroup, LightApp_Preferences::IntSpin, "SMESH", "highlight_width" );
|
|
||||||
|
|
||||||
setPreferenceProperty( preW, "min", 1 );
|
|
||||||
setPreferenceProperty( preW, "max", 5 );
|
|
||||||
|
|
||||||
int precSelGroup = addPreference( tr( "PREF_GROUP_PRECISION" ), selTab );
|
int precSelGroup = addPreference( tr( "PREF_GROUP_PRECISION" ), selTab );
|
||||||
setPreferenceProperty( precSelGroup, "columns", 2 );
|
setPreferenceProperty( precSelGroup, "columns", 2 );
|
||||||
@ -4814,7 +4806,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
|
|||||||
std::string aWarning;
|
std::string aWarning;
|
||||||
SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this);
|
SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this);
|
||||||
if( name=="selection_object_color" || name=="selection_element_color" ||
|
if( name=="selection_object_color" || name=="selection_element_color" ||
|
||||||
name=="selection_width" || name=="highlight_color" || name=="highlight_width" ||
|
name=="highlight_color" ||
|
||||||
name=="selection_precision_node" || name=="selection_precision_element" ||
|
name=="selection_precision_node" || name=="selection_precision_element" ||
|
||||||
name=="selection_precision_object")
|
name=="selection_precision_object")
|
||||||
SMESH::UpdateSelectionProp( this );
|
SMESH::UpdateSelectionProp( this );
|
||||||
|
@ -896,16 +896,11 @@ namespace SMESH
|
|||||||
aSelColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow ),
|
aSelColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow ),
|
||||||
aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
|
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 aElem0DSize = mgr->integerValue("SMESH", "elem0d_size", 5);
|
||||||
int aLineWidth = mgr->integerValue("SMESH", "element_width", 1);
|
int aLineWidth = mgr->integerValue("SMESH", "element_width", 1);
|
||||||
int maxSize = aElem0DSize;
|
int maxSize = aElem0DSize;
|
||||||
if (aElem0DSize > maxSize) maxSize = aElem0DSize;
|
if (aElem0DSize > maxSize) maxSize = aElem0DSize;
|
||||||
if (aLineWidth > maxSize) maxSize = aLineWidth;
|
if (aLineWidth > maxSize) maxSize = aLineWidth;
|
||||||
if (PW < maxSize + 2) PW = maxSize + 2;
|
|
||||||
|
|
||||||
double SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ),
|
double SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ),
|
||||||
SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ),
|
SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ),
|
||||||
@ -917,16 +912,14 @@ namespace SMESH
|
|||||||
// mesh element selection
|
// mesh element selection
|
||||||
aVtkView->SetSelectionProp(aSelColor.red()/255.,
|
aVtkView->SetSelectionProp(aSelColor.red()/255.,
|
||||||
aSelColor.green()/255.,
|
aSelColor.green()/255.,
|
||||||
aSelColor.blue()/255.,
|
aSelColor.blue()/255.);
|
||||||
SW );
|
|
||||||
// tolerances
|
// tolerances
|
||||||
aVtkView->SetSelectionTolerance(SP1, SP2, SP3);
|
aVtkView->SetSelectionTolerance(SP1, SP2, SP3);
|
||||||
|
|
||||||
// pre-selection
|
// pre-selection
|
||||||
aVtkView->SetPreselectionProp(aPreColor.red()/255.,
|
aVtkView->SetPreselectionProp(aPreColor.red()/255.,
|
||||||
aPreColor.green()/255.,
|
aPreColor.green()/255.,
|
||||||
aPreColor.blue()/255.,
|
aPreColor.blue()/255.);
|
||||||
PW);
|
|
||||||
// update actors
|
// update actors
|
||||||
vtkRenderer* aRenderer = aVtkView->getRenderer();
|
vtkRenderer* aRenderer = aVtkView->getRenderer();
|
||||||
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
|
||||||
|
Loading…
Reference in New Issue
Block a user