source: osgVisual/trunk/include/extLink/manip_extLink.h @ 301

Last change on this file since 301 was 221, checked in by Torben Dannhauer, 14 years ago

Updated copyright NOTICE
(No code changes)

File size: 3.3 KB
Line 
1#pragma once
2/* -*-c++-*- osgVisual - Copyright (C) 2009-2011 Torben Dannhauer
3 *
4 * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under
5 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
6 * (at your option) any later version.  The full license is in LICENSE file
7 * included with this distribution, and on the openscenegraph.org website.
8 *
9 * osgVisual requires for some proprietary modules a license from the correspondig manufacturer.
10 * You have to aquire licenses for all used proprietary modules.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * OpenSceneGraph Public License for more details.
16*/
17
18#include <visual_object.h>
19
20
21
22namespace osgVisual
23{ 
24
25/**
26 * \brief This class is a camera manipulator based slots without objects.
27 *
28 * @author Torben Dannhauer
29 * @date  Aug 2009
30 */ 
31class extLinkManipulator : public osgGA::CameraManipulator
32{
33        #include <leakDetection.h>
34    public:
35                /**
36                 * \brief Constructor
37                 *
38                 */ 
39        extLinkManipulator();
40
41                /**
42                 * \brief This function returns the classname.
43                 *
44                 * @return Classname of this manipulator.
45                 */ 
46        virtual const char* className() const { return "extLinkManipulator"; }
47
48                /**
49                 * \brief Set the position of the matrix manipulator using a 4x4 Matrix.
50                 *
51                 * @param matrix : Matrix to set.
52                 */ 
53        virtual void setByMatrix(const osg::Matrixd& matrix);
54
55                /**
56                 * \brief Set the position of the matrix manipulator using a 4x4 Matrix.
57                 *
58                 * @param matrix : Inverse Matrix to set.
59                 */ 
60        virtual void setByInverseMatrix(const osg::Matrixd& matrix) { setByMatrix(osg::Matrixd::inverse(matrix)); }
61
62        /** get the position of the manipulator as 4x4 Matrix.*/
63        virtual osg::Matrixd getMatrix() const;
64
65        /** get the position of the manipulator as a inverse matrix of the manipulator, typically used as a model view matrix.*/
66        virtual osg::Matrixd getInverseMatrix() const;
67
68                /**
69                 * \brief Start/restart the manipulator.
70                 *
71                 * No further implementation
72                 *
73                 * @param ea : GUI eventadapter to use for initialization.
74                 * @param us : GUI actionadapter to use for initialization.
75                 */ 
76        virtual void init(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
77
78        /** handle events, return true if handled, false otherwise.*/
79        virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
80
81        /** Get the keyboard and mouse usage of this manipulator.*/
82        virtual void getUsage(osg::ApplicationUsage& usage) const;
83
84                virtual void setAttachedObject( 
85                        visual_object* object_ ) {attachedObject = object_;};
86
87                virtual osgVisual::visual_object* getAttachedObject() {return attachedObject.get();};
88
89
90    protected:
91                /**
92                 * \brief Destructor. Because it is protected, no explicit delete myPointer by external caller is possible.
93                 * This forces the class to be used with osg::ref pointers.
94                 */ 
95        virtual ~extLinkManipulator();
96
97                osg::Matrixd manipMatrix;
98       
99
100                osg::ref_ptr<osgVisual::visual_object> attachedObject;
101};
102
103}       // END NAMESPACE
104
Note: See TracBrowser for help on using the repository browser.