// OCCT Includes
#include <AIS_Drawer.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
+#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <StdSelect_TypeOfEdge.hxx>
AISShape->Attributes()->SetPointAspect( anAspect );
}
}
+ else
+ {
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+
+ // Set color for iso lines
+ QColor col = aResMgr->colorValue( "Geometry", "isos_color", QColor(int(0.5*255), int(0.5*255), int(0.5*255)) );
+ Quantity_Color aColor = SalomeApp_Tools::color( col );
+
+ Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect();
+ anAspect->SetColor( aColor );
+ AISShape->Attributes()->SetUIsoAspect( anAspect );
+
+ anAspect = AISShape->Attributes()->VIsoAspect();
+ anAspect->SetColor( aColor );
+ AISShape->Attributes()->SetVIsoAspect( anAspect );
+
+ if ( myShape.ShapeType() == TopAbs_FACE )
+ {
+ col = aResMgr->colorValue( "Geometry", "face_color", QColor( 0, 255, 0 ) );
+ aColor = SalomeApp_Tools::color( col );
+
+ AISShape->SetColor( aColor );
+ }
+ else if ( myShape.ShapeType() == TopAbs_EDGE || myShape.ShapeType() == TopAbs_WIRE )
+ {
+ col = aResMgr->colorValue( "Geometry", "edge_wire_color", QColor( 255, 0, 0 ) );
+ aColor = SalomeApp_Tools::color( col );
+
+ AISShape->SetColor( aColor );
+ }
+ else if ( myShape.ShapeType() == TopAbs_VERTEX )
+ {
+ col = aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) );
+ aColor = SalomeApp_Tools::color( col );
+
+ Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect();
+ anAspect->SetColor( aColor );
+ AISShape->Attributes()->SetPointAspect( anAspect );
+ }
+ else
+ {
+ col = aResMgr->colorValue( "Geometry", "wireframe_color", QColor( 255, 255, 0 ) );
+ aColor = SalomeApp_Tools::color( col );
+
+ AISShape->SetColor( aColor );
+ }
+ }
if ( HasWidth() )
AISShape->SetWidth( GetWidth() );
int tabId = addPreference( tr( "PREF_TAB_SETTINGS" ) );
int genGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), tabId );
+ setPreferenceProperty( genGroup, "columns", 1 );
+
+ int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), genGroup,
+ LightApp_Preferences::Selector, "Geometry", "display_mode" );
+
addPreference( tr( "PREF_SHADING_COLOR" ), genGroup,
LightApp_Preferences::Color, "Geometry", "shading_color" );
+
+ addPreference( tr( "PREF_WIREFRAME_COLOR" ), genGroup,
+ LightApp_Preferences::Color, "Geometry", "wireframe_color" );
+
+ addPreference( tr( "PREF_FACE_COLOR" ), genGroup,
+ LightApp_Preferences::Color, "Geometry", "face_color" );
+
+ addPreference( tr( "PREF_EDGE_WIRE_COLOR"), genGroup,
+ LightApp_Preferences::Color, "Geometry", "edge_wire_color" );
+
+ addPreference( tr( "PREF_POINT_COLOR"), genGroup,
+ LightApp_Preferences::Color, "Geometry", "point_color" );
+
+ addPreference( tr( "PREF_ISOS_COLOR" ), genGroup,
+ LightApp_Preferences::Color, "Geometry", "isos_color" );
+
int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup,
LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" );
- int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), genGroup,
- LightApp_Preferences::Selector, "Geometry", "display_mode" );
-
- setPreferenceProperty( genGroup, "columns", 1 );
-
- setPreferenceProperty( step, "min", 0.001 );
- setPreferenceProperty( step, "max", 10000 );
- setPreferenceProperty( step, "precision", 3 );
// Set property for default display mode
QStringList aModesList;
setPreferenceProperty( dispmode, "strings", aModesList );
setPreferenceProperty( dispmode, "indexes", anIndexesList );
+
+ // Set property for step value for spinboxes
+ setPreferenceProperty( step, "min", 0.001 );
+ setPreferenceProperty( step, "max", 10000 );
+ setPreferenceProperty( step, "precision", 3 );
+
}
void GeometryGUI::preferencesChanged( const QString& section, const QString& param )
#include "GEOM_AssemblyBuilder.h"
#include "GEOM_Actor.h"
+#include <SUIT_Session.h>
+
#include <vtkProperty.h>
// Open CASCADE Includes
FaceProp->SetDiffuseColor(0.780392, 0.568627, 0.113725);
FaceProp->SetSpecularColor(0.992157, 0.941176, 0.807843);
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ QColor aColor;
+
// Wireframe for iso
+ aColor = aResMgr->colorValue( "Geometry", "isos_color", QColor( int(0.5*255), int(0.5*255), int(0.5*255) ) );
+ float red = aColor.red()/255.0;
+ float green = aColor.green()/255.0;
+ float blue = aColor.blue()/255.0;
IsoProp->SetRepresentationToWireframe();
- IsoProp->SetAmbientColor(0.5, 0.5, 0.5);
- IsoProp->SetDiffuseColor(0.5, 0.5, 0.5);
- IsoProp->SetSpecularColor(0.5, 0.5, 0.5);
-
+ IsoProp->SetAmbientColor(red, green, blue);
+ IsoProp->SetDiffuseColor(red, green, blue);
+ IsoProp->SetSpecularColor(red, green, blue);
+
// Wireframe for iso
IsoPVProp->SetRepresentationToWireframe();
IsoPVProp->SetAmbientColor(0, 1, 1);
IsoPVProp->SetSpecularColor(0, 1, 1);
// Wireframe for shared edge
+ aColor = aResMgr->colorValue( "Geometry", "wireframe_color", QColor( 255, 255, 0 ) );
+ red = aColor.red()/255.0;
+ green = aColor.green()/255.0;
+ blue = aColor.blue()/255.0;
EdgeSProp->SetRepresentationToWireframe();
- EdgeSProp->SetAmbientColor(1, 1, 0);
- EdgeSProp->SetDiffuseColor(1, 1, 0);
- EdgeSProp->SetSpecularColor(1, 1, 0);
-
+ EdgeSProp->SetAmbientColor(red, green, blue);
+ EdgeSProp->SetDiffuseColor(red, green, blue);
+ EdgeSProp->SetSpecularColor(red, green, blue);
+
// Wireframe for free edge
+ aColor = aResMgr->colorValue( "Geometry", "face_color", QColor( 0, 255, 0 ) );
+ red = aColor.red()/255.0;
+ green = aColor.green()/255.0;
+ blue = aColor.blue()/255.0;
EdgeFProp->SetRepresentationToWireframe();
- EdgeFProp->SetAmbientColor(0, 1, 0);
- EdgeFProp->SetDiffuseColor(0, 1, 0);
- EdgeFProp->SetSpecularColor(0, 1, 0);
+ EdgeFProp->SetAmbientColor(red, green, blue);
+ EdgeFProp->SetDiffuseColor(red, green, blue);
+ EdgeFProp->SetSpecularColor(red, green, blue);
// Wireframe for isolated edge
+ aColor = aResMgr->colorValue( "Geometry", "edge_wire_color", QColor( 255, 0, 0 ) );
+ red = aColor.red()/255.0;
+ green = aColor.green()/255.0;
+ blue = aColor.blue()/255.0;
EdgeIProp->SetRepresentationToWireframe();
- EdgeIProp->SetAmbientColor(1, 0, 0);
- EdgeIProp->SetDiffuseColor(1, 0, 0);
- EdgeIProp->SetSpecularColor(1, 0, 0);
-
+ EdgeIProp->SetAmbientColor(red, green, blue);
+ EdgeIProp->SetDiffuseColor(red, green, blue);
+
// Wireframe for Preview edge
EdgePVProp->SetRepresentationToWireframe();
EdgePVProp->SetAmbientColor(1, 1, 0);
EdgePVProp->SetSpecularColor(1, 1, 0);
// Wireframe for vertex
+ aColor = aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) );
+ red = aColor.red()/255.0;
+ green = aColor.green()/255.0;
+ blue = aColor.blue()/255.0;
VertexProp->SetRepresentationToWireframe();
- VertexProp->SetAmbientColor(1, 1, 0);
- VertexProp->SetDiffuseColor(1, 1, 0);
- VertexProp->SetSpecularColor(1, 1, 0);
-
+ VertexProp->SetAmbientColor(red, green, blue);
+ VertexProp->SetDiffuseColor(red, green, blue);
+ VertexProp->SetSpecularColor(red, green, blue);
+
// Wireframe for vertex
VertexPVProp->SetRepresentationToWireframe();
VertexPVProp->SetAmbientColor(0, 1, 1);
continue;
}
+ /* PAL12858: we should to unify colors with OCC
// compute the number of faces
Standard_Integer nbf = edgemap.FindFromKey(ex2.Current()).Extent();
GEOM_Actor* EdgeActor = GEOM_Actor::New();
EdgeActor->SubShapeOn();
EdgeActor->setInputShape(ex2.Current(),deflection,mode);
+
switch (nbf) {
case 0 : // isolated edge
EdgeActor->SetWireframeProperty(EdgeSProp);
}
}
+ */
+ GEOM_Actor* EdgeActor = GEOM_Actor::New();
+ EdgeActor->SubShapeOn();
+ EdgeActor->setInputShape(ex2.Current(),deflection,mode);
+
+ if ( myShape.ShapeType() == 4 )
+ {
+ EdgeActor->SetShadingProperty(EdgeFProp);
+ EdgeActor->SetWireframeProperty(EdgeFProp);
+ }
+ else
+ {
+ EdgeActor->SetShadingProperty(EdgeSProp);
+ EdgeActor->SetWireframeProperty(EdgeSProp);
+ }
+
EdgeActor->SetPreviewProperty(EdgePVProp);
AISActors->AddItem(EdgeActor);
}