Class collection

Class Documentation

class acme::collection

Collection class container.

Collection of entity objects in 3D space.

Public Functions

collection(collection const&) = default

Collection copy constructor.

collection(collection&&) = default

Collection move constructor.

collection(void)

Collection class constructor.

collection(entity::vecptr &entities)

Collection class constructor.

Parameters

entities – Vector of shared pointers to entity objects

void clear(void)

Clear all collection object data.

void resize(integer size)

Resize collection shared pointer vector.

Parameters

size – Input size

void push_back(entity::ptr entity)

Adds a new element at the end of the collection shared pointer vector.

Parameters

entity – Input shared pointer to entity

entity::ptr &operator[](integer i)

Get i-th entity object shared pointer reference.

Parameters

i – Input i-th value

entity::ptr const &operator[](integer i) const

Get i-th entity object shared pointer const reference.

Parameters

i – Input i-th value

void translate(vec3 const &input)

Translate collection by vector.

Parameters

input – Input translation vector

void rotate(real angle, vec3 const &axis)

Rotate collection by a rotation angle around an arbitrary axis.

Parameters
  • angle – Input angle [rad]

  • axis – Input axis

void rotate(real angle, std::string const &axis)

Rotate tire by a rotation angle around an arbitrary axis.

Parameters
  • angle – Input angle [rad]

  • axis – Input axis

void transform(affine const &matrix)

Transform collection with affine transformation matrix.

Parameters

matrix – 4x4 affine transformation matrix

bool containNone(void) const

Check whether in the collection there are any none entity objects.

bool areNone(void) const

Check whether the collection is composed only by none entity objects.

bool isNone(integer i) const

Check whether in the collection the i-th element is a none entity object.

Parameters

i – Input i-th value

void removeNone(void)

Remove all none entity objects from collection.

integer countNone(void) const

Count all none entity objects in collection.

bool containPoint(void) const

Check whether in the collection there are any point entity objects.

bool arePoint(void) const

Check whether the collection is composed only by point entity objects.

bool isPoint(integer i) const

Check whether in the collection the i-th element is a point entity object.

Parameters

i – Input i-th value

void removePoint(void)

Remove all point entity objects from collection.

integer countPoint(void) const

Count all point entity objects in collection.

bool containLine(void) const

Check whether in the collection there are any line entity objects.

bool areLine(void) const

Check whether the collection is composed only by line entity objects.

bool isLine(integer i) const

Check whether in the collection the i-th element is a line entity object.

Parameters

i – Input i-th value

void removeLine(void)

Remove all line entity objects from collection.

integer countLine(void) const

Count all line entity objects in collection.

bool containRay(void) const

Check whether in the collection there are any ray entity objects.

bool areRay(void) const

Check whether the collection is composed only by ray entity objects.

bool isRay(integer i) const

Check whether in the collection the i-th element is a ray entity object.

Parameters

i – Input i-th value

void removeRay(void)

Remove all ray entity objects from collection.

integer countRay(void) const

Count all ray entity objects in collection.

bool containPlane(void) const

Check whether in the collection there are any plane entity objects.

bool arePlane(void) const

Check whether the collection is composed only by plane entity objects.

bool isPlane(integer i) const

Check whether in the collection the i-th element is a plane entity object.

Parameters

i – Input i-th value

void removePlane(void)

Remove all plane entity objects from collection.

integer countPlane(void) const

Count all plane entity objects in collection.

bool containSegment(void) const

Check whether in the collection there are any segment entity objects.

bool areSegment(void) const

Check whether the collection is composed only by segment entity objects.

bool isSegment(integer i) const

Check whether in the collection the i-th element is a segment entity object.

Parameters

i – Input i-th value

void removeSegment(void)

Remove all segment entity objects from collection.

integer countSegment(void) const

Count all segment entity objects in collection.

bool containTriangle(void) const

Check whether in the collection there are any triangle entity objects.

bool areTriangle(void) const

Check whether the collection is composed only by triangle entity objects.

bool isTriangle(integer i) const

Check whether in the collection the i-th element is a triangle entity object.

Parameters

i – Input i-th value

