myShadingColor = SalomeApp_Tools::color( col );
myDisplayMode = resMgr->integerValue("Geometry", "display_mode", 0);
+
int aType = resMgr->integerValue("Geometry", "type_of_marker", (int)Aspect_TOM_PLUS);
+ myWidth = resMgr->integerValue("Geometry", "edge_width", -1);
+ myIsosWidth = resMgr->integerValue("Geometry", "isolines_width", -1);
+
myTypeOfMarker = (Aspect_TypeOfMarker)(std::min((int)Aspect_TOM_RING3, std::max((int)Aspect_TOM_POINT, aType)));
myScaleOfMarker = (resMgr->integerValue("Geometry", "marker_scale", 1)-(int)GEOM::MS_10)*0.5 + 1.0;
myScaleOfMarker = std::min(7.0, std::max(1., myScaleOfMarker));
AISShape->SetDisplayMode( aPropMap.value(DISPLAY_MODE_PROP).toInt() );
AISShape->SetDisplayVectors(aPropMap.value(VECTOR_MODE_PROP).toInt());
- //Color property
- if(aPropMap.contains(COLOR_PROP)) {
+ if(aPropMap.contains(TOP_LEVEL_PROP)) {
+ AISShape->setTopLevel( aPropMap.value(TOP_LEVEL_PROP).value<Standard_Boolean>() );
+ }
+
+ if(aPropMap.contains(COLOR_PROP)) {
Quantity_Color quant_col = SalomeApp_Tools::color( aPropMap.value(COLOR_PROP).value<QColor>());
AISShape->SetShadingColor( quant_col );
} else
useObjColor = true;
}else {
MESSAGE("myDisplayMode = "<< myDisplayMode)
- AISShape->SetDisplayMode( myDisplayMode );
+ AISShape->SetDisplayMode( myDisplayMode );
AISShape->SetShadingColor( myShadingColor );
}
Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect();
anAspect->SetNumber( anUIsoNumber );
anAspect->SetColor( aColor );
+ if(HasIsosWidth())
+ anAspect->SetWidth( GetIsosWidth() );
AISShape->Attributes()->SetUIsoAspect( anAspect );
+
anAspect = AISShape->Attributes()->VIsoAspect();
anAspect->SetNumber( aVIsoNumber );
+ if(HasIsosWidth())
+ anAspect->SetWidth( GetIsosWidth() );
anAspect->SetColor( aColor );
AISShape->Attributes()->SetVIsoAspect( anAspect );
anAspect = AISShape->Attributes()->UnFreeBoundaryAspect();
anAspect->SetColor( aColor );
AISShape->Attributes()->SetUnFreeBoundaryAspect( anAspect );
+ AISShape->storeBoundaryColors();
// Set free boundaries aspect
col = aResMgr->colorValue( "Geometry", "free_bound_color", QColor( 0, 255, 0 ) );
double aDC = 0;
if(useStudy) {
aDC = aPropMap.value(DEFLECTION_COEFF_PROP).toDouble();
+ SetWidth(aPropMap.value(EDGE_WIDTH_PROP).toInt());
+ SetIsosWidth(aPropMap.value(ISOS_WIDTH_PROP).toInt());
}
else {
aDC = aResMgr->doubleValue("Geometry", "deflection_coeff", 0.001);
AISShape->SetOwnDeviationCoefficient(aDC);
}
}
-
+
if ( HasTexture() )
{
AISShape->SetTextureFileName(TCollection_AsciiString(myTexture.c_str()));
AISShape->DisableTextureModulate();
AISShape->SetDisplayMode(3);
}
-
+
if ( HasWidth() )
AISShape->SetWidth( GetWidth() );
anAspect->SetTypeOfMarker( myTypeOfMarker );
AISShape->Attributes()->SetPointAspect( anAspect );
}
- } else if(!hasColor) {
+ } else if( !hasColor ) {
//In case if color wasn't defined in the property map of the object
//and GEOM_Object color also wasn't defined get default color from Resource Mgr.
QColor col = aResMgr->colorValue( "Geometry", "shading_color", QColor( 255, 0, 0 ) );
if ( aModelB )
delete aModelB;
+ if(HasWidth())
+ aStudy->setObjectProperty( aMgrId, anIO->getEntry(), EDGE_WIDTH_PROP, GetWidth() );
+
+ if(HasIsosWidth())
+ aStudy->setObjectProperty( aMgrId, anIO->getEntry(), ISOS_WIDTH_PROP, GetIsosWidth() );
+
+
}
// AISShape->SetName(???); ??? necessary to set name ???
aProp->SetColor( aColor.Red(), aColor.Green(), aColor.Blue() );
}
- if ( HasWidth() )
- {
- aProp->SetLineWidth( GetWidth() );
- }
-
while ( anActor != NULL )
{
SALOME_Actor* GActor = SALOME_Actor::SafeDownCast( anActor );
aIsos[0] = uv[0].toInt(); aIsos[1] = uv[1].toInt();
aGeomGActor->SetNbIsos(aIsos);
aGeomGActor->SetOpacity(1.0 - aPropMap.value(TRANSPARENCY_PROP).toDouble());
+ SetWidth(aPropMap.value(EDGE_WIDTH_PROP).toInt());
+ SetIsosWidth(aPropMap.value(ISOS_WIDTH_PROP).toInt());
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,
// Release memory
delete aModelB;
+
+ if(HasWidth())
+ aStudy->setObjectProperty( aMgrId, anEntry, EDGE_WIDTH_PROP, GetWidth() );
+
+ if(HasIsosWidth())
+ aStudy->setObjectProperty( aMgrId, anEntry, ISOS_WIDTH_PROP, GetIsosWidth() );
+
}
else {
// Set the same front and back materials for the selected shape
}
}
+ if ( HasWidth() )
+ {
+ aGeomGActor->SetWidth( GetWidth() );
+ }
+
+
+ if ( HasIsosWidth() )
+ {
+ aGeomGActor->SetIsosWidth( GetIsosWidth() );
+ }
+
if ( myToActivate )
GActor->PickableOn();
else
myWidth = -1;
}
+
+int GEOM_Displayer::GetIsosWidth() const
+{
+ return myIsosWidth;
+}
+
+void GEOM_Displayer::SetIsosWidth(const int width)
+{
+ myIsosWidth = width;
+}
+
+bool GEOM_Displayer::HasIsosWidth() const
+{
+ return myIsosWidth != -1;
+}
+
+
//=================================================================
/*!
* GEOM_Displayer::SetToActivate
QString aMaterialF = aModelF.getMaterialProperty();
aDefaultMap.insert( FRONT_MATERIAL_PROP , aMaterialF );
- // Back material
+ //9. Back material
Material_Model aModelB;
aModelB.fromResources( aResMgr, "Geometry", false );
QString aMaterialB = aModelB.getMaterialProperty();
aDefaultMap.insert( BACK_MATERIAL_PROP , aMaterialB );
+ //10. Width of the edges
+ aDefaultMap.insert( EDGE_WIDTH_PROP , aResMgr->integerValue("Geometry", "edge_width", 1));
+
+
+ //11. Width of iso-lines
+ aDefaultMap.insert( ISOS_WIDTH_PROP , aResMgr->integerValue("Geometry", "isolines_width", 1));
+
+ if(viewer_type == SOCC_Viewer::Type()) {
+
+ aDefaultMap.insert(TOP_LEVEL_PROP, Standard_False);
+ }
+
return aDefaultMap;
}
theOrigin.insert(BACK_MATERIAL_PROP, theDefault.value(BACK_MATERIAL_PROP));
nbInserted++;
}
+
+ if(!theOrigin.contains(EDGE_WIDTH_PROP)) {
+ theOrigin.insert(EDGE_WIDTH_PROP, theDefault.value(EDGE_WIDTH_PROP));
+ nbInserted++;
+ }
+
+ if(!theOrigin.contains(ISOS_WIDTH_PROP)) {
+ theOrigin.insert(ISOS_WIDTH_PROP, theDefault.value(ISOS_WIDTH_PROP));
+ nbInserted++;
+ }
+
return (nbInserted > 0);
}