qwt_point_3d.h
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_POINT_3D_H
#define QWT_POINT_3D_H
#include "qwt_global.h"
#include <qpoint.h>
#include <qmetatype.h>
class QWT_EXPORT QwtPoint3D
{
public:
QwtPoint3D();
QwtPoint3D( double x, double y, double z );
QwtPoint3D( const QPointF& );
bool isNull() const;
double x() const;
double y() const;
double z() const;
double& rx();
double& ry();
double& rz();
void setX( double x );
void setY( double y );
void setZ( double y );
QPointF toPoint() const;
bool operator==( const QwtPoint3D& ) const;
bool operator!=( const QwtPoint3D& ) const;
private:
double m_x;
double m_y;
double m_z;
};
Q_DECLARE_TYPEINFO( QwtPoint3D, Q_MOVABLE_TYPE );
Q_DECLARE_METATYPE( QwtPoint3D );
#ifndef QT_NO_DEBUG_STREAM
QWT_EXPORT QDebug operator<<( QDebug, const QwtPoint3D& );
#endif
inline QwtPoint3D::QwtPoint3D()
: m_x( 0.0 )
, m_y( 0.0 )
, m_z( 0.0 )
{
}
inline QwtPoint3D::QwtPoint3D( double x, double y, double z = 0.0 )
: m_x( x )
, m_y( y )
, m_z( z )
{
}
inline QwtPoint3D::QwtPoint3D( const QPointF& other )
: m_x( other.x() )
, m_y( other.y() )
, m_z( 0.0 )
{
}
inline bool QwtPoint3D::isNull() const
{
return m_x == 0.0 && m_y == 0.0 && m_z == 0.0;
}
inline double QwtPoint3D::x() const
{
return m_x;
}
inline double QwtPoint3D::y() const
{
return m_y;
}
inline double QwtPoint3D::z() const
{
return m_z;
}
inline double& QwtPoint3D::rx()
{
return m_x;
}
inline double& QwtPoint3D::ry()
{
return m_y;
}
inline double& QwtPoint3D::rz()
{
return m_z;
}
inline void QwtPoint3D::setX( double x )
{
m_x = x;
}
inline void QwtPoint3D::setY( double y )
{
m_y = y;
}
inline void QwtPoint3D::setZ( double z )
{
m_z = z;
}
inline QPointF QwtPoint3D::toPoint() const
{
return QPointF( m_x, m_y );
}
inline bool QwtPoint3D::operator==( const QwtPoint3D& other ) const
{
return ( m_x == other.m_x ) && ( m_y == other.m_y ) && ( m_z == other.m_z );
}
inline bool QwtPoint3D::operator!=( const QwtPoint3D& other ) const
{
return !operator==( other );
}
#endif
QwtPoint3D
QwtPoint3D class defines a 3D point in double coordinates.
Definition: qwt_point_3d.h:23
QwtPoint3D::z
double z() const
Definition: qwt_point_3d.h:115
QwtPoint3D::operator==
bool operator==(const QwtPoint3D &) const
Definition: qwt_point_3d.h:165
QwtPoint3D::y
double y() const
Definition: qwt_point_3d.h:109
QwtPoint3D::operator!=
bool operator!=(const QwtPoint3D &) const
Definition: qwt_point_3d.h:171
QwtPoint3D::setY
void setY(double y)
Sets the y-coordinate of the point to the value specified by y.
Definition: qwt_point_3d.h:145
QwtPoint3D::rx
double & rx()
Definition: qwt_point_3d.h:121
QwtPoint3D::ry
double & ry()
Definition: qwt_point_3d.h:127
QwtPoint3D::x
double x() const
Definition: qwt_point_3d.h:103
QwtPoint3D::QwtPoint3D
QwtPoint3D()
Definition: qwt_point_3d.h:65
QwtPoint3D::setZ
void setZ(double y)
Sets the z-coordinate of the point to the value specified by z.
Definition: qwt_point_3d.h:151
QwtPoint3D::rz
double & rz()
Definition: qwt_point_3d.h:133
QwtPoint3D::isNull
bool isNull() const
Definition: qwt_point_3d.h:97
QwtPoint3D::toPoint
QPointF toPoint() const
Definition: qwt_point_3d.h:159
QwtPoint3D::setX
void setX(double x)
Sets the x-coordinate of the point to the value specified by x.
Definition: qwt_point_3d.h:139