WebCFace 2.5.2
Web-based Communication Framework & Dashboard-like UI
Loading...
Searching...
No Matches
Point Class Reference

3次元 or 2次元の座標を表すクラス。 More...

#include <webcface/transform.h>

Inheritance diagram for Point:
[legend]

Public Member Functions

 Point (const std::array< double, 3 > &pos={0, 0, 0})
 3次元座標を初期化
 
 Point (const std::array< double, 2 > &pos)
 2次元座標を初期化
 
 Point (double x, double y, double z=0)
 2or3次元座標を初期化
 
template<typename R , typename traits::ArrayLikeTrait< R >::ArrayLike = traits::TraitOk, typename traits::ArraySizeTrait< R, 3 >::SizeMatchOrDynamic = traits::TraitOk>
 Point (const R &pos)
 3次元座標を初期化
 
std::array< double, 3 > pos () const
 3次元座標を取得
 
std::array< double, 3 > & pos ()
 3次元座標を取得・変更
 
double pos (std::size_t index) const
 座標を取得
 
double & pos (std::size_t i)
 座標を取得・変更
 
Point operator+ (const Point &other) const
 2つのPointの x, y, z の各要素を加算したPointを返す
 
Point operator- () const
 x, y, z の各要素の符号を反転したPointを返す
 
Point operator+ () const
 
Point operator- (const Point &other) const
 
Pointoperator+= (const Point &other)
 
Pointoperator-= (const Point &other)
 
Point operator* (double scalar) const
 x, y, z の各要素をスカラー倍したPointを返す
 
Pointoperator*= (double scalar)
 
Point operator/ (double scalar) const
 x, y, z の各要素をスカラーで割ったPointを返す
 
Pointoperator/= (double scalar)
 
bool operator== (const Point &other) const
 
bool operator!= (const Point &other) const
 
bool operator== (const Transform &)=delete
 
bool operator!= (const Transform &)=delete
 

Protected Attributes

std::array< double, 3 > pos_
 

Friends

Point operator* (double scalar, const Point &point)
 x, y, z の各要素をスカラー倍したPointを返す
 

Detailed Description

3次元 or 2次元の座標を表すクラス。

Since
ver1.4

(ver1.6〜) 2次元の座標を表す場合にも使われ、その場合z=0とする。

Constructor & Destructor Documentation

◆ Point() [1/4]

Point ( const std::array< double, 3 > &  pos = {0, 0, 0})
inline

3次元座標を初期化

◆ Point() [2/4]

Point ( const std::array< double, 2 > &  pos)
inline

2次元座標を初期化

Since
ver1.6

◆ Point() [3/4]

Point ( double  x,
double  y,
double  z = 0 
)
inline

2or3次元座標を初期化

◆ Point() [4/4]

template<typename R , typename traits::ArrayLikeTrait< R >::ArrayLike = traits::TraitOk, typename traits::ArraySizeTrait< R, 3 >::SizeMatchOrDynamic = traits::TraitOk>
Point ( const R &  pos)
inline

3次元座標を初期化

Since
ver2.5 std::arrayに限らず任意の配列型(固定長で3要素か、またはvectorのように可変)
Todo:
std::array以外の要素数2の配列の場合エラーになってしまう

Member Function Documentation

◆ operator!=() [1/2]

bool operator!= ( const Point other) const
inline

◆ operator!=() [2/2]

bool operator!= ( const Transform )
delete

◆ operator*()

Point operator* ( double  scalar) const
inline

x, y, z の各要素をスカラー倍したPointを返す

Since
ver2.5

◆ operator*=()

Point & operator*= ( double  scalar)
inline
Since
ver2.5

◆ operator+() [1/2]

Point operator+ ( ) const
inline
Since
ver2.5

何もせずthisを返す

◆ operator+() [2/2]

Point operator+ ( const Point other) const
inline

2つのPointの x, y, z の各要素を加算したPointを返す

Since
ver2.5

◆ operator+=()

Point & operator+= ( const Point other)
inline
Since
ver2.5

◆ operator-() [1/2]

Point operator- ( ) const
inline

x, y, z の各要素の符号を反転したPointを返す

Since
ver2.5

◆ operator-() [2/2]

Point operator- ( const Point other) const
inline
Since
ver2.5

this + (-other) と同じ。

◆ operator-=()

Point & operator-= ( const Point other)
inline
Since
ver2.5

◆ operator/()

Point operator/ ( double  scalar) const
inline

x, y, z の各要素をスカラーで割ったPointを返す

Since
ver2.5

◆ operator/=()

Point & operator/= ( double  scalar)
inline
Since
ver2.5

◆ operator==() [1/2]

bool operator== ( const Point other) const
  • (ver2.5〜) x, y, z の各要素の差が 1e-8 未満のときtrue
  • (ver2.5〜) Transformとの比較は禁止

◆ operator==() [2/2]

bool operator== ( const Transform )
delete

◆ pos() [1/4]

std::array< double, 3 > & pos ( )
inline

3次元座標を取得・変更

Since
ver1.6

◆ pos() [2/4]

std::array< double, 3 > pos ( ) const
inline

3次元座標を取得

◆ pos() [3/4]

double & pos ( std::size_t  i)
inline

座標を取得・変更

Since
ver1.6
Parameters
index0→x, 1→y, 2→z

◆ pos() [4/4]

double pos ( std::size_t  index) const
inline

座標を取得

Since
ver1.6
Parameters
index0→x, 1→y, 2→z

Friends And Related Symbol Documentation

◆ operator*

Point operator* ( double  scalar,
const Point point 
)
friend

x, y, z の各要素をスカラー倍したPointを返す

Since
ver2.5

Member Data Documentation

◆ pos_

std::array<double, 3> pos_
protected

The documentation for this class was generated from the following files: