eVision C++ API 26.10.0-beta.2.dev
Loading...
Searching...
No Matches
eVision::Easy3D::E3DPlane Class Reference

Represents a 3D plane. More...

#include <eVision/Easy3D/E3DPlane.h>

Collaboration diagram for eVision::Easy3D::E3DPlane:

Public Member Functions

 E3DPlane ()
 Creates an E3DPlane object.
 E3DPlane (const eVision::Easy3D::E3DPoint &normal, float signedDistance)
 Creates an E3DPlane object.
 E3DPlane (const eVision::Easy3D::E3DPoint &point1, const eVision::Easy3D::E3DPoint &point2, const eVision::Easy3D::E3DPoint &point3)
 Creates an E3DPlane object.
 E3DPlane (const eVision::Easy3D::E3DPlane &other)
 Creates an E3DPlane object.
virtual ~E3DPlane () throw ()
eVision::Easy3D::E3DPlane & operator= (const eVision::Easy3D::E3DPlane &other)
 Assignment operator.
eVision::Easy3D::E3DPlane operator+ (float offset) const
 Operator "+": returns a new E3DPlane translated in the direction of the normal to the plane.
eVision::Easy3D::E3DPlane operator- (float offset) const
 Operator "-": returns a new E3DPlane translated in the inverse of the direction of the normal to the plane.
void Define (const eVision::Easy3D::E3DPoint &normal, float signedDistance)
 (re)Defines the plane parameters:
void Define (const eVision::Easy3D::E3DPoint &point1, const eVision::Easy3D::E3DPoint &point2, const eVision::Easy3D::E3DPoint &point3)
 (re)Defines the plane parameters:
eVision::Easy3D::E3DPoint GetNormal () const
 Gets/Sets the normal vector of the plane.
void SetNormal (const eVision::Easy3D::E3DPoint &vector)
 Gets/Sets the normal vector of the plane.
float GetSignedDistanceFromOrigin () const
 Gets/Sets the signed distance between the origin and the plane.
void SetSignedDistanceFromOrigin (float signedDistance)
 Gets/Sets the signed distance between the origin and the plane.
float DistanceTo (const eVision::Easy3D::E3DPoint &point) const
 Returns the signed distance between the plane and a given point.
eVision::Easy3D::E3DPoint ProjectPoint (const eVision::Easy3D::E3DPoint &point) const
 Returns the position of the given point projected on the plane.
eVision::Easy3D::E3DPlane Transform (const eVision::Easy3D::E3DTransformMatrix &matrix) const
 Transforms the 3D plane with the given transformation matrix. The transformation matrix must contain a rigid transformation (translation and rotation only).
void Load (const std::string &path)
 Loads a E3DPlane. The given ESerializer must have been created for reading.
void Load (eVision::ESerializer *serializer)
 Loads a E3DPlane. The given ESerializer must have been created for reading.
void Save (const std::string &path)
 Saves a E3DPlane. The given ESerializer must have been created for writing.
void Save (eVision::ESerializer *serializer)
 Saves a E3DPlane. The given ESerializer must have been created for writing.
void FlipIfNegativeZ ()
 Flips the orientation of the ZMap (normal = -normal) if the normal has a negative Z coordinate.
void OrientNormal (eVision::Easy3D::E3DPlaneNormalOrientation orientation)
 Orients the normal of the ZMap on one of the axes, see E3DPlaneNormalOrientation.
float AngleWithPlane (const eVision::Easy3D::E3DPlane &other) const
 Returns the angle (in the first quadrant) between the normals of this plane and the one passed in argument.
bool IntersectionWithTwoPlanes (const eVision::Easy3D::E3DPlane &plane1, const eVision::Easy3D::E3DPlane &plane2, eVision::Easy3D::E3DPoint &intersection) const
 Compute the intersection between this plane and the two given as argument. If the intersection exists, true is returned and intersection is filled with the intersection.
eVision::Easy3D::E3DTransformMatrix GetTransformationTo (const eVision::Easy3D::E3DPlane &destination) const
 Return the transformation that moves the plane to the given destination plane.
 E3DPlane (CppWrapperInternal::InternalConstructor)

Static Public Member Functions

static eVision::Easy3D::E3DPlane XPlane ()
 The X=0 plane.
static eVision::Easy3D::E3DPlane YPlane ()
 The Y=0 plane.
static eVision::Easy3D::E3DPlane ZPlane ()
 The Z=0 plane.

Public Attributes

CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

Represents a 3D plane.

The equation of the plane is "n_vect . (x,y,z) = signedDistance" where "n_vect" is the normal vector and "signedDistance" is the signed distance from the origin to the plane.

The signed distance is positive when the vector binding the origin to the closest point on the plane has the same direction as "n_vect" and is negative when this vector has the opposite direction as "n_vect".

License(s): Easy3D

Constructor & Destructor Documentation

◆ E3DPlane() [1/5]

eVision::Easy3D::E3DPlane::E3DPlane ( )

Creates an E3DPlane object.

