#include <TopoDS_Shape.hxx>
#include <TDataStd_Integer.hxx>
+#include <TDataStd_Real.hxx>
#include <QColor>
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
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 )
{
}
void HYDROData_Object::Update()
{
- removeTopShape();
- removeShape3D();
- removeGroupObjects();
+ if( IsMustBeUpdated( Geom_2d ) )
+ {
+ removeTopShape();
+ removeGroupObjects();
+ }
+ if( IsMustBeUpdated( Geom_3d ) )
+ removeShape3D();
+
checkAndSetAltitudeObject();
HYDROData_Entity::Update();
}
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 )
SetReferenceObject( theAltitude, DataTag_AltitudeObject );
- // Indicate model of the need to update object
- SetToUpdate( true );
+ // #636: In the case of the altitude object change the geometry of the main object is not changed,
+ // to the object should not be marked as updated
+ //SetToUpdate( true );
return true;
}
ClearReferenceObjects( DataTag_AltitudeObject );
- // Indicate model of the need to update object
- SetToUpdate( true );
+ // #636: In the case of the altitude object change the geometry of the main object is not changed,
+ // to the object should not be marked as updated
+ //SetToUpdate( true );
}
void HYDROData_Object::SetFillingColor( const QColor& theColor )
Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
ObjectKind anAltitudeObjectType = getAltitudeObjectType();
+ DEBTRACE("HYDROData_Object::checkAndSetAltitudeObject anAltitudeObjectType="<< anAltitudeObjectType);
if ( anAltitudeObjectType == KIND_UNKNOWN )
return; // No need to create altitude object
HYDROData_Iterator::CreateObject( aChildLabel, anAltitudeObjectType ) );
QString anAltitudePref = GetName() + "_Altitude";
+ DEBTRACE("anAltitudePref " << anAltitudePref.toStdString());
QString anAltitudeName = HYDROData_Tool::GenerateObjectName( aDocument, anAltitudePref );
anAltitudeObject->SetName( anAltitudeName );