ZeusMath-Library  2.0.4
zeus::IGeometricObject2D Class Referenceabstract

#include <IGeometricObject2D.hpp>

Inheritance diagram for zeus::IGeometricObject2D:
zeus::IArc2D zeus::ICircle2D zeus::ILineSegment2D zeus::IStraightLine2D zeus::TArc2D zeus::TCircle2D zeus::TLineSegment2D zeus::TStraightLine2D

Public Member Functions

virtual const InterfaceID &MQUALIFIER getInterfaceID () const =0
 Get the interface ID as GUID return value. More...
 
virtual Float MQUALIFIER getLength () const =0
 Get the length. More...
 
virtual Retval MQUALIFIER getPointFromRunningParameter (const Float &rfRunningParameter, IVector2D &rvecPoint) const =0
 
virtual Retval MQUALIFIER intersect (const IGeometricObject2D &rObject, IList< IVector2D > &rLstIntersectionPoints, const Float &rfTangentTolerance=INTERSECT_TANGENT_TOLERANCE) const =0
 
virtual bool MQUALIFIER containsPoint (const IVector2D &rVecPoint, const Float &rfTolerance=0) const =0
 
virtual void MQUALIFIER calcClosestPointToPoint (const IVector2D &rVecPoint, IVector2D &rVecClosestPoint) const =0
 
virtual Float MQUALIFIER calcDistanceToPoint (const IVector2D &rVecPoint) const =0
 
virtual Float MQUALIFIER calcDistanceToObject (const IGeometricObject2D &rObject) const =0
 
virtual Retval MQUALIFIER getXMinPoint (IVector2D &rVecPoint) const =0
 
virtual Retval MQUALIFIER getXMaxPoint (IVector2D &rVecPoint) const =0
 
virtual Retval MQUALIFIER getYMinPoint (IVector2D &rVecPoint) const =0
 
virtual Retval MQUALIFIER getYMaxPoint (IVector2D &rVecPoint) const =0
 
virtual void MQUALIFIER getMinMaxCoordinates (Float &rfXMin, Float &rfXMax, Float &rfYMin, Float &rfYMax) const =0
 

Detailed Description

IGeometricObject2D encapsulates a three dimensional floating point object for vector geometry calculations.

Member Function Documentation

§ calcClosestPointToPoint()

virtual void MQUALIFIER zeus::IGeometricObject2D::calcClosestPointToPoint ( const IVector2D rVecPoint,
IVector2D rVecClosestPoint 
) const
pure virtual

Calculate the closest point to a given point.

Parameters
rVecPoint[IN] : Vector to the given point.
rVecClosestPoint[OUT]: Closest point on this object.

Implemented in zeus::TArc2D, zeus::TCircle2D, zeus::TStraightLine2D, and zeus::TLineSegment2D.

§ calcDistanceToObject()

virtual Float MQUALIFIER zeus::IGeometricObject2D::calcDistanceToObject ( const IGeometricObject2D rObject) const
pure virtual

Calculate the distance to another given 2D object.

See the remarks under intersect() regarding the avoidance of redundancy.

Parameters
rObject[IN]: The other given 2D object.
Returns
: The distance between this object and rObject.

Implemented in zeus::TArc2D, zeus::TCircle2D, zeus::TStraightLine2D, and zeus::TLineSegment2D.

§ calcDistanceToPoint()

virtual Float MQUALIFIER zeus::IGeometricObject2D::calcDistanceToPoint ( const IVector2D rVecPoint) const
pure virtual

Calculate the distance to a given point.

Parameters
rVecPoint[IN]: The given point.
Returns
: The distance to the given point.

Implemented in zeus::TArc2D, zeus::TCircle2D, zeus::TStraightLine2D, and zeus::TLineSegment2D.

§ containsPoint()

virtual bool MQUALIFIER zeus::IGeometricObject2D::containsPoint ( const IVector2D rVecPoint,
const Float &  rfTolerance = 0 
) const
pure virtual

Is a given point on this object?

Parameters
rVecPoint[IN]: Vector to the given point.
rfTolerance[IN]: Optional: Maximum distance used as tolerance to treat the given point still as being contained.
Returns
: This object contains the given point.

Implemented in zeus::TArc2D, zeus::TCircle2D, zeus::TStraightLine2D, and zeus::TLineSegment2D.

§ getInterfaceID()

virtual const InterfaceID& MQUALIFIER zeus::IGeometricObject2D::getInterfaceID ( ) const
pure virtual

Get the interface ID as GUID return value.

Implemented in zeus::TArc2D, zeus::TCircle2D, zeus::TStraightLine2D, and zeus::TLineSegment2D.

§ getLength()

virtual Float MQUALIFIER zeus::IGeometricObject2D::getLength ( ) const
pure virtual

§ getMinMaxCoordinates()

virtual void MQUALIFIER zeus::IGeometricObject2D::getMinMaxCoordinates ( Float &  rfXMin,
Float &  rfXMax,
Float &  rfYMin,
Float &  rfYMax 
) const
pure virtual

Calculate the minimum and maximum coordinates.

Parameters
rfXMin[OUT]: The minimum x coordinate. If undefined, TFloat::NaN is returned.
rfXMax[OUT]: The maximum x coordinate. If undefined, TFloat::NaN is returned.
rfYMin[OUT]: The minimum y coordinate. If undefined, TFloat::NaN is returned.
rfYMax[OUT]: The maximum y coordinate. If undefined, TFloat::NaN is returned.

