vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ObjectSelector.h
Go to the documentation of this file.
1 #ifndef OBJECTSELECTOR_H
2 #define OBJECTSELECTOR_H
3 
4 #include <vrecko/Ability.h>
5 #include <osg/Group>
6 #include "ObjectEffect.h"
7 #include <helpers/DynamicArray.h>
8 
9 using namespace vrecko;
10 
11 namespace APObjectUtils
12 {
13  class ObjectSelector: public Ability
14  {
15  public:
17  virtual ~ObjectSelector();
18 
20  virtual void preInitialize();
22  virtual void postInitialize();
24  virtual bool loadXMLParameters(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *pParametersNode);
26  virtual void update();
28 // virtual void processEvent(const std::string &strInputName, void *pValue);
29 
30 // virtual void *processRequest(const std::string&, void *);
31 
32  protected:
34 // std::string strSelectionIDEvent;
35 
37 
38  osg::Vec3 lastPosition, lastSelTest;
39 
40  unsigned long selObjectID;
42 
43  void resolveSelection();
44  EnvironmentObject* resolveIntersections(osg::Vec3 &position, std::vector<osg::Node*> *nodePath = NULL);
45  // [nodePath] can be NULL if not necessary.
46 
47  DECLARE_INPUT(PointerPosition, MessageVec3);
48  DECLARE_OUTPUT(SelectionID, MessageObjectID);
49  DECLARE_REQUEST_INPUT(SelectionID, MessageVoid, MessageObjectID);
50  DECLARE_REQUEST_INPUT(SelectionByPointerPos, MessageVec3, MessageObjectID);
51  DECLARE_REQUEST_INPUT(SelectionByPointerPos_Path, MessageVec3, MessageNodeList);
52  };
53 
54 }
55 
56 
57 #endif