#include <Vector.h>
Public Member Functions | |
Vector (T X=0, T Y=0, T Z=0, double N=0.0, double C=1.0, int D=0) | |
virtual | ~Vector (void) |
T | norm2 (void) |
double | norm (void) |
Vector< T > | normalize (void) |
void | init (double C=1.0) |
void | set (T X, T Y=0, T Z=0, double N=0.0, double C=1.0, int D=0) |
T | element1 (void) |
T | element2 (void) |
T | element3 (void) |
T | element (int i) |
template<typename R > | |
Vector< T > & | operator= (const Vector< R > a) |
Public Attributes | |
T | x |
T | y |
T | z |
double | n |
ノルム | |
double | c |
信頼度 | |
int | d |
汎用 |
template <typename t="double"> class Vector
3次元ベクトルの定義
Definition at line 57 of file Vector.h.
Vector | ( | T | X = 0 , |
|
T | Y = 0 , |
|||
T | Z = 0 , |
|||
double | N = 0.0 , |
|||
double | C = 1.0 , |
|||
int | D = 0 | |||
) | [inline] |
T element | ( | int | i | ) | [inline] |
T element1 | ( | void | ) | [inline] |
Definition at line 80 of file Vector.h.
Referenced by jbxl::ExtEulerXYZ2RotMatrix(), jbxl::ExtEulerXZY2RotMatrix(), jbxl::ExtEulerYXZ2RotMatrix(), jbxl::ExtEulerYZX2RotMatrix(), jbxl::ExtEulerZXY2RotMatrix(), jbxl::ExtEulerZYX2RotMatrix(), Quaternion< T >::setExtEulerXYZ(), Quaternion< T >::setExtEulerXZY(), Quaternion< T >::setExtEulerYXZ(), Quaternion< T >::setExtEulerYZX(), Quaternion< T >::setExtEulerZXY(), and Quaternion< T >::setExtEulerZYX().
00080 { return x;}
T element2 | ( | void | ) | [inline] |
Definition at line 81 of file Vector.h.
Referenced by jbxl::ExtEulerXYZ2RotMatrix(), jbxl::ExtEulerXZY2RotMatrix(), jbxl::ExtEulerYXZ2RotMatrix(), jbxl::ExtEulerYZX2RotMatrix(), jbxl::ExtEulerZXY2RotMatrix(), jbxl::ExtEulerZYX2RotMatrix(), Quaternion< T >::setExtEulerXYZ(), Quaternion< T >::setExtEulerXZY(), Quaternion< T >::setExtEulerYXZ(), Quaternion< T >::setExtEulerYZX(), Quaternion< T >::setExtEulerZXY(), and Quaternion< T >::setExtEulerZYX().
00081 { return y;}
T element3 | ( | void | ) | [inline] |
Definition at line 82 of file Vector.h.
Referenced by jbxl::ExtEulerXYZ2RotMatrix(), jbxl::ExtEulerXZY2RotMatrix(), jbxl::ExtEulerYXZ2RotMatrix(), jbxl::ExtEulerYZX2RotMatrix(), jbxl::ExtEulerZXY2RotMatrix(), jbxl::ExtEulerZYX2RotMatrix(), Quaternion< T >::setExtEulerXYZ(), Quaternion< T >::setExtEulerXZY(), Quaternion< T >::setExtEulerYXZ(), Quaternion< T >::setExtEulerYZX(), Quaternion< T >::setExtEulerZXY(), and Quaternion< T >::setExtEulerZYX().
00082 { return z;}
void init | ( | double | C = 1.0 |
) | [inline] |
Definition at line 76 of file Vector.h.
Referenced by FacetTriData::init(), and Vector< T >::normalize().
double norm | ( | void | ) | [inline] |
Definition at line 73 of file Vector.h.
Referenced by jbxl::CollisionTriContour2D(), BREP_CONTOUR::ComputeDirectRS(), jbxl::MSGraph_Pool(), jbxl::operator/(), and jbxl::V2VQuaternion().
T norm2 | ( | void | ) | [inline] |
Definition at line 72 of file Vector.h.
Referenced by jbxl::FillShortageWings_Near(), and jbxl::operator/().
Vector< T > normalize | ( | void | ) | [inline] |
Definition at line 90 of file Vector.h.
References Vector< T >::init(), Vector< T >::n, Vector< T >::x, Vector< T >::y, Vector< T >::z, and jbxl::Zero_Eps.
Referenced by BREP_VERTEX::ComputeNormal(), BREP_CONTOUR::ComputeNormal(), FacetTriData::ComputeTriNormal(), Quaternion< T >::setRotation(), jbxl::SlerpQuaternion(), FacetTriIndex::SurfaceNormal(), jbxl::ToPola(), jbxl::V2VQuaternion(), and jbxl::VectorAngle().
00091 { 00092 double nrm = (double)sqrt(x*x+y*y+z*z); 00093 00094 if (nrm>=Zero_Eps) { 00095 x = (T)(x/nrm); 00096 y = (T)(y/nrm); 00097 z = (T)(z/nrm); 00098 n = 1.0; 00099 } 00100 else { 00101 init(); 00102 } 00103 00104 return *this; 00105 }
void set | ( | T | X, | |
T | Y = 0 , |
|||
T | Z = 0 , |
|||
double | N = 0.0 , |
|||
double | C = 1.0 , |
|||
int | D = 0 | |||
) | [inline] |
template <typename t>=""> void Vector<T>::set(T X, T Y, T Z, double N)
3次元ベクトルに値をセット.
Definition at line 114 of file Vector.h.
References Vector< T >::c, Vector< T >::d, Vector< T >::n, Vector< T >::x, Vector< T >::y, and Vector< T >::z.
Referenced by MeshObjectNode::generatePlanarUVMap(), CBVHTool::getPosData(), jbxl::MSGraph_Pool(), jbxl::MSGraph_Torus(), jbxl::operator*(), jbxl::RotMatrixElements2ExtEulerXYZ(), jbxl::RotMatrixElements2ExtEulerXZY(), jbxl::RotMatrixElements2ExtEulerYXZ(), jbxl::RotMatrixElements2ExtEulerYZX(), jbxl::RotMatrixElements2ExtEulerZXY(), and jbxl::RotMatrixElements2ExtEulerZYX().
00115 { 00116 x = X; 00117 y = Y; 00118 z = Z; 00119 n = N; 00120 c = C; 00121 d = D; 00122 00123 if (n<=0.0) { 00124 n = (double)sqrt(x*x + y*y + z*z); 00125 } 00126 }
double c |
Definition at line 65 of file Vector.h.
Referenced by AffineTrans< double >::execInvScale(), AffineTrans< double >::execInvShift(), AffineTrans< double >::execScale(), AffineTrans< double >::execShift(), jbxl::NewellMethod(), jbxl::NewellMethod4(), jbxl::operator*(), jbxl::operator+(), jbxl::operator-(), jbxl::operator/(), Vector< double >::operator=(), jbxl::operator^(), jbxl::PPPQuaternion(), jbxl::PPVQuaternion(), Vector< T >::set(), jbxl::V2VQuaternion(), and jbxl::VPPQuaternion().
int d |
Definition at line 66 of file Vector.h.
Referenced by Quaternion< T >::execInvRotation(), Quaternion< T >::execRotation(), jbxl::operator*(), jbxl::operator+(), jbxl::operator-(), jbxl::operator/(), Vector< double >::operator=(), and Vector< T >::set().
double n |
Definition at line 64 of file Vector.h.
Referenced by jbxl::CollisionTriContour3D(), CBVHTool::getPosOffset(), jbxl::IsInTriangle(), jbxl::MSGraph_Pool(), jbxl::NewellMethod(), jbxl::NewellMethod4(), Vector< T >::normalize(), jbxl::operator*(), jbxl::operator-(), jbxl::operator/(), Vector< double >::operator=(), jbxl::operator^(), jbxl::ProportionVector(), Vector< T >::set(), Quaternion< T >::setRotation(), jbxl::ToPola(), jbxl::TVectorMultiTolerance(), jbxl::V2VQuaternion(), jbxl::VectorAngle(), and jbxl::Vertex2TVector().
T x |
Definition at line 60 of file Vector.h.
Referenced by ColladaXML::addScene(), jbxl::CompareVertex(), BREP_CONTOUR::ComputeNormal(), BREP_VERTEX::ComputeTolerance(), jbxl::CreateTriSolidFromSTL(), RBound< int >::cutdown(), jbxl::dgree_circle_MSGraph(), AffineTrans< double >::execInvScale(), AffineTrans< double >::execInvShift(), AffineTrans< T >::execMatrixTrans(), TriPolyData::execScale(), FacetBaseData::execScale(), FacetTriData::execScale(), AffineTrans< double >::execScale(), TriPolyData::execShift(), FacetBaseData::execShift(), AffineTrans< double >::execShift(), RBound< int >::fusion(), MeshObjectNode::generatePlanarUVMap(), CBVHTool::getPosData(), CBVHTool::getPosOffset(), jbxl::Local2World(), jbxl::MSGraph_Sphere(), jbxl::NewellMethod(), jbxl::NewellMethod4(), Vector< T >::normalize(), jbxl::object_feature_MSGraph(), jbxl::operator!=(), jbxl::operator*(), jbxl::operator+(), jbxl::operator-(), jbxl::operator/(), Vector< double >::operator=(), jbxl::operator==(), jbxl::operator^(), RBound< int >::outofBounds(), jbxl::println_FacetAsciiSTL(), jbxl::RotMatrixElements2ExtEulerXYZ(), jbxl::RotMatrixElements2ExtEulerXZY(), jbxl::RotMatrixElements2ExtEulerYXZ(), jbxl::RotMatrixElements2ExtEulerYZX(), jbxl::RotMatrixElements2ExtEulerZXY(), jbxl::RotMatrixElements2ExtEulerZYX(), jbxl::same_vector(), Vector< T >::set(), Quaternion< T >::setRotation(), jbxl::ToPola(), jbxl::V2VQuaternion(), jbxl::VectorInvRotation(), jbxl::VectorRotation(), jbxl::Vertex2TVector(), jbxl::wCircle3D(), jbxl::WriteSTLFileA(), and jbxl::WriteSTLFileB().
T y |
Definition at line 61 of file Vector.h.
Referenced by ColladaXML::addScene(), jbxl::CompareVertex(), BREP_CONTOUR::ComputeNormal(), BREP_VERTEX::ComputeTolerance(), jbxl::CreateTriSolidFromSTL(), RBound< int >::cutdown(), jbxl::dgree_circle_MSGraph(), AffineTrans< double >::execInvScale(), AffineTrans< double >::execInvShift(), AffineTrans< T >::execMatrixTrans(), TriPolyData::execScale(), FacetBaseData::execScale(), FacetTriData::execScale(), AffineTrans< double >::execScale(), TriPolyData::execShift(), FacetBaseData::execShift(), AffineTrans< double >::execShift(), RBound< int >::fusion(), MeshObjectNode::generatePlanarUVMap(), CBVHTool::getPosData(), CBVHTool::getPosOffset(), jbxl::Local2World(), jbxl::MSGraph_Sphere(), jbxl::NewellMethod(), jbxl::NewellMethod4(), Vector< T >::normalize(), jbxl::operator!=(), jbxl::operator*(), jbxl::operator+(), jbxl::operator-(), jbxl::operator/(), Vector< double >::operator=(), jbxl::operator==(), jbxl::operator^(), RBound< int >::outofBounds(), jbxl::println_FacetAsciiSTL(), jbxl::RotMatrixElements2ExtEulerXYZ(), jbxl::RotMatrixElements2ExtEulerXZY(), jbxl::RotMatrixElements2ExtEulerYXZ(), jbxl::RotMatrixElements2ExtEulerYZX(), jbxl::RotMatrixElements2ExtEulerZXY(), jbxl::RotMatrixElements2ExtEulerZYX(), jbxl::same_vector(), Vector< T >::set(), Quaternion< T >::setRotation(), jbxl::ToPola(), jbxl::V2VQuaternion(), jbxl::VectorInvRotation(), jbxl::VectorRotation(), jbxl::Vertex2TVector(), jbxl::wCircle3D(), jbxl::WriteSTLFileA(), and jbxl::WriteSTLFileB().
T z |
Definition at line 62 of file Vector.h.
Referenced by ColladaXML::addScene(), jbxl::CompareVertex(), BREP_CONTOUR::ComputeNormal(), BREP_VERTEX::ComputeTolerance(), jbxl::CreateTriSolidFromSTL(), RBound< int >::cutdown(), jbxl::dgree_circle_MSGraph(), AffineTrans< double >::execInvScale(), AffineTrans< double >::execInvShift(), AffineTrans< T >::execMatrixTrans(), TriPolyData::execScale(), FacetBaseData::execScale(), FacetTriData::execScale(), AffineTrans< double >::execScale(), TriPolyData::execShift(), FacetBaseData::execShift(), AffineTrans< double >::execShift(), RBound< int >::fusion(), MeshObjectNode::generatePlanarUVMap(), CBVHTool::getPosData(), CBVHTool::getPosOffset(), jbxl::Local2World(), jbxl::MSGraph_Sphere(), jbxl::NewellMethod(), jbxl::NewellMethod4(), Vector< T >::normalize(), jbxl::operator!=(), jbxl::operator*(), jbxl::operator+(), jbxl::operator-(), jbxl::operator/(), Vector< double >::operator=(), jbxl::operator==(), jbxl::operator^(), RBound< int >::outofBounds(), jbxl::println_FacetAsciiSTL(), jbxl::RotMatrixElements2ExtEulerXYZ(), jbxl::RotMatrixElements2ExtEulerXZY(), jbxl::RotMatrixElements2ExtEulerYXZ(), jbxl::RotMatrixElements2ExtEulerYZX(), jbxl::RotMatrixElements2ExtEulerZXY(), jbxl::RotMatrixElements2ExtEulerZYX(), jbxl::same_vector(), Vector< T >::set(), Quaternion< T >::setRotation(), jbxl::ToPola(), jbxl::V2VQuaternion(), jbxl::VectorInvRotation(), jbxl::VectorRotation(), jbxl::Vertex2TVector(), jbxl::wCircle3D(), jbxl::WriteSTLFileA(), and jbxl::WriteSTLFileB().