mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-15 04:00:40 +05:00
Corrections for the following cases:
1) The names of the annotations and geometrical objects are not updated in the "Dimensions/Annotations" data tree: - Create any primitive, box for example. - Create annotation with text 'My initial annotation' - Call edit annotation dialog box and set text of the annotation to 'My updated annotation' = > As a result text is updated in the viewer, but not in the "Dimensions/Annotations" data tree. - Rename box = > As a result name is updated in the SALOME Object Browser, but not in the "Dimensions/Annotations" data tree. 2) Popup menu in the "Dimensions/Annotations" data tree: "Show all annotations" / "Hide all annotation" menu items appear / work incorrect: - "Show all annotations" / "Hide all annotation" menu items should appear only for "Annotations" root object and for concrete geometrical object - "Show all annotations" / "Hide all annotation" menu items should work in the following way: If popup menu is called for "Annotations" root object, then show / hide operations should be applied to all annotations. If popup menu is called for concrete geometrical object, then show / hide operations should be applied only to annotations which belong to this concrete geometrical object.
This commit is contained in:
parent
b9162f3eab
commit
7deaf84d7e
@ -32,7 +32,11 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class GEOMGUI_TextTreeSelector
|
\class GEOMGUI_TextTreeSelector
|
||||||
\brief Text tree selection handler class.
|
\brief Text tree selection handler class. It provides selection synchronization between
|
||||||
|
application and text tree widget. This selector listens item selection changed signal of
|
||||||
|
text tree widget to emit common selection changed signal of SUIT selector to start selection
|
||||||
|
synchronization. In get/setSelection selector processes annotation items. These items have
|
||||||
|
specific entry generated in annotation manager, having the "object entry:annotation_id" structure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -60,7 +64,7 @@ GEOMGUI_TextTreeSelector::~GEOMGUI_TextTreeSelector()
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Get object browser.
|
\brief Get object browser.
|
||||||
\return a pointer to the object browser
|
\return a pointer to the text tree widget
|
||||||
*/
|
*/
|
||||||
GEOMGUI_TextTreeWdg* GEOMGUI_TextTreeSelector::textTree() const
|
GEOMGUI_TextTreeWdg* GEOMGUI_TextTreeSelector::textTree() const
|
||||||
{
|
{
|
||||||
@ -68,7 +72,7 @@ GEOMGUI_TextTreeWdg* GEOMGUI_TextTreeSelector::textTree() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Get selector type.
|
\brief Get selector unique type.
|
||||||
\return selector type
|
\return selector type
|
||||||
*/
|
*/
|
||||||
QString GEOMGUI_TextTreeSelector::type() const
|
QString GEOMGUI_TextTreeSelector::type() const
|
||||||
@ -77,20 +81,19 @@ QString GEOMGUI_TextTreeSelector::type() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Called when the Object browser selection is changed.
|
\brief Called when the Object browser selection is changed. It emits signal to synchronize
|
||||||
|
selection in application.
|
||||||
*/
|
*/
|
||||||
void GEOMGUI_TextTreeSelector::onSelectionChanged()
|
void GEOMGUI_TextTreeSelector::onSelectionChanged()
|
||||||
{
|
{
|
||||||
//QTime t1 = QTime::currentTime();
|
|
||||||
mySelectedList.clear();
|
mySelectedList.clear();
|
||||||
selectionChanged();
|
selectionChanged();
|
||||||
//QTime t2 = QTime::currentTime();
|
|
||||||
//qDebug( QString( "selection time = %1 msecs" ).arg( t1.msecsTo( t2 ) ).toLatin1().constData() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Get list of currently selected objects.
|
\brief Get list of currently selected annotation objects.
|
||||||
\param theList list to be filled with the selected objects owners
|
\param theList list to be filled with the selected objects owners
|
||||||
|
The list contains owners for interactive objects of annotations
|
||||||
*/
|
*/
|
||||||
void GEOMGUI_TextTreeSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const
|
void GEOMGUI_TextTreeSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const
|
||||||
{
|
{
|
||||||
@ -118,35 +121,6 @@ void GEOMGUI_TextTreeSelector::getSelection( SUIT_DataOwnerPtrList& theList ) co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
theList = mySelectedList;
|
theList = mySelectedList;
|
||||||
|
|
||||||
/*if ( aSelectedAnnotations.count() == 0 ) {
|
|
||||||
SUIT_Session* session = SUIT_Session::session();
|
|
||||||
SUIT_Application* sapp = session ? session->activeApplication() : 0;
|
|
||||||
LightApp_Application* app = dynamic_cast<LightApp_Application*>( sapp );
|
|
||||||
if( !app || !myBrowser )
|
|
||||||
return;
|
|
||||||
|
|
||||||
DataObjectList objlist;
|
|
||||||
myBrowser->getSelected( objlist );
|
|
||||||
GEOMGUI_TextTreeSelector* that = (GEOMGUI_TextTreeSelector*)this;
|
|
||||||
QListIterator<SUIT_DataObject*> it( objlist );
|
|
||||||
while ( it.hasNext() ) {
|
|
||||||
LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( it.next() );
|
|
||||||
if ( obj && app->checkDataObject( obj) ) {
|
|
||||||
#ifndef DISABLE_SALOMEOBJECT
|
|
||||||
Handle(SALOME_InteractiveObject) aSObj = new SALOME_InteractiveObject
|
|
||||||
( obj->entry().toLatin1().constData(),
|
|
||||||
obj->componentDataType().toLatin1().constData(),
|
|
||||||
obj->name().toLatin1().constData() );
|
|
||||||
LightApp_DataOwner* owner = new LightApp_DataOwner( aSObj );
|
|
||||||
#else
|
|
||||||
LightApp_DataOwner* owner = new LightApp_DataOwner( obj->entry() );
|
|
||||||
#endif
|
|
||||||
that->mySelectedList.append( SUIT_DataOwnerPtr( owner ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
theList = mySelectedList;*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -158,9 +132,6 @@ void GEOMGUI_TextTreeSelector::setSelection( const SUIT_DataOwnerPtrList& theLis
|
|||||||
if ( !myTextTree )
|
if ( !myTextTree )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//if( myEntries.count() == 0 || myModifiedTime < myBrowser->getModifiedTime() )
|
|
||||||
// fillEntries( myEntries );
|
|
||||||
|
|
||||||
QMap<QString, QList<int> > aSelectedAnnotations;
|
QMap<QString, QList<int> > aSelectedAnnotations;
|
||||||
DataObjectList objList;
|
DataObjectList objList;
|
||||||
for ( SUIT_DataOwnerPtrList::const_iterator it = theList.begin();
|
for ( SUIT_DataOwnerPtrList::const_iterator it = theList.begin();
|
||||||
@ -178,7 +149,7 @@ void GEOMGUI_TextTreeSelector::setSelection( const SUIT_DataOwnerPtrList& theLis
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
QString anEntry = anAnnotationInfo[0];
|
QString anEntry = anAnnotationInfo[0];
|
||||||
int anAnnotationId = anAnnotationInfo[1].toInt();//myAnnotationMgr->FindAnnotationIndex( anIO );
|
int anAnnotationId = anAnnotationInfo[1].toInt();
|
||||||
if ( anAnnotationId < 0)
|
if ( anAnnotationId < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -195,24 +166,3 @@ void GEOMGUI_TextTreeSelector::setSelection( const SUIT_DataOwnerPtrList& theLis
|
|||||||
mySelectedList.clear();
|
mySelectedList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
\brief Fill map of the data objects currently shown in the Object Browser.
|
|
||||||
\param entries map to be filled
|
|
||||||
*/
|
|
||||||
/*void GEOMGUI_TextTreeSelector::fillEntries( QMap<QString, LightApp_DataObject*>& entries )
|
|
||||||
{
|
|
||||||
entries.clear();
|
|
||||||
|
|
||||||
if ( !myBrowser )
|
|
||||||
return;
|
|
||||||
|
|
||||||
for ( SUIT_DataObjectIterator it( myBrowser->root(),
|
|
||||||
SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it ) {
|
|
||||||
LightApp_DataObject* obj = dynamic_cast<LightApp_DataObject*>( it.current() );
|
|
||||||
if ( obj )
|
|
||||||
entries.insert( obj->entry(), obj );
|
|
||||||
}
|
|
||||||
|
|
||||||
setModified();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
|
|
||||||
class GEOMGUI_TextTreeWdg;
|
class GEOMGUI_TextTreeWdg;
|
||||||
class GEOMGUI_AnnotationMgr;
|
class GEOMGUI_AnnotationMgr;
|
||||||
//class LightApp_DataObject;
|
|
||||||
|
|
||||||
class GEOMGUI_EXPORT GEOMGUI_TextTreeSelector : public QObject, public SUIT_Selector
|
class GEOMGUI_EXPORT GEOMGUI_TextTreeSelector : public QObject, public SUIT_Selector
|
||||||
{
|
{
|
||||||
@ -46,17 +45,14 @@ public:
|
|||||||
|
|
||||||
GEOMGUI_TextTreeWdg* textTree() const;
|
GEOMGUI_TextTreeWdg* textTree() const;
|
||||||
|
|
||||||
virtual QString type() const;
|
virtual QString type() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onSelectionChanged();
|
void onSelectionChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
|
virtual void getSelection( SUIT_DataOwnerPtrList& ) const;
|
||||||
virtual void setSelection( const SUIT_DataOwnerPtrList& );
|
virtual void setSelection( const SUIT_DataOwnerPtrList& );
|
||||||
|
|
||||||
//private:
|
|
||||||
//void fillEntries( QMap<QString, LightApp_DataObject*>& );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GEOMGUI_TextTreeWdg* myTextTree;
|
GEOMGUI_TextTreeWdg* myTextTree;
|
||||||
|
@ -113,8 +113,6 @@ namespace
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return aMgr->IsDisplayed( myEntry, theIndex );
|
return aMgr->IsDisplayed( myEntry, theIndex );
|
||||||
//return annotationMgr()->IsDisplayed(myEntry, theIndex);
|
|
||||||
//return !myAttr.IsNull() ? myAttr->GetIsVisible( theIndex ) : false;
|
|
||||||
}
|
}
|
||||||
virtual void SetIsVisible( const int theIndex, const bool theIsVisible ) Standard_OVERRIDE {
|
virtual void SetIsVisible( const int theIndex, const bool theIsVisible ) Standard_OVERRIDE {
|
||||||
GEOMGUI_AnnotationMgr* aMgr = annotationMgr();
|
GEOMGUI_AnnotationMgr* aMgr = annotationMgr();
|
||||||
@ -125,9 +123,6 @@ namespace
|
|||||||
annotationMgr()->Display(myEntry, theIndex);
|
annotationMgr()->Display(myEntry, theIndex);
|
||||||
else
|
else
|
||||||
annotationMgr()->Erase(myEntry, theIndex);
|
annotationMgr()->Erase(myEntry, theIndex);
|
||||||
/*if ( !myAttr.IsNull() ) {
|
|
||||||
myAttr->SetIsVisible( theIndex, theIsVisible );
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
virtual void Save() Standard_OVERRIDE {
|
virtual void Save() Standard_OVERRIDE {
|
||||||
/* every change is automatically saved */
|
/* every change is automatically saved */
|
||||||
@ -219,6 +214,9 @@ GEOMGUI_TextTreeWdg::GEOMGUI_TextTreeWdg( SalomeApp_Application* app )
|
|||||||
this, SLOT( updateDimensionBranch( const QString& ) ) );
|
this, SLOT( updateDimensionBranch( const QString& ) ) );
|
||||||
connect( aGeomGUI, SIGNAL( SignalAnnotationsUpdated( const QString& ) ),
|
connect( aGeomGUI, SIGNAL( SignalAnnotationsUpdated( const QString& ) ),
|
||||||
this, SLOT( updateAnnotationBranch( const QString& ) ) );
|
this, SLOT( updateAnnotationBranch( const QString& ) ) );
|
||||||
|
connect( aGeomGUI, SIGNAL( SignalTextTreeRenameObject( const QString& ) ),
|
||||||
|
this, SLOT( updateObjectName( const QString& ) ) );
|
||||||
|
|
||||||
connect( this, SIGNAL( itemClicked( QTreeWidgetItem*, int) ),
|
connect( this, SIGNAL( itemClicked( QTreeWidgetItem*, int) ),
|
||||||
this, SLOT( onItemClicked( QTreeWidgetItem*, int ) ) );
|
this, SLOT( onItemClicked( QTreeWidgetItem*, int ) ) );
|
||||||
connect( myStudy, SIGNAL( objVisibilityChanged( QString, Qtx::VisibilityState ) ),
|
connect( myStudy, SIGNAL( objVisibilityChanged( QString, Qtx::VisibilityState ) ),
|
||||||
@ -251,7 +249,8 @@ void GEOMGUI_TextTreeWdg::createActions()
|
|||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : updateTree
|
// function : updateTree
|
||||||
// purpose :
|
// purpose : Rebuild branches of objects and remove objects if there are no more annotations
|
||||||
|
// for it
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GEOMGUI_TextTreeWdg::updateTree()
|
void GEOMGUI_TextTreeWdg::updateTree()
|
||||||
{
|
{
|
||||||
@ -288,7 +287,7 @@ void GEOMGUI_TextTreeWdg::updateTree()
|
|||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : updateBranches
|
// function : updateBranches
|
||||||
// purpose :
|
// purpose : Rebuild branches for object of the given entry
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GEOMGUI_TextTreeWdg::updateBranches( const QString& theEntry )
|
void GEOMGUI_TextTreeWdg::updateBranches( const QString& theEntry )
|
||||||
{
|
{
|
||||||
@ -298,7 +297,7 @@ void GEOMGUI_TextTreeWdg::updateBranches( const QString& theEntry )
|
|||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : updateDimensionBranch
|
// function : updateDimensionBranch
|
||||||
// purpose :
|
// purpose : Rebuild branch of dimension type for object of the given entry
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GEOMGUI_TextTreeWdg::updateDimensionBranch( const QString& theEntry )
|
void GEOMGUI_TextTreeWdg::updateDimensionBranch( const QString& theEntry )
|
||||||
{
|
{
|
||||||
@ -307,13 +306,43 @@ void GEOMGUI_TextTreeWdg::updateDimensionBranch( const QString& theEntry )
|
|||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : updateAnnotationBranch
|
// function : updateAnnotationBranch
|
||||||
// purpose :
|
// purpose : Rebuild branch of annotation type for object of the given entry
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GEOMGUI_TextTreeWdg::updateAnnotationBranch( const QString& theEntry )
|
void GEOMGUI_TextTreeWdg::updateAnnotationBranch( const QString& theEntry )
|
||||||
{
|
{
|
||||||
fillBranch( AnnotationShape, theEntry );
|
fillBranch( AnnotationShape, theEntry );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : updateObjectName
|
||||||
|
// purpose : Find name of the given object and set the name for corresponded tree item
|
||||||
|
//=================================================================================
|
||||||
|
void GEOMGUI_TextTreeWdg::updateObjectName( const QString& theEntry )
|
||||||
|
{
|
||||||
|
QTreeWidgetItem* anObjectItem;
|
||||||
|
|
||||||
|
QHash<QString, QTreeWidgetItem*> anObjects = getObjects( DimensionShape );
|
||||||
|
if ( anObjects.contains( theEntry ) )
|
||||||
|
anObjectItem = anObjects.value( theEntry );
|
||||||
|
else {
|
||||||
|
anObjects = getObjects( AnnotationShape );
|
||||||
|
if ( anObjects.contains( theEntry ) )
|
||||||
|
anObjectItem = anObjects.value( theEntry );
|
||||||
|
}
|
||||||
|
if ( !anObjectItem )
|
||||||
|
return;
|
||||||
|
|
||||||
|
myStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
|
||||||
|
if ( myStudy ) {
|
||||||
|
_PTR(Study) aStudyDS = myStudy->studyDS();
|
||||||
|
if ( aStudyDS ) {
|
||||||
|
_PTR(SObject) anObject( aStudyDS->FindObjectID( theEntry.toStdString() ) );
|
||||||
|
if ( anObject.get() )
|
||||||
|
anObjectItem->setText( 0, anObject->GetName().c_str() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : fillBranch
|
// function : fillBranch
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -324,7 +353,6 @@ void GEOMGUI_TextTreeWdg::fillBranch( const BranchType& theBranchType, const QSt
|
|||||||
|
|
||||||
if ( myStudy && !theEntry.isEmpty() ) {
|
if ( myStudy && !theEntry.isEmpty() ) {
|
||||||
QSharedPointer<VisualProperty> aProp = getVisualProperty( theBranchType, myStudy, theEntry.toStdString() );
|
QSharedPointer<VisualProperty> aProp = getVisualProperty( theBranchType, myStudy, theEntry.toStdString() );
|
||||||
const std::string anEntry = theEntry.toStdString();
|
|
||||||
if ( !aProp ) {
|
if ( !aProp ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -452,7 +480,7 @@ int GEOMGUI_TextTreeWdg::idFromItem( QTreeWidgetItem* theItem )
|
|||||||
// function : entryFromItem
|
// function : entryFromItem
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
QString GEOMGUI_TextTreeWdg::entryFromItem( QTreeWidgetItem* theShapeItem )
|
QString GEOMGUI_TextTreeWdg::entryFromItem( QTreeWidgetItem* theShapeItem ) const
|
||||||
{
|
{
|
||||||
if ( !theShapeItem )
|
if ( !theShapeItem )
|
||||||
return "";
|
return "";
|
||||||
@ -549,8 +577,25 @@ void GEOMGUI_TextTreeWdg::showContextMenu( const QPoint& pos )
|
|||||||
aMenu.addAction( myActions[GEOMOp::OpShow] );
|
aMenu.addAction( myActions[GEOMOp::OpShow] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aMenu.addAction( aModule->action(GEOMOp::OpShowAllAnnotations) );
|
|
||||||
aMenu.addAction( aModule->action(GEOMOp::OpHideAllAnnotations) );
|
if (selectedItems().isEmpty() && currentItem()) {
|
||||||
|
QTreeWidgetItem* anItem = currentItem();
|
||||||
|
bool aShowAll = false;
|
||||||
|
if (anItem == getPropertyRootItem(AnnotationShape))
|
||||||
|
aShowAll = true;
|
||||||
|
else {
|
||||||
|
QHash<QString, QTreeWidgetItem*> anObjects = getObjects( AnnotationShape );
|
||||||
|
QHash<QString, QTreeWidgetItem*>::const_iterator anIt = anObjects.begin(),
|
||||||
|
aLast = anObjects.end();
|
||||||
|
for (; anIt != aLast && !aShowAll; anIt++) {
|
||||||
|
aShowAll = anIt.value() == anItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (aShowAll) {
|
||||||
|
aMenu.addAction( aModule->action(GEOMOp::OpShowAllAnnotations) );
|
||||||
|
aMenu.addAction( aModule->action(GEOMOp::OpHideAllAnnotations) );
|
||||||
|
}
|
||||||
|
}
|
||||||
QAction* selPopupItem = aMenu.exec( viewport()->mapToGlobal(pos) );
|
QAction* selPopupItem = aMenu.exec( viewport()->mapToGlobal(pos) );
|
||||||
|
|
||||||
if ( selPopupItem == myActions[GEOMOp::OpShow] ||
|
if ( selPopupItem == myActions[GEOMOp::OpShow] ||
|
||||||
@ -640,7 +685,7 @@ void GEOMGUI_TextTreeWdg::setShapeItemVisibility( const BranchType& theBranchTyp
|
|||||||
// function : setShapeItemVisibility
|
// function : setShapeItemVisibility
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GEOMGUI_TextTreeWdg::updateVisibility( SALOME_View* theView )
|
void GEOMGUI_TextTreeWdg::updateVisibility()
|
||||||
{
|
{
|
||||||
//QList<QString> aDimensionObjEntries = getObjects( DimensionShape ).keys();
|
//QList<QString> aDimensionObjEntries = getObjects( DimensionShape ).keys();
|
||||||
BranchType aBranchType = AnnotationShape;
|
BranchType aBranchType = AnnotationShape;
|
||||||
@ -736,6 +781,28 @@ QList<QString> GEOMGUI_TextTreeWdg::getAllEntries( const BranchType& theBranchTy
|
|||||||
return getObjects( theBranchType ).keys();
|
return getObjects( theBranchType ).keys();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=================================================================================
|
||||||
|
// function : getSingleSelectedObject
|
||||||
|
// purpose :
|
||||||
|
//=================================================================================
|
||||||
|
QString GEOMGUI_TextTreeWdg::getSingleSelectedObject()
|
||||||
|
{
|
||||||
|
QString anEntry;
|
||||||
|
QTreeWidgetItem* anItem = currentItem();
|
||||||
|
if (anItem) {
|
||||||
|
QHash<QString, QTreeWidgetItem*> anObjects = getObjects( AnnotationShape );
|
||||||
|
QHash<QString, QTreeWidgetItem*>::const_iterator anIt = anObjects.begin(),
|
||||||
|
aLast = anObjects.end();
|
||||||
|
for (; anIt != aLast; anIt++) {
|
||||||
|
if ( anIt.value() == anItem ) {
|
||||||
|
anEntry = anIt.key();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return anEntry;
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : setShapeItemVisibility
|
// function : setShapeItemVisibility
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -807,4 +874,3 @@ GEOMGUI_TextTreeWdg::BranchType GEOMGUI_TextTreeWdg::branchTypeFromItem( QTreeWi
|
|||||||
|
|
||||||
return aBranchType;
|
return aBranchType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
void removeBranch( const BranchType& theBranchType, const QString& theEntry,
|
void removeBranch( const BranchType& theBranchType, const QString& theEntry,
|
||||||
bool force = true );
|
bool force = true );
|
||||||
int idFromItem( QTreeWidgetItem* theItem );
|
int idFromItem( QTreeWidgetItem* theItem );
|
||||||
QString entryFromItem( QTreeWidgetItem* theShapeItem );
|
QString entryFromItem( QTreeWidgetItem* theShapeItem ) const;
|
||||||
QTreeWidgetItem* itemFromEntry( const BranchType& theBranchType, QString theEntry );
|
QTreeWidgetItem* itemFromEntry( const BranchType& theBranchType, QString theEntry );
|
||||||
void setAllShapeItemsVisibility( const BranchType& theBranchType,
|
void setAllShapeItemsVisibility( const BranchType& theBranchType,
|
||||||
const QString& theEntry,
|
const QString& theEntry,
|
||||||
@ -68,13 +68,15 @@ public:
|
|||||||
const QString& theEntry,
|
const QString& theEntry,
|
||||||
QTreeWidgetItem* theWidgetItem,
|
QTreeWidgetItem* theWidgetItem,
|
||||||
const bool theVisibility );
|
const bool theVisibility );
|
||||||
void updateVisibility( SALOME_View* theView );
|
void updateVisibility();
|
||||||
|
|
||||||
void getSelected( QMap<QString, QList<int> >& theAnnotations );
|
void getSelected( QMap<QString, QList<int> >& theAnnotations );
|
||||||
void setSelected( const QMap<QString, QList<int> >& theAnnotations );
|
void setSelected( const QMap<QString, QList<int> >& theAnnotations );
|
||||||
|
|
||||||
QList<QString> getAllEntries( const BranchType& theBranchType );
|
QList<QString> getAllEntries( const BranchType& theBranchType );
|
||||||
|
|
||||||
|
QString getSingleSelectedObject();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void createActions();
|
void createActions();
|
||||||
void redisplay( QString theEntry );
|
void redisplay( QString theEntry );
|
||||||
@ -84,6 +86,7 @@ public slots:
|
|||||||
void updateBranches( const QString& theEntry );
|
void updateBranches( const QString& theEntry );
|
||||||
void updateDimensionBranch( const QString& theEntry );
|
void updateDimensionBranch( const QString& theEntry );
|
||||||
void updateAnnotationBranch( const QString& theEntry );
|
void updateAnnotationBranch( const QString& theEntry );
|
||||||
|
void updateObjectName( const QString& theEntry );
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onUpdateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState );
|
void onUpdateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState );
|
||||||
|
@ -3534,6 +3534,7 @@ bool GeometryGUI::renameObject( const QString& entry, const QString& name)
|
|||||||
if (!CORBA::is_nil(anObj)) {
|
if (!CORBA::is_nil(anObj)) {
|
||||||
anObj->SetName( name.toLatin1().data() ); // Rename the corresponding GEOM_Object
|
anObj->SetName( name.toLatin1().data() ); // Rename the corresponding GEOM_Object
|
||||||
emit SignalDependencyTreeRenameObject( anObj->GetEntry() );
|
emit SignalDependencyTreeRenameObject( anObj->GetEntry() );
|
||||||
|
emit SignalTextTreeRenameObject( entry );
|
||||||
}
|
}
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
|
@ -186,6 +186,7 @@ signals :
|
|||||||
void SignalDefaultStepValueChanged( double newVal );
|
void SignalDefaultStepValueChanged( double newVal );
|
||||||
void SignalDependencyTreeParamChanged( const QString&, const QString& );
|
void SignalDependencyTreeParamChanged( const QString&, const QString& );
|
||||||
void SignalDependencyTreeRenameObject( const QString& );
|
void SignalDependencyTreeRenameObject( const QString& );
|
||||||
|
void SignalTextTreeRenameObject( const QString& );
|
||||||
void SignalAnnotationsUpdated( const QString& );
|
void SignalAnnotationsUpdated( const QString& );
|
||||||
void DimensionsUpdated( const QString& );
|
void DimensionsUpdated( const QString& );
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include <GeometryGUI.h>
|
#include <GeometryGUI.h>
|
||||||
#include "GeometryGUI_Operations.h"
|
#include "GeometryGUI_Operations.h"
|
||||||
|
#include <GEOMGUI_TextTreeWdg.h>
|
||||||
|
|
||||||
#include <GEOMGUI_DimensionProperty.h>
|
#include <GEOMGUI_DimensionProperty.h>
|
||||||
#include <GEOMGUI_AnnotationAttrs.h>
|
#include <GEOMGUI_AnnotationAttrs.h>
|
||||||
@ -230,11 +231,17 @@ void MeasureGUI::ChangeAnnotationsVisibility( const bool theIsVisible )
|
|||||||
if ( !anActiveStudy )
|
if ( !anActiveStudy )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
QString anEntry;
|
||||||
Handle(SALOME_InteractiveObject) anIObject = getSingleSelectedIO();
|
Handle(SALOME_InteractiveObject) anIObject = getSingleSelectedIO();
|
||||||
if ( !anIObject.IsNull() && anIObject->hasEntry() ) {
|
if ( !anIObject.IsNull() && anIObject->hasEntry() ) {
|
||||||
const QString aEntry = anIObject->getEntry();
|
anEntry = anIObject->getEntry();
|
||||||
|
}
|
||||||
|
if ( anEntry.isEmpty() ) {
|
||||||
|
anEntry = getGeometryGUI()->GetTextTreeWdg()->getSingleSelectedObject();
|
||||||
|
}
|
||||||
|
|
||||||
_PTR(SObject) aSObj = anActiveStudy->studyDS()->FindObjectID( aEntry.toStdString() );
|
if ( !anEntry.isEmpty() ) {
|
||||||
|
_PTR(SObject) aSObj = anActiveStudy->studyDS()->FindObjectID( anEntry.toStdString() );
|
||||||
|
|
||||||
const Handle(GEOMGUI_AnnotationAttrs)
|
const Handle(GEOMGUI_AnnotationAttrs)
|
||||||
aShapeAnnotations = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj );
|
aShapeAnnotations = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj );
|
||||||
@ -252,14 +259,14 @@ void MeasureGUI::ChangeAnnotationsVisibility( const bool theIsVisible )
|
|||||||
for ( int anI = 0; anI < aCount; ++anI ) {
|
for ( int anI = 0; anI < aCount; ++anI ) {
|
||||||
|
|
||||||
if ( !theIsVisible ) {
|
if ( !theIsVisible ) {
|
||||||
getGeometryGUI()->GetAnnotationMgr()->Erase( aEntry, anI );
|
getGeometryGUI()->GetAnnotationMgr()->Erase( anEntry, anI );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
getGeometryGUI()->GetAnnotationMgr()->Display( aEntry , anI );
|
getGeometryGUI()->GetAnnotationMgr()->Display( anEntry , anI );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getGeometryGUI()->emitAnnotationsUpdated( aEntry );
|
getGeometryGUI()->emitAnnotationsUpdated( anEntry );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -269,6 +276,7 @@ void MeasureGUI::ChangeAnnotationsVisibility( const bool theIsVisible )
|
|||||||
else {
|
else {
|
||||||
getGeometryGUI()->GetAnnotationMgr()->EraseAllAnnotations();
|
getGeometryGUI()->GetAnnotationMgr()->EraseAllAnnotations();
|
||||||
}
|
}
|
||||||
|
getGeometryGUI()->GetTextTreeWdg()->updateVisibility();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,7 +610,6 @@ void MeasureGUI_AnnotationDlg::onTextChange()
|
|||||||
myAnnotationProperties.Text = myTextEdit->text();
|
myAnnotationProperties.Text = myTextEdit->text();
|
||||||
if ( !myShapeNameModified )
|
if ( !myShapeNameModified )
|
||||||
myShapeNameModified = true;
|
myShapeNameModified = true;
|
||||||
|
|
||||||
redisplayPreview();
|
redisplayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -792,6 +791,7 @@ bool MeasureGUI_AnnotationDlg::execute()
|
|||||||
else {
|
else {
|
||||||
|
|
||||||
aShapeAnnotations->SetProperties( myEditAnnotationIndex, myAnnotationProperties );
|
aShapeAnnotations->SetProperties( myEditAnnotationIndex, myAnnotationProperties );
|
||||||
|
myGeomGUI->emitAnnotationsUpdated( QString( myShape->GetStudyEntry() ) );
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user