#include "HYDROData_Bathymetry.h"
#include "HYDROData_DummyObject3D.h"
-#include "HYDROData_EdgesGroup.h"
+#include "HYDROData_ShapesGroup.h"
#include "HYDROData_Iterator.h"
#include <TNaming_Builder.hxx>
{
}
+void HYDROData_Object::SetName( const QString& theName )
+{
+ QString anOldObjName = GetName();
+ if ( anOldObjName != theName )
+ {
+ HYDROData_SequenceOfObjects aGroups = GetGroups();
+ HYDROData_SequenceOfObjects::Iterator anIter( aGroups );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_ShapesGroup) aGroup =
+ Handle(HYDROData_ShapesGroup)::DownCast( anIter.Value() );
+ if ( aGroup.IsNull() )
+ continue;
+
+ QString aGroupName = aGroup->GetName();
+ if ( anOldObjName.isEmpty() )
+ aGroupName.prepend( theName + "_" );
+ else if ( aGroupName.startsWith( anOldObjName ) )
+ aGroupName.replace( anOldObjName, theName );
+ else
+ continue;
+
+ aGroup->SetName( aGroupName );
+ }
+ }
+
+ HYDROData_Entity::SetName( theName );
+}
+
void HYDROData_Object::Update()
{
HYDROData_Entity::Update();
return DefaultBorderColor();
}
-Handle(HYDROData_EdgesGroup) HYDROData_Object::createGroupObject()
+Handle(HYDROData_ShapesGroup) HYDROData_Object::createGroupObject()
{
TDF_Label aNewLab = myLab.FindChild( DataTag_EdgesGroup ).NewChild();
- Handle(HYDROData_EdgesGroup) aNewGroup =
- Handle(HYDROData_EdgesGroup)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_EDGES_GROUP ) );
+ Handle(HYDROData_ShapesGroup) aNewGroup =
+ Handle(HYDROData_ShapesGroup)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_SHAPES_GROUP ) );
AddReferenceObject( aNewGroup, DataTag_EdgesGroup );
return aNewGroup;