14 #include <osg/Referenced>
23 #include <vrecko/Export>
31 #include <xercesc/dom/DOMNode.hpp>
39 class VRECKO_EXPORT
Scene;
184 #define VRECKO_START_MESSAGE_BASE(messageName, dataType) \
185 class messageName : public vrecko::VreckoMessage { \
188 virtual const char* getMessageId() { return #messageName; } \
200 #define VRECKO_START_MESSAGE_EXTENDED(messageName, dataType) \
201 VRECKO_START_MESSAGE_BASE(messageName, dataType) \
202 messageName(dataType newData) { data = newData; }; \
203 virtual bool isEqualTo(messageName *otherMsg) { return (data == (otherMsg)->data); }; \
211 #define VRECKO_END_MESSAGE \
236 virtual
bool setValueFromString(const
char *valueAsString) { data = (atoi(valueAsString) > 0);
return true; };
241 virtual
bool setValueFromString(const
char *valueAsString) { data = atoi(valueAsString);
return true; };
246 virtual bool setValueFromString(
const char *valueAsString) { data = (
unsigned int)atol(valueAsString);
return true; };
251 virtual
bool setValueFromString(const
char *valueAsString) { data = atof(valueAsString);
return true; };
256 virtual bool setValueFromString(
const char *valueAsString) { data = atol(valueAsString);
return true; };
263 virtual bool setValueFromString(
const char *valueAsString) { data = valueAsString;
return true; };
270 virtual bool setValueFromString(
const char *valueAsString) {
return (2 == sscanf_s(valueAsString,
"%f %f", &data.x(), &data.y())); };
271 virtual bool isEqualTo(VreckoMessage *otherMsg) {
return (data == ((
MessageVec2*)otherMsg)->data); };
277 virtual bool setValueFromString(
const char *valueAsString) {
return (3 == sscanf_s(valueAsString,
"%f %f %f", &data.x(), &data.y(), &data.z())); };
278 virtual bool isEqualTo(VreckoMessage *otherMsg) {
return (data == ((
MessageVec3*)otherMsg)->data); };
284 virtual bool setValueFromString(
const char *valueAsString) {
return (4 == sscanf_s(valueAsString,
"%f %f %f %f", &data.x(), &data.y(), &data.z(), &data.w())); };
285 virtual bool isEqualTo(VreckoMessage *otherMsg) {
return (data == ((
MessageVec4*)otherMsg)->data); };
291 virtual bool setValueFromString(
const char *valueAsString) {
return (4 == sscanf_s(valueAsString,
"%f %f %f %f", &data.x(), &data.y(), &data.z(), &data.w())); };
292 virtual bool isEqualTo(VreckoMessage *otherMsg) {
return (data == ((
MessageQuat*)otherMsg)->data); };
298 virtual bool setValueFromString(
const char *valueAsString) {
return (16 == sscanf_s(valueAsString,
"%f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f",
299 &data(0, 0), &data(0, 1), &data(0, 2), &data(0, 3),
300 &data(1, 0), &data(1, 1), &data(1, 2), &data(1, 3),
301 &data(2, 0), &data(2, 1), &data(2, 2), &data(2, 3),
302 &data(3, 0), &data(3, 1), &data(3, 2), &data(3, 3)