WaterTool.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. // WaterTool.h
  19. // Polygon area trigger tool for worldbuilder.
  20. // Author: John Ahlquist, Nov. 2001
  21. #pragma once
  22. #ifndef WaterTool_H
  23. #define WaterTool_H
  24. #include "PolygonTool.h"
  25. class WorldHeightMapEdit;
  26. class MapObject;
  27. class PolygonTrigger;
  28. class MovePolygonUndoable;
  29. /*************************************************************************/
  30. /** WaterTool
  31. Does the add/select water polygon operation.
  32. ***************************************************************************/
  33. /// Select tile tool.
  34. class WaterTool : public PolygonTool
  35. {
  36. public:
  37. WaterTool(void);
  38. ~WaterTool(void);
  39. protected:
  40. static Bool m_water_isActive;
  41. Real m_currentZ;
  42. public:
  43. static Bool isActive(void) {return m_water_isActive;};
  44. public:
  45. /// Perform tool on mouse down.
  46. virtual void mouseDown(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
  47. virtual void mouseMoved(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
  48. virtual void mouseUp(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
  49. virtual void setCursor(void);
  50. virtual void activate(); ///< Become the current tool.
  51. virtual void deactivate(); ///< Become not the current tool.
  52. protected:
  53. void fillTheArea(TTrackingMode m, CPoint viewPt, WbView* pView, CWorldBuilderDoc *pDoc);
  54. PolygonTrigger *adjustSpacing(PolygonTrigger *trigger, Real spacing);
  55. };
  56. #endif //WaterTool_H