ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Vector2Tpl< Type > Class Template Reference

2D Vector More...

#include <CVGeom.h>

Inheritance diagram for Vector2Tpl< Type >:
[legend]

Public Member Functions

std::size_t rows () const
 
std::size_t dimensions () const
 
Type * data ()
 
const Type * data () const
 
 Vector2Tpl (Type s=0)
 Default constructor. More...
 
 Vector2Tpl (Type _x, Type _y)
 Constructor from a couple of coordinates. More...
 
Type norm2 () const
 Returns vector square norm. More...
 
Type norm () const
 Returns vector norm. More...
 
void normalize ()
 Sets vector norm to unity. More...
 
Type dot (const Vector2Tpl &v) const
 Dot product. More...
 
Type cross (const Vector2Tpl &v) const
 Cross product. More...
 
Vector2Tpl & operator- ()
 Inverse operator. More...
 
Vector2Tpl & operator+= (const Vector2Tpl &v)
 In-place addition operator. More...
 
Vector2Tpl & operator-= (const Vector2Tpl &v)
 In-place subtraction operator. More...
 
Vector2Tpl & operator*= (Type v)
 In-place multiplication (by a scalar) operator. More...
 
Vector2Tpl & operator/= (Type v)
 In-place division (by a scalar) operator. More...
 
Vector2Tpl operator+ (const Vector2Tpl &v) const
 Addition operator. More...
 
Vector2Tpl operator- (const Vector2Tpl &v) const
 Subtraction operator. More...
 
Vector2Tpl operator* (Type s) const
 Multiplication operator. More...
 
Vector2Tpl operator/ (Type s) const
 Division operator. More...
 
Type & operator[] (unsigned i)
 Direct coordinate access. More...
 
const Type & operator[] (unsigned i) const
 Direct coordinate access (const) More...
 

Public Attributes

union {
   struct {
      Type   x
 
      Type   y
 
   } 
 
   Type   u [2]
 
}; 
 

Detailed Description

template<typename Type>
class Vector2Tpl< Type >

2D Vector

Constructor & Destructor Documentation

◆ Vector2Tpl() [1/2]

template<typename Type >
Vector2Tpl< Type >::Vector2Tpl ( Type  s = 0)
inlineexplicit

Default constructor.

Inits vector to (0,0).

Parameters
sdefault init value for both coordinates

Referenced by Vector2Tpl< PointCoordinateType >::operator*(), Vector2Tpl< PointCoordinateType >::operator+(), Vector2Tpl< PointCoordinateType >::operator-(), and Vector2Tpl< PointCoordinateType >::operator/().

◆ Vector2Tpl() [2/2]

template<typename Type >
Vector2Tpl< Type >::Vector2Tpl ( Type  _x,
Type  _y 
)
inline

Constructor from a couple of coordinates.

Inits vector to (x,y).

Parameters
_xx coordinate
_yy coordinate

Member Function Documentation

◆ cross()

template<typename Type >
Type Vector2Tpl< Type >::cross ( const Vector2Tpl< Type > &  v) const
inline

Cross product.

Returns
a positive value if (u,v) makes a counter-clockwise turn, negative for clockwise turn, and zero if the vectors are parallel

Referenced by cloudViewer::PointProjectionTools::segmentIntersect().

◆ data() [1/2]

template<typename Type >
Type* Vector2Tpl< Type >::data ( )
inline

◆ data() [2/2]

template<typename Type >
const Type* Vector2Tpl< Type >::data ( ) const
inline

◆ dimensions()

template<typename Type >
std::size_t Vector2Tpl< Type >::dimensions ( ) const
inline

◆ dot()

◆ norm()

template<typename Type >
Type Vector2Tpl< Type >::norm ( ) const
inline

◆ norm2()

◆ normalize()

template<typename Type >
void Vector2Tpl< Type >::normalize ( )
inline

◆ operator*()

template<typename Type >
Vector2Tpl Vector2Tpl< Type >::operator* ( Type  s) const
inline

