SelectionBox.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. ** Command & Conquer Renegade(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. ///////////////////////////////////////////////////////////////////////////////////////
  19. //
  20. // SelectionBoxClass.H
  21. //
  22. // Class declaration for a selected item's bounding box.
  23. //
  24. #ifndef __SELECTIONBOX_H
  25. #define __SELECTIONBOX_H
  26. #include "Utils.H"
  27. #include "Line3D.H"
  28. #include "EditorPhys.H"
  29. // Forward declarations
  30. class NodeClass;
  31. ///////////////////////////////////////////////////////////////////////////////
  32. //
  33. // SelectionBoxClass
  34. //
  35. ///////////////////////////////////////////////////////////////////////////////
  36. class SelectionBoxClass
  37. {
  38. public:
  39. ////////////////////////////////////////////////////////
  40. // Public data types
  41. ////////////////////////////////////////////////////////
  42. class DecorationLineClass : public EditorPhysClass
  43. {
  44. public:
  45. DecorationLineClass (void);
  46. virtual ~DecorationLineClass (void);
  47. // Used to reset the position of the line
  48. void Reset (const Vector3 &start, const Vector3 &end, float width) { m_pLine3D->Reset (start, end, width); Update_Cull_Box(); }
  49. void Set_Color (const Vector3 &color) { if (m_pLine3D != NULL) m_pLine3D->Re_Color (color.X, color.Y, color.Z); }
  50. private:
  51. Line3DClass *m_pLine3D;
  52. };
  53. public:
  54. ////////////////////////////////////////////////////////
  55. // Public contsructors/destructors
  56. ////////////////////////////////////////////////////////
  57. SelectionBoxClass (void);
  58. virtual ~SelectionBoxClass (void);
  59. ////////////////////////////////////////////////////////
  60. // Public methods
  61. ////////////////////////////////////////////////////////
  62. void Display_Around_Node (const NodeClass &node);
  63. void Display_Around_Node (const RenderObjClass &render_obj);
  64. void Remove_From_Scene (void);
  65. void Set_Color (const Vector3 &color);
  66. private:
  67. ////////////////////////////////////////////////////////
  68. // Private member data
  69. ////////////////////////////////////////////////////////
  70. DecorationLineClass *m_pBoundingLines[24];
  71. bool m_bIsAddedToScene;
  72. };
  73. #endif //__SELECTIONBOX_H