- {
- if ( aProp ) {
- aGeomGActor->SetShadingProperty( aProp );
- aGeomGActor->SetWireframeProperty( aProp );
- }
-
- // Set color for edges in shading
- SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- if(aResMgr) {
- QColor c = aResMgr->colorValue( "Geometry", "edges_in_shading_color", QColor( 255, 255, 0 ) );
- aGeomGActor->SetEdgesInShadingColor( c.red()/255., c.green()/255., c.blue()/255. );
- }
-
- int aIsos[2]= { 1, 1 };
- if(useStudy) {
- QString anIsos = aPropMap.value(ISOS_PROP).toString();
- QStringList uv = anIsos.split(DIGIT_SEPARATOR);
- aIsos[0] = uv[0].toInt(); aIsos[1] = uv[1].toInt();
- aGeomGActor->SetNbIsos(aIsos);
- aGeomGActor->SetOpacity(1.0 - aPropMap.value(TRANSPARENCY_PROP).toDouble());
- aGeomGActor->SetVectorMode(aPropMap.value(VECTOR_MODE_PROP).toInt());
- int aDispModeId = aPropMap.value(DISPLAY_MODE_PROP).toInt();
- // Specially processing of 'Shading with edges' mode from preferences,
- // because there is the following enum in VTK viewer:
- // Points - 0, Wireframe - 1, Surface - 2, Insideframe - 3, SurfaceWithEdges - 4
- // (see VTKViewer::Representation enum) and the following enum in GEOM_Actor:
- // eWireframe - 0, eShading - 1, eShadingWithEdges - 3
- if ( aDispModeId == 2 )
- // this is 'Shading with edges' mode => do the correct mapping to EDisplayMode
- // enum in GEOM_Actor (and further to VTKViewer::Representation enum)
- aDispModeId++;
- aGeomGActor->setDisplayMode(aDispModeId);
- aGeomGActor->SetDeflection(aPropMap.value(DEFLECTION_COEFF_PROP).toDouble());
-
- // Get front material property of the object stored in the study
- QString aMaterialF = aPropMap.value(FRONT_MATERIAL_PROP).toString();
- QStringList aPropsF = aMaterialF.split(DIGIT_SEPARATOR);
- // Create front material model
- Material_Model* aModelF = Material_Model::getMaterialModel( aPropsF );
- // Set front material properties for the object
- QString aMaterialPropF = aModelF->getMaterialProperty();
- aStudy->setObjectProperty( aMgrId, anEntry, FRONT_MATERIAL_PROP, aMaterialPropF );
- // Get material properties from the front model
- vtkProperty* aMatPropF = aModelF->getMaterialVTKProperty();
-
- // Get back material property of the object stored in the study
- QString aMaterialB = aPropMap.value(BACK_MATERIAL_PROP).toString();
- if ( !aMaterialB.isEmpty() ) {
- QStringList aPropsB = aMaterialB.split(DIGIT_SEPARATOR);
- // Create back material model
- Material_Model* aModelB = Material_Model::getMaterialModel( aPropsB );
- // Set back material properties for the object
- QString aMaterialPropB = aModelB->getMaterialProperty();
- aStudy->setObjectProperty( aMgrId, anEntry, BACK_MATERIAL_PROP, aMaterialPropB );
- // Get material properties from the back model
- vtkProperty* aMatPropB = aModelB->getMaterialVTKProperty();
-
- // Set front and back materials for the selected shape
- std::vector<vtkProperty*> aProps;
- aProps.push_back(aMatPropF);
- aProps.push_back(aMatPropB);
- aGeomGActor->SetMaterial(aProps);
-
- // Release memory
- delete aModelB;
- }
- else {
- // Set the same front and back materials for the selected shape
- std::vector<vtkProperty*> aProps;
- aProps.push_back(aMatPropF);
- aGeomGActor->SetMaterial(aProps);
- }