-/*\r
-Copyright (C) 1999-2007 id Software, Inc. and contributors.\r
-For a list of contributors, see the accompanying CONTRIBUTORS file.\r
-\r
-This file is part of GtkRadiant.\r
-\r
-GtkRadiant is free software; you can redistribute it and/or modify\r
-it under the terms of the GNU General Public License as published by\r
-the Free Software Foundation; either version 2 of the License, or\r
-(at your option) any later version.\r
-\r
-GtkRadiant is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with GtkRadiant; if not, write to the Free Software\r
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\r
-*/\r
-\r
-//-----------------------------------------------------------------------------\r
-//\r
-// DESCRIPTION:\r
-// a class to provide basic services for 2D view of a world\r
-// window <-> local 2D space transforms\r
-// snap to grid\r
-// TODO: this one could be placed under an interface, and provided to the editor as a service\r
-\r
-#ifndef _2DVIEW_H_\r
-#define _2DVIEW_H_\r
-\r
-class C2DView\r
-{\r
- enum E2DViewState { View_Idle, View_Move } ViewState;\r
- int m_xPosMove, m_yPosMove;\r
- float m_MinsMove[2], m_MaxsMove[2];\r
- qboolean m_bDoGrid;\r
- float m_GridStep[2];\r
- qboolean m_bPopup;\r
-public:\r
- RECT m_rect;\r
- float m_Mins[2],m_Maxs[2],m_Center[2];\r
- C2DView()\r
- {\r
- ViewState = View_Idle; \r
- m_bDoGrid = false;\r
- m_bPopup = false;\r
- }\r
- ~C2DView() { }\r
- void SetGrid( float xGridStep, float yGridStep )\r
- { m_bDoGrid = true; m_GridStep[0] = xGridStep; m_GridStep[1] = yGridStep; }\r
-\r
- // get window coordinates for space coordinates\r
- void WindowForSpace( int &x, int &y, const float c[2]);\r
- void SpaceForWindow( float c[2], int x, int y);\r
- void GridForWindow( float c[2], int x, int y);\r
- qboolean DoesSelect( int x, int y, float c[2] );\r
- void PreparePaint();\r
-\r
- bool OnRButtonDown (int x, int y);\r
- bool OnMouseMove (int x, int y);\r
- bool OnRButtonUp (int x, int y);\r
- bool OnKeyDown (char *s);\r
-\r
- void ZoomIn();\r
- void ZoomOut();\r
-};\r
-\r
-#endif\r
+/*
+Copyright (C) 1999-2007 id Software, Inc. and contributors.
+For a list of contributors, see the accompanying CONTRIBUTORS file.
+
+This file is part of GtkRadiant.
+
+GtkRadiant is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+GtkRadiant is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GtkRadiant; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+//-----------------------------------------------------------------------------
+//
+// DESCRIPTION:
+// a class to provide basic services for 2D view of a world
+// window <-> local 2D space transforms
+// snap to grid
+// TODO: this one could be placed under an interface, and provided to the editor as a service
+
+#ifndef _2DVIEW_H_
+#define _2DVIEW_H_
+
+class C2DView
+{
+ enum E2DViewState { View_Idle, View_Move } ViewState;
+ int m_xPosMove, m_yPosMove;
+ float m_MinsMove[2], m_MaxsMove[2];
+ qboolean m_bDoGrid;
+ float m_GridStep[2];
+ qboolean m_bPopup;
+public:
+ RECT m_rect;
+ float m_Mins[2],m_Maxs[2],m_Center[2];
+ C2DView()
+ {
+ ViewState = View_Idle;
+ m_bDoGrid = false;
+ m_bPopup = false;
+ }
+ ~C2DView() { }
+ void SetGrid( float xGridStep, float yGridStep )
+ { m_bDoGrid = true; m_GridStep[0] = xGridStep; m_GridStep[1] = yGridStep; }
+
+ // get window coordinates for space coordinates
+ void WindowForSpace( int &x, int &y, const float c[2]);
+ void SpaceForWindow( float c[2], int x, int y);
+ void GridForWindow( float c[2], int x, int y);
+ qboolean DoesSelect( int x, int y, float c[2] );
+ void PreparePaint();
+
+ bool OnRButtonDown (int x, int y);
+ bool OnMouseMove (int x, int y);
+ bool OnRButtonUp (int x, int y);
+ bool OnKeyDown (char *s);
+
+ void ZoomIn();
+ void ZoomOut();
+};
+
+#endif