X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Entity.cxx;h=f0b9e5fb034a06e9b26123375f8f69eab2fe0fc2;hb=9c947f35615e69e9e54a8c4b074dd1f2be13689c;hp=65edad85158754df0496ca2305f7bd464a60a9e1;hpb=981b9eb91e769d90dd63a0288cc3af6841bcb15e;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Entity.cxx b/src/HYDROData/HYDROData_Entity.cxx index 65edad85..f0b9e5fb 100644 --- a/src/HYDROData/HYDROData_Entity.cxx +++ b/src/HYDROData/HYDROData_Entity.cxx @@ -16,28 +16,43 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#include "HYDROData_Entity.h" - -#include "HYDROData_Iterator.h" -#include "HYDROData_Tool.h" - +#include +#include +#include +#include +#include #include #include #include -#include -#include #include -#include +#include #include - #include #include - +#include +#include +#include #include -#include +#include #include #include +HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects() + : NCollection_Sequence() +{ +} + +HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects( const HYDROData_SequenceOfObjects& theSequence ) + : NCollection_Sequence( theSequence ) +{ +} + +HYDROData_SequenceOfObjects::HYDROData_SequenceOfObjects( const NCollection_Sequence& theSequence ) + : NCollection_Sequence( theSequence ) +{ +} + + IMPLEMENT_STANDARD_HANDLE(HYDROData_Entity,MMgt_TShared) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Entity,MMgt_TShared) @@ -139,22 +154,25 @@ void HYDROData_Entity::Changed( Geometry theChangedGeometry ) if ( !aGeomChangeAttr.IsNull() ) aGeomChangeFlag = aGeomChangeAttr->Get(); - if( ( myGeom & theChangedGeometry ) == 0 ) + int aBitsToChange = ( myGeom & theChangedGeometry ); + if( aBitsToChange == 0 ) return; - aGeomChangeFlag = ( aGeomChangeFlag | theChangedGeometry ); + aGeomChangeFlag = ( aGeomChangeFlag | aBitsToChange ); TDataStd_Integer::Set( aGeomChangeLab, aGeomChangeFlag ); HYDROData_Iterator anIter( aDocument ); for ( ; anIter.More(); anIter.Next() ) { Handle(HYDROData_Entity) anObject = anIter.Current(); + if( anObject.IsNull() ) + continue; HYDROData_SequenceOfObjects aRefSeq = anObject->GetAllReferenceObjects(); for ( int i = 1, n = aRefSeq.Length(); i <= n; ++i ) { Handle(HYDROData_Entity) aRefObject = aRefSeq.Value( i ); if( aRefObject->Label()==myLab ) - Changed( theChangedGeometry ); + anObject->Changed( theChangedGeometry ); } } } @@ -630,7 +648,8 @@ QString HYDROData_Entity::getPyTypeID() const case KIND_STREAM_ALTITUDE: return "KIND_STREAM_ALTITUDE"; case KIND_OBSTACLE_ALTITUDE: return "KIND_OBSTACLE_ALTITUDE"; case KIND_STRICKLER_TABLE: return "KIND_STRICKLER_TABLE"; - case KIND_LAND_COVER: return "KIND_LAND_COVER"; + case KIND_LAND_COVER_OBSOLETE: return ""; + case KIND_LAND_COVER_MAP: return "KIND_LAND_COVER_MAP"; default: return "KIND_UNKNOWN"; ///! Unrecognized object } } @@ -706,3 +725,21 @@ void HYDROData_Entity::findPythonReferenceObject( MapOfTreatedObjects& theTreate .arg( aDocument->GetDocPyName() ) .arg( GetName() ); } + +void HYDROData_Entity::SetShape( int theTag, const TopoDS_Shape& theShape ) +{ + TNaming_Builder aBuilder( myLab.FindChild( theTag ) ); + aBuilder.Generated( theShape ); +} + +TopoDS_Shape HYDROData_Entity::GetShape( int theTag ) const +{ + TDF_Label aShapeLabel = myLab.FindChild( theTag, false ); + if ( !aShapeLabel.IsNull() ) + { + Handle(TNaming_NamedShape) aNamedShape; + if ( aShapeLabel.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) ) + return aNamedShape->Get(); + } + return TopoDS_Shape(); +}