#include <Vec.h>


Public Member Functions | |
| Vec () | |
| Default constructor: sets all values to 0. | |
| Vec (NoInit) | |
| Fast constructor: no initialization. | |
| Vec (real r1) | |
| Specific constructor for 1-element vectors. | |
| void | operator= (real r1) |
| Specific constructor for 1-element vectors. | |
| Vec (real r1, real r2) | |
| Specific constructor for 2-elements vectors. | |
| Vec (real r1, real r2, real r3) | |
| Specific constructor for 3-elements vectors. | |
| Vec (real r1, real r2, real r3, real r4) | |
| Specific constructor for 4-elements vectors. | |
| Vec (real r1, real r2, real r3, real r4, real r5, real r6) | |
| Specific constructor for 6-elements vectors. | |
| Vec (real r1, real r2, real r3, real r4, real r5, real r6, real r7, real r8) | |
| Specific constructor for 8-elements vectors. | |
| Vec (real r1, real r2, real r3, real r4, real r5, real r6, real r7, real r8, real r9) | |
| Specific constructor for 9-elements vectors. | |
| Vec (const Vec< N-1, real > &v, real r1) | |
| Constructor from an N-1 elements vector and an additional value (added at the end). | |
| template<typename real2 > | |
| Vec (const Vec< N, real2 > &p) | |
| template<typename real2 > | |
| Vec (const real2 *p) | |
| Constructor from an array of values. | |
| real & | x () |
| Special access to first element. | |
| real & | y () |
| Special access to second element. | |
| real & | z () |
| Special access to third element. | |
| real & | w () |
| Special access to fourth element. | |
| const real & | x () const |
| Special const access to first element. | |
| const real & | y () const |
| Special const access to second element. | |
| const real & | z () const |
| Special const access to third element. | |
| const real & | w () const |
| Special const access to fourth element. | |
| template<typename real2 > | |
| void | operator= (const real2 *p) |
| Assignment operator from an array of values. | |
| template<int M, typename real2 > | |
| void | operator= (const Vec< M, real2 > &v) |
| Assignment from a vector with different dimensions. | |
| void | clear () |
| Sets every element to 0. | |
| void | fill (real r) |
| Sets every element to r. | |
| real & | operator() (int i) |
| Const access to i-th element. | |
| const real & | operator() (int i) const |
| Const access to i-th element. | |
| const real * | ptr () const |
| Cast into a const array of values. | |
| real * | ptr () |
| Cast into an array of values. | |
| template<class real2 > | |
| Vec< N, real > | operator* (real2 f) const |
| Multiplication by a scalar f. | |
| template<class real2 > | |
| void | operator*= (real2 f) |
| On-place multiplication by a scalar f. | |
| template<class real2 > | |
| Vec< N, real > | operator/ (real2 f) const |
| Division by a scalar f. | |
| template<class real2 > | |
| void | operator/= (real2 f) |
| On-place division by a scalar f. | |
| template<class real2 > | |
| real | operator* (const Vec< N, real2 > &v) const |
| Dot product. | |
| template<class real2 > | |
| Vec< N, real > | linearProduct (const Vec< N, real2 > &v) const |
| linear product. | |
| template<class real2 > | |
| Vec< N, real > | linearDivision (const Vec< N, real2 > &v) const |
| linear division. | |
| template<class real2 > | |
| Vec< N, real > | operator+ (const Vec< N, real2 > &v) const |
| Vector addition. | |
| template<class real2 > | |
| void | operator+= (const Vec< N, real2 > &v) |
| On-place vector addition. | |
| template<class real2 > | |
| Vec< N, real > | operator- (const Vec< N, real2 > &v) const |
| Vector subtraction. | |
| template<class real2 > | |
| void | operator-= (const Vec< N, real2 > &v) |
| On-place vector subtraction. | |
| Vec< N, real > | operator- () const |
| Vector negation. | |
| real | norm2 () const |
| Squared norm. | |
| real | norm () const |
| Euclidean norm. | |
| void | normalize () |
| Normalize the vector. | |
| Vec | cross (const Vec &b) const |
| real | sum () const |
| sum of all elements of the vector | |
Tests operators | |
| bool | operator== (const Vec &b) const |
| bool | operator!= (const Vec &b) const |
Definition at line 47 of file Vec.h.
| sofa::defaulttype::Vec< N, real >::Vec | ( | ) | [inline] |
Default constructor: sets all values to 0.
Definition at line 52 of file Vec.h.
Referenced by sofa::defaulttype::Vec< 3, float >::cross().
| sofa::defaulttype::Vec< N, real >::Vec | ( | NoInit | ) | [inline, explicit] |
| sofa::defaulttype::Vec< N, real >::Vec | ( | real | r1 | ) | [inline, explicit] |
| sofa::defaulttype::Vec< N, real >::Vec | ( | real | r1, | |
| real | r2 | |||
| ) | [inline] |
| sofa::defaulttype::Vec< N, real >::Vec | ( | real | r1, | |
| real | r2, | |||
| real | r3 | |||
| ) | [inline] |
| sofa::defaulttype::Vec< N, real >::Vec | ( | real | r1, | |
| real | r2, | |||
| real | r3, | |||
| real | r4 | |||
| ) | [inline] |
| sofa::defaulttype::Vec< N, real >::Vec | ( | real | r1, | |
| real | r2, | |||
| real | r3, | |||
| real | r4, | |||
| real | r5, | |||
| real | r6 | |||
| ) | [inline] |
| sofa::defaulttype::Vec< N, real >::Vec | ( | real | r1, | |
| real | r2, | |||
| real | r3, | |||
| real | r4, | |||
| real | r5, | |||
| real | r6, | |||
| real | r7, | |||
| real | r8 | |||
| ) | [inline] |
| sofa::defaulttype::Vec< N, real >::Vec | ( | real | r1, | |
| real | r2, | |||
| real | r3, | |||
| real | r4, | |||
| real | r5, | |||
| real | r6, | |||
| real | r7, | |||
| real | r8, | |||
| real | r9 | |||
| ) | [inline] |
| sofa::defaulttype::Vec< N, real >::Vec | ( | const Vec< N-1, real > & | v, | |
| real | r1 | |||
| ) | [inline] |
| sofa::defaulttype::Vec< N, real >::Vec | ( | const Vec< N, real2 > & | p | ) | [inline] |
| sofa::defaulttype::Vec< N, real >::Vec | ( | const real2 * | p | ) | [inline, explicit] |
| void sofa::defaulttype::Vec< N, real >::clear | ( | ) | [inline] |
Sets every element to 0.
Definition at line 240 of file Vec.h.
Referenced by sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::addForce(), sofa::component::behaviormodel::eulerianfluid::Grid3D::Cell::clear(), sofa::component::behaviormodel::eulerianfluid::Grid2D::Cell::clear(), sofa::defaulttype::LaparoscopicRigid3Types::Deriv::clear(), sofa::component::visualmodel::CudaVisualModel< TDataTypes >::drawVisual(), sofa::component::behaviormodel::eulerianfluid::Grid2D::Grid2D(), sofa::component::behaviormodel::eulerianfluid::Grid3D::Grid3D(), sofa::component::visualmodel::OglModel::internalDraw(), sofa::component::behaviormodel::eulerianfluid::Grid3D::step_forces(), sofa::component::behaviormodel::eulerianfluid::Grid2D::step_forces(), and sofa::defaulttype::Vec< 3, float >::Vec().
| Vec sofa::defaulttype::Vec< N, real >::cross | ( | const Vec< N, real > & | b | ) | const [inline] |
Definition at line 442 of file Vec.h.
Referenced by sofa::component::forcefield::PlaneForceField< DataTypes >::addBBox(), sofa::component::interactionforcefield::InteractionEllipsoidForceField< DataTypes1, DataTypes2 >::addForce2(), sofa::component::contextobject::CoordinateSystem::apply(), sofa::component::mapping::LineSetSkinningMapping< BasicMapping >::applyJ(), sofa::component::mapping::LineSetSkinningMapping< BasicMapping >::applyJT(), sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::compute3PointsBarycoefs(), sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeSegmentTriangleIntersection(), sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeTriangleBarycoefs(), sofa::component::ParticleSink< TDataTypes >::draw(), sofa::helper::gl::Axis::draw(), sofa::component::forcefield::PlaneForceField< DataTypes >::drawPlane(), sofa::component::collision::RayTriangleIntersection::NewComputation(), sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::Prepare_VertexDuplication(), sofa::component::forcefield::PlaneForceField< DataTypes >::rotate(), sofa::gui::qt::viewer::qt::QtViewer::StoreLightMatrices(), sofa::gui::qt::viewer::qgl::QtGLViewer::StoreLightMatrices(), and sofa::gui::glut::SimpleGUI::StoreLightMatrices().
| void sofa::defaulttype::Vec< N, real >::fill | ( | real | r | ) | [inline] |
| Vec<N,real> sofa::defaulttype::Vec< N, real >::linearDivision | ( | const Vec< N, real2 > & | v | ) | const [inline] |
| Vec<N,real> sofa::defaulttype::Vec< N, real >::linearProduct | ( | const Vec< N, real2 > & | v | ) | const [inline] |
linear product.
Reimplemented in sofa::gpu::cuda::Vec3r1< Real >.
Definition at line 354 of file Vec.h.
Referenced by sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeSegmentTriangleIntersection(), and sofa::helper::MarchingCubeUtility::run().
| real sofa::defaulttype::Vec< N, real >::norm | ( | ) | const [inline] |
Euclidean norm.
Definition at line 428 of file Vec.h.
Referenced by applyForceCallback(), sofa::helper::Quater< Real >::axisToQuat(), sofa::component::collision::NewProximityIntersection::computeIntersection(), sofa::component::collision::LocalMinDistance::computeIntersection(), sofa::helper::gl::Trackball::ComputeQuaternion(), sofa::component::topology::TriangleSetGeometryAlgorithms< DataTypes >::computeSegmentTriangleIntersection(), sofa::component::mapping::LineSetSkinningMapping< BasicMapping >::convolutionSegment(), sofa::component::collision::NewProximityIntersection::doIntersectionLineLine(), sofa::component::collision::NewProximityIntersection::doIntersectionLinePoint(), sofa::component::collision::NewProximityIntersection::doIntersectionPointPoint(), sofa::component::collision::NewProximityIntersection::doIntersectionTrianglePoint(), sofa::component::mass::UniformMass< DataTypes, MassType >::draw(), SensAble::draw(), sofa::component::topology::CylinderGridTopology::getPoint(), sofa::component::forcefield::BeamFEMForceField< DataTypes >::initLarge(), sofa::gpu::cuda::CudaRigidTypes< 3, real >::interpolate(), sofa::defaulttype::StdRigidTypes< 3, real >::interpolate(), sofa::defaulttype::Vec< 3, float >::normalize(), sofa::component::mapping::LineSetSkinningMapping< BasicMapping >::projectToSegment(), sofa::component::behaviormodel::eulerianfluid::Grid3D::seed(), sofa::component::behaviormodel::eulerianfluid::Grid2D::seed(), sofa::component::collision::Point::testLMD(), and sofa::component::collision::LocalMinDistance::testValidity().
| real sofa::defaulttype::Vec< N, real >::norm2 | ( | ) | const [inline] |
Squared norm.
Definition at line 419 of file Vec.h.
Referenced by sofa::component::forcefield::TetrahedronFEMForceFieldInternalData< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >::addForce(), sofa::component::collision::NewProximityIntersection::computeIntersection(), sofa::component::collision::LocalMinDistance::computeIntersection(), sofa::component::collision::DiscreteIntersection::computeIntersection(), sofa::component::collision::NewProximityIntersection::doIntersectionLineLine(), sofa::component::collision::NewProximityIntersection::doIntersectionLinePoint(), sofa::component::collision::NewProximityIntersection::doIntersectionPointPoint(), sofa::component::collision::NewProximityIntersection::doIntersectionTrianglePoint(), sofa::defaulttype::Vec< 3, float >::norm(), sofa::component::collision::NewProximityIntersection::testIntersection(), and sofa::component::collision::LocalMinDistance::testIntersection().
| void sofa::defaulttype::Vec< N, real >::normalize | ( | ) | [inline] |
Normalize the vector.
Definition at line 434 of file Vec.h.
Referenced by sofa::component::forcefield::PlaneForceField< DataTypes >::addBBox(), sofa::component::forcefield::ConicalForceField< DataTypes >::addForce(), applyForceCallback(), sofa::component::collision::DistanceGrid::calcDistance(), sofa::component::constraint::AttachConstraint< DataTypes >::calcRestRotations(), sofa::component::collision::TriangleOctreeModel::computeBoundingTree(), sofa::component::mapping::computeOrientation(), sofa::component::ParticleSink< TDataTypes >::draw(), sofa::component::collision::RigidDistanceGridCollisionModel::draw(), sofa::helper::gl::Axis::draw(), SensAble::draw(), sofa::component::forcefield::PlaneForceField< DataTypes >::drawPlane(), sofa::component::topology::CylinderGridTopology::getPoint(), sofa::component::constraint::ParabolicConstraint< DataTypes >::init(), sofa::component::forcefield::BeamFEMForceField< DataTypes >::initLarge(), sofa::gpu::cuda::CudaRigidTypes< 3, real >::interpolate(), sofa::defaulttype::StdRigidTypes< 3, real >::interpolate(), sofa::component::controller::MechanicalStateController< DataTypes >::MechanicalStateController(), sofa::gui::glut::SimpleGUI::mouseEvent(), sofa::gui::qt::viewer::qtogre::QtOgreViewer::moveRayPickInteractor(), sofa::gui::qt::viewer::qt::QtViewer::moveRayPickInteractor(), sofa::gui::qt::viewer::qgl::QtGLViewer::moveRayPickInteractor(), sofa::defaulttype::RigidCoord< 3, real >::operator+=(), sofa::component::forcefield::PlaneForceField< DataTypes >::rotate(), sofa::component::behaviormodel::eulerianfluid::Grid3D::seed(), sofa::component::behaviormodel::eulerianfluid::Grid2D::seed(), sofa::gui::qt::viewer::qt::QtViewer::StoreLightMatrices(), sofa::gui::qt::viewer::qgl::QtGLViewer::StoreLightMatrices(), sofa::gui::glut::SimpleGUI::StoreLightMatrices(), sofa::component::collision::Point::testLMD(), sofa::component::collision::LocalMinDistance::testValidity(), sofa::component::collision::RayPickInteractor::updatePosition(), sofa::component::behaviormodel::eulerianfluid::Fluid3D::updateVisual(), and sofa::component::behaviormodel::eulerianfluid::Fluid2D::updateVisual().
| bool sofa::defaulttype::Vec< N, real >::operator!= | ( | const Vec< N, real > & | b | ) | const [inline] |
| const real& sofa::defaulttype::Vec< N, real >::operator() | ( | int | i | ) | const [inline] |
| real& sofa::defaulttype::Vec< N, real >::operator() | ( | int | i | ) | [inline] |
| real sofa::defaulttype::Vec< N, real >::operator* | ( | const Vec< N, real2 > & | v | ) | const [inline] |
| Vec<N,real> sofa::defaulttype::Vec< N, real >::operator* | ( | real2 | f | ) | const [inline] |
| void sofa::defaulttype::Vec< N, real >::operator*= | ( | real2 | f | ) | [inline] |
| Vec<N,real> sofa::defaulttype::Vec< N, real >::operator+ | ( | const Vec< N, real2 > & | v | ) | const [inline] |
| void sofa::defaulttype::Vec< N, real >::operator+= | ( | const Vec< N, real2 > & | v | ) | [inline] |
| Vec<N,real> sofa::defaulttype::Vec< N, real >::operator- | ( | ) | const [inline] |
| Vec<N,real> sofa::defaulttype::Vec< N, real >::operator- | ( | const Vec< N, real2 > & | v | ) | const [inline] |
| void sofa::defaulttype::Vec< N, real >::operator-= | ( | const Vec< N, real2 > & | v | ) | [inline] |
| Vec<N,real> sofa::defaulttype::Vec< N, real >::operator/ | ( | real2 | f | ) | const [inline] |
| void sofa::defaulttype::Vec< N, real >::operator/= | ( | real2 | f | ) | [inline] |
| void sofa::defaulttype::Vec< N, real >::operator= | ( | const Vec< M, real2 > & | v | ) | [inline] |
Assignment from a vector with different dimensions.
Reimplemented in sofa::defaulttype::VecNoInit< N, real >.
| void sofa::defaulttype::Vec< N, real >::operator= | ( | const real2 * | p | ) | [inline] |
Assignment operator from an array of values.
Reimplemented in sofa::defaulttype::VecNoInit< N, real >.
| void sofa::defaulttype::Vec< N, real >::operator= | ( | real | r1 | ) | [inline] |
| bool sofa::defaulttype::Vec< N, real >::operator== | ( | const Vec< N, real > & | b | ) | const [inline] |
| real* sofa::defaulttype::Vec< N, real >::ptr | ( | ) | [inline] |
| const real* sofa::defaulttype::Vec< N, real >::ptr | ( | ) | const [inline] |
Cast into a const array of values.
CHANGE(Jeremie A.): removed it as it confuses some compilers. Use ptr() or data() instead Cast into an array of values. CHANGE(Jeremie A.): removed it as it confuses some compilers. Use ptr() or data() instead Cast into a const array of values.
Definition at line 293 of file Vec.h.
Referenced by sofa::gui::glut::SimpleGUI::DisplayOBJs(), sofa::component::forcefield::TriangularFEMForceField< DataTypes >::draw(), sofa::component::visualmodel::CudaVisualModel< TDataTypes >::drawVisual(), sofa::component::mapping::BarycentricMapperRegularGridTopology< gpu::cuda::CudaVectorTypes< VecIn, VecIn, float >, gpu::cuda::CudaVectorTypes< VecOut, VecOut, float > >::init(), sofa::component::visualmodel::OglModel::internalDraw(), and sofa::gui::qt::viewer::qtogre::QtOgreViewer::showEntireScene().
| real sofa::defaulttype::Vec< N, real >::sum | ( | ) | const [inline] |
sum of all elements of the vector
Definition at line 454 of file Vec.h.
Referenced by sofa::defaulttype::Vec< 3, float >::sum().
| const real& sofa::defaulttype::Vec< N, real >::w | ( | ) | const [inline] |
| real& sofa::defaulttype::Vec< N, real >::w | ( | ) | [inline] |
| const real& sofa::defaulttype::Vec< N, real >::x | ( | ) | const [inline] |
| real& sofa::defaulttype::Vec< N, real >::x | ( | ) | [inline] |
Special access to first element.
Definition at line 172 of file Vec.h.
Referenced by sofa::component::mapping::ArticulatedSystemMapping< BasicMapping >::apply(), sofa::component::mapping::ArticulatedSystemMapping< BasicMapping >::applyJ(), sofa::component::topology::areaProduct(), sofa::helper::Quater< Real >::axisToQuat(), sofa::defaulttype::cross(), sofa::component::constraint::ParabolicConstraint< DataTypes >::draw(), sofa::component::mass::UniformMass< DataTypes, MassType >::parse(), sofa::component::constraint::ParabolicConstraint< DataTypes >::projectPosition(), sofa::component::constraint::ParabolicConstraint< DataTypes >::projectVelocity(), and sofa::helper::Quater< Real >::toEulerVector().
| const real& sofa::defaulttype::Vec< N, real >::y | ( | ) | const [inline] |
| real& sofa::defaulttype::Vec< N, real >::y | ( | ) | [inline] |
Special access to second element.
Definition at line 178 of file Vec.h.
Referenced by sofa::component::topology::areaProduct(), sofa::helper::Quater< Real >::axisToQuat(), sofa::defaulttype::cross(), sofa::component::constraint::ParabolicConstraint< DataTypes >::draw(), sofa::component::mass::UniformMass< DataTypes, MassType >::parse(), sofa::component::constraint::ParabolicConstraint< DataTypes >::projectPosition(), sofa::component::constraint::ParabolicConstraint< DataTypes >::projectVelocity(), and sofa::helper::Quater< Real >::toEulerVector().
| const real& sofa::defaulttype::Vec< N, real >::z | ( | ) | const [inline] |
| real& sofa::defaulttype::Vec< N, real >::z | ( | ) | [inline] |
Special access to third element.
Definition at line 184 of file Vec.h.
Referenced by sofa::component::topology::areaProduct(), sofa::helper::Quater< Real >::axisToQuat(), sofa::defaulttype::cross(), sofa::component::mass::UniformMass< DataTypes, MassType >::parse(), and sofa::helper::Quater< Real >::toEulerVector().
1.5.7.1