mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-27 14:50:33 +05:00
Fix for the "0021580: GEOM EDF: SetColor does not work" issue.
This commit is contained in:
parent
e6e039b1a4
commit
d0aa43b5c2
@ -262,17 +262,32 @@ GEOMToolsGUI_MaterialPropertiesDlg::GEOMToolsGUI_MaterialPropertiesDlg( QWidget*
|
|||||||
if ( selected.Extent() > 0 ) {
|
if ( selected.Extent() > 0 ) {
|
||||||
Handle(SALOME_InteractiveObject) io = selected.First();
|
Handle(SALOME_InteractiveObject) io = selected.First();
|
||||||
if ( !io.IsNull() ) {
|
if ( !io.IsNull() ) {
|
||||||
SUIT_ViewWindow* window = app->desktop()->activeWindow();
|
SUIT_ViewWindow* window = app->desktop()->activeWindow();
|
||||||
if ( window ) {
|
if ( window ) {
|
||||||
int mgrId = window->getViewManager()->getGlobalId();
|
int mgrId = window->getViewManager()->getGlobalId();
|
||||||
PropMap propMap = study->getObjectPropMap( mgrId, io->getEntry() );
|
PropMap propMap = study->getObjectPropMap( mgrId, io->getEntry() );
|
||||||
QString matProp = propMap.value(MATERIAL_PROP).toString();
|
QString matProp = propMap.value(MATERIAL_PROP).toString();
|
||||||
if ( !matProp.isEmpty() )
|
if ( !matProp.isEmpty() )
|
||||||
myCurrentModel.fromProperties( matProp );
|
myCurrentModel.fromProperties( matProp );
|
||||||
QColor c = propMap.value(COLOR_PROP).value<QColor>();
|
QColor c;
|
||||||
if ( c.isValid() )
|
if(propMap.contains(COLOR_PROP))
|
||||||
myColor->setColor( c );
|
c = propMap.value(COLOR_PROP).value<QColor>();
|
||||||
}
|
else {
|
||||||
|
_PTR(SObject) SO ( study->studyDS()->FindObjectID( io->getEntry() ) );
|
||||||
|
if ( SO ) {
|
||||||
|
// get CORBA reference to data object
|
||||||
|
CORBA::Object_var object = GeometryGUI::ClientSObjectToObject(SO);
|
||||||
|
if ( !CORBA::is_nil( object ) ) {
|
||||||
|
// downcast to GEOM object
|
||||||
|
GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( object );
|
||||||
|
SALOMEDS::Color aSColor = aGeomObject->GetColor();
|
||||||
|
c.setRgb( 255.*aSColor.R, 255.*aSColor.G, 255.*aSColor.B );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( c.isValid() )
|
||||||
|
myColor->setColor( c );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user