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

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

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