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. | |
VECTOR3< T > | SetAll (T val) |
Set all elements to val. | |
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 134 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 144 of file vector3.h.
References VECTOR3< T >::x, VECTOR3< T >::y, and VECTOR3< T >::z.
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 153 of file vector3.h.
Referenced by editArcEndpointKeepTangent().
Compute the normalized vector.
Definition at line 160 of file vector3.h.
References T.
Referenced by DXF_IMPORT_PLUGIN::getArbitraryAxis(), SPICE_VALUE::operator*(), SPICE_VALUE::operator+(), SPICE_VALUE::operator-(), and SPICE_VALUE::operator/().
Not equality operator.
Definition at line 193 of file vector3.h.
References VECTOR3< T >::x, VECTOR3< T >::y, and VECTOR3< T >::z.
Equality operator.
Definition at line 186 of file vector3.h.
References VECTOR3< T >::x, VECTOR3< T >::y, and VECTOR3< T >::z.
Set all elements to val.
Definition at line 175 of file vector3.h.
Referenced by DIALOG_RENDER_JOB::TransferDataFromWindow().
|
staticconstexpr |
|
staticconstexpr |
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(), editArcEndpointKeepTangent(), PCB_IO_EASYEDAPRO_PARSER::fillFootprintModelInfo(), nlohmann::adl_serializer< VECTOR3D >::from_json(), DXF_IMPORT_PLUGIN::getArbitraryAxis(), UTILS_STEP_MODEL::GetBoundingBox(), UTILS_BOX3D::GetCenter(), getColorOrIntensity(), 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(), nlohmann::adl_serializer< VECTOR3D >::to_json(), DIALOG_SELECT_3DMODEL::TransferDataFromWindow(), DIALOG_RENDER_JOB::TransferDataFromWindow(), DIALOG_RENDER_JOB::TransferDataToWindow(), STEP_PCB_MODEL::transferModel(), and PANEL_PREVIEW_3D_MODEL::updateOrientation().
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(), editArcEndpointKeepTangent(), PCB_IO_EASYEDAPRO_PARSER::fillFootprintModelInfo(), nlohmann::adl_serializer< VECTOR3D >::from_json(), DXF_IMPORT_PLUGIN::getArbitraryAxis(), UTILS_STEP_MODEL::GetBoundingBox(), UTILS_BOX3D::GetCenter(), getColorOrIntensity(), 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(), nlohmann::adl_serializer< VECTOR3D >::to_json(), DIALOG_SELECT_3DMODEL::TransferDataFromWindow(), DIALOG_RENDER_JOB::TransferDataFromWindow(), DIALOG_RENDER_JOB::TransferDataToWindow(), STEP_PCB_MODEL::transferModel(), and PANEL_PREVIEW_3D_MODEL::updateOrientation().
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(), nlohmann::adl_serializer< VECTOR3D >::from_json(), UTILS_STEP_MODEL::GetBoundingBox(), UTILS_BOX3D::GetCenter(), getColorOrIntensity(), 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(), nlohmann::adl_serializer< VECTOR3D >::to_json(), DIALOG_SELECT_3DMODEL::TransferDataFromWindow(), DIALOG_RENDER_JOB::TransferDataFromWindow(), DIALOG_RENDER_JOB::TransferDataToWindow(), STEP_PCB_MODEL::transferModel(), and PANEL_PREVIEW_3D_MODEL::updateOrientation().