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

cybpointingdevicec.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 1999  Carsten Winkelholz
00003 
00004 Address:  FGAN Forschungsgesellschaft fr Angewandte Naturwissenschaften e. V.
00005       Neuenahrer Str. 20
00006       D - 53343 Wachtberg
00007       
00008 Email:    winkelholz@fgan.de
00009 
00010 This program is free software; you can redistribute it and/or
00011 modify it under the terms of the GNU General Public License
00012 as published by the Free Software Foundation; either version 2
00013 of the License, or (at your option) any later version.
00014 
00015 This program is distributed in the hope that it will be useful,
00016 but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 GNU General Public License for more details.
00019 
00020 You should have received a copy of the GNU General Public License
00021 along with this program; if not, write to the Free Software
00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00023 */
00024 
00025 #ifndef CYBPOINTINGDEVICEC_H
00026 #define CYBPOINTINGDEVICEC_H
00027 
00028 #include "oaw/ctk/cybinterfacec.h"
00029 #include "oaw/ctk/cybwrlfields.h"
00030 #include "../oawconfig.h"
00031 
00032 OAW_BEGIN_NAMESPACE
00033 
00034 
00035 class CybSelectVolumeC;
00036 class CybTouchSensorC;
00037 class CybWorldC;
00038 class CybDragSensorC;
00039 
00040 // Drag event id's
00041 
00042 #define  DRAGSENSOR_EVENT_STARTDRAG  1
00043 #define  DRAGSENSOR_EVENT_DODRAG     2
00044 #define  DRAGSENSOR_EVENT_ENDDRAG    3
00045 
00046 // Drag event
00047 
00048 typedef void PointerStateCallback(void*,short);
00049 
00050 typedef struct _DragEvent
00051 {
00052   long lEvent, lSensorId;
00053   VectorC vLineStart, vLineEnd, vIntersection;
00054 
00055   CybDragSensorC *pDragSensor;
00056 } DragEvent;
00057 
00058 // Class definition
00059 
00060 class OAW_DLLMAPPING CybPointingDeviceC : public CybInterfaceC
00061 {
00062 public:
00063 
00064   enum PointerState {TOUCH, NOTOUCH};
00065 
00066   CybPointingDeviceC(CybWorldC* pW);
00067   virtual CybNodeC* CreateNew(){return 0;}
00068   void SetButtonState(short bs){m_buttonState = bs;m_processSelect = true;}
00069   void SetEnabled(short b){m_bEnabled = b;}
00070   short IsEnabled(){return m_bEnabled;}
00071   virtual void RouteData();
00072   virtual void ProcessSelect();
00073   virtual long GetInterfaceDataMinLength();
00074   virtual void SetInterfaceData(AnyC&); //const byteArray& data);
00075   virtual void CopyInterfaceData(AnyC&,long maxLen);
00076   void SetStateCallback(PointerStateCallback*,void*);
00077 
00078 protected:
00079   ArrayC<DragEvent> m_dragEvents;
00080   CybSelectVolumeC* m_pSelectVolume;
00081   short m_buttonState;
00082   short m_processSelect;
00083   CybTouchSensorC* m_pT;
00084   VectorC m_hitPoint;
00085   VectorC m_hitNormal;
00086   Vector2C m_hitTexCoord;
00087   short m_bEnabled;
00088 
00089   void* m_pCallbackData;
00090   PointerStateCallback* m_pCallbackFunc;
00091 };
00092 
00093 OAW_END_NAMESPACE
00094 
00095 
00096 #endif
00097 
00098 
00099 
00100 
00101 

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