FineKernelToolKit 4.2.13
読み取り中…
検索中…
一致する文字列を見つけられません
BezCurve.h
[詳解]
1#if !defined(__FK_BEZCURVE_HEADER__)
2#define __FK_BEZCURVE_HEADER__
3
4#include <FK/Curve.h>
5#include <FK/Matrix.h>
6
7namespace FK {
8
10
16 class fk_BezCurve : public fk_Curve {
17
18#if !defined(FK_DOXYGEN_USER_PROCESS)
19 class Member {
20 public:
21 int deg;
22
23 Member(void);
24 };
25#endif
26 public:
29
31 virtual ~fk_BezCurve();
32
34
39 void init(void);
40
42
54 bool setDegree(int deg);
55
57
62 int getDegree(void);
63
65
74 fk_Vector pos(double t);
75
77
86 fk_Vector diff(double t);
87
89
102 bool split(double t, std::vector<fk_Vector> *C);
103
105
116 void calcCrossParam(fk_Vector S, fk_Vector E, std::vector<double> *A);
117
119
135 void calcCrossParam(fk_Matrix M, fk_Vector S, fk_Vector E, std::vector<double> *A);
136
137 private:
138 std::unique_ptr<Member> _m;
139
140 void MakeDiv(double, std::vector<std::vector<fk_Vector> > &);
141 double CrossZero(fk_Vector &, fk_Vector &);
142 bool CrossCH(std::vector<fk_Vector> *, double *, double *);
143 void CrossFunc(std::vector<fk_Vector> *, double, double, std::vector<double> *);
144 void CheckCross(std::vector<fk_Vector> *, std::vector<double> *,
145 std::vector<double> *, double);
146 };
147}
148
149#endif // __FK_BEZCURVE_HEADER__
150
151/****************************************************************************
152 *
153 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
154 *
155 * Redistribution and use in source and binary forms,
156 * with or without modification, are permitted provided that the
157 * following conditions are met:
158 *
159 * - Redistributions of source code must retain the above
160 * copyright notice, this list of conditions and the
161 * following disclaimer.
162 *
163 * - Redistributions in binary form must reproduce the above
164 * copyright notice, this list of conditions and the
165 * following disclaimer in the documentation and/or
166 * other materials provided with the distribution.
167 *
168 * - Neither the name of the copyright holders nor the names
169 * of its contributors may be used to endorse or promote
170 * products derived from this software without specific
171 * prior written permission.
172 *
173 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
174 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
175 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
176 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
177 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
178 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
179 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
180 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
181 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
182 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
183 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
184 * POSSIBILITY OF SUCH DAMAGE.
185 *
186 ****************************************************************************/
187/****************************************************************************
188 *
189 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
190 *
191 * 本ソフトウェアおよびソースコードのライセンスは、基本的に
192 * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
193 *
194 * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
195 * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
196 *
197 * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
198 * および下記免責条項を含めること。
199 *
200 * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
201 * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
202 * 含めること。
203 *
204 * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
205 * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
206 * コントリビューターの名前を使用してはならない。
207 *
208 * 本ソフトウェアは、著作権者およびコントリビューターによって「現
209 * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
210 * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
211 * に限定されない、いかなる保証もないものとします。著作権者もコン
212 * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
213 * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
214 * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
215 * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
216 * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
217 * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
218 * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
219 * ついて、一切責任を負わないものとします。
220 *
221 ****************************************************************************/
Bezier曲線を生成、管理するクラス
Definition BezCurve.h:16
void init(void)
初期化用関数
void calcCrossParam(fk_Matrix M, fk_Vector S, fk_Vector E, std::vector< double > *A)
変換行列付直線交点算出関数
int getDegree(void)
次数参照関数
void calcCrossParam(fk_Vector S, fk_Vector E, std::vector< double > *A)
直線交点算出関数
fk_BezCurve(void)
コンストラクタ
fk_Vector diff(double t)
曲線1階微分ベクトル算出関数
fk_Vector pos(double t)
曲線算出関数
bool split(double t, std::vector< fk_Vector > *C)
曲線分割制御点算出関数
bool setDegree(int deg)
次数設定関数
virtual ~fk_BezCurve()
デストラクタ
曲線用純粋仮想クラス
Definition Curve.h:22
一般4元正方行列を管理するクラス
Definition Matrix.h:549
3次元ベクトルを管理するクラス
Definition Vector.h:45
Fine Kernel Toolkit 名前空間
Definition Angle.h:6