Skip to content

Commit

Permalink
move SIP_CODE to public section
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Apr 30, 2017
1 parent b82c9b8 commit c5dcfc1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
6 changes: 5 additions & 1 deletion python/core/qgspoint.sip
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ Divides the coordinates in this point by a scalar quantity in place
:rtype: QgsPoint
%End

private:
SIP_PYOBJECT __repr__();
%MethodCode
QString str = "(" + QString::number( sipCpp->x() ) + "," + QString::number( sipCpp->y() ) + ")";
Expand Down Expand Up @@ -331,9 +330,14 @@ Divides the coordinates in this point by a scalar quantity in place
%MethodCode
sipRes = qHash( *sipCpp );
%End

}; // class QgsPoint






/************************************************************************
* This file has been generated automatically from *
* *
Expand Down
29 changes: 14 additions & 15 deletions src/core/qgspoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,6 @@ class CORE_EXPORT QgsPoint
//! Divides the coordinates in this point by a scalar quantity in place
QgsPoint &operator/=( double scalar ) { mX /= scalar; mY /= scalar; return *this; }

private:

//! x coordinate
double mX;

//! y coordinate
double mY;

friend uint qHash( const QgsPoint &pnt );

#ifdef SIP_RUN
SIP_PYOBJECT __repr__();
% MethodCode
Expand Down Expand Up @@ -307,26 +297,36 @@ class CORE_EXPORT QgsPoint
sipRes = qHash( *sipCpp );
% End
#endif

private:

//! x coordinate
double mX;

//! y coordinate
double mY;

friend uint qHash( const QgsPoint &pnt );

}; // class QgsPoint

#ifndef SIP_RUN

inline bool operator==( const QgsPoint &p1, const QgsPoint &p2 )
inline bool operator==( const QgsPoint &p1, const QgsPoint &p2 ) SIP_SKIP
{
if ( qgsDoubleNear( p1.x(), p2.x() ) && qgsDoubleNear( p1.y(), p2.y() ) )
{ return true; }
else
{ return false; }
}

inline std::ostream &operator << ( std::ostream &os, const QgsPoint &p )
inline std::ostream &operator << ( std::ostream &os, const QgsPoint &p ) SIP_SKIP
{
// Use Local8Bit for printouts
os << p.toString().toLocal8Bit().data();
return os;
}

inline uint qHash( const QgsPoint &p )
inline uint qHash( const QgsPoint &p ) SIP_SKIP
{
uint hash;
uint h1 = qHash( static_cast< quint64 >( p.mX ) );
Expand All @@ -335,6 +335,5 @@ inline uint qHash( const QgsPoint &p )
return hash;
}

#endif

#endif //QGSPOINT_H

0 comments on commit c5dcfc1

Please sign in to comment.