+
+bool GEOMGUI_Selection::isFolder( const int index ) const
+{
+ bool res = false;
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( study() );
+
+ if ( appStudy ) {
+ QString anEntry = entry( index );
+ _PTR(Study) study = appStudy->studyDS();
+ if ( study && !anEntry.isNull() ) {
+ _PTR(SObject) aSO( study->FindObjectID( anEntry.toStdString() ) );
+ if ( aSO ) res = isFolder( aSO );
+ }
+ }
+ return res;
+}
+
+bool GEOMGUI_Selection::hasDimensions( const int theIndex, bool& theHidden, bool& theVisible ) const
+{
+ QString anEntry = entry( theIndex );
+ if ( anEntry.isNull() )
+ {
+ return false;
+ }
+
+ GEOMGUI_DimensionProperty aDimensions( anEntry.toStdString() );
+
+ theHidden = false;
+ theVisible = false;
+
+ for ( int it = 0; it < aDimensions.GetNumber(); ++it )
+ {
+ if ( aDimensions.IsVisible( it ) )
+ theVisible = true;
+ else
+ theHidden = true;
+ }
+
+ return aDimensions.GetNumber() > 0;
+}
+
+bool GEOMGUI_Selection::hasHiddenDimensions( const int theIndex ) const
+{
+ bool isAnyVisible = false;
+ bool isAnyHidden = false;
+ if ( !hasDimensions( theIndex, isAnyHidden, isAnyVisible ) )
+ {
+ return false;
+ }
+
+ return isAnyHidden;
+}
+
+bool GEOMGUI_Selection::hasVisibleDimensions( const int theIndex ) const
+{
+ bool isAnyVisible = false;
+ bool isAnyHidden = false;
+ if ( !hasDimensions( theIndex, isAnyHidden, isAnyVisible ) )
+ {
+ return false;
+ }
+
+ return isAnyVisible;
+}
+
+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() );
+
+ const Handle(GEOMGUI_AnnotationAttrs)
+ aShapeAnnotations = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj );
+
+ if ( aShapeAnnotations.IsNull() )
+ return false;
+
+ 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;
+}