{
QStringList aResList;
- Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( this );
+ Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
if ( aDocument.IsNull() )
return aResList;
return aResList;
}
+bool HYDROData_Zone::CanRemove()
+{
+ return false;
+}
+
+HYDROData_SequenceOfObjects HYDROData_Zone::GetAllReferenceObjects() const
+{
+ HYDROData_SequenceOfObjects aResSeq = HYDROData_Entity::GetAllReferenceObjects();
+
+ HYDROData_SequenceOfObjects aSeqOfGeomObjects = GetGeometryObjects();
+ aResSeq.Append( aSeqOfGeomObjects );
+
+ return aResSeq;
+}
+
void HYDROData_Zone::SetShape( const TopoDS_Shape& theShape )
{
TNaming_Builder aBuilder( myLab.FindChild( DataTag_Shape ) );
return TopoDS_Shape();
}
+bool HYDROData_Zone::IsMergingNeed() const
+{
+ Handle(HYDROData_Bathymetry) aRefBathymetry;
+
+ HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
+ HYDROData_SequenceOfObjects::Iterator aGeomObjsIter( aGeomObjects );
+ for ( ; aGeomObjsIter.More(); aGeomObjsIter.Next() )
+ {
+ Handle(HYDROData_Object) aRefGeomObj =
+ Handle(HYDROData_Object)::DownCast( aGeomObjsIter.Value() );
+ if ( aRefGeomObj.IsNull() )
+ continue;
+
+ Handle(HYDROData_Bathymetry) anObjBathymetry = aRefGeomObj->GetBathymetry();
+ if ( anObjBathymetry.IsNull() )
+ continue;
+
+ if ( aRefBathymetry.IsNull() )
+ {
+ aRefBathymetry = anObjBathymetry;
+ continue;
+ }
+
+ if ( !IsEqual( aRefBathymetry, anObjBathymetry ) )
+ return true;
+ }
+
+ return false;
+}
+
void HYDROData_Zone::SetMergeType( const MergeBathymetriesType& theType )
{
Handle(TDataStd_Integer) anInt;
- if ( !myLab.FindChild( DataTag_MergeType ).FindAttribute( TDataStd_Integer::GetID(), anInt ) )
- anInt = TDataStd_Integer::Set( myLab, 0 );
- anInt->Set( (int)theType );
+ if ( myLab.FindChild( DataTag_MergeType ).FindAttribute( TDataStd_Integer::GetID(), anInt ) )
+ {
+ anInt->Set( (int)theType );
+ }
+ else
+ {
+ anInt = TDataStd_Integer::Set( myLab.FindChild( DataTag_MergeType ), (int)theType );
+ }
}
HYDROData_Zone::MergeBathymetriesType HYDROData_Zone::GetMergeType() const
{
- MergeBathymetriesType aMergeType = Merge_ZMIN;
+ MergeBathymetriesType aMergeType = Merge_UNKNOWN;
Handle(TDataStd_Integer) anInt;
if ( myLab.FindChild( DataTag_MergeType ).FindAttribute( TDataStd_Integer::GetID(), anInt ) )