X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Zone.cxx;h=6f247eddc32f07a68190252993d20c8f155effff;hb=d398a8be8e0b0259b476b358d53d234ce4c82379;hp=c6e3da1af9650fb148aa9bdd0946e87c38a3cd7d;hpb=f7598de0de5abad3f557c8b2c52d0e0163a0951c;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Zone.cxx b/src/HYDROData/HYDROData_Zone.cxx index c6e3da1a..6f247edd 100644 --- a/src/HYDROData/HYDROData_Zone.cxx +++ b/src/HYDROData/HYDROData_Zone.cxx @@ -22,23 +22,19 @@ #include "HYDROData_IAltitudeObject.h" #include "HYDROData_Document.h" #include "HYDROData_NaturalObject.h" -#include "HYDROData_LandCover.h" - -#include -#include - -#include - #include - #include +#include + +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" IMPLEMENT_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Zone, HYDROData_Entity) HYDROData_Zone::HYDROData_Zone() -: HYDROData_Entity() +: HYDROData_Entity( Geom_2d ) { myInterpolator = NULL; } @@ -74,21 +70,12 @@ HYDROData_SequenceOfObjects HYDROData_Zone::GetAllReferenceObjects() const void HYDROData_Zone::SetShape( const TopoDS_Shape& theShape ) { - TNaming_Builder aBuilder( myLab.FindChild( DataTag_Shape ) ); - aBuilder.Generated( theShape ); + HYDROData_Entity::SetShape( DataTag_Shape, theShape ); } TopoDS_Shape HYDROData_Zone::GetShape() const { - TDF_Label aLabel = myLab.FindChild( DataTag_Shape, false ); - if ( !aLabel.IsNull() ) - { - Handle(TNaming_NamedShape) aNamedShape; - if( aLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) ) - return aNamedShape->Get(); - } - - return TopoDS_Shape(); + return HYDROData_Entity::GetShape( DataTag_Shape ); } bool HYDROData_Zone::IsMergingNeed() const @@ -119,30 +106,6 @@ bool HYDROData_Zone::IsMergingNeed() const return true; } - // Zones based on land cover objects (compare Strickler types) - QString aRefStricklerType; - - anObjsIter.Init( anObjects ); - for ( ; anObjsIter.More(); anObjsIter.Next() ) - { - Handle(HYDROData_LandCover) aRefLandCoverObj = - Handle(HYDROData_LandCover)::DownCast( anObjsIter.Value() ); - if ( aRefLandCoverObj.IsNull() ) - continue; - - QString aStricklerType = aRefLandCoverObj->GetStricklerType(); - - if ( aRefStricklerType.isNull() ) - { - aRefStricklerType = aStricklerType; - continue; - } - - if ( aRefStricklerType != aStricklerType ) - return true; - } - - return false; } @@ -178,6 +141,7 @@ HYDROData_Zone::MergeType HYDROData_Zone::GetMergeType() const void HYDROData_Zone::SetMergeObject( const Handle(HYDROData_Entity)& theObject ) { + //DEBTRACE("HYDROData_Zone::SetMergeObject"); SetReferenceObject( theObject, DataTag_MergeObject ); } @@ -198,8 +162,7 @@ bool HYDROData_Zone::AddObject( const Handle(HYDROData_Entity)& theObject ) return false; if ( !theObject->IsKind( STANDARD_TYPE(HYDROData_ArtificialObject) ) && - !theObject->IsKind( STANDARD_TYPE(HYDROData_NaturalObject) ) && - !theObject->IsKind( STANDARD_TYPE(HYDROData_LandCover) ) ) + !theObject->IsKind( STANDARD_TYPE(HYDROData_NaturalObject) ) ) return false; // Wrong type of object if ( HasReference( theObject, DataTag_Object ) )