Line | |
---|
1 | #ifndef _BoundingBoxConverter_H__
|
---|
2 | #define _BoundingBoxConverter_H__
|
---|
3 | #include <vector>
|
---|
4 | #include "AxisAlignedBox3.h"
|
---|
5 |
|
---|
6 | namespace GtpVisibilityPreprocessor {
|
---|
7 |
|
---|
8 | /** helper struct used to identify objects with similar bounding boxes.
|
---|
9 | */
|
---|
10 | struct IndexedBoundingBox: public std::pair<int, AxisAlignedBox3>
|
---|
11 | {
|
---|
12 | typedef std::pair<int, AxisAlignedBox3> IndexedBoundingBoxParent;
|
---|
13 |
|
---|
14 | IndexedBoundingBox(int idx, const AxisAlignedBox3 &box): IndexedBoundingBoxParent(idx, box)
|
---|
15 | {}
|
---|
16 | };
|
---|
17 |
|
---|
18 | /** Class used to assign unique indices to objects using a comparison of bounding boxes.
|
---|
19 | */
|
---|
20 | class BoundingBoxConverter
|
---|
21 | {
|
---|
22 | public:
|
---|
23 | //BoundingBoxConverter();
|
---|
24 | /** Takes a vector of indexed bounding boxes and uses it to identify objects with a similar bounding box
|
---|
25 | and to assign the index.
|
---|
26 | The objects are returned in the object container.
|
---|
27 |
|
---|
28 | @returns true if conversion was successful
|
---|
29 | */
|
---|
30 | virtual bool IdentifyObjects(const IndexedBoundingBoxContainer &iboxes,
|
---|
31 | ObjectContainer &objects) const
|
---|
32 | {
|
---|
33 | // default: do nothing as we assume that a unique id is already assigned to the objects.
|
---|
34 | return true;
|
---|
35 | }
|
---|
36 | };
|
---|
37 |
|
---|
38 | }
|
---|
39 |
|
---|
40 | #endif // _BoundingBoxConverter_H__
|
---|
Note: See
TracBrowser
for help on using the repository browser.