Vector< T > Class Template Reference

#include <Vector.h>

Inheritance diagram for Vector< T >:
Inheritance graph
[legend]

List of all members.

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)
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)
element1 (void)
element2 (void)
element3 (void)
element (int i)
template<typename R >
Vector< T > & operator= (const Vector< R > a)

Public Attributes

x
y
z
double n
 ノルム
double c
 信頼度
int d
 汎用

Detailed Description

template<typename T = double>
class jbxl::Vector< T >

template <typename t="double"> class Vector

3次元ベクトルの定義

Definition at line 57 of file Vector.h.


Constructor & Destructor Documentation

Vector ( X = 0,
Y = 0,
Z = 0,
double  N = 0.0,
double  C = 1.0,
int  D = 0 
) [inline]

Definition at line 69 of file Vector.h.

00069 { set(X, Y, Z, N, C, D);}

virtual ~Vector ( void   )  [inline, virtual]

Definition at line 70 of file Vector.h.

00070 {}


Member Function Documentation

T element ( int  i  )  [inline]

Definition at line 83 of file Vector.h.

00083 { if(i==1) return x; else if(i==2) return y; else if(i==3) return z; else return (T)0;} 

T element1 ( void   )  [inline]
T element2 ( void   )  [inline]
T element3 ( void   )  [inline]
void init ( double  C = 1.0  )  [inline]

Definition at line 76 of file Vector.h.

Referenced by FacetTriData::init(), and Vector< T >::normalize().

00076 { x = y = z = (T)0; n = 0.0; c = C; d = 0;}

Here is the caller graph for this function:

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().

00073 { n = (double)sqrt(x*x + y*y + z*z); return n;}

Here is the caller graph for this function:

T norm2 ( void   )  [inline]

Definition at line 72 of file Vector.h.

Referenced by jbxl::FillShortageWings_Near(), and jbxl::operator/().

00072 { return (x*x + y*y + z*z);}

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

Vector<T>& operator= ( const Vector< R >  a  )  [inline]

Definition at line 85 of file Vector.h.

00085 { x=(T)a.x; y=(T)a.y; z=(T)a.z; n=a.n; c=a.c; d=a.d; return *this;}

void set ( X,
Y = 0,
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 }

Here is the caller graph for this function:


Member Data Documentation

double c
int d
double n
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().


The documentation for this class was generated from the following file:

Generated on 15 Nov 2023 for JunkBox_Lib++ (for Windows) by  doxygen 1.6.1