- Main Page
- Classes
- Files

- Search for |

# MouseHapticDevice.h

Go to the documentation of this file.

    00001 /*****************************
    00002 File:      MouseHapticDevice.h
    00003 Language:   C++ (header)
    00004 Project:    H3DNetworkingUtils
    00005 The contents of this file are subject to the Mozilla Public License
    00006 Version 1.1 (the "License"); you may not use this file except in
    00007 compliance with the License. You may obtain a copy of the License at
    00008 http://www.mozilla.org/MPL/
    00009
    00010 Software distributed under the License is distributed on an "AS IS"
    00011 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
    00012 License for the specific language governing rights and limitations
    00013 under the License.
    00014
    00015 The Original Code is H3DNetworkingUtils v1.0.
    00016
    00017 The Initial Developer of the Original Code is CSIRO.
    00018 Portions created by the Initial Developer are Copyright (C) 1009 CSIRO. All Rights Reserved.
    00019 Contributor(s):
    00020     Chris Gunn  <Chris.Gunn@csiro.au> <ChrisJGunn@gmail.com>
    00021 ***************************/
    00022
    00025
    00026 #ifndef MouseHapticDevice_H
    00027 #define MouseHapticDevice_H
    00028
    00029
    00030
    00031 #include <H3D/FakeHapticsDevice.h>
    00032 #include "H3DNetworkingUtils/Config.h"
    00033 #include <H3D/SFNode.h>
    00034 #include <H3D/MouseSensor.h>
    00035 #include <H3D/SFVec3f.h>
    00036
    00037 namespace H3DNetworkingUtils {
    00038
    00067
    00068 class H3D_NETWORKING_UTILS_DLL_SPEC MouseHapticDevice : public H3D::FakeHapticsDevice {
    00069 public:
    00070
    00071    typedef H3D::TypedSFNode<H3D::MouseSensor> SFMouseSensor;
    00072
    00074    MouseHapticDevice(H3D::Inst<SFMouseSensor> mouseSensor = 0);
    00075
    00077    static H3D::H3DNodeDatabase database;
    00078
    00080    virtual void initialize();
    00081
    00086    auto_ptr<SFMouseSensor> mouseSensor;
    00087
    00088 protected:
    00089    // Input fields are 'grab' boolean, current proxy pos, mouse vec2f motion and the right button for z direction
    00090    struct MouseMotion : public H3D::AutoUpdate< H3D::TypedField< H3D::SFVec3f,
    00091       H3D::Types<H3D::SFBool, H3D::SFVec3f, H3D::SFVec2f, H3D::SFBool> > > {
    00092       virtual void update();
    00093    };
    00094
    00095 private:
    00096    auto_ptr<MouseMotion> motion_converter;
    00097 };
    00098
    00099 }
    00100
    00101 #endif