36 #define GUI_RTREE_QUAL RTree<GUIGlObject*, GUIGlObject, float, 2, GUIVisualizationSettings> 41 inline float GUI_RTREE_QUAL::RectSphericalVolume(Rect* a_rect) {
43 const float extent0 = a_rect->m_max[0] - a_rect->m_min[0];
44 const float extent1 = a_rect->m_max[1] - a_rect->m_min[1];
45 return .78539816f * (extent0 * extent0 + extent1 * extent1);
49 inline GUI_RTREE_QUAL::Rect GUI_RTREE_QUAL::CombineRect(Rect* a_rectA, Rect* a_rectB) {
50 ASSERT(a_rectA && a_rectB);
52 newRect.m_min[0] =
rtree_min(a_rectA->m_min[0], a_rectB->m_min[0]);
53 newRect.m_max[0] =
rtree_max(a_rectA->m_max[0], a_rectB->m_max[0]);
54 newRect.m_min[1] =
rtree_min(a_rectA->m_min[1], a_rectB->m_min[1]);
55 newRect.m_max[1] =
rtree_max(a_rectA->m_max[1], a_rectB->m_max[1]);
91 virtual void Insert(
const float a_min[2],
const float a_max[2],
GUIGlObject*
const & a_dataId) {
93 GUI_RTREE_QUAL::Insert(a_min, a_max, a_dataId);
102 virtual void Remove(
const float a_min[2],
const float a_max[2],
GUIGlObject*
const & a_dataId) {
104 GUI_RTREE_QUAL::Remove(a_min, a_max, a_dataId);
118 return GUI_RTREE_QUAL::Search(a_min, a_max, c);
144 const float cmin[2] = {(float) b.
xmin(), (float) b.
ymin()};
145 const float cmax[2] = {(float) b.
xmax(), (float) b.
ymax()};
171 const float cmin[2] = {(float) b.
xmin(), (float) b.
ymin()};
172 const float cmax[2] = {(float) b.
xmax(), (float) b.
ymax()};
MFXMutex myLock
A mutex avoiding parallel change and traversal of the tree.
double ymin() const
Returns minimum y-coordinate.
double xmax() const
Returns maximum x-coordinate.
Stores the information about how to visualize structures.
void removeAdditionalGLObject(GUIGlObject *o)
Removes an additional object (detector/shape/trigger) from being visualised.
#define WRITE_GLDEBUG(msg)
static bool writeDebugGLMessages()
check whether to enable/disable gl-debug messages
double getWidth() const
Returns the width of the boudary (x-axis)
virtual void Remove(const float a_min[2], const float a_max[2], GUIGlObject *const &a_dataId)
Remove entry.
virtual Boundary getCenteringBoundary() const =0
A RT-tree for efficient storing of SUMO's GL-objects.
A class that stores a 2D geometrical boundary.
FXuint lockCount()
return current lock value
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double xmin() const
Returns minimum x-coordinate.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
double getHeight() const
Returns the height of the boundary (y-axis)
void addAdditionalGLObject(GUIGlObject *o)
Adds an additional object (detector/shape/trigger) for visualisation.
A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.
std::map< GUIGlObject *, Boundary > myTreeDebug
Map only used for check that SUMORTree works as expected, only is used if option "gui-testing-debug-g...
FXbool locked()
check if mutex is locked
const std::string & getFullName() const
double ymax() const
Returns maximum y-coordinate.
virtual void Insert(const float a_min[2], const float a_max[2], GUIGlObject *const &a_dataId)
Insert entry.
virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings &c) const
Find all within search rectangle.
virtual ~SUMORTree()
Destructor.