JugiMap Framework
GeometricShape Struct Referenceabstract

The GeometricShape is the base class for geometric shapes. More...

#include <jmVectorShapes.h>

Inherited by BezierShape, EllipseShape, PolyLineShape, and SinglePointShape.

Public Member Functions

ShapeKind GetKind ()
 Returns the kind of this shape. More...
 
virtual bool IsValid ()=0
 Returns true if this shape is a valid geometric object; otherwise returns false. More...
 
bool IsClosed ()
 Returns true if this shape is a closed geometric object; otherwise returns false. More...
 
void _SetClosed (bool _closed)
 Set the closed parameter when you create a geometric shape by hand. Do not change it for existing shapes! More...
 
std::vector< TShapePoint > & GetPath ()
 Returns a reference to the path vector of this geometric shape. More...
 
virtual void RebuildPath ()=0
 Rebuild the path from the current shape geometry. More...
 
float GetPathLength ()
 Returns the length of the path. More...
 
virtual Vec2f GetPathPoint (float p)
 Returns a point along the path at the given parametric position p. More...
 
virtual Vec2f GetPathPoint (float p, float &directionAngle)
 Returns a point along the path at the given parametric position p. More...
 

Static Public Member Functions

static GeometricShapeCopy (GeometricShape *_geomShape)
 Create a new geometric object which is a copy of the given *_geomShape*. More...
 
static void Assign (GeometricShape *sSrc, GeometricShape *sDst)
 Assign the content of the given sSrc to the sDst. More...
 

Detailed Description

The GeometricShape is the base class for geometric shapes.

The GeometricShape provides the shape data for the VectorShape objects. It can be used for standalone objects in collision functions.

Member Function Documentation

◆ Copy()

GeometricShape * Copy ( GeometricShape _geomShape)
static

Create a new geometric object which is a copy of the given *_geomShape*.

◆ Assign()

void Assign ( GeometricShape sSrc,
GeometricShape sDst 
)
static

Assign the content of the given sSrc to the sDst.

Assigning shapes sSrc and sDst must be of the same kind!

◆ GetKind()

ShapeKind GetKind ( )
inline

Returns the kind of this shape.

◆ IsValid()

virtual bool IsValid ( )
pure virtual

Returns true if this shape is a valid geometric object; otherwise returns false.

This function is usually called from the VectorShape::IsValid.

Implemented in SinglePointShape, EllipseShape, BezierShape, and PolyLineShape.

◆ IsClosed()

bool IsClosed ( )
inline

Returns true if this shape is a closed geometric object; otherwise returns false.

This function is usually called from the VectorShape::IsClosed.

◆ _SetClosed()

void _SetClosed ( bool  _closed)
inline

Set the closed parameter when you create a geometric shape by hand. Do not change it for existing shapes!

◆ GetPath()

std::vector<TShapePoint>& GetPath ( )
inline

Returns a reference to the path vector of this geometric shape.

This function is usually called from the VectorShape::GetPath.

◆ RebuildPath()

virtual void RebuildPath ( )
pure virtual

Rebuild the path from the current shape geometry.

This function is usually called from the VectorShape::RebuildPath.

Implemented in SinglePointShape, EllipseShape, BezierShape, and PolyLineShape.

◆ GetPathLength()

float GetPathLength ( )
inline

Returns the length of the path.

This function is usually called from the VectorShape::GetPathLength.

◆ GetPathPoint() [1/2]

Vec2f GetPathPoint ( float  p)
virtual

Returns a point along the path at the given parametric position p.

This function is usually called from the VectorShape::GetPathPoint.

Parameters
pA parameter in the range of [0.0 - 1.0] where 0.0 gives the starting point and 1.0 gives the end point of the path.

Reimplemented in SinglePointShape.

◆ GetPathPoint() [2/2]

Vec2f GetPathPoint ( float  p,
float &  directionAngle 
)
virtual

Returns a point along the path at the given parametric position p.

This function is usually called from the VectorShape::GetPathPoint.

Parameters
pA parameter in the range of [0.0 - 1.0] where 0.0 gives the starting point and 1.0 gives the end point of the path.
directionAngleThe direction angle of the path at the returned point.

Reimplemented in SinglePointShape.


The documentation for this struct was generated from the following files: