#ifndef _BoundingBoxConverter_H__ #define _BoundingBoxConverter_H__ #include #include "AxisAlignedBox3.h" namespace GtpVisibilityPreprocessor { /** helper struct used to identify objects with similar bounding boxes. */ struct IndexedBoundingBox: public std::pair { typedef std::pair IndexedBoundingBoxParent; IndexedBoundingBox(int idx, const AxisAlignedBox3 &box): IndexedBoundingBoxParent(idx, box) {} }; /** Class used to assign unique indices to objects using a comparison of bounding boxes. */ class BoundingBoxConverter { public: /** Takes a vector of indexed bounding boxes and uses it to identify objects with a similar bounding box and assigns them their index (id). The objects are returned in the object container. @returns true if conversion was successful */ virtual bool IdentifyObjects(const IndexedBoundingBoxContainer &iboxes, ObjectContainer &objects) const { // default: do nothing as we assume that a unique id is already assigned to the objects. return true; } }; } #endif // _BoundingBoxConverter_H__