LIBPOLYMNIA
公開メンバ関数 | 全メンバ一覧
polymnia::HexPainter< C_ > クラステンプレート

正六角形マス描畫クラス [詳解]

#include <hex.h>

公開メンバ関数

 HexPainter (int r, int p0, int q0)
 構築子 [詳解]
 
void resetOrigin (int p0, int q0)
 原點の再設定 [詳解]
 
void resetRadius (int r)
 HEXの大きさの再設定 [詳解]
 
void getOrigin (int &p, int &q) const
 原點の取得 [詳解]
 
int getRadius () const
 HEXの大きさの取得 [詳解]
 
void draw (polymnia::ImageBuffer< C_ > *pict, int x, int y, const C_ &col)
 HEX外周の描畫 [詳解]
 
void draw (polymnia::ImageBuffer< C_ > *pict, int x, int y, int w, int h, const C_ &col)
 指定範圍のHEX外周の描畫 [詳解]
 
void fill (polymnia::ImageBuffer< C_ > *pict, int x, int y, const C_ &col)
 HEXの塗り潰し [詳解]
 
void fill (polymnia::ImageBuffer< C_ > *pict, int x, int y, int w, int h, const C_ &col)
 指定範圍のHEXの塗り潰し [詳解]
 
void getHexPosition (int &x, int &y, int p, int q)
 HEX位置の取得 [詳解]
 
void getPixelPosition (int &p, int &q, int x, int y)
 ピクセル座標の取得 [詳解]
 
void getPixelPosition (double &p, double &q, int x, int y)
 ピクセル位置の取得 [詳解]
 
int distance (int x0, int y0, int x1, int y1)
 距離の取得 [詳解]
 

詳解

template<class C_>
class polymnia::HexPainter< C_ >

正六角形マス描畫クラス

内部狀態として以下の値を保持し、 それらに基づいて正六角形の升目を描畫する。

構築子と解体子

◆ HexPainter()

template<class C_ >
polymnia::HexPainter< C_ >::HexPainter ( int  r,
int  p0,
int  q0 
)
inline

構築子

引数
rHEXの邊の長さR
p0HEX(0, 0)の中心の水平座標P0
q0HEX(0, 0)の中心の垂直座標Q0

関数詳解

◆ distance()

template<class C_ >
int polymnia::HexPainter< C_ >::distance ( int  x0,
int  y0,
int  x1,
int  y1 
)
inline

距離の取得

HEX(x0, y0)と(x1, y1)の距離を取得する。

◆ draw() [1/2]

template<class C_ >
void polymnia::HexPainter< C_ >::draw ( polymnia::ImageBuffer< C_ > *  pict,
int  x,
int  y,
const C_ &  col 
)
inline

HEX外周の描畫

HEX(x, y)の外周を色colで描畫する。

引数
pict描畫對象のイメージバッファ
xHEXの水平座標
yHEXの垂直座標
colHEX外周を描畫する色
呼び出し関係図:

◆ draw() [2/2]

template<class C_ >
void polymnia::HexPainter< C_ >::draw ( polymnia::ImageBuffer< C_ > *  pict,
int  x,
int  y,
int  w,
int  h,
const C_ &  col 
)
inline

指定範圍のHEX外周の描畫

HEX(x, y)-(x + w - 1, y + h - 1)の外周を色colで描畫する。

引数
pict描畫對象のイメージバッファ
x領域左上のHEXの水平座標
y領域左上のHEXの垂直座標
w領域の幅
h領域の高さ
colHEX外周を描畫する色
呼び出し関係図:

◆ fill() [1/2]

template<class C_ >
void polymnia::HexPainter< C_ >::fill ( polymnia::ImageBuffer< C_ > *  pict,
int  x,
int  y,
const C_ &  col 
)
inline

HEXの塗り潰し

HEX(x, y)を色colで塗り潰す。

引数
pict描畫對象のイメージバッファ
xHEXのx座標
yHEXのy座標
colHEXを塗り潰す色

◆ fill() [2/2]

template<class C_ >
void polymnia::HexPainter< C_ >::fill ( polymnia::ImageBuffer< C_ > *  pict,
int  x,
int  y,
int  w,
int  h,
const C_ &  col 
)
inline

指定範圍のHEXの塗り潰し

HEX(x, y)を色colで塗り潰す。

引数
pict描畫對象のイメージバッファ
x領域左上のHEXの水平座標
y領域左上のHEXの垂直座標
w領域の幅
h領域の高さ
colHEXを塗り潰す色
呼び出し関係図:

◆ getHexPosition()

template<class C_ >
void polymnia::HexPainter< C_ >::getHexPosition ( int &  x,
int &  y,
int  p,
int  q 
)
inline

HEX位置の取得

ピクセル(p, q)を含むHEX(x, y)を取得する。

引数
[out]xHEXの水平座標
[out]yHEXの垂直座標
[in]pピクセルの水平座標
[in]qピクセルの垂直座標

◆ getOrigin()

template<class C_ >
void polymnia::HexPainter< C_ >::getOrigin ( int &  p,
int &  q 
) const
inline

原點の取得

HEX(0, 0)の中心のピクセル座標(P0, Q0)を取得する。

引数
[out]pP0
[out]qQ0

◆ getPixelPosition() [1/2]

template<class C_ >
void polymnia::HexPainter< C_ >::getPixelPosition ( int &  p,
int &  q,
int  x,
int  y 
)
inline

ピクセル座標の取得

HEX(x, y)の中心のピクセル座標(p, q)を取得する。

引数
[out]pピクセルの水平座標
[out]qピクセルの垂直座標
[in]xHEXの水平座標
[in]yHEXの垂直座標

◆ getPixelPosition() [2/2]

template<class C_ >
void polymnia::HexPainter< C_ >::getPixelPosition ( double &  p,
double &  q,
int  x,
int  y 
)
inline

ピクセル位置の取得

HEX(x, y)の中心のピクセル座標(p, q)を取得する。

引数
[out]pピクセルの水平座標
[out]qピクセルの垂直座標
[in]xHEXの水平座標
[in]yHEXの垂直座標

◆ getRadius()

template<class C_ >
int polymnia::HexPainter< C_ >::getRadius ( ) const
inline

HEXの大きさの取得

HEXの一邊の長さ(=半徑)Rを取得する。

◆ resetOrigin()

template<class C_ >
void polymnia::HexPainter< C_ >::resetOrigin ( int  p0,
int  q0 
)
inline

原點の再設定

HEX(0, 0)の中心のピクセル座標(P0, Q0)を變更する。

引数
p0新たなP0
q0新たなQ0

◆ resetRadius()

template<class C_ >
void polymnia::HexPainter< C_ >::resetRadius ( int  r)
inline

HEXの大きさの再設定

HEXの一邊の長さ(=半徑)Rを變更する。

引数
r新たなR

このクラス詳解は次のファイルから抽出されました: