Go to the documentation of this file.
19 #ifndef __APRIL_MAIN_HEADER_INC__
20 #define __APRIL_MAIN_HEADER_INC__
27 #include <april/april_config.h>
31 #include <libbbb/1/memtrack.h>
32 #include <libbbb/1/refcnt.h>
50 #define RAND_0_1 ( ((qreal)qrand()) / RAND_MAX )
53 #define RAND_ARROUND_1 ( RAND_0_1 + 0.5 )
56 #define RAND_ARROUND_0 ( RAND_0_1 - 0.5 )
59 #define SMALL_RANDOM ( RAND_ARROUND_0 / 100000 )
62 #define RANDINT_0_MAX(m) ( qrand() % (m) )
68 #define firstSensor_(p) static_cast<Sensor*>(p->sensors_.first())
69 #define prevSensor_(p) static_cast<Sensor*>(p->prev())
70 #define nextSensor_(p) static_cast<Sensor*>(p->next())
72 #define firstActor_(p) static_cast<Actor*>(p->actors_.first())
73 #define prevActor_(p) static_cast<Actor*>(p->prev())
74 #define nextActor_(p) static_cast<Actor*>(p->next())
76 #define firstActuator_(p) static_cast<Actuator*>(p->actuators_.first())
77 #define prevActuator_(p) static_cast<Actuator*>(p->prev())
78 #define nextActuator_(p) static_cast<Actuator*>(p->next())
80 #define firstReflex_(p) static_cast<Reflex*>(p->reflexes_.first())
81 #define prevReflex_(p) static_cast<Reflex*>(p->prev())
82 #define nextReflex_(p) static_cast<Reflex*>(p->next())
84 #define firstBrain_(p) static_cast<Brain*>(p->brains_.first())
85 #define prevBrain_(p) static_cast<Brain*>(p->prev())
86 #define nextBrain_(p) static_cast<Brain*>(p->next())
88 #define firstEvent_(p) static_cast<EventSource*>(p->events_.first())
89 #define prevEvent_(p) static_cast<EventSource*>(p->prev())
90 #define nextEvent_(p) static_cast<EventSource*>(p->next())
92 #define firstWorld_(p) static_cast<World*>(p->worlds_.first())
93 #define prevWorld_(p) static_cast<World*>(p->prev())
94 #define nextWorld_(p) static_cast<World*>(p->next())
96 #define firstEventData_(p) static_cast<EventData*>(p->event_data_.first())
97 #define prevEventData_(p) static_cast<EventData*>(p->prev())
98 #define nextEventData_(p) static_cast<EventData*>(p->next())
100 #define firstPlugin_(p) static_cast<AprilPluginLoader*>(p->plugins_.first())
101 #define prevPlugin_(p) static_cast<AprilPluginLoader*>(p->prev())
102 #define nextPlugin_(p) static_cast<AprilPluginLoader*>(p->next())
110 #define xstringify(s) #s
112 #define stringify(s) xstringify(s)
137 #endif // __APRIL_MAIN_HEADER_INC__