1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include <HYDROData_Entity.h>
20 #include <HYDROData_Document.h>
21 #include <HYDROData_Iterator.h>
22 #include <HYDROData_Tool.h>
23 #include <Standard_GUID.hxx>
24 #include <TDataStd_Name.hxx>
25 #include <TDataStd_ByteArray.hxx>
26 #include <TDataStd_UAttribute.hxx>
27 #include <TDataStd_Integer.hxx>
28 #include <TDataStd_IntegerArray.hxx>
29 #include <TDataStd_ReferenceList.hxx>
30 #include <TDF_CopyLabel.hxx>
31 #include <TDF_ListIteratorOfLabelList.hxx>
32 #include <TNaming_Builder.hxx>
33 #include <TNaming_NamedShape.hxx>
34 #include <TopoDS_Shape.hxx>
37 #include <QStringList>
41 #include "HYDRO_trace.hxx"
43 HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects()
44 : NCollection_Sequence<Handle_HYDROData_Entity>()
48 HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects( const HYDROData_SequenceOfObjects& theSequence )
49 : NCollection_Sequence<Handle_HYDROData_Entity>( theSequence )
53 HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects( const NCollection_Sequence<Handle_HYDROData_Entity>& theSequence )
54 : NCollection_Sequence<Handle_HYDROData_Entity>( theSequence )
58 IMPLEMENT_STANDARD_HANDLE(HYDROData_Entity,MMgt_TShared)
59 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Entity,MMgt_TShared)
61 // is equal function for unique object mapping
62 bool IsEqual(const Handle_HYDROData_Entity& theObj1, const Handle_HYDROData_Entity& theObj2)
64 if ( !theObj1.IsNull() && !theObj2.IsNull() )
65 return theObj1->Label() == theObj2->Label();
69 QString HYDROData_Entity::GetName() const
71 Handle(TDataStd_Name) aName;
72 if (myLab.FindAttribute(TDataStd_Name::GetID(), aName)) {
73 TCollection_AsciiString aStr(aName->Get());
74 return QString(aStr.ToCString());
79 QString HYDROData_Entity::GetObjPyName() const
81 QString aName = GetName();
82 aName.replace(QRegExp("[\\W]"), "_");
87 void HYDROData_Entity::SetName(const QString& theName)
89 TDataStd_Name::Set(myLab, TCollection_ExtendedString(theName.toLatin1().constData()));
92 QStringList HYDROData_Entity::DumpToPython( const QString& thePyScriptPath,
93 MapOfTreatedObjects& theTreatedObjects ) const
95 QStringList anEmptyList;
99 void HYDROData_Entity::Update()
104 void HYDROData_Entity::UpdateLocalCS( double theDx, double theDy )
106 //On the base level no actions are necessary
109 bool HYDROData_Entity::IsHas2dPrs() const
114 void HYDROData_Entity::Show()
119 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
120 if ( aDocument.IsNull() )
123 aDocument->Show( this );
126 QVariant HYDROData_Entity::GetDataVariant()
131 void HYDROData_Entity::ClearChanged()
133 TDataStd_Integer::Set( myLab.FindChild( DataTag_GeomChange ), 0 );
136 int HYDROData_Entity::GetGeomChangeFlag() const
138 int aGeomChangeFlag = 0;
139 Handle(TDataStd_Integer) aGeomChangeAttr;
140 TDF_Label aGeomChangeLab = myLab.FindChild( DataTag_GeomChange );
141 aGeomChangeLab.FindAttribute( TDataStd_Integer::GetID(), aGeomChangeAttr );
142 if ( !aGeomChangeAttr.IsNull() )
143 aGeomChangeFlag = aGeomChangeAttr->Get();
144 return aGeomChangeFlag;
147 void HYDROData_Entity::Changed( Geometry theChangedGeometry )
149 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
150 if( aDocument.IsNull() )
153 int aGeomChangeFlag = 0;
154 Handle(TDataStd_Integer) aGeomChangeAttr;
155 TDF_Label aGeomChangeLab = myLab.FindChild( DataTag_GeomChange );
156 aGeomChangeLab.FindAttribute( TDataStd_Integer::GetID(), aGeomChangeAttr );
157 if ( !aGeomChangeAttr.IsNull() )
158 aGeomChangeFlag = aGeomChangeAttr->Get();
160 int aBitsToChange = ( myGeom & theChangedGeometry );
161 if( aBitsToChange == 0 )
164 aGeomChangeFlag = ( aGeomChangeFlag | aBitsToChange );
165 TDataStd_Integer::Set( aGeomChangeLab, aGeomChangeFlag );
167 HYDROData_Iterator anIter( aDocument );
168 for ( ; anIter.More(); anIter.Next() )
170 Handle(HYDROData_Entity) anObject = anIter.Current();
171 if( anObject.IsNull() )
173 HYDROData_SequenceOfObjects aRefSeq = anObject->GetAllReferenceObjects();
174 for ( int i = 1, n = aRefSeq.Length(); i <= n; ++i )
176 Handle(HYDROData_Entity) aRefObject = aRefSeq.Value( i );
177 if( aRefObject->Label()==myLab )
178 anObject->Changed( theChangedGeometry );
183 bool HYDROData_Entity::IsMustBeUpdated( Geometry theGeom ) const
185 return ( ( GetGeomChangeFlag() & theGeom ) != 0 );
188 bool HYDROData_Entity::CanBeUpdated() const
193 bool HYDROData_Entity::IsRemoved() const
195 return !myLab.HasAttribute();
198 void HYDROData_Entity::Remove()
200 return myLab.ForgetAllAttributes( true );
203 bool HYDROData_Entity::CanRemove()
208 HYDROData_Entity::HYDROData_Entity( Geometry theGeom )
213 HYDROData_Entity::~HYDROData_Entity()
217 void HYDROData_Entity::CopyTo( const Handle(HYDROData_Entity)& theDestination,
218 bool isGenerateNewName ) const
220 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
221 if ( aDocument.IsNull() ) {
225 TDF_CopyLabel aCopy(myLab, theDestination->Label());
228 if( isGenerateNewName )
230 // generate a new unique name for the clone object:
231 // case 1: Image_1 -> Image_2
232 // case 2: ImageObj -> ImageObj_1
233 QString aName = theDestination->GetName();
234 QString aPrefix = aName;
235 if( aName.contains( '_' ) ) { // case 1
236 QString aSuffix = aName.section( '_', -1 );
237 bool anIsInteger = false;
238 aSuffix.toInt( &anIsInteger );
240 aPrefix = aName.section( '_', 0, -2 );
245 aName = HYDROData_Tool::GenerateObjectName( aDocument, aPrefix );
246 theDestination->SetName( aName );
250 Handle(HYDROData_Entity) HYDROData_Entity::GetFatherObject() const
252 Handle(HYDROData_Entity) aFather;
254 if ( !myLab.IsNull() )
256 TDF_Label aFatherLabel = myLab.Father();
258 while ( aFather.IsNull() && !aFatherLabel.IsNull() && !aFatherLabel.IsRoot() )
260 aFather = HYDROData_Iterator::Object( aFatherLabel );
261 aFatherLabel = aFatherLabel.Father();
268 HYDROData_SequenceOfObjects HYDROData_Entity::GetAllReferenceObjects() const
270 return HYDROData_SequenceOfObjects();
273 Standard_Boolean HYDROData_Entity::GetZLevel( Standard_Integer& theLevel ) const
277 TDF_Label aLabel = myLab.FindChild( DataTag_ZLevel, false );
278 if ( !aLabel.IsNull() )
280 Handle(TDataStd_Integer) anIntVal;
281 if ( aLabel.FindAttribute( TDataStd_Integer::GetID(), anIntVal ) )
283 theLevel = anIntVal->Get();
284 return Standard_True;
288 return Standard_False;
291 void HYDROData_Entity::SetZLevel( const Standard_Integer& theLevel )
293 TDataStd_Integer::Set( myLab.FindChild( DataTag_ZLevel ), theLevel );
296 void HYDROData_Entity::RemoveZLevel()
298 TDF_Label aLabel = myLab.FindChild( DataTag_ZLevel, false );
299 if ( !aLabel.IsNull() )
300 aLabel.ForgetAllAttributes();
303 void HYDROData_Entity::SetLabel( const TDF_Label& theLabel )
308 void HYDROData_Entity::SaveByteArray( const int theTag,
312 TDF_Label aLab = theTag == 0 ? myLab : myLab.FindChild(theTag);
313 // array is empty, remove the attribute
315 aLab.ForgetAttribute(TDataStd_ByteArray::GetID());
318 // store data of image in byte array
319 Handle(TDataStd_ByteArray) aData;
320 if (!aLab.FindAttribute(TDataStd_ByteArray::GetID(), aData)) {
321 aData = TDataStd_ByteArray::Set(aLab, 1, theLen);
323 // copy bytes one by one
324 if (aData->Length() != theLen) {
325 Handle(TColStd_HArray1OfByte) aNewData = new TColStd_HArray1OfByte(1, theLen);
326 for(int a = 0; a < theLen; a++)
327 aNewData->SetValue(a + 1, theData[a]);
328 aData->ChangeArray(aNewData);
330 for(int a = 0; a < theLen; a++)
331 aData->SetValue(a + 1, theData[a]);
335 const char* HYDROData_Entity::ByteArray(const int theTag, int& theLen) const
337 TDF_Label aLab = theTag == 0 ? myLab : myLab.FindChild(theTag);
338 Handle(TDataStd_ByteArray) aData;
339 if (!aLab.FindAttribute(TDataStd_ByteArray::GetID(), aData))
340 return NULL; // return empty image if there is no array
341 theLen = aData->Length();
343 return (const char*)(&(aData->InternalArray()->ChangeArray1().ChangeValue(1)));
347 int HYDROData_Entity::NbReferenceObjects( const int theTag ) const
349 Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false );
350 return aRefs.IsNull() ? 0 : aRefs->Extent();
353 bool HYDROData_Entity::HasReference( const Handle_HYDROData_Entity& theObj,
354 const int theTag ) const
356 if ( theObj.IsNull() )
359 Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false );
360 if ( aRefs.IsNull() || aRefs->IsEmpty() )
363 TDF_ListIteratorOfLabelList aListIt( aRefs->List() );
364 for ( ; aListIt.More(); aListIt.Next() )
366 const TDF_Label& aRefLabel = aListIt.Value();
367 if ( theObj->Label() == aRefLabel )
374 void HYDROData_Entity::AddReferenceObject( const Handle_HYDROData_Entity& theObj,
377 if ( theObj.IsNull() )
380 Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, true );
381 aRefs->Append( theObj->Label() );
384 void HYDROData_Entity::SetReferenceObject( const Handle_HYDROData_Entity& theObj,
388 if ( theObj.IsNull() )
390 RemoveReferenceObject( theTag, theIndex );
394 Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, true );
396 if ( theIndex >= aRefs->Extent() )
398 aRefs->Append( theObj->Label() );
400 else if ( theIndex < 0 )
402 aRefs->Prepend( theObj->Label() );
406 RemoveReferenceObject( theTag, theIndex );
408 Handle(HYDROData_Entity) aBeforeObj = GetReferenceObject( theTag, theIndex );
410 aRefs = getReferenceList( theTag, true ); // because reference list can be removed
411 if ( !aBeforeObj.IsNull() )
412 aRefs->InsertBefore( theObj->Label(), aBeforeObj->Label() );
414 aRefs->Append( theObj->Label() );
418 void HYDROData_Entity::InsertReferenceObject( const Handle_HYDROData_Entity& theObj,
420 const int theBeforeIndex )
422 if ( theObj.IsNull() )
425 Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, true );
427 if ( theBeforeIndex >= aRefs->Extent() )
429 aRefs->Append( theObj->Label() );
431 else if ( theBeforeIndex < 0 )
433 aRefs->Prepend( theObj->Label() );
437 Handle(HYDROData_Entity) aBeforeObj = GetReferenceObject( theTag, theBeforeIndex );
438 if ( !aBeforeObj.IsNull() )
439 aRefs->InsertBefore( theObj->Label(), aBeforeObj->Label() );
441 aRefs->Append( theObj->Label() );
445 void HYDROData_Entity::SetReferenceObjects( const HYDROData_SequenceOfObjects& theObjects,
448 ClearReferenceObjects( theTag );
449 if ( theObjects.IsEmpty() )
452 HYDROData_SequenceOfObjects::Iterator anIter( theObjects );
453 for ( ; anIter.More(); anIter.Next() )
454 AddReferenceObject( anIter.Value(), theTag );
457 Handle(HYDROData_Entity) HYDROData_Entity::GetReferenceObject( const int theTag,
458 const int theIndex ) const
460 Handle(HYDROData_Entity) aRes;
462 Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false );
463 if ( aRefs.IsNull() || theIndex < 0 || theIndex >= aRefs->Extent() )
466 TDF_ListIteratorOfLabelList anIter( aRefs->List() );
467 for ( int anIndex = 0; anIndex != theIndex && anIter.More(); anIter.Next(), ++anIndex );
469 const TDF_Label& aRefLabel = anIter.Value();
470 aRes = HYDROData_Iterator::Object( aRefLabel );
475 HYDROData_SequenceOfObjects HYDROData_Entity::GetReferenceObjects( const int theTag ) const
477 HYDROData_SequenceOfObjects aRes;
479 Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false );
480 if ( aRefs.IsNull() )
483 TDF_ListIteratorOfLabelList anIter( aRefs->List() );
484 for ( ; anIter.More(); anIter.Next() )
486 const TDF_Label& aRefLabel = anIter.Value();
488 Handle(HYDROData_Entity) aRefObject = HYDROData_Iterator::Object( aRefLabel );
489 if ( aRefObject.IsNull() )
492 aRes.Append( aRefObject );
498 void HYDROData_Entity::RemoveReferenceObject( const TDF_Label& theRefLabel,
501 Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false );
502 if ( aRefs.IsNull() )
505 if ( aRefs->Extent() == 1 )
507 // remove all if only one
508 ClearReferenceObjects( theTag );
512 aRefs->Remove( theRefLabel );
515 void HYDROData_Entity::RemoveReferenceObject( const int theTag,
518 Handle(TDataStd_ReferenceList) aRefs = getReferenceList( theTag, false );
519 if ( aRefs.IsNull() )
522 if ( aRefs->Extent() == 1 && theIndex == 0 )
524 // remove all if only one
525 ClearReferenceObjects( theTag );
530 TDF_ListIteratorOfLabelList anIter( aRefs->List() );
531 for ( ; anIndex != theIndex && anIter.More(); anIter.Next(), ++anIndex );
533 if ( anIndex != theIndex || !anIter.More() )
536 const TDF_Label& aRefLabel = anIter.Value();
537 aRefs->Remove( aRefLabel );
540 void HYDROData_Entity::ClearReferenceObjects( const int theTag )
542 TDF_Label aSetLabel = theTag == 0 ? myLab : myLab.FindChild( theTag );
543 aSetLabel.ForgetAttribute( TDataStd_ReferenceList::GetID() );
546 Handle(TDataStd_ReferenceList) HYDROData_Entity::getReferenceList( const int theTag,
547 const bool theIsCreate ) const
549 TDF_Label aLabel = theTag == 0 ? myLab : myLab.FindChild( theTag );
551 Handle(TDataStd_ReferenceList) aRefs;
552 if ( !aLabel.FindAttribute( TDataStd_ReferenceList::GetID(), aRefs ) && theIsCreate )
553 aRefs = TDataStd_ReferenceList::Set( aLabel );
558 void HYDROData_Entity::SetColor( const QColor& theColor,
561 TDF_Label aLabel = theTag == 0 ? myLab : myLab.FindChild( theTag );
563 Handle(TDataStd_IntegerArray) aColorArray;
564 if ( !aLabel.FindAttribute( TDataStd_IntegerArray::GetID(), aColorArray ) )
565 aColorArray = TDataStd_IntegerArray::Set( aLabel, 1, 4 );
567 aColorArray->SetValue( 1, theColor.red() );
568 aColorArray->SetValue( 2, theColor.green() );
569 aColorArray->SetValue( 3, theColor.blue() );
570 aColorArray->SetValue( 4, theColor.alpha() );
573 QColor HYDROData_Entity::GetColor( const QColor& theDefColor,
574 const int theTag ) const
576 QColor aResColor = theDefColor;
578 TDF_Label aLabel = theTag == 0 ? myLab : myLab.FindChild( theTag );
580 Handle(TDataStd_IntegerArray) aColorArray;
581 if ( aLabel.FindAttribute( TDataStd_IntegerArray::GetID(), aColorArray ) )
583 aResColor.setRed( aColorArray->Value( 1 ) );
584 aResColor.setGreen( aColorArray->Value( 2 ) );
585 aResColor.setBlue( aColorArray->Value( 3 ) );
586 aResColor.setAlpha( aColorArray->Value( 4 ) );
592 QStringList HYDROData_Entity::dumpObjectCreation( MapOfTreatedObjects& theTreatedObjects ) const
594 QStringList aResList;
596 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
597 if ( aDocument.IsNull() )
600 QString aDocName = aDocument->GetDocPyName();
601 QString aName = GetObjPyName();
603 aResList << QString( "%1 = %2.CreateObject( %3 );" )
604 .arg( aName ).arg( aDocName ).arg( getPyTypeID() );
605 aResList << QString( "%1.SetName( \"%2\" );" )
606 .arg( aName ).arg( GetName() );
607 aResList << QString( "" );
611 // Dump object z-level in viewer
612 Standard_Integer anObjZLevel = -1;
613 if ( GetZLevel( anObjZLevel ) )
615 aResList << QString( "%1.SetZLevel( %2 );" )
616 .arg( aName ).arg( anObjZLevel );
617 aResList << QString( "" );
624 QString HYDROData_Entity::getPyTypeID() const
626 DEBTRACE("HYDROData_Entity::getPyTypeID " << GetKind());
629 case KIND_IMAGE: return "KIND_IMAGE";
630 case KIND_POLYLINE: return "KIND_POLYLINE";
631 case KIND_BATHYMETRY: return "KIND_BATHYMETRY";
632 case KIND_ALTITUDE: return "KIND_ALTITUDE";
633 case KIND_IMMERSIBLE_ZONE: return "KIND_IMMERSIBLE_ZONE";
634 case KIND_RIVER: return "KIND_RIVER";
635 case KIND_STREAM: return "KIND_STREAM";
636 case KIND_CONFLUENCE: return "KIND_CONFLUENCE";
637 case KIND_CHANNEL: return "KIND_CHANNEL";
638 case KIND_OBSTACLE: return "KIND_OBSTACLE";
639 case KIND_DIGUE: return "KIND_DIGUE";
640 case KIND_PROFILE: return "KIND_PROFILE";
641 case KIND_PROFILEUZ: return "KIND_PROFILEUZ";
642 case KIND_POLYLINEXY: return "KIND_POLYLINEXY";
643 case KIND_CALCULATION: return "KIND_CALCULATION";
644 case KIND_ZONE: return "KIND_ZONE";
645 case KIND_REGION: return "KIND_REGION";
646 case KIND_VISUAL_STATE: return "KIND_VISUAL_STATE";
647 case KIND_ARTIFICIAL_OBJECT: return "KIND_ARTIFICIAL_OBJECT";
648 case KIND_NATURAL_OBJECT: return "KIND_NATURAL_OBJECT";
649 case KIND_DUMMY_3D: return "KIND_DUMMY_3D";
650 case KIND_SHAPES_GROUP: return "KIND_SHAPES_GROUP";
651 case KIND_SPLIT_GROUP: return "KIND_SPLIT_GROUP";
652 case KIND_STREAM_ALTITUDE: return "KIND_STREAM_ALTITUDE";
653 case KIND_OBSTACLE_ALTITUDE: return "KIND_OBSTACLE_ALTITUDE";
654 case KIND_STRICKLER_TABLE: return "KIND_STRICKLER_TABLE";
655 case KIND_LAND_COVER_OBSOLETE: return "";
656 case KIND_CHANNEL_ALTITUDE: return "KIND_CHANNEL_ALTITUDE";
657 case KIND_LAND_COVER_MAP: return "KIND_LAND_COVER_MAP";
658 default: return "KIND_UNKNOWN"; ///! Unrecognized object
662 void HYDROData_Entity::setPythonReferenceObject( const QString& thePyScriptPath,
663 MapOfTreatedObjects& theTreatedObjects,
664 QStringList& theScript,
665 const Handle(HYDROData_Entity)& theRefObject,
666 const QString& theMethod ) const
668 if ( !checkObjectPythonDefinition( thePyScriptPath, theTreatedObjects, theScript, theRefObject ) )
671 QString aRefObjName = theRefObject->GetObjPyName();
673 QString anObjName = GetObjPyName();
674 theScript << QString( "%1.%2( %3 );" )
675 .arg( anObjName ).arg( theMethod ).arg( aRefObjName );
678 bool HYDROData_Entity::checkObjectPythonDefinition( const QString& thePyScriptPath,
679 MapOfTreatedObjects& theTreatedObjects,
680 QStringList& theScript,
681 const Handle(HYDROData_Entity)& theRefObject ) const
683 if ( theRefObject.IsNull() )
686 QString aRefObjName = theRefObject->GetName();
687 if ( aRefObjName.isEmpty() )
690 if ( theTreatedObjects.contains( aRefObjName ) )
693 // The definition of reference object must be dumped before this
694 QStringList aRefObjDump = theRefObject->DumpToPython( thePyScriptPath, theTreatedObjects );
695 if ( aRefObjDump.isEmpty() )
698 QStringList aTmpList = theScript;
699 theScript = aRefObjDump;
701 theScript << QString( "" );
702 theScript << aTmpList;
704 theTreatedObjects.insert( aRefObjName, theRefObject );
709 void HYDROData_Entity::setPythonObjectColor( QStringList& theScript,
710 const QColor& theColor,
711 const QColor& theDefaultColor,
712 const QString& theMethod ) const
714 if ( theColor == theDefaultColor )
715 return; //Do not set the color for object if it like default
717 QString anObjName = GetObjPyName();
718 theScript << QString( "%1.%2( QColor( %3, %4, %5, %6 ) );" )
719 .arg( anObjName ).arg( theMethod )
720 .arg( theColor.red() ).arg( theColor.green() )
721 .arg( theColor.blue() ).arg( theColor.alpha() );
724 void HYDROData_Entity::findPythonReferenceObject( MapOfTreatedObjects& theTreatedObjects,
725 QStringList& theScript ) const
727 Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
728 if ( aDocument.IsNull() )
731 theScript << QString( "%1 = %2.FindObjectByName( \"%3\" );" ).arg( GetObjPyName() )
732 .arg( aDocument->GetDocPyName() )
736 void HYDROData_Entity::SetShape( int theTag, const TopoDS_Shape& theShape )
738 TNaming_Builder aBuilder( myLab.FindChild( theTag ) );
739 aBuilder.Generated( theShape );
742 TopoDS_Shape HYDROData_Entity::GetShape( int theTag ) const
744 TDF_Label aShapeLabel = myLab.FindChild( theTag, false );
745 if ( !aShapeLabel.IsNull() )
747 Handle(TNaming_NamedShape) aNamedShape;
748 if ( aShapeLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
749 return aNamedShape->Get();
751 return TopoDS_Shape();