Ignore:
Timestamp:
Feb 13, 2011, 7:25:16 PM (13 years ago)
Author:
Torben Dannhauer
Message:

Now the trackingID can be updated by the external Link.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/include/core/core_manipulator.h

    r231 r234  
    6363        void trackNode( int trackingID );
    6464        int getCurrentTrackingID(){return _currentTrackingID;};
     65        void setTrackingIdUpdaterSlot(std::string updaterSlot){_updaterSlot=updaterSlot;};
     66        std::string getTrackingIdUpdaterSlot(){return _updaterSlot;};
    6567
    6668private:
     69        class core_manipulatorCallback : public osg::NodeCallback
     70        {
     71        public:
     72                /**
     73                 * \brief Constructor, for setting the member variables.
     74                 *
     75                 * @param manipulators : Pointer to the manipulator and tracking class.
     76                 */
     77                core_manipulatorCallback(core_manipulator* manipulators):_manipulators(manipulators){};
     78
     79                /**
     80                 * \brief This function is executed as callback during event traversal.
     81                 *
     82                 */
     83                virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
     84        private:
     85                /** Pointer to the manipulator class to edit its value */
     86                core_manipulator* _manipulators;
     87        };
     88
     89        /** Pointer to the callback isntalled to update the tracking ID */
     90        osg::ref_ptr<core_manipulatorCallback> _callback;
     91
     92        /** core_manipulatorCallback must be a freind of this class to allow the callback to edit the member values of this class directly */
     93        friend class core_manipulatorCallback;
    6794
    6895#ifdef USE_SPACENAVIGATOR
     
    93120        int _currentTrackingID;
    94121
     122        /** Slotname to use for dynamic updated tracking ID. */
     123        std::string _updaterSlot;
     124
    95125        /**
    96126         * Pointer to the  scene root node
    97127         */
    98128        osg::ref_ptr<osg::Node> _rootNode;
     129
     130        /**
     131         * Referenced pointer to the applications viewer.
     132         */
     133        osg::ref_ptr<osgViewer::Viewer> _viewer;
    99134};
    100135
Note: See TracChangeset for help on using the changeset viewer.