HYDROData_Stream::HYDROData_Stream()
-: HYDROData_NaturalObject()
+: HYDROData_NaturalObject( Geom_3d )
{
}
{
}
-QStringList HYDROData_Stream::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
+QStringList HYDROData_Stream::DumpToPython( const QString& thePyScriptPath,
+ MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
QString aName = GetObjPyName();
Handle(HYDROData_PolylineXY) aHydAxis = GetHydraulicAxis();
- setPythonReferenceObject( theTreatedObjects, aResList, aHydAxis, "SetHydraulicAxis" );
+ setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aHydAxis, "SetHydraulicAxis" );
HYDROData_SequenceOfObjects aSeqOfProfiles = GetProfiles();
for ( int i = 1, aNb = aSeqOfProfiles.Size(); i <= aNb; ++i )
{
const Handle(HYDROData_Entity) aProfile = aSeqOfProfiles.Value( i );
- setPythonReferenceObject( theTreatedObjects, aResList, aProfile, "AddProfile" );
+ setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aProfile, "AddProfile" );
}
// Set bottom polyline if exists
const Handle(HYDROData_Polyline3D) aBottomPolyline = GetBottomPolyline();
if ( !aBottomPolyline.IsNull() ) {
- setPythonReferenceObject( theTreatedObjects, aResList, aBottomPolyline, "SetBottomPolyline" );
+ setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aBottomPolyline, "SetBottomPolyline" );
}
aResList << QString( "" );
return aResSeq;
}
-TopoDS_Shape HYDROData_Stream::GetTopShape() const
-{
- return getTopShape();
-}
-
-TopoDS_Shape HYDROData_Stream::GetShape3D() const
-{
- return getShape3D();
-}
-
Handle(Geom_BSplineCurve) HYDROData_Stream::buildInterpolationCurve(
const Handle(TColgp_HArray1OfPnt)& theArrayOfPnt )
{
anOutGroup->AddShape( aResultPrs.myOutlet );
}
-QColor HYDROData_Stream::DefaultFillingColor()
+QColor HYDROData_Stream::DefaultFillingColor() const
{
return QColor( Qt::green );
}
-QColor HYDROData_Stream::DefaultBorderColor()
+QColor HYDROData_Stream::DefaultBorderColor() const
{
return QColor( Qt::transparent );
}
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 );
+ return HYDROData_Tool::getFirstShapeFromGroup( aGroups, 1);
}
TopoDS_Shape HYDROData_Stream::GetRightShape() const
{
HYDROData_SequenceOfObjects aGroups = GetGroups();
- return getShapeFromGroup( aGroups, 2 );
+ return HYDROData_Tool::getFirstShapeFromGroup( aGroups, 2);
}
TopoDS_Shape HYDROData_Stream::GetInletShape() const
{
HYDROData_SequenceOfObjects aGroups = GetGroups();
- return getShapeFromGroup( aGroups, 3 );
+ return HYDROData_Tool::getFirstShapeFromGroup( aGroups, 3);
}
TopoDS_Shape HYDROData_Stream::GetOutletShape() const
{
HYDROData_SequenceOfObjects aGroups = GetGroups();
- return getShapeFromGroup( aGroups, 4 );
-}
-
-QColor HYDROData_Stream::getDefaultFillingColor() const
-{
- return DefaultFillingColor();
-}
-
-QColor HYDROData_Stream::getDefaultBorderColor() const
-{
- return DefaultBorderColor();
+ return HYDROData_Tool::getFirstShapeFromGroup( aGroups, 4);
}
bool HYDROData_Stream::SetHydraulicAxis( const Handle(HYDROData_PolylineXY)& theAxis )
updateProfilesOrder();
// Indicate model of the need to update the stream presentation
- SetToUpdate( true );
+ Changed( Geom_3d );
return true;
}
RemoveProfiles();
// Indicate model of the need to update the stream presentation
- SetToUpdate( true );
+ Changed( Geom_3d );
}
bool HYDROData_Stream::HasIntersection( const Handle(HYDROData_Profile)& theProfile,
insertProfileInToOrder( theProfile, aProfileIndex );
// Indicate model of the need to update the stream presentation
- SetToUpdate( true );
+ Changed( Geom_3d );
return true;
}
SetReferenceObjects( theProfiles, DataTag_Profile );
if ( anIsToUpdate )
- SetToUpdate( true );
+ Changed( Geom_3d );
}
return true;
removeParameter( aProfileIndex );
// Indicate model of the need to update the stream presentation
- SetToUpdate( true );
+ Changed( Geom_3d );
return true;
}
void HYDROData_Stream::RemoveProfiles()
{
- bool anIsToUpdate = IsMustBeUpdated() || NbReferenceObjects( DataTag_Profile ) > 0;
-
ClearReferenceObjects( DataTag_Profile );
// Remove the parameters array
removeParametersArray();
// Indicate model of the need to update the stream presentation
- SetToUpdate( anIsToUpdate );
+ Changed( Geom_3d );
}
void HYDROData_Stream::insertProfileInToOrder( const Handle(HYDROData_Profile)& theProfile,
return isOK;
}
-void HYDROData_Stream::CopyTo( const Handle(HYDROData_Entity)& theDestination ) const
+void HYDROData_Stream::CopyTo( const Handle(HYDROData_Entity)& theDestination,
+ bool isGenerateNewName ) const
{
// Get the document
Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
}
// Call base method
- HYDROData_Entity::CopyTo( theDestination );
+ HYDROData_Entity::CopyTo( theDestination, isGenerateNewName );
Handle(HYDROData_Stream) aStreamCopy =
Handle(HYDROData_Stream)::DownCast( theDestination );