From 04e80ddd750143bdd5e47e53ee2c624c6efd650b Mon Sep 17 00:00:00 2001 From: mpa Date: Thu, 11 Sep 2014 11:02:20 +0400 Subject: [PATCH] 0021671: EDF 1829 GEOM : Bring to front selected objects (continuation) - solved a problem with selection and pre-selection object in the "additional wireframe actor" mode; - added GEOM documentation --- .../gui/GEOM/input/geometry_preferences.doc | 14 +++++ src/OBJECT/GEOM_AISShape.cxx | 4 +- src/OBJECT/GEOM_TopWireframeShape.cxx | 55 +++++++++++-------- 3 files changed, 47 insertions(+), 26 deletions(-) diff --git a/doc/salome/gui/GEOM/input/geometry_preferences.doc b/doc/salome/gui/GEOM/input/geometry_preferences.doc index 6c1f7d03b..5e9e94e7d 100644 --- a/doc/salome/gui/GEOM/input/geometry_preferences.doc +++ b/doc/salome/gui/GEOM/input/geometry_preferences.doc @@ -33,6 +33,20 @@ default color for edges, vectors and wires (isolated lines). vertices.
  • Color of isolines - allows to select default color for isolines.
  • +
  • Top level color - allows to select default color for objects which +were brought to the viewer foreground.
  • +
  • Top level display mode - allows to select default top level display mode between:
  • +
  • Transparency - allows to define default transparency value.
  • Deflection coefficient - allows to define default deflection coefficient for lines and surfaces. A smaller coefficient provides diff --git a/src/OBJECT/GEOM_AISShape.cxx b/src/OBJECT/GEOM_AISShape.cxx index fe26569e1..f75b7a6b7 100644 --- a/src/OBJECT/GEOM_AISShape.cxx +++ b/src/OBJECT/GEOM_AISShape.cxx @@ -457,11 +457,11 @@ void GEOM_AISShape::setTopLevelDisplayMode(const GEOM_AISShape::TopLevelDispMode } Standard_Boolean GEOM_AISShape::switchTopLevel() { - return myTopLevelDm != TopShowAdditionalWActor; + return myTopLevelDm != TopShowAdditionalWActor; } Standard_Boolean GEOM_AISShape::toActivate() { - return Standard_True; + return ( myTopLevel && myTopLevelDm == TopShowAdditionalWActor ) ? false : true; } void GEOM_AISShape::setFieldStepInfo( const GEOM::field_data_type theFieldDataType, diff --git a/src/OBJECT/GEOM_TopWireframeShape.cxx b/src/OBJECT/GEOM_TopWireframeShape.cxx index 0cec60e0d..2a2101fff 100755 --- a/src/OBJECT/GEOM_TopWireframeShape.cxx +++ b/src/OBJECT/GEOM_TopWireframeShape.cxx @@ -43,64 +43,71 @@ #include #include -GEOM_TopWireframeShape::GEOM_TopWireframeShape(const TopoDS_Shape& shape) - : SALOME_AISShape(shape) +GEOM_TopWireframeShape::GEOM_TopWireframeShape( const TopoDS_Shape& shape ) + :SALOME_AISShape(shape) { - SetDisplayMode(AIS_WireFrame); - Handle(Prs3d_IsoAspect) anAspect = Attributes()->UIsoAspect(); - anAspect->SetNumber( 0 ); - Attributes()->SetUIsoAspect( anAspect ); - anAspect = Attributes()->VIsoAspect(); - anAspect->SetNumber( 0 ); - Attributes()->SetVIsoAspect( anAspect ); - SetColor(GEOM_AISShape::topLevelColor()); + SetDisplayMode( AIS_WireFrame ); + Handle(Prs3d_IsoAspect) anAspect = Attributes()->UIsoAspect(); + anAspect->SetNumber( 0 ); + Attributes()->SetUIsoAspect( anAspect ); + anAspect = Attributes()->VIsoAspect(); + anAspect->SetNumber( 0 ); + Attributes()->SetVIsoAspect( anAspect ); + SetColor( GEOM_AISShape::topLevelColor() ); } GEOM_TopWireframeShape::~GEOM_TopWireframeShape() { } -Handle(SALOME_InteractiveObject) GEOM_TopWireframeShape::getIO(){ +Handle(SALOME_InteractiveObject) GEOM_TopWireframeShape::getIO() +{ Handle(SALOME_InteractiveObject) IO; if ( !GetOwner().IsNull() ) IO = Handle(SALOME_InteractiveObject)::DownCast( GetOwner() ); return IO; } -Standard_Boolean GEOM_TopWireframeShape::hasIO(){ +Standard_Boolean GEOM_TopWireframeShape::hasIO() +{ return !getIO().IsNull(); } -void GEOM_TopWireframeShape::setName(const Standard_CString /*aName*/) +void GEOM_TopWireframeShape::setName( const Standard_CString /*aName*/ ) { } -Standard_CString GEOM_TopWireframeShape::getName(){ +Standard_CString GEOM_TopWireframeShape::getName() +{ return ""; } -void GEOM_TopWireframeShape::highlightSubShapes(const TColStd_IndexedMapOfInteger& /*aIndexMap*/, - const Standard_Boolean /*aHighlight*/ ) +void GEOM_TopWireframeShape::highlightSubShapes( const TColStd_IndexedMapOfInteger& /*aIndexMap*/, + const Standard_Boolean /*aHighlight*/ ) { } -Standard_Boolean GEOM_TopWireframeShape::isTopLevel() { +Standard_Boolean GEOM_TopWireframeShape::isTopLevel() +{ return Standard_True; } -void GEOM_TopWireframeShape::setTopLevel(Standard_Boolean /*f*/) { - +void GEOM_TopWireframeShape::setTopLevel( Standard_Boolean /*f*/ ) +{ } -Standard_Boolean GEOM_TopWireframeShape::toActivate() { - return Standard_False; +Standard_Boolean GEOM_TopWireframeShape::toActivate() +{ + return Standard_True; } -Standard_Boolean GEOM_TopWireframeShape::switchTopLevel() { - return Standard_True; +Standard_Boolean GEOM_TopWireframeShape::switchTopLevel() +{ + return Standard_True; } -void GEOM_TopWireframeShape::setIO(const Handle(SALOME_InteractiveObject)& io){ +void GEOM_TopWireframeShape::setIO( const Handle(SALOME_InteractiveObject)& io ) +{ SetOwner( io ); } -- 2.39.2