QStringList HYDROData_AltitudeObject::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
- QString anAltitudeName = GetName();
+ QString aName = GetName();
// TODO
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "" );
+
return aResList;
}
aResList << QString( "%1.ImportFromFile( \"%2\" );" )
.arg( aBathymetryName ).arg( aFilePath.ToCString() );
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aBathymetryName );
+ aResList << QString( "" );
+
return aResList;
}
// TODO
}
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aCalculName );
+ aResList << QString( "" );
+
return aResList;
}
QStringList HYDROData_Channel::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
+ QString aName = GetName();
// TODO
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "" );
+
return aResList;
}
QStringList HYDROData_Confluence::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
+ QString aName = GetName();
// TODO
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "" );
+
return aResList;
}
QStringList HYDROData_Digue::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
+ QString aName = GetName();
// TODO
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "" );
+
return aResList;
}
QStringList aResScript;
- aResScript << QString( "from HYDROpy import *" );
+ aResScript << QString( "from HYDROPy import *" );
aResScript << QString( "from PyQt4.QtCore import *" );
aResScript << QString( "from PyQt4.QtGui import *" );
aResScript << QString( "" );
aResList << QString( "%1.Update();" ).arg( anImageName );
}
+ aResList << QString( "" );
+
return aResList;
}
Handle(HYDROData_PolylineXY) aRefPolyline = GetPolyline();
setPythonReferenceObject( theTreatedObjects, aResList, aRefPolyline, "SetPolyline" );
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aZoneName );
+ aResList << QString( "" );
+
return aResList;
}
QStringList HYDROData_Obstacle::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
+ QString aName = GetName();
// TODO
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "" );
+
return aResList;
}
QStringList HYDROData_ObstacleAltitude::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
+ QString aName = GetName();
// TODO
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "" );
+
return aResList;
}
QStringList HYDROData_Polyline3D::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
+ QString aName = GetName();
// TODO
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "" );
+
return aResList;
}
aResList << QString( "%1.AddSection( \"%2\", %3, %4 );" ).arg( aPolylineName )
.arg( aSectName.ToCString() ).arg( aSectType ).arg( aSectClosure );
- HYDROData_PolylineXY::PointsList aSectPointsList = GetPoints( i );
+ HYDROData_IPolyline::PointsList aSectPointsList = GetPoints( i - 1 );
for ( int k = 1, aNbPoints = aSectPointsList.Size(); k <= aNbPoints; ++k )
{
const Point& aSectPoint = aSectPointsList.Value( k );
}
}
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aPolylineName );
+ aResList << QString( "" );
+
return aResList;
}
QStringList HYDROData_Profile::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
+ QString aName = GetName();
+
+ QColor aFillingColor = GetFillingColor();
+ aResList << QString( "filling_color = QColor( %1, %2, %3, %4 );" )
+ .arg( aFillingColor.red() ).arg( aFillingColor.green() )
+ .arg( aFillingColor.blue() ).arg( aFillingColor.alpha() );
+ aResList << QString( "%1.SetFillingColor( filling_color );" ).arg( aName );
+ aResList << QString( "" );
+
+ QColor aBorderColor = GetBorderColor();
+ aResList << QString( "border_color = QColor( %1, %2, %3, %4 );" )
+ .arg( aBorderColor.red() ).arg( aBorderColor.green() )
+ .arg( aBorderColor.blue() ).arg( aBorderColor.alpha() );
+ aResList << QString( "%1.SetBorderColor( border_color );" ).arg( aName );
+ aResList << QString( "" );
+
+ //TCollection_AsciiString aFilePath = GetFilePath();
+ //if ( !aFilePath.IsEmpty() )
+ //{
+ // aResList << QString( "%1.ImportFromFile( \"%2\" );" )
+ // .arg( aName ).arg( aFilePath.ToCString() );
+ //}
+
+ bool isValid = IsValid();
+ QString aGap = QString().fill( ' ', 11 );
+
+ aResList << QString( "points = [" );
- //TODO
+ if ( isValid )
+ {
+ HYDROData_Profile::ProfilePoints aPointsList = GetProfilePoints();
+ for ( int k = 1, aNbPoints = aPointsList.Size(); k <= aNbPoints; ++k )
+ {
+ const ProfilePoint& aPoint = aPointsList.Value( k );
+ aResList << QString( aGap + "gp_XYZ( %1, %2, %3 )%4" ).arg( aPoint.X() ).arg( aPoint.Y() ).arg( aPoint.Z() )
+ .arg( ( k < aNbPoints ? "," : "" ) );
+ }
+ aResList << QString( "];" );
+ aResList << QString( "%1.SetProfilePoints( points );" ).arg( aName );
+ }
+ else
+ {
+ HYDROData_IPolyline::PointsList aPointsList = GetParametricPoints();
+ for ( int k = 1, aNbPoints = aPointsList.Size(); k <= aNbPoints; ++k )
+ {
+ const HYDROData_IPolyline::Point& aPoint = aPointsList.Value( k );
+ aResList << QString( aGap + "gp_XY( %1, %2 )%3" ).arg( aPoint.X() ).arg( aPoint.Y() )
+ .arg( ( k < aNbPoints ? "," : "" ) );
+ }
+ aResList << QString( "];" );
+ aResList << QString( "%1.SetParametricPoints( points )" ).arg( aName );
+ }
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "" );
return aResList;
}
{
}
+QStringList HYDROData_ProfileUZ::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
+{
+ QStringList aResList = dumpObjectCreation( theTreatedObjects );
+ QString aName = GetName();
+
+ // Set polilyne data
+ const TCollection_AsciiString& aSectName = GetSectionName( 0 );
+ const SectionType& aSectType = GetSectionType( 0 );
+ bool aSectClosure = IsClosedSection( 0 );
+
+ aResList << QString( "%1.AddSection( \"%2\", %3, %4 );" ).arg( aName )
+ .arg( aSectName.ToCString() ).arg( aSectType ).arg( aSectClosure );
+
+ HYDROData_IPolyline::PointsList aSectPointsList = GetPoints( 0 );
+ for ( int k = 1, aNbPoints = aSectPointsList.Size(); k <= aNbPoints; ++k )
+ {
+ const Point& aSectPoint = aSectPointsList.Value( k );
+
+ aResList << QString( "%1.AddPoint( 0, QPointF( %2, %3 ) );" ).arg( aName )
+ .arg( aSectPoint.X() ).arg( aSectPoint.Y() );
+ }
+
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "" );
+
+ return aResList;
+}
+
TopoDS_Shape HYDROData_ProfileUZ::GetShape() const
{
// TODO
*/
HYDRODATA_EXPORT virtual const ObjectKind GetKind() const {return KIND_PROFILEUZ;}
+ /**
+ * Dump object to Python script representation.
+ */
+ HYDRODATA_EXPORT virtual QStringList DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const;
+
public:
/**
if ( !aRefZone.IsNull() )
setPythonReferenceObject( theTreatedObjects, aResList, aRefZone, "AddZone" );
}
+
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aRegionName );
aResList << QString( "" );
return aResList;
QStringList HYDROData_River::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
+ QString aName = GetName();
// TODO
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "" );
+
return aResList;
}
QStringList HYDROData_Stream::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
+ QString aName = GetName();
// TODO
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "" );
+
return aResList;
}
QStringList HYDROData_StreamAltitude::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
{
QStringList aResList = dumpObjectCreation( theTreatedObjects );
+ QString aName = GetName();
// TODO
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "" );
+
return aResList;
}
// How can we get the shape? Mb Update() method to intersect the shapes of reference objects?
// TODO: TopoDS_Shape aRefShape = GetShape();
+ QString aName = GetName();
+ aResList << QString( "" );
+ aResList << QString( "%1.Update();" ).arg( aName );
+ aResList << QString( "" );
return aResList;
}