X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Object.cxx;h=20eead85ab2a6ab08dbbced470a32b015fe94632;hb=9c947f35615e69e9e54a8c4b074dd1f2be13689c;hp=95d0efeb7166607a71f7c693594dbd0a604af5f7;hpb=254bc4b391a60c6a0c49435711d48071be58f761;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Object.cxx b/src/HYDROData/HYDROData_Object.cxx index 95d0efeb..20eead85 100644 --- a/src/HYDROData/HYDROData_Object.cxx +++ b/src/HYDROData/HYDROData_Object.cxx @@ -31,8 +31,8 @@ IMPLEMENT_STANDARD_HANDLE(HYDROData_Object,HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Object,HYDROData_Entity) -HYDROData_Object::HYDROData_Object() -: HYDROData_Entity() +HYDROData_Object::HYDROData_Object( Geometry theGeometry ) + : HYDROData_Entity( theGeometry ) { } @@ -71,9 +71,14 @@ void HYDROData_Object::SetName( const QString& theName ) void HYDROData_Object::Update() { - RemoveTopShape(); - RemoveShape3D(); - RemoveGroupObjects(); + if( IsMustBeUpdated( Geom_2d ) ) + { + RemoveTopShape(); + RemoveGroupObjects(); + } + if( IsMustBeUpdated( Geom_3d ) ) + RemoveShape3D(); + checkAndSetAltitudeObject(); HYDROData_Entity::Update(); } @@ -89,13 +94,13 @@ HYDROData_SequenceOfObjects HYDROData_Object::GetAllReferenceObjects() const return aResSeq; } -void HYDROData_Object::SetToUpdate( bool theFlag ) +void HYDROData_Object::Changed( Geometry theChangedGeometry ) { - HYDROData_Entity::SetToUpdate( theFlag ); + HYDROData_Entity::Changed( theChangedGeometry ); Handle(HYDROData_DummyObject3D) anObject3D = GetObject3D(); if ( !anObject3D.IsNull() ) - anObject3D->SetToUpdate( theFlag ); + anObject3D->Changed( theChangedGeometry ); } void HYDROData_Object::SetTopShape( const TopoDS_Shape& theShape ) @@ -230,7 +235,7 @@ void HYDROData_Object::SetFillingColor( const QColor& theColor ) QColor HYDROData_Object::GetFillingColor() const { - return GetColor( getDefaultFillingColor(), DataTag_FillingColor ); + return GetColor( DefaultFillingColor(), DataTag_FillingColor ); } void HYDROData_Object::SetBorderColor( const QColor& theColor ) @@ -240,15 +245,15 @@ void HYDROData_Object::SetBorderColor( const QColor& theColor ) QColor HYDROData_Object::GetBorderColor() const { - return GetColor( getDefaultBorderColor(), DataTag_BorderColor ); + return GetColor( DefaultBorderColor(), DataTag_BorderColor ); } -QColor HYDROData_Object::getDefaultFillingColor() const +QColor HYDROData_Object::DefaultFillingColor() const { return QColor( Qt::yellow ); } -QColor HYDROData_Object::getDefaultBorderColor() const +QColor HYDROData_Object::DefaultBorderColor() const { return QColor( Qt::transparent ); } @@ -262,10 +267,10 @@ QStringList HYDROData_Object::dumpObjectCreation( MapOfTreatedObjects& theTreate QStringList aColorsDef; QColor aFillingColor = GetFillingColor(); - setPythonObjectColor( aColorsDef, aFillingColor, getDefaultFillingColor(), "SetFillingColor" ); + setPythonObjectColor( aColorsDef, aFillingColor, DefaultFillingColor(), "SetFillingColor" ); QColor aBorderColor = GetBorderColor(); - setPythonObjectColor( aColorsDef, aBorderColor, getDefaultBorderColor(), "SetBorderColor" ); + setPythonObjectColor( aColorsDef, aBorderColor, DefaultBorderColor(), "SetBorderColor" ); if ( !aColorsDef.isEmpty() ) { @@ -369,3 +374,26 @@ void HYDROData_Object::SetIsSubmersible( bool isSubmersible ) const { TDataStd_Integer::Set( myLab, isSubmersible ? 1 : 0 ); } + +void HYDROData_Object::GetBoundaries( QList& theBoundShapes, + QStringList& theBoundNames ) const +{ + 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 aName = aGroup->GetName(); + TopTools_SequenceOfShape aShapes; + aGroup->GetShapes( aShapes ); + for( int i=1, n=aShapes.Length(); i<=n; i++ ) + { + theBoundShapes.append( aShapes( i ) ); + theBoundNames.append( aName ); + } + } +}