+int GEOMGUI_Selection::annotationsCount() const
+{
+ return myAnnotationEntries.size();
+}
+
+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;
+}