FineKernelToolKit 4.2.13
読み取り中…
検索中…
一致する文字列を見つけられません
Surface.h
[詳解]
1#if !defined(__FK_SURFACE_HEADER__)
2#define __FK_SURFACE_HEADER__
3
4#include <FK/Vector.h>
5#include <FK/FVecArray.h>
6#include <FK/Line.h>
7#include <FK/Point.h>
8
9namespace FK {
10
12 enum class fk_UV : int {
13 U_S = 0,
14 U_E = 1,
15 V_S = 2,
16 V_E = 3
17 };
18
20
36 class fk_Surface : public fk_Shape {
37
38#if !defined(FK_DOXYGEN_USER_PROCESS)
39 class fk_SurfaceData {
40 public:
41 fk_FVecArray ctrlPos;
42 fk_Line ctrlLine;
43
44 fk_SurfaceData(void);
45 };
46
47 class Member {
48 public:
49 int div;
50 int size;
51 fk_Point ctrlPoint;
52
53 Member(void);
54 };
55#endif
56
57 public:
58
61
63 virtual ~fk_Surface();
64
66
75 virtual fk_Vector pos(double u, double v) = 0;
76
78
87 virtual fk_Vector uDeriv(double u, double v) = 0;
88
90
99 virtual fk_Vector vDeriv(double u, double v) = 0;
100
101 // 曲面法線ベクトル算出関数
111 fk_Vector norm(double u, double v);
112
114
120 void setDiv(int div);
121
123
129 int getDiv(void);
130
131
133
138 int getCtrlSize(void);
139
140#if !defined(FK_DOXYGEN_USER_PROCESS)
141 fk_Line * GetLine(void);
142 fk_Point * GetPoint(void);
143#endif
144
145 protected:
147
157 bool setCtrl(int ID, fk_Vector *pos);
158
160
170 bool setCtrl(int ID, fk_Vector pos);
171
173
184
186
193 void setCtrlSize(int num);
194
196
203 void setCtrlNum(int num);
204
205#if !defined(FK_DOXYGEN_USER_PROCESS)
206 double Bernstein(int, int, double);
207 std::unique_ptr<fk_SurfaceData> _m_surf;
208#endif
209
210 private:
211 std::unique_ptr<Member> _m;
212 };
213}
214
215#endif // __FK_SURFACE_HEADER__
216
217/****************************************************************************
218 *
219 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
220 *
221 * Redistribution and use in source and binary forms,
222 * with or without modification, are permitted provided that the
223 * following conditions are met:
224 *
225 * - Redistributions of source code must retain the above
226 * copyright notice, this list of conditions and the
227 * following disclaimer.
228 *
229 * - Redistributions in binary form must reproduce the above
230 * copyright notice, this list of conditions and the
231 * following disclaimer in the documentation and/or
232 * other materials provided with the distribution.
233 *
234 * - Neither the name of the copyright holders nor the names
235 * of its contributors may be used to endorse or promote
236 * products derived from this software without specific
237 * prior written permission.
238 *
239 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
240 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
241 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
242 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
243 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
244 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
245 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
246 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
247 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
248 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
249 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
250 * POSSIBILITY OF SUCH DAMAGE.
251 *
252 ****************************************************************************/
253/****************************************************************************
254 *
255 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
256 *
257 * 本ソフトウェアおよびソースコードのライセンスは、基本的に
258 * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
259 *
260 * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
261 * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
262 *
263 * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
264 * および下記免責条項を含めること。
265 *
266 * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
267 * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
268 * 含めること。
269 *
270 * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
271 * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
272 * コントリビューターの名前を使用してはならない。
273 *
274 * 本ソフトウェアは、著作権者およびコントリビューターによって「現
275 * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
276 * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
277 * に限定されない、いかなる保証もないものとします。著作権者もコン
278 * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
279 * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
280 * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
281 * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
282 * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
283 * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
284 * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
285 * ついて、一切責任を負わないものとします。
286 *
287 ****************************************************************************/
シェーダー内 attribute 変数用ベクトル管理クラス
Definition FVecArray.h:31
有向線分を生成、管理するクラス
Definition Line.h:22
点群を生成、管理するクラス
Definition Point.h:29
形状用基底クラス
Definition Shape.h:44
曲面用純粋仮想クラス
Definition Surface.h:36
void setCtrlNum(int num)
制御点数設定関数
bool setCtrl(int ID, fk_Vector *pos)
制御点設定関数1
int getCtrlSize(void)
制御点数取得関数
fk_Vector getCtrl(int ID)
制御点取得関数
fk_Vector norm(double u, double v)
virtual ~fk_Surface()
デストラクタ
virtual fk_Vector uDeriv(double u, double v)=0
曲面 u 方向偏微分ベクトル算出関数
bool setCtrl(int ID, fk_Vector pos)
制御点設定関数2
int getDiv(void)
曲面分割数参照関数
virtual fk_Vector vDeriv(double u, double v)=0
曲面 v 方向偏微分ベクトル算出関数
void setCtrlSize(int num)
制御点最大サイズ設定関数
void setDiv(int div)
曲面分割数設定関数
fk_Surface(void)
コンストラクタ
virtual fk_Vector pos(double u, double v)=0
曲面点位置ベクトル算出関数
3次元ベクトルを管理するクラス
Definition Vector.h:45
Fine Kernel Toolkit 名前空間
Definition Angle.h:6
fk_UV
曲面の uv 方向を表す列挙型
Definition Surface.h:12
@ V_S
v側(u始点側)
@ U_S
u側(v始点側)
@ V_E
v側(u終点側)
@ U_E
u側(v終点側)