void removeTriangle(void)

Remove all triangle entity objects from collection.

integer countTriangle(void) const

Count all triangle entity objects in collection.

bool containDisk(void) const

Check whether in the collection there are any disk entity objects.

bool areDisk(void) const

Check whether the collection is composed only by disk entity objects.

bool isDisk(integer i) const

Check whether in the collection the i-th element is a disk entity object.

Parameters

i – Input i-th value

void removeDisk(void)

Remove all disk entity objects from collection.

integer countDisk(void) const

Count all disk entity objects in collection.

bool containBall(void) const

Check whether in the collection there are any ball entity objects.

bool areBall(void) const

Check whether the collection is composed only by ball entity objects.

bool isBall(integer i) const

Check whether in the collection the i-th element is a ball entity object.

Parameters

i – Input i-th value

void removeBall(void)

Remove all ball entity objects from collection.

integer countBall(void) const

Count all ball entity objects in collection.

bool containDegenerated(real tolerance = EPSILON) const

Check if one of the objects in the collection is degenerated.

Parameters

tolerance – Tolerance

bool areDegenerated(real tolerance = EPSILON) const

Check whether the collection is composed only by degenerated entity objects.

Parameters

tolerance – Tolerance

bool isDegenerated(integer i, real tolerance = EPSILON) const

Check whether in the collection the i-th element is a degenerated entity object.

Parameters
  • i – Input i-th value

  • tolerance – Tolerance

void removeDegenerated(real tolerance = EPSILON)

Remove all degenerated entity objects from collection.

Parameters

tolerance – Tolerance

integer countDegenerated(real tolerance = EPSILON) const

Count all degenerated entity objects in collection.

Parameters

tolerance – Tolerance

bool containClampable(void) const

Check whether in the collection there are any clampable entity objects.

bool areClampable(void) const

Check whether the collection is composed only by clampable entity objects.

bool isClampable(integer i) const

Check whether in the collection the i-th element is a clampable entity object.

Parameters

i – Input i-th value

void removeClampable(void)

Remove all clampable entity objects from collection.

integer countClampable(void) const

Count all clampable entity objects in collection.

bool containNonClampable(void) const

Check whether in the collection there are any non clampable entity objects.

bool areNonClampable(void) const

Check whether the collection is composed only by non clampable entity objects.

bool isNonClampable(integer i) const

Check whether in the collection the i-th element is a non clampable entity object.

Parameters

i – Input i-th value

void removeNonClampable(void)

Remove all non clampable entity objects from collection.

integer countNonClampable(void) const

Count all non clampable entity objects in collection.

integer size(void) const

Get collection size (number of entities)

std::map<std::string, integer> count(real tolerance = EPSILON) const

Count all entity types objects in collection.

Parameters

tolerance – Tolerance

void clamp(aabb::vecptr &boxes) const

Get vector of shered pointer to collection objects aabbs.

Parameters

boxes – Vector of shered pointer to collection objects aabbs

void buildAABBtree(void)

Build collection AABB tree.

AABBtree::ptr const &ptrAABBtree(void)

Return collection AABB tree shared pointer.

bool intersection(collection &entities, collection &candidates) const

Intersect the collection with an external collection.

Parameters
  • entities – External entities collection

  • candidates – Intersection candidates

bool intersection(AABBtree::ptr const &AABBtree, collection &entities) const

Intersect the collection AABB tree with an external AABB tree.

Parameters
  • AABBtree – External AABBtree object pointer

  • entities – Intersected entities vector list

bool intersection(aabb::vecptr const &boxes, collection &entities) const

Update the collection AABBtree with an external aabb object pointer vector.

Parameters
  • boxes – External aabb object pointer vector

  • entities – Intersected entities vector list

bool intersection(aabb::ptr const box, collection &entities) const

Update the collection AABBtree with an external aabb object pointer.

Parameters
  • box – External aabb object pointer

  • entities – Intersected entities vector list

void intersection(collection &entities, real tolerance = EPSILON) const

Intersect all entities of the two collections.

Parameters
  • entities – Intersection candidates

  • tolerance – Tolerance