// Try to import the file
if ( aFileSuf == "xyz" )
aRes = importFromXYZFile( aFile, aPoints );
-
+
// Close the file
aFile.close();
+
+
+ // Convert from global to local CS
+ Handle_HYDROData_Document aDoc = HYDROData_Document::Document( myLab );
+ AltitudePoints::Iterator anIter( aPoints );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ AltitudePoint& aPoint = anIter.ChangeValue();
+ aDoc->Transform( aPoint, true );
+ }
if ( aRes )
{
myLY = theLocalCS.Y();
}
-void HYDROData_Document::Transform( gp_Pnt& thePnt, bool IsToLocalCS ) const
+void HYDROData_Document::Transform( double& X, double& Y, bool IsToLocalCS ) const
{
if( myLX < 0 || myLY < 0 )
{
aThat->myLX = aLCS.X();
aThat->myLY = aLCS.Y();
}
- double X = IsToLocalCS ? thePnt.X() - myLX : thePnt.X() + myLX;
- double Y = IsToLocalCS ? thePnt.Y() - myLY : thePnt.Y() + myLY;
+ if( IsToLocalCS )
+ {
+ X -= myLX;
+ Y -= myLY;
+ }
+ else
+ {
+ X += myLX;
+ Y += myLY;
+ }
+}
+
+void HYDROData_Document::Transform( gp_Pnt& thePnt, bool IsToLocalCS ) const
+{
+ double X = thePnt.X();
+ double Y = thePnt.Y();
double Z = thePnt.Z();
+ Transform( X, Y, IsToLocalCS );
thePnt = gp_Pnt( X, Y, Z );
}
+void HYDROData_Document::Transform( gp_XYZ& thePnt, bool IsToLocalCS ) const
+{
+ double X = thePnt.X();
+ double Y = thePnt.Y();
+ double Z = thePnt.Z();
+ Transform( X, Y, IsToLocalCS );
+ thePnt = gp_XYZ( X, Y, Z );
+}
class QFile;
class gp_Pnt2d;
class gp_Pnt;
+class gp_XYZ;
/**
* Errors that could appear on document open/save actions.
HYDRODATA_EXPORT gp_Pnt2d GetLocalCS() const;
HYDRODATA_EXPORT void SetLocalCS( const gp_Pnt2d& );
+ HYDRODATA_EXPORT void Transform( double& X, double& Y, bool IsToLocalCS ) const;
HYDRODATA_EXPORT void Transform( gp_Pnt& thePnt, bool IsToLocalCS ) const;
+ HYDRODATA_EXPORT void Transform( gp_XYZ& thePnt, bool IsToLocalCS ) const;
public:
</message>
<message>
<source>COORDINATES_INFO</source>
- <translation>
-X: %1, Y: %2
-WX: %3, WY: %4
- </translation>
+ <translation>Local CS: (%1, %2); Global CS: (%3, %4)</translation>
</message>
<message>
<source>POLYLINE3D_POLYLINE</source>