#include "HYDROData_Profile.h"
#include "HYDROData_ShapesGroup.h"
#include "HYDROData_ShapesTool.h"
+#include "HYDROData_IAltitudeObject.h"
#include <TDataStd_RealArray.hxx>
}
void HYDROData_Stream::Update()
+{
+ updateProfilesOrder();
+ UpdatePrs();
+}
+
+void HYDROData_Stream::UpdatePrs()
{
HYDROData_NaturalObject::Update();
// Create the stream groups
createGroupObjects();
+
+ // This peace of code is for testing of functionality of altitude,
+ // will be removed by adv when testing will be finished
+ Handle(HYDROData_IAltitudeObject) anAltObj = GetAltitudeObject();
+ gp_XY aTestPnt( 5, 0 );
+ anAltObj->GetAltitudeForPoint( aTestPnt );
+ // End of test code
+
}
QColor HYDROData_Stream::DefaultFillingColor()
return true;
}
+TopoDS_Shape getShapeFromGroup( const HYDROData_SequenceOfObjects& theGroups,
+ const int theGroupId )
+{
+ TopoDS_Shape aResShape;
+ if ( theGroups.Length() != 4 )
+ return aResShape;
+
+ Handle(HYDROData_ShapesGroup) aGroup =
+ Handle(HYDROData_ShapesGroup)::DownCast( theGroups.Value( theGroupId ) );
+ if ( aGroup.IsNull() )
+ return aResShape;
+
+ TopTools_SequenceOfShape aGroupShapes;
+ aGroup->GetShapes( aGroupShapes );
+
+ if ( !aGroupShapes.IsEmpty() )
+ aResShape = aGroupShapes.First();
+
+ return aResShape;
+}
+
+TopoDS_Shape HYDROData_Stream::GetLeftShape() const
+{
+ HYDROData_SequenceOfObjects aGroups = GetGroups();
+ return getShapeFromGroup( aGroups, 1 );
+}
+
+TopoDS_Shape HYDROData_Stream::GetRightShape() const
+{
+ HYDROData_SequenceOfObjects aGroups = GetGroups();
+ return getShapeFromGroup( aGroups, 2 );
+}
+
+TopoDS_Shape HYDROData_Stream::GetInletShape() const
+{
+ HYDROData_SequenceOfObjects aGroups = GetGroups();
+ return getShapeFromGroup( aGroups, 3 );
+}
+
+TopoDS_Shape HYDROData_Stream::GetOutletShape() const
+{
+ HYDROData_SequenceOfObjects aGroups = GetGroups();
+ return getShapeFromGroup( aGroups, 4 );
+}
+
QColor HYDROData_Stream::getDefaultFillingColor() const
{
return DefaultFillingColor();