#include "GEOMGUI_Selection.h"
#include <GEOMGUI_DimensionProperty.h>
+#include <GEOMGUI_AnnotationAttrs.h>
#include "GeometryGUI.h"
#include "GEOM_Displayer.h"
v = hasHiddenDimensions(idx);
else if ( p == "hasVisibleDimensions" )
v = hasVisibleDimensions(idx);
+ else if ( p == "hasHiddenAnnotations" )
+ v = hasHiddenAnnotations(idx);
+ else if ( p == "hasVisibleAnnotations" )
+ v = hasVisibleAnnotations(idx);
else
v = LightApp_Selection::parameter( idx, p );
return isAnyVisible;
}
+bool GEOMGUI_Selection::hasAnnotations( const int theIndex, bool& theHidden, bool& theVisible ) const
+{
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( study() );
+ if ( !appStudy )
+ return false;
+
+ QString anEntry = entry( theIndex );
+ _PTR(Study) aStudy = appStudy->studyDS();
+ if ( !aStudy || anEntry.isNull() )
+ return false;
+
+ _PTR(SObject) aSObj = appStudy->studyDS()->FindObjectID( anEntry.toStdString() );\r
+
+ const Handle(GEOMGUI_AnnotationAttrs)\r
+ aShapeAnnotations = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj );\r
+
+ if ( aShapeAnnotations.IsNull() )\r
+ return false;\r
+
+ theHidden = false;
+ theVisible = false;
+
+ const int aCount = aShapeAnnotations->GetNbAnnotation();
+ for ( int anI = 0; anI < aCount; ++anI )
+ {
+ if ( aShapeAnnotations->GetIsVisible( anI ) )
+ theVisible = true;
+ else
+ theHidden = true;
+ }
+
+ return aCount > 0;
+}
+
+bool GEOMGUI_Selection::hasHiddenAnnotations( const int theIndex ) const
+{
+ bool isAnyVisible, isAnyHidden = false;
+ if ( !hasAnnotations( theIndex, isAnyHidden, isAnyVisible ) )
+ {
+ return false;
+ }
+
+ return isAnyHidden;
+}
+
+bool GEOMGUI_Selection::hasVisibleAnnotations( const int theIndex ) const
+{
+ bool isAnyVisible, isAnyHidden = false;
+ if ( !hasAnnotations( theIndex, isAnyHidden, isAnyVisible ) )
+ {
+ return false;
+ }
+
+ return isAnyVisible;
+}
bool hasHiddenDimensions( const int ) const;
bool hasVisibleDimensions( const int ) const;
+ bool hasAnnotations( const int, bool&, bool& ) const;
+ bool hasHiddenAnnotations( const int ) const;
+ bool hasVisibleAnnotations( const int ) const;
+
GEOM::GEOM_Object_ptr getObject( const int ) const;
GEOM::GEOM_BaseObject_ptr getBaseObject( const int ) const;
// ----------------------------------------------------------------------------
// Text tree widget implementation
// ----------------------------------------------------------------------------
+
+//=================================================================================
+// function : Constructor
+// purpose :
+//=================================================================================
GEOMGUI_TextTreeWdg::GEOMGUI_TextTreeWdg( SalomeApp_Application* app )
: myDisplayer(NULL)
{
connect( app->objectBrowser(), SIGNAL( updated() ), this, SLOT( updateTree() ) );
GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
- connect( aGeomGUI, SIGNAL( DimensionsUpdated( const QString& ) ), this, SLOT( updateBranch( const QString& ) ) );
+ connect( aGeomGUI, SIGNAL( DimensionsUpdated( const QString& ) ),
+ this, SLOT( updateDimensionBranch( const QString& ) ) );
+ connect( aGeomGUI, SIGNAL( SignalAnnotationsUpdated( const QString& ) ),
+ this, SLOT( updateAnnotationBranch( const QString& ) ) );
connect( this, SIGNAL( itemClicked( QTreeWidgetItem*, int) ),
this, SLOT( onItemClicked( QTreeWidgetItem*, int ) ) );
}
+//=================================================================================
+// function : Destructor
+// purpose :
+//=================================================================================
GEOMGUI_TextTreeWdg::~GEOMGUI_TextTreeWdg()
{
//std::cout<<"~GEOMGUI_TextTreeWdg"<<std::endl;
if ( !valSO->ReferencedObject( refSO ) ) {
// update tree of object's dimensions
QString anEntry = valSO->GetID().c_str();
- updateBranch( anEntry );
+ updateBranches( anEntry );
aDimensionObjEntries.removeAll( anEntry );
anAnnotationObjEntries.removeAll( anEntry );
}
}
//=================================================================================
-// function : updateBranch
+// function : updateBranches
// purpose :
//=================================================================================
-void GEOMGUI_TextTreeWdg::updateBranch( const QString& theEntry )
+void GEOMGUI_TextTreeWdg::updateBranches( const QString& theEntry )
+{
+ updateDimensionBranch( theEntry );
+ updateAnnotationBranch( theEntry );
+}
+
+//=================================================================================
+// function : updateDimensionBranch
+// purpose :
+//=================================================================================
+void GEOMGUI_TextTreeWdg::updateDimensionBranch( const QString& theEntry )
{
- // dimension property branch
fillBranch( DimensionShape, theEntry );
+}
- // annotation property branch
+//=================================================================================
+// function : updateAnnotationBranch
+// purpose :
+//=================================================================================
+void GEOMGUI_TextTreeWdg::updateAnnotationBranch( const QString& theEntry )
+{
fillBranch( AnnotationShape, theEntry );
}
public slots:
void updateTree();
- void updateBranch( const QString& theEntry );
+ void updateBranches( const QString& theEntry );
+ void updateDimensionBranch( const QString& theEntry );
+ void updateAnnotationBranch( const QString& theEntry );
private slots:
void onItemClicked(QTreeWidgetItem*, int );
if ( !aShapeAnnotations.IsNull() )
{
- gp_Trsf aToLCS;\r
+ gp_Trsf aToLCS;
aToLCS.SetTransformation( theShapeLCS, gp_Ax3() );
for ( int anI = 0; anI < aShapeAnnotations->GetNbAnnotation(); ++anI )
continue;
}
- Handle(GEOM_Annotation) aPresentation = new GEOM_Annotation();\r
-\r
- aShapeAnnotations->SetupPresentation( aPresentation, anI, theShapeLCS );\r
+ Handle(GEOM_Annotation) aPresentation = new GEOM_Annotation();
+
+ aShapeAnnotations->SetupPresentation( aPresentation, anI, theShapeLCS );
aPresentation->SetOwner( theIO );
<source>TOP_POP_HIDE_ALL_DIMENSIONS</source>
<translation>Show all visible measures (dimension) created for the object</translation>
</message>
+ <message>
+ <source>MEN_POP_SHOW_ALL_ANNOTATIONS</source>
+ <translation>Show all annotations</translation>
+ </message>
+ <message>
+ <source>STB_POP_SHOW_ALL_ANNOTATIONS</source>
+ <translation>Show all shape annotations for the object</translation>
+ </message>
+ <message>
+ <source>TOP_POP_SHOW_ALL_ANNOTATIONS</source>
+ <translation>Show all shape annotations for the object</translation>
+ </message>
+ <message>
+ <source>MEN_POP_HIDE_ALL_ANNOTATIONS</source>
+ <translation>Hide all annotations</translation>
+ </message>
+ <message>
+ <source>STB_POP_HIDE_ALL_ANNOTATIONS</source>
+ <translation>Hide all shape annotations for the object</translation>
+ </message>
+ <message>
+ <source>TOP_POP_HIDE_ALL_ANNOTATIONS</source>
+ <translation>Hide all shape annotations for the object</translation>
+ </message>
<message>
<source>TOP_POP_AUTO_COLOR</source>
<translation>Auto color</translation>
<translation>Utiliser du texte 3D</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS</source>
+ <source>PREF_SHAPE_ANNOTATIONS</source>
+ <translation type="unfinished">Shape annotations</translation>
</message>
<message>
<source>PREF_SHAPE_ANNOTATIONS_FONT</source>
+ <translation type="unfinished">Font</translation>
</message>
<message>
<source>PREF_SHAPE_ANNOTATIONS_FONT_COLOR</source>
+ <translation type="unfinished">Font color</translation>
</message>
<message>
<source>PREF_SHAPE_ANNOTATIONS_LINE_COLOR</source>
+ <translation type="unfinished">Line color</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_LINE_WIDTH</source>
+ <source>PREF_SHAPE_ANNOTATIONS_LINE_WIDTH</source>
+ <translation type="unfinished">Line width</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_LINE_STYLE</source>
+ <source>PREF_SHAPE_ANNOTATIONS_LINE_STYLE</source>
+ <translation type="unfinished">Line style</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_AUTOHIDE</source>
+ <source>PREF_SHAPE_ANNOTATIONS_AUTOHIDE</source>
+ <translation type="unfinished">Hide when attachment is invisible</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_SOLID</source>
+ <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_SOLID</source>
+ <translation type="unfinished">Solid</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_DASH</source>
+ <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_DASH</source>
+ <translation type="unfinished">Dashed</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOT</source>
+ <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOT</source>
+ <translation type="unfinished">Dotted</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOTDASH</source>
+ <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOTDASH</source>
+ <translation type="unfinished">Mixed</translation>
</message>
<message>
<source>PREF_HIDE_INPUT_OBJECT</source>
<source>TOP_POP_HIDE_ALL_DIMENSIONS</source>
<translation>Afficher toutes les cotations visibles créées sur l'objet</translation>
</message>
+ <message>
+ <source>MEN_POP_SHOW_ALL_ANNOTATIONS</source>
+ <translation type="unfinished">Show all annotations</translation>
+ </message>
+ <message>
+ <source>STB_POP_SHOW_ALL_ANNOTATIONS</source>
+ <translation type="unfinished">Show all shape annotations for the object</translation>
+ </message>
+ <message>
+ <source>TOP_POP_SHOW_ALL_ANNOTATIONS</source>
+ <translation type="unfinished">Show all shape annotations for the object</translation>
+ </message>
+ <message>
+ <source>MEN_POP_HIDE_ALL_ANNOTATIONS</source>
+ <translation type="unfinished">Hide all annotations</translation>
+ </message>
+ <message>
+ <source>STB_POP_HIDE_ALL_ANNOTATIONS</source>
+ <translation type="unfinished">Hide all shape annotations for the object</translation>
+ </message>
+ <message>
+ <source>TOP_POP_HIDE_ALL_ANNOTATIONS</source>
+ <translation type="unfinished">Hide all shape annotations for the object</translation>
+ </message>
<message>
<source>TOP_POP_AUTO_COLOR</source>
<translation>Couleur automatique</translation>
<translation>3Dテキストの使用</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS</source>
+ <source>PREF_SHAPE_ANNOTATIONS</source>
+ <translation type="unfinished">Shape annotations</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_FONT</source>
+ <source>PREF_SHAPE_ANNOTATIONS_FONT</source>
+ <translation type="unfinished">Font</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_FONT_COLOR</source>
+ <source>PREF_SHAPE_ANNOTATIONS_FONT_COLOR</source>
+ <translation type="unfinished">Font color</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_LINE_COLOR</source>
+ <source>PREF_SHAPE_ANNOTATIONS_LINE_COLOR</source>
+ <translation type="unfinished">Line color</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_LINE_WIDTH</source>
+ <source>PREF_SHAPE_ANNOTATIONS_LINE_WIDTH</source>
+ <translation type="unfinished">Line width</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_LINE_STYLE</source>
+ <source>PREF_SHAPE_ANNOTATIONS_LINE_STYLE</source>
+ <translation type="unfinished">Line style</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_AUTOHIDE</source>
+ <source>PREF_SHAPE_ANNOTATIONS_AUTOHIDE</source>
+ <translation type="unfinished">Hide when attachment is invisible</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_SOLID</source>
+ <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_SOLID</source>
+ <translation type="unfinished">Solid</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_DASH</source>
+ <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_DASH</source>
+ <translation type="unfinished">Dashed</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOT</source>
+ <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOT</source>
+ <translation type="unfinished">Dotted</translation>
</message>
<message>
- <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOTDASH</source>
+ <source>PREF_SHAPE_ANNOTATIONS_LINESTYLE_DOTDASH</source>
+ <translation type="unfinished">Mixed</translation>
</message>
<message>
<source>PREF_HIDE_INPUT_OBJECT</source>
<source>TOP_POP_HIDE_ALL_DIMENSIONS</source>
<translation>オブジェクトのために作成されたすべての見える基準寸法を表示</translation>
</message>
+ <message>
+ <source>MEN_POP_SHOW_ALL_ANNOTATIONS</source>
+ <translation type="unfinished">Show all annotations</translation>
+ </message>
+ <message>
+ <source>STB_POP_SHOW_ALL_ANNOTATIONS</source>
+ <translation type="unfinished">Show all shape annotations for the object</translation>
+ </message>
+ <message>
+ <source>TOP_POP_SHOW_ALL_ANNOTATIONS</source>
+ <translation type="unfinished">Show all shape annotations for the object</translation>
+ </message>
+ <message>
+ <source>MEN_POP_HIDE_ALL_ANNOTATIONS</source>
+ <translation type="unfinished">Hide all annotations</translation>
+ </message>
+ <message>
+ <source>STB_POP_HIDE_ALL_ANNOTATIONS</source>
+ <translation type="unfinished">Hide all shape annotations for the object</translation>
+ </message>
+ <message>
+ <source>TOP_POP_HIDE_ALL_ANNOTATIONS</source>
+ <translation type="unfinished">Hide all shape annotations for the object</translation>
+ </message>
<message>
<source>TOP_POP_AUTO_COLOR</source>
<translation>自動色</translation>
#endif
case GEOMOp::OpShowAllDimensions: // POPUP MENU - SHOW ALL DIMENSIONS
case GEOMOp::OpHideAllDimensions: // POPUP MENU - HIDE ALL DIMENSIONS
+ case GEOMOp::OpShowAllAnnotations: // POPUP MENU - SHOW ALL ANNOTATIONS
+ case GEOMOp::OpHideAllAnnotations: // POPUP MENU - HIDE ALL ANNOTATIONS
libName = "MeasureGUI";
break;
case GEOMOp::OpGroupCreate: // MENU GROUP - CREATE
#ifndef DISABLE_GRAPHICSVIEW
createGeomAction( GEOMOp::OpShowDependencyTree, "POP_SHOW_DEPENDENCY_TREE" );
#endif
- createGeomAction( GEOMOp::OpReduceStudy, "POP_REDUCE_STUDY" );
- createGeomAction( GEOMOp::OpShowAllDimensions, "POP_SHOW_ALL_DIMENSIONS" );
- createGeomAction( GEOMOp::OpHideAllDimensions, "POP_HIDE_ALL_DIMENSIONS" );
+ createGeomAction( GEOMOp::OpReduceStudy, "POP_REDUCE_STUDY" );
+ createGeomAction( GEOMOp::OpShowAllDimensions, "POP_SHOW_ALL_DIMENSIONS" );
+ createGeomAction( GEOMOp::OpHideAllDimensions, "POP_HIDE_ALL_DIMENSIONS" );
+ createGeomAction( GEOMOp::OpShowAllAnnotations, "POP_SHOW_ALL_ANNOTATIONS" );
+ createGeomAction( GEOMOp::OpHideAllAnnotations, "POP_HIDE_ALL_ANNOTATIONS" );
// Create actions for increase/decrease transparency shortcuts
createGeomAction( GEOMOp::OpIncrTransparency, "", "", 0, false,
mgr->setRule( action( GEOMOp::OpShowAllDimensions ), aDimensionRule.arg( "hasHiddenDimensions" ), QtxPopupMgr::VisibleRule );
mgr->insert( action( GEOMOp::OpHideAllDimensions ), -1, -1 ); // hide all dimensions
mgr->setRule( action( GEOMOp::OpHideAllDimensions ), aDimensionRule.arg( "hasVisibleDimensions" ), QtxPopupMgr::VisibleRule );
+ mgr->insert( action( GEOMOp::OpShowAllAnnotations ), -1, -1 ); // show all annotations
+ mgr->setRule( action( GEOMOp::OpShowAllAnnotations ), aDimensionRule.arg( "hasHiddenAnnotations" ), QtxPopupMgr::VisibleRule );
+ mgr->insert( action( GEOMOp::OpHideAllAnnotations ), -1, -1 ); // hide all annotations
+ mgr->setRule( action( GEOMOp::OpHideAllAnnotations ), aDimensionRule.arg( "hasVisibleAnnotations" ), QtxPopupMgr::VisibleRule );
mgr->insert( separator(), -1, -1 ); // -----------
mgr->insert( action( GEOMOp::OpUnpublishObject ), -1, -1 ); // Unpublish object
aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps, true );
}
}
- else if ( param == QString("dimensions_color") ||
- param == QString("dimensions_line_width") ||
- param == QString("dimensions_font") ||
- param == QString("dimensions_arrow_length") ||
- param == QString("dimensions_show_units") ||
- param == QString("dimensions_length_units") ||
- param == QString("dimensions_angle_units") ||
- param == QString("dimensions_use_text3d") ||
+ else if ( param == QString("dimensions_color") ||
+ param == QString("dimensions_line_width") ||
+ param == QString("dimensions_font") ||
+ param == QString("dimensions_arrow_length") ||
+ param == QString("dimensions_show_units") ||
+ param == QString("dimensions_length_units") ||
+ param == QString("dimensions_angle_units") ||
+ param == QString("dimensions_use_text3d") ||
+ param == QString("shape_annotation_font_color") ||
+ param == QString("shape_annotation_line_color") ||
+ param == QString("shape_annotation_font") ||
+ param == QString("shape_annotation_line_width") ||
+ param == QString("shape_annotation_autohide") ||
+ param == QString("shape_annotation_line_style") ||
+ param == QString("shape_annotation_line_style") ||
param == QString("label_color") )
{
SalomeApp_Application* anApp = getApp();
{
emit DimensionsUpdated( entry );
}
+
+void GeometryGUI::emitAnnotationsUpdated( QString entry )
+{
+ emit SignalAnnotationsUpdated( entry );
+}
const int row, Qt::DropAction action );
void emitDimensionsUpdated( QString entry );
+ void emitAnnotationsUpdated( QString entry );
public slots:
virtual bool deactivateModule( SUIT_Study* );
void SignalDefaultStepValueChanged( double newVal );
void SignalDependencyTreeParamChanged( const QString&, const QString& );
void SignalDependencyTreeRenameObject( const QString& );
+ void SignalAnnotationsUpdated( const QString& );
void DimensionsUpdated( const QString& );
protected:
#endif
OpAnnotation = 5020, // MENU MEASURES - ANNOTATION
OpEditAnnotation = 5021, // POPUP MENU - EDIT ANNOTATION
+ OpShowAllAnnotations = 5022, // POPUP MENU - SHOW ALL ANNOTATIONS
+ OpHideAllAnnotations = 5023, // POPUP MENU - HIDE ALL ANNOTATIONS
// GroupGUI --------------------//--------------------------------
OpGroupCreate = 6000, // MENU GROUP - CREATE
OpGroupEdit = 6001, // MENU GROUP - EDIT
#include "GeometryGUI_Operations.h"
#include <GEOMGUI_DimensionProperty.h>
+#include <GEOMGUI_AnnotationAttrs.h>
#include <LightApp_SelectionMgr.h>
#include <SUIT_OverrideCursor.h>
case GEOMOp::OpHideAllDimensions:
ChangeDimensionsVisibility( false );
break; // HIDE ALL DIMENSIONS
+ case GEOMOp::OpShowAllAnnotations:
+ ChangeAnnotationsVisibility( true );
+ break; // SHOW ALL ANNOTATIONS
+ case GEOMOp::OpHideAllAnnotations:
+ ChangeAnnotationsVisibility( false );
+ break; // HIDE ALL ANNOTATIONS
default:
app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
break;
void MeasureGUI::ChangeDimensionsVisibility( const bool theIsVisible )
{
SalomeApp_Application* anApp = getGeometryGUI()->getApp();
- if (!anApp)
- {
+ if ( !anApp )
return;
- }
SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() );
if ( !anActiveStudy )
- {
return;
- }
- LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr();
- if ( !aSelMgr )
- {
+ Handle(SALOME_InteractiveObject) anIObject = getSingleSelectedIO();
+ if ( anIObject.IsNull()
+ || !anIObject->hasEntry() )
return;
- }
-
- SALOME_ListIO aListIO;
- aSelMgr->selectedObjects( aListIO );
- if ( aListIO.Extent() != 1 )
- {
- return;
- }
-
- Handle(SALOME_InteractiveObject) anIObject = aListIO.First();
- if ( !anIObject->hasEntry() )
- {
- return;
- }
SUIT_OverrideCursor wc;
GEOMGUI_DimensionProperty aDimensions( anActiveStudy, anIObject->getEntry() );
- for ( int anIt = 0; anIt < aDimensions.GetNumber(); ++anIt )
- {
+ for ( int anIt = 0; anIt < aDimensions.GetNumber(); ++anIt ) {
aDimensions.SetVisible( anIt, theIsVisible );
}
GEOM_Displayer( anActiveStudy ).Redisplay( anIObject, true );
}
+//=======================================================================
+// function : ChangeAnnotationsVisibility
+// purpose :
+//=======================================================================
+void MeasureGUI::ChangeAnnotationsVisibility( const bool theIsVisible )
+{
+ SalomeApp_Application* anApp = getGeometryGUI()->getApp();
+ if ( !anApp )
+ return;
+
+ SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() );
+ if ( !anActiveStudy )
+ return;
+
+ Handle(SALOME_InteractiveObject) anIObject = getSingleSelectedIO();
+ if ( anIObject.IsNull()
+ || !anIObject->hasEntry() )
+ return;
+
+ _PTR(SObject) aSObj = anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() );\r
+
+ const Handle(GEOMGUI_AnnotationAttrs)\r
+ aShapeAnnotations = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj );\r
+
+ if ( aShapeAnnotations.IsNull() )\r
+ return;\r
+
+ const int aCount = aShapeAnnotations->GetNbAnnotation();
+
+ if ( aCount > 0 ) {
+
+ SUIT_OverrideCursor wc;
+
+ for ( int anI = 0; anI <= aCount; ++anI ) {
+
+ aShapeAnnotations->SetIsVisible( anI, theIsVisible );
+ }
+
+ GEOM_Displayer( anActiveStudy ).Redisplay( anIObject, true );
+ }
+}
+
+//=======================================================================
+// function : getSingleSelectedIO
+// purpose : returns selected interactive object for single selection.
+//=======================================================================
+Handle(SALOME_InteractiveObject) MeasureGUI::getSingleSelectedIO()
+{
+ SalomeApp_Application* anApp = getGeometryGUI()->getApp();
+ if ( !anApp ) {
+ return Handle(SALOME_InteractiveObject)();
+ }
+
+ LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr();
+ if ( !aSelMgr ) {
+ return Handle(SALOME_InteractiveObject)();
+ }
+
+ SALOME_ListIO aListIO;
+ aSelMgr->selectedObjects( aListIO );
+ if ( aListIO.Extent() != 1 ) {
+ return Handle(SALOME_InteractiveObject)();
+ }
+
+ return aListIO.First();
+}
+
//=======================================================================
// function : onFinished
// purpose : called then "Manage Dimension" dialog is closed.
#ifndef MEASUREGUI_H
#define MEASUREGUI_H
+// GEOM includes
#include <GEOMGUI.h>
+// GUI includes
+#include <SALOME_InteractiveObject.hxx>
+
class QDialog;
//=================================================================================
// Show/hide all dimension created for object
void ChangeDimensionsVisibility( const bool theIsVisible );
+
+ // Show/hide all shape annotations created for GEOM object
+ void ChangeAnnotationsVisibility( const bool theIsVisible );
+
+private:
+ // Returns selected interactive object for single selection
+ Handle(SALOME_InteractiveObject) getSingleSelectedIO();
+
private:
QDialog* myManageDimensionDlg;
private slots:
aShapeAnnotations->Append( myAnnotationProperties );
- /* myGeomGUI->emitDimensionsUpdated( QString( myShape->GetStudyEntry() ) ); */
+ myGeomGUI->emitAnnotationsUpdated( QString( myShape->GetStudyEntry() ) );
}
else {
/*SalomeApp_Study* aStudy = getStudy();