{
}
+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();
public:
DEFINE_STANDARD_RTTI(HYDROData_Object);
+ /**
+ * Updates the name of this object.
+ * Reimplemented to update the names child groups.
+ */
+ HYDRODATA_EXPORT virtual void SetName( const QString& theName );
+
/**
* Update the geometry object.
* Call this method whenever you made changes for object data.