Multiplication operator.

◆ operator*=()

template<typename Type >
Vector2Tpl& Vector2Tpl< Type >::operator*= ( Type  v)
inline

In-place multiplication (by a scalar) operator.

◆ operator+()

template<typename Type >
Vector2Tpl Vector2Tpl< Type >::operator+ ( const Vector2Tpl< Type > &  v) const
inline

Addition operator.

◆ operator+=()

template<typename Type >
Vector2Tpl& Vector2Tpl< Type >::operator+= ( const Vector2Tpl< Type > &  v)
inline

In-place addition operator.

◆ operator-() [1/2]

template<typename Type >
Vector2Tpl& Vector2Tpl< Type >::operator- ( )
inline

Inverse operator.

◆ operator-() [2/2]

template<typename Type >
Vector2Tpl Vector2Tpl< Type >::operator- ( const Vector2Tpl< Type > &  v) const
inline

Subtraction operator.

◆ operator-=()

template<typename Type >
Vector2Tpl& Vector2Tpl< Type >::operator-= ( const Vector2Tpl< Type > &  v)
inline

In-place subtraction operator.

◆ operator/()

template<typename Type >
Vector2Tpl Vector2Tpl< Type >::operator/ ( Type  s) const
inline

Division operator.

◆ operator/=()

template<typename Type >
Vector2Tpl& Vector2Tpl< Type >::operator/= ( Type  v)
inline

In-place division (by a scalar) operator.

◆ operator[]() [1/2]

template<typename Type >
Type& Vector2Tpl< Type >::operator[] ( unsigned  i)
inline

Direct coordinate access.

◆ operator[]() [2/2]

template<typename Type >
const Type& Vector2Tpl< Type >::operator[] ( unsigned  i) const
inline

Direct coordinate access (const)

◆ rows()

template<typename Type >
std::size_t Vector2Tpl< Type >::rows ( ) const
inline

Member Data Documentation

◆ @1

union { ... }

◆ u

◆ x

template<typename Type >
Type Vector2Tpl< Type >::x

Referenced by PclUtils::PCLVis::addCaption(), cloudViewer::Delaunay2dMesh::buildMesh(), ccExtru::buildUp(), ccQuadric::buildUp(), Classifier::checkRefPoints(), ccGBLSensor::checkVisibility(), Classifier::classify2D_checkcondnum(), ccGBLSensor::computeAutoParameters(), ccGBLSensor::computeDepthBuffer(), ccCameraSensor::computeUncertainty(), DistanceMapGenerationTool::CreateMap(), Vector2Tpl< PointCoordinateType >::cross(), cloudViewer::GeometricalAnalysisTools::DetectCircle(), DilateClassifier(), Vector2Tpl< PointCoordinateType >::dot(), ccContourExtractor::ExtractConcaveHull2D(), cloudViewer::PointProjectionTools::extractConcaveHull2D(), ccRasterGrid::fillWith(), FindNearestCandidate(), ccPlane::Fit(), ccCameraSensor::fromImageCoordToLocalCoord(), ccCameraSensor::fromLocalCoordToImageCoord(), ccCameraSensor::fromRealImCoordToIdealImCoord(), ccQuadric::getOwnFitBB(), cloudViewer::ManualSegmentationTools::isPointInsidePoly(), Landau_Smith(), LexicographicSort(), ProfileLoader::Load(), Classifier::Load(), ecvGenericCameraTool::CameraInfo::loadConfig(), Vector2Tpl< PointCoordinateType >::norm2(), Vector2Tpl< PointCoordinateType >::operator*(), Vector2Tpl< PointCoordinateType >::operator*=(), Vector2Tpl< PointCoordinateType >::operator+(), Vector2Tpl< PointCoordinateType >::operator+=(), Vector2Tpl< PointCoordinateType >::operator-(), Vector2Tpl< PointCoordinateType >::operator-=(), Vector2Tpl< PointCoordinateType >::operator/(), Vector2Tpl< PointCoordinateType >::operator/=(), ccCameraSensor::orthoRectifyAsImageDirect(), ccOctree::pointPicking(), cc2DLabel::pointPicking(), ccGenericPointCloud::pointPicking(), Classifier::project(), ccGBLSensor::projectColors(), ccGBLSensor::projectNormals(), ccGBLSensor::projectPoint(), PclUtils::PCLVis::rotateWithAxis(), Classifier::save(), MascaretFilter::saveToFile(), PdmsTools::PdmsObjects::Vertex::setPosition(), ecvDisplayTools::StartCPUBasedPointPicking(), ToLocalAbscissa(), ecvGenericCameraTool::CameraInfo::toString(), qCanupo2DViewDialog::trainClassifier(), qCanupoTools::TrainClassifier(), ccGenericMesh::trianglePicking(), ecvCameraParamEditDlg::updateCamera(), and ecvCameraParamEditDlg::updateUi().

