RulerTool.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. // RulerTool.h
  19. // Author: Mike Lytle, January 2003
  20. #pragma once
  21. #ifndef RULER_TOOL_H
  22. #define RULER_TOOL_H
  23. #include "Tool.h"
  24. class RulerTool : public Tool
  25. {
  26. protected:
  27. Coord3D m_downPt3d;
  28. int m_rulerType;
  29. WbView* m_View;
  30. Real m_savedLength;
  31. static RulerTool* m_staticThis;
  32. public:
  33. RulerTool(void);
  34. ~RulerTool(void);
  35. public:
  36. /// Clear the selection on activate or deactivate.
  37. virtual void activate();
  38. virtual void deactivate();
  39. virtual void setCursor(void);
  40. virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
  41. virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
  42. virtual Bool followsTerrain(void) {return false;};
  43. static void setLength(Real length);
  44. static Bool switchType();
  45. static int getType();
  46. static Real getLength(void);
  47. };
  48. #endif //RULER_TOOL_H