vertices.</li>
<li><b>Color of isolines</b> - allows to select default color for
isolines.</li>
+<li><b>Color of labels</b> - allows to select default color for
+labels (textual fields, shape name).</li>
<li><b>Top level color</b> - allows to select default color for objects which
were brought to the viewer foreground.</li>
<li><b>Top level display mode</b> - allows to select default top level display mode between:</li>
<parameter name="line_color" value="255, 0, 0" />
<parameter name="point_color" value="#ff7700" />
<parameter name="isos_color" value="200, 200, 200" />
+ <parameter name="label_color" value="255, 255, 255" />
<parameter name="toplevel_color" value="170, 85, 0" />
<parameter name="toplevel_dm" value="0" />
<parameter name="editgroup_color" value="170, 85, 0" />
// - color for edges in shading+edges mode
AISShape->SetEdgesInShadingColor( SalomeApp_Tools::color( propMap.value( GEOM::propertyName( GEOM::OutlineColor ) ).value<QColor>() ) );
+ // - color of labels (textual fields and shape name)
+ AISShape->SetLabelColor( qColorFromResources( "label_color", QColor( 255, 255, 255 ) ) );
+
// set display mode
AISShape->SetDisplayMode( HasDisplayMode() ?
// predefined display mode, manually set to displayer via GEOM_Displayer::SetDisplayMode() function
c = propMap.value( GEOM::propertyName( GEOM::OutlineColor ) ).value<QColor>();
actor->SetEdgesInShadingColor( c.redF(), c.greenF(), c.blueF() );
+ // - color of labels (shape name)
+ c = colorFromResources( "label_color", QColor( 255, 255, 255 ) );
+ actor->SetLabelColor( c.redF(), c.greenF(), c.blueF() );
+
// set opacity
if( HasTransparency() ) {
actor->SetOpacity( 1.0 - GetTransparency() );
<source>PREF_ISOS_COLOR</source>
<translation>Color of isolines</translation>
</message>
+ <message>
+ <source>PREF_LABEL_COLOR</source>
+ <translation>Color of labels</translation>
+ </message>
<message>
<source>PREF_TOPLEVEL_COLOR</source>
<translation>Top level color</translation>
<source>PREF_ISOS_COLOR</source>
<translation>Couleur des isolignes</translation>
</message>
+ <message>
+ <source>PREF_LABEL_COLOR</source>
+ <translation type="unfinished">Color of labels</translation>
+ </message>
<message>
<source>PREF_TOPLEVEL_COLOR</source>
<translation>Couleur des objets mis au premier plan</translation>
<source>PREF_ISOS_COLOR</source>
<translation>輪郭の色</translation>
</message>
+ <message>
+ <source>PREF_LABEL_COLOR</source>
+ <translation type="unfinished">Color of labels</translation>
+ </message>
<message>
<source>PREF_TOPLEVEL_COLOR</source>
<translation>前景オブジェクトの色</translation>
addPreference( tr( "PREF_ISOS_COLOR" ), genGroup,
LightApp_Preferences::Color, "Geometry", "isos_color" );
+ addPreference( tr( "PREF_LABEL_COLOR" ), genGroup,
+ LightApp_Preferences::Color, "Geometry", "label_color" );
+
+ addPreference( "", genGroup, LightApp_Preferences::Space );
+
addPreference( tr( "PREF_TOPLEVEL_COLOR" ), genGroup,
LightApp_Preferences::Color, "Geometry", "toplevel_color" );
param == QString("dimensions_arrow_length") ||
param == QString("dimensions_show_units") ||
param == QString("dimensions_length_units") ||
- param == QString("dimensions_angle_units") )
+ param == QString("dimensions_angle_units") ||
+ param == QString("label_color") )
{
SalomeApp_Application* anApp = getApp();
if ( !anApp )
aViewer->GetVisible( aVisible );
aDisplayer.Redisplay( aVisible, false, aViewer );
}
-
+ if ( param == QString( "label_color" ) ) {
+ ViewManagerList aVMsVTK;
+ anApp->viewManagers( SVTK_Viewer::Type(), aVMsVTK );
+ ViewManagerList::Iterator anIt = aVMsVTK.begin();
+ for ( ; anIt != aVMsVTK.end(); ++anIt )
+ {
+ SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>( (*anIt)->getViewModel() );
+ if ( !aViewer )
+ {
+ continue;
+ }
+ SALOME_ListIO aVisible;
+ aViewer->GetVisible( aVisible );
+ aDisplayer.Redisplay( aVisible, false, aViewer );
+ }
+ }
aDisplayer.UpdateViewer();
}
else if ( param.startsWith( "dependency_tree") )
myEdgesInShadingColor = aCol;
}
+void GEOM_AISShape::SetLabelColor(const Quantity_Color &aCol) {
+ myLabelColor = aCol;
+}
+
void GEOM_AISShape::highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap,
const Standard_Boolean aHighlight )
{
Handle(Graphic3d_AspectText3d) anAspectText3d = new Graphic3d_AspectText3d();
anAspectText3d->SetStyle( Aspect_TOST_ANNOTATION );
+ anAspectText3d->SetColor( myLabelColor );
aGroup->SetPrimitivesAspect( anAspectText3d );
aGroup->Text( aString.toLatin1().constData(), aVertex, 14 );
Handle(Graphic3d_AspectText3d) anAspectText3d = new Graphic3d_AspectText3d();
anAspectText3d->SetStyle( Aspect_TOST_ANNOTATION );
+ anAspectText3d->SetColor( myLabelColor );
aGroup->SetPrimitivesAspect( anAspectText3d );
const char* aName = getIO()->getName();
Standard_EXPORT void SetShadingColor(const Quantity_Color &aCol);
Standard_EXPORT void SetEdgesInShadingColor(const Quantity_Color &aCol);
+ Standard_EXPORT void SetLabelColor(const Quantity_Color &aCol);
Standard_EXPORT void SetDisplayVectors(bool isShow);
Standard_EXPORT void SetDisplayVertices(bool isShow);
Standard_EXPORT void SetDisplayName(bool isShow);
private:
Quantity_Color myShadingColor;
Quantity_Color myEdgesInShadingColor;
+ Quantity_Color myLabelColor;
TCollection_AsciiString myName;
bool myDisplayVectors;
void
GEOM_Actor
-::SetShapeName(const TopoDS_Shape& theShape)
+::SetShapeName()
{
- if( !getIO() )
+ if( !getIO() || myShape.IsNull() )
return;
- gp_Ax3 anAx3 = GEOMUtils::GetPosition(theShape);
+ gp_Ax3 anAx3 = GEOMUtils::GetPosition(myShape);
double center[3] = { anAx3.Location().X(),
anAx3.Location().Y(),
anAx3.Location().Z() };
myHighlightActor->GetDeviceActor()->SetInfinitive(true);
}
- SetShapeName( theShape );
+ SetShapeName();
// 0051777: TC7.2.0: Element could not be selected in Hypothesis Construction
myAppendFilter->Update();
myWireframeFaceActor->GetProperty()->SetColor(r, g, b);
}
+/*!
+ \brief Set color of labels
+ This actor is shown only if 'Show name' is switched-on, see SetVisibility()
+*/
+void GEOM_Actor::SetLabelColor(double r, double g, double b)
+{
+ myTextActor->GetTextProperty()->SetColor(r, g, b);
+}
+
void GEOM_Actor::SetMaterial(std::vector<vtkProperty*> theProps)
{
// we set material properties as back and front material
void SetEdgesInShadingColor(double r, double g, double b);
// Color of iso-lines
void SetIsosColor(double r, double g, double b);
+ // Color of labels
+ void SetLabelColor(double r, double g, double b);
// Material
void SetModified();
void GetMatrix(vtkCamera* theCam, vtkMatrix4x4 *result);
- void SetShapeName(const TopoDS_Shape& theShape);
+ void SetShapeName();
GEOM_Actor();
~GEOM_Actor();