KiCad PCB EDA Suite
|
Define a general 3D-vector. More...
#include <vector3.h>
Public Types | |
typedef VECTOR3_TRAITS< T >::extended_type | extended_type |
typedef T | coord_type |
Public Member Functions | |
VECTOR3 ()=default | |
Construct a 3D-vector with x, y, z = 0. More... | |
VECTOR3 (T x, T y, T z) | |
Construct a vector with given components x, y, z. More... | |
template<typename CastingType > | |
VECTOR3 (const VECTOR3< CastingType > &aVec) | |
Initializes a vector from another specialization. More... | |
VECTOR3< T > | Cross (const VECTOR3< T > &aVector) const |
Compute cross product of self with aVector. More... | |
VECTOR3< T >::extended_type | Dot (const VECTOR3< T > &aVector) const |
Compute the dot product of self with aVector. More... | |
T | EuclideanNorm () const |
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2). More... | |
VECTOR3< T > | Normalize () |
Compute the normalized vector. More... | |
bool | operator== (const VECTOR3< T > &aVector) const |
Equality operator. More... | |
bool | operator!= (const VECTOR3< T > &aVector) const |
Not equality operator. More... | |
VECTOR3< T > & | operator*= (T val) |
VECTOR3< T > & | operator/= (T val) |
Public Attributes | |
T | x {} |
T | y {} |
T | z {} |
Static Public Attributes | |
static constexpr extended_type | ECOORD_MAX = std::numeric_limits<extended_type>::max() |
static constexpr extended_type | ECOORD_MIN = std::numeric_limits<extended_type>::min() |
Define a general 3D-vector.
This class uses templates to be universal. Several operators are provided to help easy implementing of linear algebra equations.
typedef VECTOR3_TRAITS<T>::extended_type VECTOR3< T >::extended_type |
Compute cross product of self with aVector.
Definition at line 127 of file vector3.h.
References VECTOR3< T >::x, VECTOR3< T >::y, and VECTOR3< T >::z.
Referenced by DXF_IMPORT_PLUGIN::getArbitraryAxis().
VECTOR3< T >::extended_type VECTOR3< T >::Dot | ( | const VECTOR3< T > & | aVector | ) | const |
Compute the dot product of self with aVector.
Definition at line 137 of file vector3.h.
References VECTOR3< T >::x, VECTOR3< T >::y, and VECTOR3< T >::z.
T VECTOR3< T >::EuclideanNorm |
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
It is used to calculate the length of the vector.
Definition at line 146 of file vector3.h.
Referenced by PCB_POINT_EDITOR::editArcEndpointKeepTangent().
Compute the normalized vector.
Definition at line 153 of file vector3.h.
References EuclideanNorm().
Referenced by DXF_IMPORT_PLUGIN::getArbitraryAxis(), SPICE_VALUE::operator*(), SPICE_VALUE::operator+(), SPICE_VALUE::operator-(), and SPICE_VALUE::operator/().
bool VECTOR3< T >::operator!= | ( | const VECTOR3< T > & | aVector | ) | const |
Not equality operator.
Definition at line 175 of file vector3.h.
References VECTOR3< T >::x, VECTOR3< T >::y, and VECTOR3< T >::z.
Equality operator.
Definition at line 168 of file vector3.h.
References VECTOR3< T >::x, VECTOR3< T >::y, and VECTOR3< T >::z.
|
staticconstexpr |
|
staticconstexpr |
T VECTOR3< T >::x {} |
Definition at line 61 of file vector3.h.
Referenced by ACOMPONENTBODY6::ACOMPONENTBODY6(), DXF_IMPORT_PLUGIN::addArc(), DXF_IMPORT_PLUGIN::addCircle(), DXF_IMPORT_PLUGIN::addEllipse(), DXF_IMPORT_PLUGIN::addInsert(), DXF_IMPORT_PLUGIN::addMText(), DXF_IMPORT_PLUGIN::addPoint(), DXF_IMPORT_PLUGIN::addText(), TRIANGLE_DISPLAY_LIST::AddToMiddleContourns(), RENDER_3D_OPENGL::addTopAndBottomTriangles(), DXF_IMPORT_PLUGIN::addVertex(), AMODEL::AMODEL(), VECTOR3< T >::Cross(), VECTOR3< T >::Dot(), KIGFX::OPENGL_GAL::DrawBitmap(), KIGFX::OPENGL_GAL::drawLineQuad(), PCB_POINT_EDITOR::editArcEndpointKeepTangent(), DXF_IMPORT_PLUGIN::getArbitraryAxis(), STEP_PCB_MODEL::getModelLabel(), STEP_PCB_MODEL::getModelLocation(), LEGACY_PLUGIN::load3D(), EAGLE_PLUGIN::loadPolygon(), MATRIX3x3< T >::MATRIX3x3(), VECTOR3< T >::operator!=(), operator*(), VECTOR3< T >::operator==(), EAGLE_PLUGIN::packagePolygon(), PCB_PARSER::parse3DModel(), ALTIUM_PCB::ParseComponentsBodies6Data(), RENDER_3D_RAYTRACE::Reload(), PANEL_PREVIEW_3D_MODEL::SetSelectedModel(), PNS::shovedArea(), DIALOG_SELECT_3DMODEL::TransferDataFromWindow(), STEP_PCB_MODEL::transferModel(), and PANEL_PREVIEW_3D_MODEL::updateOrientation().
T VECTOR3< T >::y {} |
Definition at line 62 of file vector3.h.
Referenced by ACOMPONENTBODY6::ACOMPONENTBODY6(), DXF_IMPORT_PLUGIN::addArc(), DXF_IMPORT_PLUGIN::addCircle(), DXF_IMPORT_PLUGIN::addEllipse(), DXF_IMPORT_PLUGIN::addInsert(), DXF_IMPORT_PLUGIN::addMText(), DXF_IMPORT_PLUGIN::addPoint(), DXF_IMPORT_PLUGIN::addText(), TRIANGLE_DISPLAY_LIST::AddToMiddleContourns(), RENDER_3D_OPENGL::addTopAndBottomTriangles(), DXF_IMPORT_PLUGIN::addVertex(), AMODEL::AMODEL(), VECTOR3< T >::Cross(), VECTOR3< T >::Dot(), KIGFX::OPENGL_GAL::DrawBitmap(), KIGFX::OPENGL_GAL::drawLineQuad(), PCB_POINT_EDITOR::editArcEndpointKeepTangent(), DXF_IMPORT_PLUGIN::getArbitraryAxis(), STEP_PCB_MODEL::getModelLabel(), STEP_PCB_MODEL::getModelLocation(), LEGACY_PLUGIN::load3D(), EAGLE_PLUGIN::loadPolygon(), MATRIX3x3< T >::MATRIX3x3(), VECTOR3< T >::operator!=(), operator*(), VECTOR3< T >::operator==(), EAGLE_PLUGIN::packagePolygon(), PCB_PARSER::parse3DModel(), ALTIUM_PCB::ParseComponentsBodies6Data(), RENDER_3D_RAYTRACE::Reload(), PANEL_PREVIEW_3D_MODEL::SetSelectedModel(), PNS::shovedArea(), DIALOG_SELECT_3DMODEL::TransferDataFromWindow(), STEP_PCB_MODEL::transferModel(), and PANEL_PREVIEW_3D_MODEL::updateOrientation().
T VECTOR3< T >::z {} |
Definition at line 63 of file vector3.h.
Referenced by ACOMPONENTBODY6::ACOMPONENTBODY6(), AMODEL::AMODEL(), VECTOR3< T >::Cross(), VECTOR3< T >::Dot(), STEP_PCB_MODEL::getModelLabel(), STEP_PCB_MODEL::getModelLocation(), LEGACY_PLUGIN::load3D(), MATRIX3x3< T >::MATRIX3x3(), VECTOR3< T >::operator!=(), operator*(), VECTOR3< T >::operator==(), PCB_PARSER::parse3DModel(), ALTIUM_PCB::ParseComponentsBodies6Data(), RENDER_3D_RAYTRACE::Reload(), PANEL_PREVIEW_3D_MODEL::SetSelectedModel(), DIALOG_SELECT_3DMODEL::TransferDataFromWindow(), STEP_PCB_MODEL::transferModel(), and PANEL_PREVIEW_3D_MODEL::updateOrientation().