00001 //=========================================================================== 00002 /* 00003 This file is part of the CHAI 3D visualization and haptics libraries. 00004 Copyright (C) 2003-2009 by CHAI 3D. All rights reserved. 00005 00006 This library is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License("GPL") version 2 00008 as published by the Free Software Foundation. 00009 00010 For using the CHAI 3D libraries with software that can not be combined 00011 with the GNU GPL, and for taking advantage of the additional benefits 00012 of our support services, please contact CHAI 3D about acquiring a 00013 Professional Edition License. 00014 00015 \author <http://www.chai3d.org> 00016 \author Francois Conti 00017 \author Federico Barbagli 00018 \version 2.0.0 $Rev: 251 $ 00019 */ 00020 //=========================================================================== 00021 00022 //--------------------------------------------------------------------------- 00023 #ifndef CGenericToolH 00024 #define CGenericToolH 00025 //--------------------------------------------------------------------------- 00026 #include "extras/CGlobals.h" 00027 //--------------------------------------------------------------------------- 00028 #include "scenegraph/CGenericObject.h" 00029 #include "devices/CGenericHapticDevice.h" 00030 //--------------------------------------------------------------------------- 00031 00032 //=========================================================================== 00040 //=========================================================================== 00041 00042 //=========================================================================== 00051 //=========================================================================== 00052 class cGenericTool : public cGenericObject 00053 { 00054 public: 00055 00056 //----------------------------------------------------------------------- 00057 // CONSTRUCTOR & DESTRUCTOR: 00058 //----------------------------------------------------------------------- 00059 00061 cGenericTool(); 00062 00064 virtual ~cGenericTool() {}; 00065 00066 00067 //----------------------------------------------------------------------- 00068 // METHODS: 00069 //----------------------------------------------------------------------- 00070 00072 void setHapticDevice(cGenericHapticDevice* a_device) { if (a_device != NULL) { m_device = a_device; } } 00073 00075 cGenericHapticDevice* getHapticDevice() { return (m_device); } 00076 00078 virtual void render(const int a_renderMode=0) {}; 00079 00081 virtual void updatePose() {}; 00082 00084 virtual void computeInteractionForces() {}; 00085 00087 virtual void applyForces() {}; 00088 00090 virtual int start() { return (-1); } 00091 00093 virtual int stop() { return (-1); } 00094 00096 virtual int initialize(const bool a_resetEncoders=false) { return (-1); } 00097 00099 virtual int setForcesON() { return (-1); } 00100 00102 virtual int setForcesOFF() { return (-1); } 00103 00105 virtual bool getUserSwitch(int a_switchIndex); 00106 00108 virtual bool isInContact(cGenericObject* a_object) { return (false); } 00109 00110 00111 protected: 00112 00113 //----------------------------------------------------------------------- 00114 // MEMBERS: 00115 //----------------------------------------------------------------------- 00116 00118 cGenericHapticDevice *m_device; 00119 00121 int m_userSwitches; 00122 }; 00123 00124 //--------------------------------------------------------------------------- 00125 #endif 00126 //--------------------------------------------------------------------------- 00127