qwt_point_3d.h
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* 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 1
#include "qwt_global.h"
#include <qpoint.h>
#ifndef QT_NO_DEBUG_STREAM
#include <qdebug.h>
#endif
class QWT_EXPORT QwtPoint3D
{
public:
QwtPoint3D();
QwtPoint3D( double x, double y, double z );
QwtPoint3D( const QwtPoint3D & );
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 d_x;
double d_y;
double d_z;
};
Q_DECLARE_TYPEINFO(QwtPoint3D, Q_MOVABLE_TYPE);
#ifndef QT_NO_DEBUG_STREAM
QWT_EXPORT QDebug operator<<( QDebug, const QwtPoint3D & );
#endif
inline QwtPoint3D::QwtPoint3D():
d_x( 0.0 ),
d_y( 0.0 ),
d_z( 0.0 )
{
}
inline QwtPoint3D::QwtPoint3D( double x, double y, double z = 0.0 ):
d_x( x ),
d_y( y ),
d_z( z )
{
}
inline QwtPoint3D::QwtPoint3D( const QwtPoint3D &other ):
d_x( other.d_x ),
d_y( other.d_y ),
d_z( other.d_z )
{
}
inline QwtPoint3D::QwtPoint3D( const QPointF &other ):
d_x( other.x() ),
d_y( other.y() ),
d_z( 0.0 )
{
}
inline bool QwtPoint3D::isNull() const
{
return d_x == 0.0 && d_y == 0.0 && d_z == 0.0;
}
inline double QwtPoint3D::x() const
{
return d_x;
}
inline double QwtPoint3D::y() const
{
return d_y;
}
inline double QwtPoint3D::z() const
{
return d_z;
}
inline double &QwtPoint3D::rx()
{
return d_x;
}
inline double &QwtPoint3D::ry()
{
return d_y;
}
inline double &QwtPoint3D::rz()
{
return d_z;
}
inline void QwtPoint3D::setX( double x )
{
d_x = x;
}
inline void QwtPoint3D::setY( double y )
{
d_y = y;
}
inline void QwtPoint3D::setZ( double z )
{
d_z = z;
}
inline QPointF QwtPoint3D::toPoint() const
{
return QPointF( d_x, d_y );
}
inline bool QwtPoint3D::operator==( const QwtPoint3D &other ) const
{
return ( d_x == other.d_x ) && ( d_y == other.d_y ) && ( d_z == other.d_z );
}
inline bool QwtPoint3D::operator!=( const QwtPoint3D &other ) const
{
return !operator==( other );
}
#endif
QwtPoint3D::setY
void setY(double y)
Sets the y-coordinate of the point to the value specified by y.
Definition: qwt_point_3d.h:158
QwtPoint3D::toPoint
QPointF toPoint() const
Definition: qwt_point_3d.h:172
QwtPoint3D::operator==
bool operator==(const QwtPoint3D &) const
Definition: qwt_point_3d.h:178
QwtPoint3D::setZ
void setZ(double y)
Sets the z-coordinate of the point to the value specified by z.
Definition: qwt_point_3d.h:164
QwtPoint3D::z
double z() const
Definition: qwt_point_3d.h:128
QwtPoint3D::operator!=
bool operator!=(const QwtPoint3D &) const
Definition: qwt_point_3d.h:184
QwtPoint3D::QwtPoint3D
QwtPoint3D()
Definition: qwt_point_3d.h:67
QwtPoint3D::setX
void setX(double x)
Sets the x-coordinate of the point to the value specified by x.
Definition: qwt_point_3d.h:152
QwtPoint3D::isNull
bool isNull() const
Definition: qwt_point_3d.h:110
QwtPoint3D::rx
double & rx()
Definition: qwt_point_3d.h:134
QwtPoint3D::y
double y() const
Definition: qwt_point_3d.h:122
QwtPoint3D::x
double x() const
Definition: qwt_point_3d.h:116
QwtPoint3D::rz
double & rz()
Definition: qwt_point_3d.h:146
QwtPoint3D::ry
double & ry()
Definition: qwt_point_3d.h:140
QwtPoint3D
QwtPoint3D class defines a 3D point in double coordinates.
Definition: qwt_point_3d.h:24