FineKernelToolKit  3.1.0
Vector_CLI.h
[詳解]
1 // Vector_CLI.h
2 
3 #pragma once
4 
5 #include <FK/Vector.h>
6 
7 namespace FK_CLI
8 {
9  using namespace System;
10 
12  public enum class fk_Axis {
13  X,
14  Y,
15  Z
16  };
17 
19 
37  public ref class fk_Vector {
38 
39  internal:
40  //::fk_Vector *pVec;
41  double x_, y_, z_;
42 
43  static ::fk_Axis GetAxis(fk_Axis);
44  static operator ::fk_Vector (fk_Vector^);
45 
46  public:
47 
49 
52  fk_Vector();
53 
55 
60  fk_Vector(double x, double y, double z);
61 
63 
68  fk_Vector(fk_Vector^ V);
69 
70 #ifndef FK_DOXYGEN_USER_PROCESS
71  fk_Vector(::fk_Vector *);
73 #endif
74 
75  // デストラクタ
76  ~fk_Vector();
77 
79 
84  property double x {
85  double get();
86  void set(double);
87  }
88 
90 
95  property double y {
96  double get();
97  void set(double);
98  }
99 
101 
106  property double z {
107  double get();
108  void set(double);
109  }
110 
112 
113 
115 
120  static fk_Vector^ operator-(fk_Vector^);
121 
123 
125 
126 
128 
143  static double operator*(fk_Vector^, fk_Vector^);
144 
146 
154  static fk_Vector^ operator+(fk_Vector^, fk_Vector^);
155 
157 
165  static fk_Vector^ operator-(fk_Vector^, fk_Vector^);
166 
168 
176  static fk_Vector^ operator*(fk_Vector^, double);
177 
179 
187  static fk_Vector^ operator*(double, fk_Vector^);
188 
190 
196  static fk_Vector^ operator/(fk_Vector^, double);
197 
199 
227  static fk_Vector^ operator^(fk_Vector^, fk_Vector^);
228 
230 
232 
233 
235 
245  static void operator *= (fk_Vector^, double);
246 
248 
260  static void operator /= (fk_Vector^, double);
261 
263 
273  static void operator += (fk_Vector^, fk_Vector^);
274 
276 
286  static void operator -= (fk_Vector^, fk_Vector^);
287 
289 
291 
300  bool Equals(fk_Vector^ V);
301 
303 
312  virtual bool Equals(Object^ V) override;
313 
315 
320  String^ ToString() override;
321 
323 
330  void Set(double x, double y, double z);
331 
333 
339  void Set(double x, double y);
340 
342 
351  double Dist();
352 
354 
365  double Dist2();
366 
368 
382  bool Normalize();
383 
385 
388  bool IsZero();
389 
391 
409  fk_Vector^ Proj(fk_Vector^ Q);
410 
411 
413 
424  fk_Vector^ Perp(fk_Vector^ Q);
425 
426 
428 
431  void Init(void);
432  };
433 
435 
446  public ref class fk_HVector {
447  internal:
448  double x_, y_, z_, w_;
449  static operator ::fk_HVector (fk_HVector^);
450 
451  public:
452 #ifndef FK_DOXYGEN_USER_PROCESS
454 #endif
455 
457 
460  fk_HVector();
461 
463 
468  fk_HVector(fk_Vector^ V);
469 
471 
478  fk_HVector(fk_Vector^ V, double w);
479 
481 
487 
489  ~fk_HVector();
490 
492 
497  property double x {
498  double get();
499  void set(double);
500  }
501 
503 
508  property double y {
509  double get();
510  void set(double);
511  }
512 
514 
519  property double z {
520  double get();
521  void set(double);
522  }
523 
525 
530  property double w {
531  double get();
532  void set(double);
533  }
534 
536 
551  static double operator* (fk_HVector^, fk_HVector^);
552 
554 
566  static operator fk_HVector^ (fk_Vector^ V);
567 
569 
579  static operator fk_Vector^ (fk_HVector^ H);
580 
582 
591  bool Equals(fk_HVector^ H);
592 
594 
603  virtual bool Equals(Object^ H) override;
604 
606 
611  String^ ToString() override;
612 
614 
620  void Set(fk_Vector^ V, double w);
621 
623 
631  void Set(double x, double y, double z, double w);
632 
634 
641  void Set(double x, double y, double z);
642 
644 
650  void Set(double x, double y);
651 
653 
658  void Set(fk_Vector^ V);
659 
661 
666  fk_Vector^ GetV(void);
667 
669 
673  void IsPos(void);
674 
676 
680  void IsVec(void);
681 
683 
686  void Init(void);
687  };
688 
690 
704  public ref class fk_FVector {
705  internal:
706  float x_, y_, z_;
707  public:
708 
710 
713  fk_FVector();
714 
716 
721  fk_FVector(float x, float y, float z);
722 
724 
730 
732  ~fk_FVector();
733 
735 
745  static operator fk_FVector ^ (fk_Vector^ V);
746 
748 
753  String^ ToString() override;
754 
756 
761  property float x {
762  float get();
763  void set(float);
764  }
765 
767 
772  property float y {
773  float get();
774  void set(float);
775  }
776 
778 
783  property float z {
784  float get();
785  void set(float);
786  }
787  };
788 }
789 
790 /****************************************************************************
791  *
792  * Copyright (c) 1999-2016, Fine Kernel Project, All rights reserved.
793  *
794  * Redistribution and use in source and binary forms,
795  * with or without modification, are permitted provided that the
796  * following conditions are met:
797  *
798  * - Redistributions of source code must retain the above
799  * copyright notice, this list of conditions and the
800  * following disclaimer.
801  *
802  * - Redistributions in binary form must reproduce the above
803  * copyright notice, this list of conditions and the
804  * following disclaimer in the documentation and/or
805  * other materials provided with the distribution.
806  *
807  * - Neither the name of the copyright holders nor the names
808  * of its contributors may be used to endorse or promote
809  * products derived from this software without specific
810  * prior written permission.
811  *
812  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
813  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
814  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
815  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
816  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
817  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
818  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
819  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
820  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
821  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
822  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
823  * POSSIBILITY OF SUCH DAMAGE.
824  *
825  ****************************************************************************/
826 /****************************************************************************
827  *
828  * Copyright (c) 1999-2016, Fine Kernel Project, All rights reserved.
829  *
830  * 本ソフトウェアおよびソースコードのライセンスは、基本的に
831  * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
832  *
833  * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
834  * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
835  *
836  * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
837  * および下記免責条項を含めること。
838  *
839  * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
840  * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
841  * 含めること。
842  *
843  * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
844  * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
845  * コントリビューターの名前を使用してはならない。
846  *
847  * 本ソフトウェアは、著作権者およびコントリビューターによって「現
848  * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
849  * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
850  * に限定されない、いかなる保証もないものとします。著作権者もコン
851  * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
852  * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
853  * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
854  * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
855  * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
856  * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
857  * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
858  * ついて、一切責任を負わないものとします。
859  *
860  ****************************************************************************/
4次元ベクトルを管理するクラス
Definition: Vector_CLI.h:446
fk_Axis
座標軸を表す列挙型
Definition: Vector_CLI.h:12
3次元ベクトルを管理するクラス
Definition: Vector_CLI.h:37
単精度浮動小数点型3次元ベクトルを管理するクラス
Definition: Vector_CLI.h:704
Definition: AppWindow_CLI.h:11