#include "GEOMGUI_Selection.h"
#include <GEOMGUI_DimensionProperty.h>
#include <GEOMGUI_AnnotationAttrs.h>
+#include <GEOMGUI_AnnotationMgr.h>
#include "GeometryGUI.h"
#include "GEOM_Displayer.h"
v = hasImported();
else if ( p == "allImported" )
v = allImported();
+ else if (p == "annotationsCount")
+ v = annotationsCount();
else
v = LightApp_Selection::parameter( p );
return v;
// the method to skip temporary objects from selection (called from LightApp)
bool GEOMGUI_Selection::processOwner( const LightApp_DataOwner* theOwner )
{
+ if ( theOwner->entry().contains( GEOMGUI_AnnotationMgr::GetEntrySeparator() ) ) {
+ myAnnotationEntries.append( theOwner->entry() );
+ }
return !theOwner->entry().contains("_");
}
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() );
bool hasHiddenDimensions( const int ) const;
bool hasVisibleDimensions( const int ) const;
+ int annotationsCount() const;
+
bool hasAnnotations( const int, bool&, bool& ) const;
bool hasHiddenAnnotations( const int ) const;
bool hasVisibleAnnotations( const int ) const;
private:
GeomObjectVector myObjects;
+ QStringList myAnnotationEntries;
};
#endif
mgr->insert( separator(), -1, -1 ); // -----------
mgr->insert( action( GEOMOp::OpEditAnnotation ), -1, -1 ); // edit annotation
- mgr->setRule( action( GEOMOp::OpEditAnnotation ), QString("($component={'GEOM'}) and type='Shape' and selcount=1"), QtxPopupMgr::VisibleRule );
+ mgr->setRule( action( GEOMOp::OpEditAnnotation ), clientOCC + " and annotationsCount=1", QtxPopupMgr::VisibleRule );
mgr->insert( action( GEOMOp::OpDeleteAnnotation ), -1, -1 ); // delete annotation
- mgr->setRule( action( GEOMOp::OpDeleteAnnotation ), QString("($component={'GEOM'}) and type='Shape' and selcount=1"), QtxPopupMgr::VisibleRule );
+ mgr->setRule( action( GEOMOp::OpDeleteAnnotation ), clientOCC + " and (annotationsCount>1)", QtxPopupMgr::VisibleRule );
mgr->insert( separator(), -1, -1 ); // -----------
QString canDisplay = "($component={'GEOM'}) and (selcount>0) and ({true} in $canBeDisplayed) ",