It is possible to initialize it by specifying its normal and signed distance from the origin. In that case, it exits with an exception if the norm of the normal is null. It is also possible to initialize it by specifying 3 points of the plane. In that case, it exits with an exception if the 3 points are aligned.

When we define a plane by specifying 3 points, the normal vector is always oriented towards the positive Z axis, see E3DPlaneNormalOrientation::E3DPlaneNormalOrientation_PosZ.

◆ E3DPlane() [2/5]

eVision::Easy3D::E3DPlane::E3DPlane ( const eVision::Easy3D::E3DPoint & normal,
float signedDistance )

Creates an E3DPlane object.

It is possible to initialize it by specifying its normal and signed distance from the origin. In that case, it exits with an exception if the norm of the normal is null. It is also possible to initialize it by specifying 3 points of the plane. In that case, it exits with an exception if the 3 points are aligned.

Parameters
normalThe normal vector. May not be null.
signedDistanceThe signed distance from the origin to the plane.

When we define a plane by specifying 3 points, the normal vector is always oriented towards the positive Z axis, see E3DPlaneNormalOrientation::E3DPlaneNormalOrientation_PosZ.

◆ E3DPlane() [3/5]

eVision::Easy3D::E3DPlane::E3DPlane ( const eVision::Easy3D::E3DPoint & point1,
const eVision::Easy3D::E3DPoint & point2,
const eVision::Easy3D::E3DPoint & point3 )

Creates an E3DPlane object.

It is possible to initialize it by specifying its normal and signed distance from the origin. In that case, it exits with an exception if the norm of the normal is null. It is also possible to initialize it by specifying 3 points of the plane. In that case, it exits with an exception if the 3 points are aligned.

Parameters
point1First point
point2Second point
point3Third point

When we define a plane by specifying 3 points, the normal vector is always oriented towards the positive Z axis, see E3DPlaneNormalOrientation::E3DPlaneNormalOrientation_PosZ.

◆ E3DPlane() [4/5]

eVision::Easy3D::E3DPlane::E3DPlane ( const eVision::Easy3D::E3DPlane & other)

Creates an E3DPlane object.

It is possible to initialize it by specifying its normal and signed distance from the origin. In that case, it exits with an exception if the norm of the normal is null. It is also possible to initialize it by specifying 3 points of the plane. In that case, it exits with an exception if the 3 points are aligned.

Parameters
otherReference to the plane used for the initialization.

When we define a plane by specifying 3 points, the normal vector is always oriented towards the positive Z axis, see E3DPlaneNormalOrientation::E3DPlaneNormalOrientation_PosZ.

◆ ~E3DPlane()

eVision::Easy3D::E3DPlane::~E3DPlane ( )
throw ( )
virtual

◆ E3DPlane() [5/5]

eVision::Easy3D::E3DPlane::E3DPlane ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ AngleWithPlane()

float eVision::Easy3D::E3DPlane::AngleWithPlane ( const eVision::Easy3D::E3DPlane & other) const

Returns the angle (in the first quadrant) between the normals of this plane and the one passed in argument.

Parameters
otherThe plane with respect to which we compute our angle

This function does not take the orientation of the normals into account, i.e. (0, 0, 1) and (0, 0, -1) will give the same angle

◆ Define() [1/2]

void eVision::Easy3D::E3DPlane::Define ( const eVision::Easy3D::E3DPoint & normal,
float signedDistance )

(re)Defines the plane parameters:

It is possible to use the normal and the signed distance of the plane. In that case, it exits with an exception if the normal vector is the null vector. It is also possible to use 3 points of the plane. In that case, it exits with an exception if the 3 points are aligned.

Parameters
normalThe normal vector, represented by an E3DPoint.
signedDistanceThe signed distance between the origin and the plane.

When we define a plane by specifying 3 points, the normal vector always points toward the positive Z.

◆ Define() [2/2]

void eVision::Easy3D::E3DPlane::Define ( const eVision::Easy3D::E3DPoint & point1,
const eVision::Easy3D::E3DPoint & point2,
const eVision::Easy3D::E3DPoint & point3 )

(re)Defines the plane parameters:

It is possible to use the normal and the signed distance of the plane. In that case, it exits with an exception if the normal vector is the null vector. It is also possible to use 3 points of the plane. In that case, it exits with an exception if the 3 points are aligned.

Parameters
point1First point.
point2Second point.
point3Third point.

When we define a plane by specifying 3 points, the normal vector always points toward the positive Z.

◆ DistanceTo()

float eVision::Easy3D::E3DPlane::DistanceTo ( const eVision::Easy3D::E3DPoint & point) const

Returns the signed distance between the plane and a given point.

A positive distance means that the vector connecting the plane to the point has the same direction as the normal while a negative distance means that it has the opposite direction.

Parameters
pointThe 3D point to measure the distance to.

◆ FlipIfNegativeZ()

void eVision::Easy3D::E3DPlane::FlipIfNegativeZ ( )

Flips the orientation of the ZMap (normal = -normal) if the normal has a negative Z coordinate.

Deprecated

Use E3DPlane::OrientNormal ( E3DPlaneNormalOrientation::E3DPlaneNormalOrientation_PosZ ) instead.

