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