00001 /* *********************************************************************************** 00002 Writer: Sebastien Bloc 00003 Copyright: 2003-2004 00004 eMail: sebastien.bloc@free.fr 00005 URL: http://mignonsoft.free.fr 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 as published by the Free Software Foundation; either version 2 00010 of the License, or (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 http://www.gnu.org/copyleft/gpl.html 00017 *********************************************************************************** */ 00018 00023 #ifndef INCLUDE_PICKING_H 00024 #define INCLUDE_PICKING_H 00025 00026 #include "3d.h" 00027 #include "input.h" 00028 00029 #define MAX_BUFFER_SELECT 512 // taille du buffer du picking 00030 00031 class Control; 00035 class Picking 00036 { 00037 private: 00038 void TestOvers(); 00039 void TestOver(Control *lastControl,int lastFace,Control *control,int face); 00040 00041 public: 00042 Control *lastControlHover; 00043 Control *lastControlContainer; 00044 int lastFaceHover; 00045 int lastFaceContainer; 00046 StateMouse mouse,oldMouse; 00047 Control *controlHover; 00048 Control *controlContainer; 00049 int faceHover; 00050 int faceContainer; 00051 double zDist; 00052 BOOL isMoving; 00053 00054 public: 00055 Picking(); 00056 00057 void operator=(Picking &scr); 00058 BOOL Test(); 00059 BOOL FindContainer(); 00060 void SetMousePos(int x,int y); 00061 void SetDeltaWheel(int delta); 00062 00063 void UpdateLast(); 00064 void ResetLast(); 00065 void ResetCurrent(); 00066 00067 void OnMouseMove(int x,int y); 00068 void OnMouseWheel(int delta); 00069 void OnLButtonUp(); 00070 void OnMButtonUp(); 00071 void OnRButtonUp(); 00072 }; 00073 00074 #endif