Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

cybspheresensorc.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 1999  Carsten Winkelholz
00003 
00004 Malte Weiß, 26.08.2002: Fields are loaded by events.
00005             28.08.2002: Rotation implemented besides rotation outside the sphere.
00006                         Tests of offset rotation.
00007             29.08.2002: Sensor fully functional:
00008                         - Rotation problem solved.
00009                         - Added rotation functionality for dragging outside the sphere.
00010 
00011 Address:  FGAN Forschungsgesellschaft fr Angewandte Naturwissenschaften e. V.
00012       Neuenahrer Str. 20
00013       D - 53343 Wachtberg
00014       
00015 Email:    winkelholz@fgan.de
00016 
00017 This program is free software; you can redistribute it and/or
00018 modify it under the terms of the GNU General Public License
00019 as published by the Free Software Foundation; either version 2
00020 of the License, or (at your option) any later version.
00021 
00022 This program is distributed in the hope that it will be useful,
00023 but WITHOUT ANY WARRANTY; without even the implied warranty of
00024 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00025 GNU General Public License for more details.
00026 
00027 You should have received a copy of the GNU General Public License
00028 along with this program; if not, write to the Free Software
00029 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00030 */
00031 
00032 #ifndef CYBSPHERESENSOR_HC
00033 #define CYBSPHERESENSOR_HC
00034 
00035 #include "oaw/ctk/cybdragsensorc.h"
00036 #include "oaw/ctk/cybwrlfields.h"
00037 #include "../oawconfig.h"
00038 
00039 OAW_BEGIN_NAMESPACE
00040 
00041 
00042 class OAW_DLLMAPPING CybSphereSensorC : public CybDragSensorC
00043 {
00044 public:
00045   CybSphereSensorC(CybWorldC*);
00046   CybSphereSensorC(const CybSphereSensorC&);
00047   CybSphereSensorC& operator = (const CybSphereSensorC&);
00048   virtual void CreateNewCopy(CybNodeC* pNode);
00049   virtual ~CybSphereSensorC();
00050 
00051   virtual void SetEvent(long, const void*, BaseI*);
00052   virtual long GetFieldEventID(const char*);
00053   virtual long GetFieldDataType(long);
00054 
00055   virtual void StartDrag(Vector3C vLineStart, Vector3C vLineEnd, Vector3C vIntersect);
00056   virtual void DoDrag(Vector3C vLineStart, Vector3C vLineEnd);
00057   virtual void EndDrag();
00058 
00059 protected:
00060   virtual void LoadVRML(char*& iter, const char* iterEnd,long& znr);
00061   
00062   // Send eventOuts
00063   void SendIsActive(SFBool b);
00064   void SendRotationChanged(SFRotation r);
00065   void SendTrackPointChanged(SFVec3f v);
00066   void SendOffsetChanged(SFRotation r);
00067 
00068 protected:
00069   short       m_bLoading;      // Currently loading?
00070   SFFloat     m_fRadius;       // Sphere radius
00071   SFVec3f     m_vTrackStart;   // Start track point
00072   SFRotation  m_vCurrent;      // Current rotation
00073 
00074 public:
00075   // Sphere sensor properties
00076   SFBool      m_bAutoOffset;   // Auto offset?
00077   SFBool      m_bEnabled;      // Enabled?
00078   SFRotation  m_vOffset;       // Offset
00079 
00080   // Key list
00081   static char VRMLKeyStrList[][30];
00082 };
00083 
00084 OAW_END_NAMESPACE
00085 
00086 
00087 #endif

Generated on Tue Jul 29 14:24:13 2003 for Open ActiveWrl by doxygen1.3-rc2