#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 )
{
}
}
#ifdef DEB_CHANNEL
- BRepTools::Write( aPathWire, "guideline.brep" );
- BRepTools::Write( aProfileWire, "profile.brep" );
+ std::string brepName = "guideline_";
+ brepName += theGuideLine->GetName().toStdString();
+ brepName += ".brep";
+ BRepTools::Write( aPathWire, brepName.c_str() );
+ brepName = "profile_";
+ brepName += theGuideLine->GetName().toStdString();
+ brepName += ".brep";
+ BRepTools::Write( aProfileWire, brepName.c_str() );
#endif
// Pre-processing
}
// 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 );
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
{
DEBTRACE("HYDROData_Channel::getAltitudeObjectType");
return KIND_CHANNEL_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);
+}