SetToUpdate( true );
}
-HYDROData_Bathymetry::AltitudePoints HYDROData_Bathymetry::GetAltitudePoints() const
+HYDROData_Bathymetry::AltitudePoints HYDROData_Bathymetry::GetAltitudePoints(bool IsConvertToGlobal) const
{
AltitudePoints aPoints;
if ( !aLabel.FindAttribute( TDataStd_RealArray::GetID(), aCoordsArray ) )
return aPoints;
+ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( myLab );
for ( int i = aCoordsArray->Lower(), n = aCoordsArray->Upper(); i <= n; )
{
if ( i + 3 > n + 1 )
aPoint.SetY( aCoordsArray->Value( i++ ) );
aPoint.SetZ( aCoordsArray->Value( i++ ) );
+ if( IsConvertToGlobal )
+ aDoc->Transform( aPoint, false );
aPoints.Append( aPoint );
}
* Returns altitude points list.
* \return points list
*/
- HYDRODATA_EXPORT virtual AltitudePoints GetAltitudePoints() const;
+ HYDRODATA_EXPORT virtual AltitudePoints GetAltitudePoints(bool IsConvertToGlobal = false) const;
/**
* Remove all altitude points.
* only for section with this index
* \return list of points
*/
- HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1 ) const = 0;
+ HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1, bool IsConvertToGlobal = false ) const = 0;
protected:
SetToUpdate( true );
}
-HYDROData_PolylineXY::PointsList HYDROData_PolylineXY::GetPoints( const int theSectionIndex ) const
+HYDROData_PolylineXY::PointsList HYDROData_PolylineXY::GetPoints( const int theSectionIndex, bool IsConvertToGlobal ) const
{
PointsList aResList;
TColStd_ListIteratorOfListOfReal anIterX( aListX->List() );
TColStd_ListIteratorOfListOfReal anIterY( aListY->List() );
+ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( myLab );
for ( ; anIterX.More() && anIterY.More(); anIterX.Next(), anIterY.Next() )
{
Point aPoint( anIterX.Value(), anIterY.Value() );
+ if (IsConvertToGlobal)
+ aDoc->Transform( aPoint, false );
aResList.Append( aPoint );
}
* only for section with this index
* \return list of points
*/
- HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1 ) const;
+ HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1, bool IsConvertToGlobal = false ) const;
/**
}
}
-HYDROData_ProfileUZ::PointsList HYDROData_ProfileUZ::GetPoints( const int /*theSectionIndex*/ ) const
+HYDROData_ProfileUZ::PointsList HYDROData_ProfileUZ::GetPoints( const int /*theSectionIndex*/, bool /*IsConvertToGlobal*/ ) const
{
PointsList aResList;
* only for section with this index
* \return list of points
*/
- HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1 ) const;
+ HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1, bool IsConvertToGlobal = false ) const;
HYDRODATA_EXPORT virtual void CalculateAndAddPoints(const NCollection_Sequence<gp_XYZ>& theXYZPoints, Handle_HYDROData_PolylineXY& thePolylineXY);
Handle_HYDROData_Entity anEnt = theEntities.Value(i);
if (anEnt->IsKind( STANDARD_TYPE(HYDROData_Bathymetry) ))
{
- Handle(HYDROData_Bathymetry) aBathy = Handle(HYDROData_Bathymetry)::DownCast( anEnt );
- HYDROData_Bathymetry::AltitudePoints anXYZPoints = aBathy->GetAltitudePoints();
- //Write to stream
- aTextStream << "B S\n";
- aTextStream << "CN " << aBathy->GetName() << "\n";
- aTextStream << "CP 0 0\n";
- aTextStream << "CP 0\n";
- for (int j = anXYZPoints.Lower(); j <= anXYZPoints.Upper(); j++)
- aTextStream << " " << QString::number(anXYZPoints(j).X(), 'f', 3)
- << " " << QString::number(anXYZPoints(j).Y(), 'f', 3)
- << " " << QString::number(anXYZPoints(j).Z(), 'f', 3) << "\n";
+ Handle(HYDROData_Bathymetry) aBathy = Handle(HYDROData_Bathymetry)::DownCast( anEnt );
+ HYDROData_Bathymetry::AltitudePoints anXYZPoints = aBathy->GetAltitudePoints(true);
+ //Write to stream
+ aTextStream << "B S\n";
+ aTextStream << "CN " << aBathy->GetName() << "\n";
+ aTextStream << "CP 0 0\n";
+ aTextStream << "CP 0\n";
+ for (int j = anXYZPoints.Lower(); j <= anXYZPoints.Upper(); j++)
+ aTextStream << " " << QString::number(anXYZPoints(j).X(), 'f', 3)
+ << " " << QString::number(anXYZPoints(j).Y(), 'f', 3)
+ << " " << QString::number(anXYZPoints(j).Z(), 'f', 3) << "\n";
}
else if (anEnt->IsKind( STANDARD_TYPE(HYDROData_PolylineXY) ))
{
bool IsSpline = false;
if (aPolyXY->GetSectionType(j) == HYDROData_PolylineXY::SECTION_SPLINE)
IsSpline = true;
- HYDROData_PolylineXY::PointsList anXYPoints = aPolyXY->GetPoints(j);
+ HYDROData_PolylineXY::PointsList anXYPoints = aPolyXY->GetPoints(j, true);
//Write to stream
aTextStream << "B N\n";
aTextStream << "CN " << aPolyXY->GetName() << "\n";