Deprecated in version 26.2. Scheduled to be removed in version 27.6.

◆ GetNormal()

eVision::Easy3D::E3DPoint eVision::Easy3D::E3DPlane::GetNormal ( ) const

Gets/Sets the normal vector of the plane.

Normal values will be stored normalized.

◆ GetSignedDistanceFromOrigin()

float eVision::Easy3D::E3DPlane::GetSignedDistanceFromOrigin ( ) const

Gets/Sets the signed distance between the origin and the plane.

◆ GetTransformationTo()

eVision::Easy3D::E3DTransformMatrix eVision::Easy3D::E3DPlane::GetTransformationTo ( const eVision::Easy3D::E3DPlane & destination) const

Return the transformation that moves the plane to the given destination plane.

Parameters
destinationThe destination plane.

◆ IntersectionWithTwoPlanes()

bool eVision::Easy3D::E3DPlane::IntersectionWithTwoPlanes ( const eVision::Easy3D::E3DPlane & plane1,
const eVision::Easy3D::E3DPlane & plane2,
eVision::Easy3D::E3DPoint & intersection ) const

Compute the intersection between this plane and the two given as argument. If the intersection exists, true is returned and intersection is filled with the intersection.

Parameters
plane1The first plane with which we compute the intersection.
plane2The second plane with which we compute the intersection.
intersectionThe point that will contain the intersection between the three planes.

◆ Load() [1/2]

void eVision::Easy3D::E3DPlane::Load ( const std::string & path)

Loads a E3DPlane. The given ESerializer must have been created for reading.

Parameters
pathThe file path.

◆ Load() [2/2]

void eVision::Easy3D::E3DPlane::Load ( eVision::ESerializer * serializer)

Loads a E3DPlane. The given ESerializer must have been created for reading.

Parameters
serializerThe serializer.

◆ operator+()

eVision::Easy3D::E3DPlane eVision::Easy3D::E3DPlane::operator+ ( float offset) const

Operator "+": returns a new E3DPlane translated in the direction of the normal to the plane.

Parameters
offsetoffset value

◆ operator-()

eVision::Easy3D::E3DPlane eVision::Easy3D::E3DPlane::operator- ( float offset) const

Operator "-": returns a new E3DPlane translated in the inverse of the direction of the normal to the plane.

Parameters
offsetoffset value

◆ operator=()

eVision::Easy3D::E3DPlane & eVision::Easy3D::E3DPlane::operator= ( const eVision::Easy3D::E3DPlane & other)

Assignment operator.

Parameters
otherThe E3DPlane object that should be copied.

◆ OrientNormal()

void eVision::Easy3D::E3DPlane::OrientNormal ( eVision::Easy3D::E3DPlaneNormalOrientation orientation)

Orients the normal of the ZMap on one of the axes, see E3DPlaneNormalOrientation.

Parameters
orientationAxis to orient the normal towards.

◆ ProjectPoint()

eVision::Easy3D::E3DPoint eVision::Easy3D::E3DPlane::ProjectPoint ( const eVision::Easy3D::E3DPoint & point) const

Returns the position of the given point projected on the plane.

Parameters
pointThe 3D point to project on plane.

◆ Save() [1/2]

void eVision::Easy3D::E3DPlane::Save ( const std::string & path)

Saves a E3DPlane. The given ESerializer must have been created for writing.

Parameters
pathThe file path.

◆ Save() [2/2]

void eVision::Easy3D::E3DPlane::Save ( eVision::ESerializer * serializer)

Saves a E3DPlane. The given ESerializer must have been created for writing.

Parameters
serializerThe ESerializer object that is written to.

◆ SetNormal()

void eVision::Easy3D::E3DPlane::SetNormal ( const eVision::Easy3D::E3DPoint & vector)

Gets/Sets the normal vector of the plane.

Normal values will be stored normalized.

◆ SetSignedDistanceFromOrigin()

void eVision::Easy3D::E3DPlane::SetSignedDistanceFromOrigin ( float signedDistance)

Gets/Sets the signed distance between the origin and the plane.

◆ Transform()

eVision::Easy3D::E3DPlane eVision::Easy3D::E3DPlane::Transform ( const eVision::Easy3D::E3DTransformMatrix & matrix) const

Transforms the 3D plane with the given transformation matrix. The transformation matrix must contain a rigid transformation (translation and rotation only).

Parameters
matrixThe 3D transformation matrix.

◆ XPlane()

eVision::Easy3D::E3DPlane eVision::Easy3D::E3DPlane::XPlane ( )
static

The X=0 plane.

◆ YPlane()

eVision::Easy3D::E3DPlane eVision::Easy3D::E3DPlane::YPlane ( )
static

The Y=0 plane.

◆ ZPlane()

eVision::Easy3D::E3DPlane eVision::Easy3D::E3DPlane::ZPlane ( )
static

The Z=0 plane.

Member Data Documentation

◆ wrappedClass_

CppWrapperInternal::WrappedClass eVision::Easy3D::E3DPlane::wrappedClass_