◆ y

template<typename Type >
Type Vector2Tpl< Type >::y

Referenced by PclUtils::PCLVis::addCaption(), cloudViewer::Delaunay2dMesh::buildMesh(), ccExtru::buildUp(), ccQuadric::buildUp(), Classifier::checkRefPoints(), ccGBLSensor::checkVisibility(), Classifier::classify2D_checkcondnum(), ccGBLSensor::computeAutoParameters(), ccGBLSensor::computeDepthBuffer(), ccCameraSensor::computeUncertainty(), DistanceMapGenerationTool::CreateMap(), Vector2Tpl< PointCoordinateType >::cross(), cloudViewer::GeometricalAnalysisTools::DetectCircle(), DilateClassifier(), Vector2Tpl< PointCoordinateType >::dot(), ccContourExtractor::ExtractConcaveHull2D(), cloudViewer::PointProjectionTools::extractConcaveHull2D(), ccRasterGrid::fillWith(), FindNearestCandidate(), ccPlane::Fit(), ccCameraSensor::fromImageCoordToLocalCoord(), ccCameraSensor::fromLocalCoordToImageCoord(), ccCameraSensor::fromRealImCoordToIdealImCoord(), ccQuadric::getOwnFitBB(), cloudViewer::ManualSegmentationTools::isPointInsidePoly(), Landau_Smith(), LexicographicSort(), ProfileLoader::Load(), Classifier::Load(), ecvGenericCameraTool::CameraInfo::loadConfig(), Vector2Tpl< PointCoordinateType >::norm2(), Vector2Tpl< PointCoordinateType >::operator*(), Vector2Tpl< PointCoordinateType >::operator*=(), Vector2Tpl< PointCoordinateType >::operator+(), Vector2Tpl< PointCoordinateType >::operator+=(), Vector2Tpl< PointCoordinateType >::operator-(), Vector2Tpl< PointCoordinateType >::operator-=(), Vector2Tpl< PointCoordinateType >::operator/(), Vector2Tpl< PointCoordinateType >::operator/=(), ccCameraSensor::orthoRectifyAsImageDirect(), ccOctree::pointPicking(), cc2DLabel::pointPicking(), ccGenericPointCloud::pointPicking(), Classifier::project(), ccGBLSensor::projectColors(), ccGBLSensor::projectNormals(), ccGBLSensor::projectPoint(), PclUtils::PCLVis::rotateWithAxis(), Classifier::save(), MascaretFilter::saveToFile(), PdmsTools::PdmsObjects::Vertex::setPosition(), ecvDisplayTools::StartCPUBasedPointPicking(), ToLocalAbscissa(), ecvGenericCameraTool::CameraInfo::toString(), ecvDisplayTools::ToVtkCoordinates(), qCanupo2DViewDialog::trainClassifier(), qCanupoTools::TrainClassifier(), ccGenericMesh::trianglePicking(), ecvCameraParamEditDlg::updateCamera(), and ecvCameraParamEditDlg::updateUi().


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