Implemented in zeus::TArc2D, zeus::TCircle2D, zeus::TStraightLine2D, and zeus::TLineSegment2D.

§ getPointFromRunningParameter()

virtual Retval MQUALIFIER zeus::IGeometricObject2D::getPointFromRunningParameter ( const Float &  rfRunningParameter,
IVector2D rvecPoint 
) const
pure virtual

Get the vector to a point defined by a running parameter.

Parameters
rfRunningParameter[IN] : The given running parameter.
rvecPoint[OUT]: Vector to the point.
Return values
RET_NOERROR: The point was successfully calculated.
RET_REQUEST_FAILED: The point could not be calculated. Example: Passing a running parameter outside of the interval [0,1] for a line segment or an arc will lead to this error.

Implemented in zeus::TArc2D, zeus::TCircle2D, zeus::TStraightLine2D, and zeus::TLineSegment2D.

§ getXMaxPoint()

virtual Retval MQUALIFIER zeus::IGeometricObject2D::getXMaxPoint ( IVector2D rVecPoint) const
pure virtual

Calculate the point on this object with a maximum x coordinate.

Parameters
rVecPoint[OUT]: The desired point.
Return values
RET_NOERROR: rVecPoint is valid and the only such point.
RET_EMPTY_SET: There is no such point. rVecPoint is not valid.
RET_INFINITE_SET: There is an infinite number of such points. rVecPoint is valid, but only an example.

Implemented in zeus::TArc2D, zeus::TCircle2D, zeus::TStraightLine2D, and zeus::TLineSegment2D.

§ getXMinPoint()

virtual Retval MQUALIFIER zeus::IGeometricObject2D::getXMinPoint ( IVector2D rVecPoint) const
pure virtual

Calculate the point on this object with a minimum x coordinate.

Parameters
rVecPoint[OUT]: The desired point.
Return values
RET_NOERROR: rVecPoint is valid and the only such point.
RET_EMPTY_SET: There is no such point. rVecPoint is not valid.
RET_INFINITE_SET: There is an infinite number of such points. rVecPoint is valid, but only an example.

Implemented in zeus::TArc2D, zeus::TCircle2D, zeus::TStraightLine2D, and zeus::TLineSegment2D.

§ getYMaxPoint()

virtual Retval MQUALIFIER zeus::IGeometricObject2D::getYMaxPoint ( IVector2D rVecPoint) const
pure virtual

Calculate the point on this object with a maximum y coordinate.

Parameters
rVecPoint[OUT]: The desired point.
Return values
RET_NOERROR: rVecPoint is valid and the only such point.
RET_EMPTY_SET: There is no such point. rVecPoint is not valid.
RET_INFINITE_SET: There is an infinite number of such points. rVecPoint is valid, but only an example.

Implemented in zeus::TArc2D, zeus::TCircle2D, zeus::TStraightLine2D, and zeus::TLineSegment2D.

§ getYMinPoint()

virtual Retval MQUALIFIER zeus::IGeometricObject2D::getYMinPoint ( IVector2D rVecPoint) const
pure virtual

Calculate the point on this object with a minimum y coordinate.

Parameters
rVecPoint[OUT]: The desired point.
Return values
RET_NOERROR: rVecPoint is valid and the only such point.
RET_EMPTY_SET: There is no such point. rVecPoint is not valid.
RET_INFINITE_SET: There is an infinite number of such points. rVecPoint is valid, but only an example.

Implemented in zeus::TArc2D, zeus::TCircle2D, zeus::TStraightLine2D, and zeus::TLineSegment2D.

§ intersect()

virtual Retval MQUALIFIER zeus::IGeometricObject2D::intersect ( const IGeometricObject2D rObject,
IList< IVector2D > &  rLstIntersectionPoints,
const Float &  rfTangentTolerance = INTERSECT_TANGENT_TOLERANCE 
) const
pure virtual

Intersect this object with another given 2D object.

To avoid redundancy within implementation, the following order of specialized classes must be respected:

  1. IStraightLine2D
  2. ILineSegment2D
  3. ICircle2D
  4. IArc2D

The implementation for intersecting class A with class B is

  • In class A if the order of A is higher or equal than the order of B.
  • In class B if the order of A is lower than the order of B.

Examples: The code for intersecting

Parameters
rObject[IN] : The other given 2D object.
rLstIntersectionPoints[OUT]: List of intersection points as 2D vectors. The list is not cleared. Points are only added in case RET_NOERROR is returned. The caller can instantiate TValueTypeList<TVector2D, IVector2D> from zeusbase/System.
rfTangentTolerance[IN] : Optional: Maximum distance used as tolerance to treat non-intersection still as tangent.
Return values
RET_NOERROR: An intersection point set of finite size was calculated.
RET_INFINITE_SET: An intersection point set of infinite size was calculated.
RET_EMPTY_SET: An empty intersection point set was calculated.
RET_FEATURE_UNAVAILABLE: The intersection calculation is not implemented for the given combination of objects.

Implemented in zeus::TArc2D, zeus::TCircle2D, zeus::TStraightLine2D, and zeus::TLineSegment2D.


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


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Wed Sep 14 2016 06:46:02