#include "HYDROData_Projection.h"
#include "HYDROData_ShapesGroup.h"
#include "HYDROData_ShapesTool.h"
-#include "HYDROData_Pipes.h"
#include "HYDROData_Stream.h"
+#include "HYDROData_Tool.h"
#include <BRepBuilderAPI_MakeWire.hxx>
HYDROData_Channel::HYDROData_Channel()
-: HYDROData_ArtificialObject()
+: HYDROData_ArtificialObject( Geom_3d )
{
}
{
}
-QStringList HYDROData_Channel::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
+QStringList HYDROData_Channel::DumpToPython( const QString& thePyScriptPath,
+ MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
QString aName = GetObjPyName();
Handle(HYDROData_Polyline3D) aRefGideLine = GetGuideLine();
- setPythonReferenceObject( theTreatedObjects, aResList, aRefGideLine, "SetGuideLine" );
+ setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aRefGideLine, "SetGuideLine" );
Handle(HYDROData_Profile) aRefProfile = GetProfile();
- setPythonReferenceObject( theTreatedObjects, aResList, aRefProfile, "SetProfile" );
+ setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aRefProfile, "SetProfile" );
aResList << QString( "" );
aResList << QString( "%1.Update();" ).arg( aName );
return aResSeq;
}
-TopoDS_Shape HYDROData_Channel::GetTopShape() const
-{
- return getTopShape();
-}
-
-TopoDS_Shape HYDROData_Channel::GetShape3D() const
-{
- return getShape3D();
-}
-
bool HYDROData_Channel::CreatePresentations( const Handle(HYDROData_Polyline3D)& theGuideLine,
const Handle(HYDROData_Profile)& theProfile,
PrsDefinition& thePrs )
}
// Get the profile middle point ( 3D )
- gp_Pnt aMiddlePoint( theProfile->GetMiddlePoint() );
+ gp_Pnt aMiddlePoint( theProfile->GetMiddlePoint( true ) );
// Translate the profile to each point on the guide line ( 3D )
Handle(TColgp_HArray1OfPnt) anArrayOfFPnt = new TColgp_HArray1OfPnt(1, aNbPoints );
return true;
}
-QColor HYDROData_Channel::DefaultFillingColor()
+QColor HYDROData_Channel::DefaultFillingColor() const
{
return QColor( Qt::blue );
}
-QColor HYDROData_Channel::DefaultBorderColor()
+QColor HYDROData_Channel::DefaultBorderColor() const
{
return QColor( Qt::transparent );
}
-QColor HYDROData_Channel::getDefaultFillingColor() const
-{
- return DefaultFillingColor();
-}
-
-QColor HYDROData_Channel::getDefaultBorderColor() const
-{
- return DefaultBorderColor();
-}
-
bool HYDROData_Channel::SetGuideLine( const Handle(HYDROData_Polyline3D)& theGuideLine )
{
Handle(HYDROData_Polyline3D) aPrevGuideLine = GetGuideLine();
SetReferenceObject( theGuideLine, DataTag_GuideLine );
// Indicate model of the need to update the chanel presentation
- SetToUpdate( true );
+ Changed( Geom_3d );
return true;
}
ClearReferenceObjects( DataTag_GuideLine );
// Indicate model of the need to update the chanel presentation
- SetToUpdate( true );
+ Changed( Geom_3d );
}
bool HYDROData_Channel::SetProfile( const Handle(HYDROData_Profile)& theProfile )
SetReferenceObject( theProfile, DataTag_Profile );
// Indicate model of the need to update the chanel presentation
- SetToUpdate( true );
+ Changed( Geom_3d );
return true;
}
ClearReferenceObjects( DataTag_Profile );
// Indicate model of the need to update the chanel presentation
- SetToUpdate( true );
+ Changed( Geom_3d );
}
ObjectKind HYDROData_Channel::getAltitudeObjectType() const
{
- return KIND_OBSTACLE_ALTITUDE;
+ return KIND_STREAM_ALTITUDE;
+}
+
+TopoDS_Shape HYDROData_Channel::GetLeftShape() const
+{
+ HYDROData_SequenceOfObjects aGroups = GetGroups();
+ return HYDROData_Tool::getFirstShapeFromGroup( aGroups, 1);
}
+TopoDS_Shape HYDROData_Channel::GetRightShape() const
+{
+ HYDROData_SequenceOfObjects aGroups = GetGroups();
+ return HYDROData_Tool::getFirstShapeFromGroup( aGroups, 2);
+}