7 #include <osg/ShapeDrawable>
8 #include <osgText/Text>
20 using namespace vrecko;
28 #define MI_F_SELECTED 0x00000001
30 #define MI_F_EXPANDED 0x00000002
67 virtual void destroy();
71 virtual bool loadParametersFromNode(XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode*
node);
74 inline void setName(
const char* newName);
75 inline const std::string&
getName() {
return name; }
77 bool setFlags(
unsigned long dwNewFlags,
bool bForceUpdate =
false);
79 inline unsigned long getFlags() {
return dwFlags; }
81 virtual bool invalidate(
bool bIncludeSubItems =
false);
86 bool isPointed(osg::Vec3 *projPointerPos);
93 virtual bool show(
unsigned long _dwItemIndex,
unsigned long _dwNumItems,
94 osg::Vec3 *_refPoint1, osg::Vec3 *_refPoint2, osg::Vec3 *_refPoint3);
96 virtual void hide(
bool bIncludeSubItems =
false);
104 virtual bool pointerMove(osg::Vec3 *projPointerPos) {
return true; };
112 virtual void getClickedString(
char *outClickedEventString,
size_t bufferSize) { sprintf_s(outClickedEventString, bufferSize,
"%s", name.c_str()); }
117 virtual bool setAndPlayConfirmationEffect();
128 virtual bool resetConfirmationEffect();
132 inline bool isExpanded() {
return (lpChild && lpChild->isVisible()); }
174 bool createGraphics();
175 bool destroyGraphics();
177 float menuRadial_CalcItemAngle(
int _iItemIndex);
180 unsigned long menuBoxes_CalcItemDisplayIndex();
182 virtual bool createGraphicsCore();
186 virtual bool destroyGraphicsCore();
187 virtual bool showGraphicsAtPoint();
188 virtual bool hideGraphics();
189 virtual bool setFlagsCore(
unsigned long dwOldFlags,
unsigned long dwNewFlags);
191 virtual const osg::BoundingBox& getInnerBoundingBox() = 0;
194 virtual bool addInputOutputs();
199 virtual bool removeInputOutputs();
203 virtual int processNotification(
BaseClass *sender,
unsigned long notificationType,
204 void *notificationData);
232 virtual void destroy();
234 virtual bool loadParametersFromNode(XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode*
node);
236 virtual bool clicked();
239 virtual bool setCaption(
const char* newCaption);
242 virtual bool setModelFile(
const char* newModelFile);
244 void setSignName(
const char* name);
262 virtual bool createGraphicsCore();
263 virtual bool destroyGraphicsCore();
264 virtual bool showGraphicsAtPoint();
265 virtual const osg::BoundingBox& getInnerBoundingBox();
267 bool getTextBoundingBox(osg::BoundingBox *outBox);
271 virtual bool addInputOutputs();
272 virtual bool removeInputOutputs();
274 virtual bool createModel();
275 virtual void destroyModel();
276 virtual void repositionModel();
280 virtual void updateText();
293 virtual void destroy();
295 virtual bool loadParametersFromNode(XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode*
node);
300 virtual void getClickedString(
char *outClickedEventString,
size_t bufferSize);
302 virtual bool pointerButtonDown();
303 virtual bool pointerButtonUp();
304 virtual bool pointerMove(osg::Vec3 *projPointerPos);
307 virtual bool setSliderPos01(
float fNewSliderPos01,
bool bSendEvent =
true);
309 virtual float getSliderPosXY();
310 virtual bool setSliderPosXY(
float fNewSliderPos,
bool bSendEvent =
true) {
return setSliderPos01((fNewSliderPos - fSliderFromX) / (fSliderToY - fSliderFromX), bSendEvent); }
324 virtual bool createGraphicsCore();
325 virtual bool destroyGraphicsCore();
326 virtual bool showGraphicsAtPoint();
327 virtual const osg::BoundingBox& getInnerBoundingBox();
329 virtual bool addInputOutputs();
330 virtual bool removeInputOutputs();
332 bool updateSliderGraphicPos();
334 float getPointerSliderPos01(
bool *bIsOutside);
340 virtual void updateText();
380 virtual void preInitialize();
382 virtual void postInitialize();
384 virtual bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode *pParametersNode);
386 virtual void update();
393 bool setMenuString(
const char *newMenuString);
399 bool deleteMenuItem(
MenuItem *item);
401 bool registerNewItemType(
MenuItem *itemTemplate);
405 inline void setAttribute(
const std::string &name,
float value) { attributes[name] = value; }
406 inline float getAttribute(
const std::string &name) {
return attributes[name]; }
408 void setSign(
const std::string &name,
const std::string &value);
409 osg::Node* getSignObject(
const std::string &name);
414 bool showMenu(osg::Vec3 *_menuPos);
420 void sendToClickedOutput(
char *eventValue);
435 osg::Vec3 origMenuPos, origViewPos,
origViewUp, origViewLookAt;
498 std::map<std::string, DynamicMenuSign*>
signs;
519 bool mainButtonPressed();
520 bool mainButtonReleased();
522 bool showChildMenu(
MenuItem* parentItem,
bool bSetNewRoot);
523 void hideChildMenu(
MenuItem* parentItem = NULL,
bool bIncludeSubMenus =
true);
526 bool showMainMenuObject();
527 void hideMainMenuObject();
529 void updatePointerPosition();
531 void updateMainObjectTransformation();
533 void updateInverseCalc();
535 bool pointerMoved(osg::Vec3 *pointerPos);
537 bool pointerViewMovedHelper();
539 bool createMenuFromString();
540 bool createMenuFromNode(XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode* paramNode);
542 bool loadMenuStructureFromNode (XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode* paramNode);
543 bool loadSignsFromXML(XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode* attribsNode);
544 bool loadAttributes(XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode* attribsNode);
545 bool loadMenuItems(
MenuItem *parentItem, XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode* parentNode);
546 void destroyMenuStructure();
548 bool createMainObjects();
549 void destroyMainObjects();
551 bool createPointerTrail();
552 void destroyPointerTrail();
553 void showPointerTrail();
554 void hidePointerTrail();
556 bool pointerUnselectItem(
bool bLeaveSelectedIfLocked =
true);
559 bool pointerSelectItem(
MenuItem *item);
560 bool solvePointerSelection();
570 bool collapseSiblings(
MenuItem *item);
574 void confirmAnimationEnded();
576 void resetBaseValues();
577 void initStandardSignSet();
578 void changeToStructureOccured();
590 void menuGrid_getSize(
int *columns,
int *rows);