 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
35 #define GUI_RTREE_QUAL RTree<GUIGlObject*, GUIGlObject, float, 2, GUIVisualizationSettings>
40 inline float GUI_RTREE_QUAL::RectSphericalVolume(Rect* a_rect) {
42 const float extent0 = a_rect->m_max[0] - a_rect->m_min[0];
43 const float extent1 = a_rect->m_max[1] - a_rect->m_min[1];
44 return .78539816f * (extent0 * extent0 + extent1 * extent1);
48 inline GUI_RTREE_QUAL::Rect GUI_RTREE_QUAL::CombineRect(Rect* a_rectA, Rect* a_rectB) {
49 ASSERT(a_rectA && a_rectB);
51 newRect.m_min[0] =
rtree_min(a_rectA->m_min[0], a_rectB->m_min[0]);
52 newRect.m_max[0] =
rtree_max(a_rectA->m_max[0], a_rectB->m_max[0]);
53 newRect.m_min[1] =
rtree_min(a_rectA->m_min[1], a_rectB->m_min[1]);
54 newRect.m_max[1] =
rtree_max(a_rectA->m_max[1], a_rectB->m_max[1]);
81 WRITE_ERROR(
"Mutex of SUMORTree is locked during call of the destructor");
93 virtual void Insert(
const float a_min[2],
const float a_max[2],
GUIGlObject*
const & a_dataId) {
94 FXMutexLock locker(
myLock);
95 GUI_RTREE_QUAL::Insert(a_min, a_max, a_dataId);
104 virtual void Remove(
const float a_min[2],
const float a_max[2],
GUIGlObject*
const & a_dataId) {
105 FXMutexLock locker(
myLock);
106 GUI_RTREE_QUAL::Remove(a_min, a_max, a_dataId);
119 FXMutexLock locker(
myLock);
120 return GUI_RTREE_QUAL::Search(a_min, a_max, c);
129 throw ProcessError(
"Mutex of SUMORTree is locked before object insertion");
132 FXMutexLock locker(
myLock);
148 const float cmin[2] = {(float) b.
xmin(), (float) b.
ymin()};
149 const float cmax[2] = {(float) b.
xmax(), (float) b.
ymax()};
159 throw ProcessError(
"Mutex of SUMORTree is locked before object remove");
162 FXMutexLock locker(
myLock);
179 const float cmin[2] = {(float) b.
xmin(), (float) b.
ymin()};
180 const float cmax[2] = {(float) b.
xmax(), (float) b.
ymax()};
#define WRITE_GLDEBUG(msg)
double ymin() const
Returns minimum y-coordinate.
virtual void Remove(const float a_min[2], const float a_max[2], GUIGlObject *const &a_dataId)
Remove entry.
double xmax() const
Returns maximum x-coordinate.
double getHeight() const
Returns the height of the boundary (y-axis)
const std::string & getFullName() const
A RT-tree for efficient storing of SUMO's GL-objects.
virtual void Insert(const float a_min[2], const float a_max[2], GUIGlObject *const &a_dataId)
Insert entry.
double xmin() const
Returns minimum x-coordinate.
void removeAdditionalGLObject(GUIGlObject *o)
Removes an additional object (detector/shape/trigger) from being visualised.
A class that stores a 2D geometrical boundary.
double getWidth() const
Returns the width of the boudary (x-axis)
virtual ~SUMORTree()
Destructor.
FXMutex myLock
A mutex avoiding parallel change and traversal of the tree.
std::map< GUIGlObject *, Boundary > myTreeDebug
Map only used for check that SUMORTree works as expected, only is used if option "gui-testing-debug-g...
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
virtual Boundary getCenteringBoundary() const =0
static bool writeDebugGLMessages()
check whether to enable/disable gl-debug messages
void addAdditionalGLObject(GUIGlObject *o)
Adds an additional object (detector/shape/trigger) for visualisation.
virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings &c) const
Find all within search rectangle.
Stores the information about how to visualize structures.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
double ymax() const
Returns maximum y-coordinate.