#include "HYDROGUI_Tool.h"
#include "HYDROGUI_UpdateFlags.h"
-#include <HYDROData_Document.h>
-
#include <GraphicsView_ViewManager.h>
#include <GraphicsView_ViewPort.h>
#include <GraphicsView_Viewer.h>
if( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anImageName ) )
{
// check that there are no other objects with the same name in the document
- Handle(HYDROData_Object) anObject = findObjectByName( anImageName, KIND_UNKNOWN );
+ Handle(HYDROData_Object) anObject = HYDROGUI_Tool::FindObjectByName( module(), anImageName );
if( !anObject.IsNull() )
{
theErrorMsg = tr( "OBJECT_EXISTS_IN_DOCUMENT" ).arg( anImageName );
anImageName = myEditedObject->GetName();
}
else
- {
- int anImageId = 1;
- while( anImageId < 100 )
- {
- anImageName = QString( "Image_%1" ).arg( QString::number( anImageId++ ) );
-
- // check that there are no other objects with the same name in the document
- Handle(HYDROData_Object) anObject = findObjectByName( anImageName, KIND_UNKNOWN );
- if( anObject.IsNull() )
- break;
- }
- }
+ anImageName = HYDROGUI_Tool::GenerateObjectName( module(), "Image" );
aPanel->setImageName( anImageName );
aPanel->initializePointSelection();