FineKernelToolKit  2.9.0
 全て クラス ネームスペース ファイル 関数 変数 型定義 列挙型 列挙型の値 フレンド マクロ定義 ページ
Projection.h
説明を見る。
1 /****************************************************************************
2  *
3  * Copyright (c) 1999-2014, Fine Kernel Project, All rights reserved.
4  *
5  * Redistribution and use in source and binary forms,
6  * with or without modification, are permitted provided that the
7  * following conditions are met:
8  *
9  * - Redistributions of source code must retain the above
10  * copyright notice, this list of conditions and the
11  * following disclaimer.
12  *
13  * - Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the
15  * following disclaimer in the documentation and/or
16  * other materials provided with the distribution.
17  *
18  * - Neither the name of the copyright holders nor the names
19  * of its contributors may be used to endorse or promote
20  * products derived from this software without specific
21  * prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
33  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  ****************************************************************************/
37 /****************************************************************************
38  *
39  * Copyright (c) 1999-2014, Fine Kernel Project, All rights reserved.
40  *
41  * 本ソフトウェアおよびソースコードのライセンスは、基本的に
42  * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
43  *
44  * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
45  * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
46  *
47  * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
48  * および下記免責条項を含めること。
49  *
50  * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
51  * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
52  * 含めること。
53  *
54  * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
55  * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
56  * コントリビューターの名前を使用してはならない。
57  *
58  * 本ソフトウェアは、著作権者およびコントリビューターによって「現
59  * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
60  * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
61  * に限定されない、いかなる保証もないものとします。著作権者もコン
62  * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
63  * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
64  * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
65  * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
66  * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
67  * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
68  * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
69  * ついて、一切責任を負わないものとします。
70  *
71  ****************************************************************************/
72 #ifndef __FK_PROJECTION_HEADER__
73 #define __FK_PROJECTION_HEADER__
74 
75 #include <FK/Base.h>
76 
83 };
84 
85 
87 
94 class fk_ProjectBase : public fk_BaseObject {
95  private:
96  fk_ProjectMode Mode;
97 
98  protected:
99 
100 #ifndef FK_DOXYGEN_USER_PROCESS
101 
102  void SetMode(fk_ProjectMode);
103 
104 #endif
105 
106  public:
107 
110 
112  virtual ~fk_ProjectBase();
113 
115 
120  fk_ProjectMode getMode(void) const;
121 };
122 
124 
161  private:
162  double Fovy;
163  double Near, Far;
164 
165  public:
166 
168 
175  fk_Perspective(double fovy = 2.0*FK_PI/9.0,
176  double near = 1.0,
177  double far = 6000.0);
178 
180  virtual ~fk_Perspective();
181 
184 
187 
189 
194  void setFovy(double fovy);
195 
197 
202  void setNear(double near);
203 
205 
210  void setFar(double far);
211 
213 
220  void setAll(double fovy, double near, double far);
221 
223 
228  double getFovy(void) const;
229 
230 
232 
237  double getNear(void) const;
238 
240 
245  double getFar(void) const;
246 };
247 
249 
282 class fk_Frustum : public fk_ProjectBase {
283  private:
284  double Left, Right, Bottom, Top, Near, Far;
285 
286  public:
288 
298  fk_Frustum(double left = -10.0,
299  double right = 10.0,
300  double bottom = -10.0,
301  double top = 10.0,
302  double near = 1.0,
303  double far = 6000.0);
304 
306  virtual ~fk_Frustum();
307 
309  fk_Frustum(const fk_Frustum &);
310 
312  fk_Frustum & operator =(const fk_Frustum &);
313 
315 
320  void setLeft(double left);
321 
323 
328  void setRight(double right);
329 
331 
336  void setBottom(double bottom);
337 
339 
344  void setTop(double top);
345 
347 
352  void setNear(double near);
353 
355 
360  void setFar(double far);
361 
363 
373  void setAll(double left,
374  double right,
375  double bottom,
376  double top,
377  double near,
378  double far);
379 
381 
386  double getLeft(void) const;
387 
389 
394  double getRight(void) const;
395 
397 
402  double getBottom(void) const;
403 
405 
410  double getTop(void) const;
411 
413 
418  double getNear(void) const;
419 
421 
426  double getFar(void) const;
427 };
428 
430 
450 class fk_Ortho : public fk_ProjectBase {
451  private:
452  double Left, Right;
453  double Bottom, Top;
454  double Near, Far;
455 
456  public:
457 
459 
470  fk_Ortho(double left = -500.0, double right = 500.0,
471  double bottom = -500.0, double top = 500.0,
472  double near = 0.0, double far = 10000.0);
473 
475  virtual ~fk_Ortho();
476 
478  fk_Ortho(const fk_Ortho &);
479 
481  fk_Ortho & operator =(const fk_Ortho &);
482 
484 
489  void setLeft(double left);
490 
492 
497  void setRight(double right);
498 
500 
505  void setBottom(double bottom);
506 
508 
513  void setTop(double top);
514 
516 
521  void setNear(double near);
522 
524 
529  void setFar(double far);
530 
532 
543  void setAll(double left, double right,
544  double bottom, double top,
545  double near, double far);
546 
548 
553  double getLeft(void) const;
554 
556 
561  double getRight(void) const;
562 
564 
569  double getBottom(void) const;
570 
572 
577  double getTop(void) const;
578 
580 
585  double getNear(void) const;
586 
588 
593  double getFar(void) const;
594 };
595 
596 #endif // !__FK_PROJECTION_HEADER__
double getFovy(void) const
視野角参照関数
fk_ProjectMode
投影法を表す列挙型
Definition: Projection.h:78
double getFar(void) const
クリッピング遠距離距離参照関数
double getBottom(void) const
クリッピング下側面距離参照関数
void setAll(double fovy, double near, double far)
一括設定関数
const double FK_PI
円周率
Definition: Base.h:113
double getNear(void) const
クリッピング近距離距離参照関数
void setFar(double far)
クリッピング遠距離距離設定関数
double getNear(void) const
クリッピング近距離面距離取得関数
void setFar(double far)
クリッピング遠距離面距離設定関数
virtual ~fk_Frustum()
デストラクタ
対称透視投影法
Definition: Projection.h:80
double getNear(void) const
クリッピング近距離面距離参照関数
対称透視投影法を制御するクラス
Definition: Projection.h:160
fk_Perspective(double fovy=2.0 *FK_PI/9.0, double near=1.0, double far=6000.0)
コンストラクタ
void setRight(double right)
視錐台右側符号付き距離設定関数
double getFar(void) const
クリッピング遠距離面距離取得関数
void setTop(double top)
クリッピング左側面距離設定関数
fk_Frustum(double left=-10.0, double right=10.0, double bottom=-10.0, double top=10.0, double near=1.0, double far=6000.0)
コンストラクタ
void setBottom(double bottom)
クリッピング左側面距離設定関数
void setNear(double near)
クリッピング近距離面距離設定関数
virtual ~fk_Ortho()
デストラクタ
void setFar(double far)
クリッピング遠距離面距離設定関数
void setBottom(double bottom)
視錐台下側符号付き距離設定関数
投影法の基底クラス
Definition: Projection.h:94
void setFovy(double fovy)
視野角設定関数
fk_ProjectMode getMode(void) const
投影法参照関数
virtual ~fk_ProjectBase()
デストラクタ
void setNear(double near)
クリッピング近距離距離設定関数
void setNear(double near)
クリッピング近距離面距離設定関数
void setRight(double right)
クリッピング左側面距離設定関数
virtual ~fk_Perspective()
デストラクタ
double getLeft(void) const
クリッピング左側面距離参照関数
fk_Frustum & operator=(const fk_Frustum &)
単純代入演算子
FK の各クラスの基盤となる基本クラス
Definition: Base.h:212
double getRight(void) const
視錐台右側符号付き距離取得関数
一般透視投影を制御するクラス
Definition: Projection.h:282
double getRight(void) const
クリッピング右側面距離参照関数
void setAll(double left, double right, double bottom, double top, double near, double far)
一括設定関数
double getTop(void) const
視錐台上側符号付き距離取得関数
double getLeft(void) const
視錐台左側符号付き距離取得関数
void setAll(double left, double right, double bottom, double top, double near, double far)
一括設定関数
void setTop(double top)
視錐台上側符号付き距離設定関数
fk_Ortho & operator=(const fk_Ortho &)
単純代入演算子
void setLeft(double left)
クリッピング左側面距離設定関数
fk_ProjectBase(fk_ProjectMode=FK_NONE_PROJ_MODE)
コンストラクタ
fk_Perspective & operator=(const fk_Perspective &)
単純代入演算子
fk_Ortho(double left=-500.0, double right=500.0, double bottom=-500.0, double top=500.0, double near=0.0, double far=10000.0)
コンストラクタ
void setLeft(double left)
視錐台左側符号付き距離設定関数
double getTop(void) const
クリッピング上側面距離参照関数
double getFar(void) const
クリッピング遠距離面距離参照関数
平行投影法
Definition: Projection.h:82
平行投影法を制御するクラス
Definition: Projection.h:450
double getBottom(void) const
視錐台下側符号付き距離取得関数
指定なし
Definition: Projection.h:79
一般透視投影法
Definition: Projection.h:81