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. | |
VECTOR3 (T x, T y, T z) | |
Construct a vector with given components x, y, z. | |
template<typename CastingType > | |
VECTOR3 (const VECTOR3< CastingType > &aVec) | |
Initializes a vector from another specialization. | |
VECTOR3< T > | Cross (const VECTOR3< T > &aVector) const |
Compute cross product of self with aVector. | |
VECTOR3< T >::extended_type | Dot (const VECTOR3< T > &aVector) const |
Compute the dot product of self with aVector. | |
T | EuclideanNorm () const |
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2). | |
VECTOR3< T > | Normalize () |
Compute the normalized vector. | |
bool | operator== (const VECTOR3< T > &aVector) const |
Equality operator. | |
bool | operator!= (const VECTOR3< T > &aVector) const |
Not equality operator. | |
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 129 of file vector3.h.
References VECTOR3< T >::x, VECTOR3< T >::y, and VECTOR3< T >::z.
Referenced by DXF_IMPORT_PLUGIN::getArbitraryAxis(), and SHAPE_ARC::IsCCW().
VECTOR3< T >::extended_type VECTOR3< T >::Dot | ( | const VECTOR3< T > & | aVector | ) | const |
Compute the dot product of self with aVector.
Definition at line 139 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 148 of file vector3.h.
Referenced by ARC_POINT_EDIT_BEHAVIOR::editArcEndpointKeepTangent().
Compute the normalized vector.
Definition at line 155 of file vector3.h.
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 177 of file vector3.h.
References VECTOR3< T >::x, VECTOR3< T >::y, and VECTOR3< T >::z.
Equality operator.
Definition at line 170 of file vector3.h.
References VECTOR3< T >::x, VECTOR3< T >::y, and VECTOR3< T >::z.
|
staticconstexpr |
|
staticconstexpr |
T VECTOR3< T >::x {} |
Definition at line 63 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(), ALTIUM_PCB::ConvertComponentBody6ToFootprintItem(), VECTOR3< T >::Cross(), VECTOR3< T >::Dot(), KIGFX::OPENGL_GAL::DrawBitmap(), KIGFX::OPENGL_GAL::drawLineQuad(), ARC_POINT_EDIT_BEHAVIOR::editArcEndpointKeepTangent(), PCB_IO_EASYEDAPRO_PARSER::fillFootprintModelInfo(), DXF_IMPORT_PLUGIN::getArbitraryAxis(), UTILS_STEP_MODEL::GetBoundingBox(), UTILS_BOX3D::GetCenter(), STEP_PCB_MODEL::getModelLabel(), STEP_PCB_MODEL::getModelLocation(), UTILS_BOX3D::GetSize(), getToVector3(), PCBNEW_JOBS_HANDLER::JobExportRender(), PCB_IO_KICAD_LEGACY::load3D(), PCB_IO_EAGLE::loadPolygon(), MATRIX3x3< T >::MATRIX3x3(), VECTOR3< T >::operator!=(), operator*(), operator<<(), VECTOR3< T >::operator==(), PCB_IO_EAGLE::packagePolygon(), kiapi::common::PackVector3D(), PCB_IO_KICAD_SEXPR_PARSER::parse3DModel(), ALTIUM_PCB::ParseComponentsBodies6Data(), PCB_IO_EASYEDA_PARSER::ParseToBoardItemContainer(), RENDER_3D_RAYTRACE_BASE::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 64 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(), ALTIUM_PCB::ConvertComponentBody6ToFootprintItem(), VECTOR3< T >::Cross(), VECTOR3< T >::Dot(), KIGFX::OPENGL_GAL::DrawBitmap(), KIGFX::OPENGL_GAL::drawLineQuad(), ARC_POINT_EDIT_BEHAVIOR::editArcEndpointKeepTangent(), PCB_IO_EASYEDAPRO_PARSER::fillFootprintModelInfo(), DXF_IMPORT_PLUGIN::getArbitraryAxis(), UTILS_STEP_MODEL::GetBoundingBox(), UTILS_BOX3D::GetCenter(), STEP_PCB_MODEL::getModelLabel(), STEP_PCB_MODEL::getModelLocation(), UTILS_BOX3D::GetSize(), getToVector3(), PCBNEW_JOBS_HANDLER::JobExportRender(), PCB_IO_KICAD_LEGACY::load3D(), PCB_IO_EAGLE::loadPolygon(), MATRIX3x3< T >::MATRIX3x3(), VECTOR3< T >::operator!=(), operator*(), operator<<(), VECTOR3< T >::operator==(), PCB_IO_EAGLE::packagePolygon(), kiapi::common::PackVector3D(), PCB_IO_KICAD_SEXPR_PARSER::parse3DModel(), ALTIUM_PCB::ParseComponentsBodies6Data(), PCB_IO_EASYEDA_PARSER::ParseToBoardItemContainer(), RENDER_3D_RAYTRACE_BASE::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 65 of file vector3.h.
Referenced by ACOMPONENTBODY6::ACOMPONENTBODY6(), AMODEL::AMODEL(), ALTIUM_PCB::ConvertComponentBody6ToFootprintItem(), VECTOR3< T >::Cross(), VECTOR3< T >::Dot(), PCB_IO_EASYEDAPRO_PARSER::fillFootprintModelInfo(), UTILS_STEP_MODEL::GetBoundingBox(), UTILS_BOX3D::GetCenter(), STEP_PCB_MODEL::getModelLabel(), STEP_PCB_MODEL::getModelLocation(), UTILS_BOX3D::GetSize(), getToVector3(), PCBNEW_JOBS_HANDLER::JobExportRender(), PCB_IO_KICAD_LEGACY::load3D(), MATRIX3x3< T >::MATRIX3x3(), VECTOR3< T >::operator!=(), operator*(), operator<<(), VECTOR3< T >::operator==(), kiapi::common::PackVector3D(), PCB_IO_KICAD_SEXPR_PARSER::parse3DModel(), ALTIUM_PCB::ParseComponentsBodies6Data(), PCB_IO_EASYEDA_PARSER::ParseToBoardItemContainer(), RENDER_3D_RAYTRACE_BASE::Reload(), PANEL_PREVIEW_3D_MODEL::SetSelectedModel(), DIALOG_SELECT_3DMODEL::TransferDataFromWindow(), STEP_PCB_MODEL::transferModel(), and PANEL_PREVIEW_3D_MODEL::updateOrientation().