00001 /* 00002 This source file is part of OgreHaptics 00003 (a library for wrapping haptics devices for use with the open-source 00004 graphics engine OGRE, http://www.ogre3d.org) 00005 00006 Copyright (c) 2006 - 2008 Jorrit de Vries 00007 Also see acknowledgements in Readme.html 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Lesser General Public License 00011 as published by the Free Software Foundation; either version 2.1 00012 of the License, or (at your option) any later version. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public 00020 License along with this library; if not, write to the 00021 Free Software Foundation, Inc., 00022 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 */ 00024 #ifndef _OgreHapticsDebugRenderer_H__ 00025 #define _OgreHapticsDebugRenderer_H__ 00026 00027 #include "OgreHapticsPrerequisites.h" 00028 00029 namespace OgreHaptics { 00030 00032 enum DebugRenderMode 00033 { 00035 DRM_TOUCH_WORKSPACE = 0x01, 00037 DRM_STYLUS = 0x02 00038 }; 00039 00050 class _OgreHapticsExport DebugRenderer : public MovableObject, 00051 public Renderable 00052 { 00053 public: 00061 DebugRenderer(SceneManager* sceneMgr, int renderMode = 0); 00063 virtual ~DebugRenderer(); 00064 00070 void setRenderMode(int mode) { mRenderMode = mode; } 00072 void setTouchWorkspaceDisplayEnabled(bool enable); 00074 void setStylusDisplayEnabled(bool enable); 00075 00077 bool isTouchWorkspaceDisplayEnabled(void) const; 00079 bool isStylusDisplayEnabled(void) const; 00080 00090 void addLine(const Vector3& start, const Vector3& end, 00091 const ColourValue& colour = ColourValue::White); 00111 void addLine(Real startX, Real startY, Real startZ, Real endX, 00112 Real endY, Real endZ, const ColourValue& colour = 00113 ColourValue::White); 00121 void addPoint(const Vector3& point, const ColourValue& colour = 00122 ColourValue::White); 00132 void addPoint(Real x, Real y, Real z, const ColourValue& colour = 00133 ColourValue::White); 00134 00136 void clear(void); 00144 void draw(void); 00145 00147 Real getBoundingRadius(void) const; 00149 const String& getMovableType(void) const; 00151 const AxisAlignedBox& getBoundingBox(void) const; 00153 void _updateRenderQueue(RenderQueue* queue); 00155 void visitRenderables(Renderable::Visitor* visitor, 00156 bool debugRenderables = false); 00157 00159 const MaterialPtr& getMaterial(void) const; 00161 void getRenderOperation(RenderOperation& op); 00163 void getWorldTransforms(Matrix4* xform) const; 00165 Real getSquaredViewDepth(const Camera* cam) const; 00167 const LightList& getLights(void) const; 00168 protected: 00170 SceneManager* mSceneMgr; 00172 SceneNode* mSceneNode; 00174 bool mIsDrawn; 00176 int mRenderMode; 00178 RenderOperation mRenderOperation; 00180 MaterialPtr mMaterial; 00182 AxisAlignedBox mAABB; 00184 std::vector<std::pair<Vector3, ColourValue>> mPoints; 00185 00190 void addTouchWorkspace(Device* device); 00195 void addStylus(Device* device); 00196 }; 00197 00198 } 00199 00200 #endif
Last modified Tue Jan 6 22:31:25 2009