source: osgVisual/src/extLink/manip_extLink.cpp @ 87

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

Introductes VS 2008 Memory Leak Debugging.
Todo: Compile on Linux and compare with Valgrind, VS 2008 seems to be awkward in leak debugging

File size: 1.8 KB
Line 
1/* -*-c++-*- osgVisual - Copyright (C) 2009-2010 Torben Dannhauer
2 *
3 * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * osgVisual requires for some proprietary modules a license from the correspondig manufacturer.
9 * You have to aquire licenses for all used proprietary modules.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * OpenSceneGraph Public License for more details.
15*/
16#include <manip_extLink.h>
17
18
19
20using namespace osg;
21using namespace osgGA;
22using namespace osgVisual;
23
24extLinkManipulator::extLinkManipulator()
25{
26        #include <leakDetection.h>
27}
28
29extLinkManipulator::~extLinkManipulator()
30{
31}
32
33void extLinkManipulator::init(const GUIEventAdapter& ,GUIActionAdapter& )
34{
35}
36
37void extLinkManipulator::getUsage(osg::ApplicationUsage& usage) const
38{
39}
40
41bool extLinkManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& us)
42{
43    switch(ea.getEventType())
44    {
45    case(GUIEventAdapter::FRAME):
46        if (attachedObject.valid())
47                {
48                        setByMatrix( attachedObject->getCameraMatrix() );
49                }
50        return false;
51    default:
52        break;
53    }
54
55    return false;
56}
57
58void extLinkManipulator::setByMatrix(const osg::Matrixd& matrix)
59{
60    manipMatrix = matrix;
61}
62
63osg::Matrixd extLinkManipulator::getMatrix() const
64{
65    return manipMatrix;
66}
67
68osg::Matrixd extLinkManipulator::getInverseMatrix() const
69{
70        return osg::Matrixd::inverse(manipMatrix);
71}
Note: See TracBrowser for help on using the repository browser.