GrabHandles.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : LevelEdit *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/LevelEdit/GrabHandles.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 9/30/99 4:53p $*
  29. * *
  30. * $Revision:: 3 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __GRABHANDLES_H
  39. #define __GRABHANDLES_H
  40. #include "box3d.h"
  41. #include "hittestinfo.h"
  42. #include "nodefunction.h"
  43. // Forward declarations
  44. class NodeClass;
  45. class GrabHandlesClass;
  46. /////////////////////////////////////////////////////////////////////////
  47. //
  48. // GrabHandlePhysClass
  49. //
  50. /////////////////////////////////////////////////////////////////////////
  51. class GrabHandlePhysClass : public NodeFunctionClass, public Box3DPhysClass
  52. {
  53. public:
  54. //////////////////////////////////////////////////////////
  55. //
  56. // Public constructors/destructors
  57. //
  58. GrabHandlePhysClass (void)
  59. : m_iVertex (0),
  60. m_pParent (NULL),
  61. m_HitTestInfo (this),
  62. NodeFunctionClass (),
  63. Box3DPhysClass () { Initialize (); }
  64. GrabHandlePhysClass (int ivertex, GrabHandlesClass *pparent)
  65. : m_iVertex (ivertex),
  66. m_pParent (pparent),
  67. m_HitTestInfo (this),
  68. NodeFunctionClass (),
  69. Box3DPhysClass () { Initialize (); }
  70. virtual ~GrabHandlePhysClass (void) {}
  71. //////////////////////////////////////////////////////////
  72. //
  73. // Public operators/methods
  74. //
  75. //
  76. // Inline accessors
  77. //
  78. int Get_Vertex (void) const { return m_iVertex; }
  79. void Set_Vertex (int ivertex) { m_iVertex = ivertex; }
  80. GrabHandlesClass * Get_Parent (void) const { return m_pParent; }
  81. void Get_Parent (GrabHandlesClass *pparent) { m_pParent = pparent; }
  82. //
  83. // Overrides from NodeFunctionClass
  84. //
  85. void On_Click (void);
  86. protected:
  87. //////////////////////////////////////////////////////////
  88. //
  89. // Protected methdos
  90. //
  91. void Initialize ();
  92. //////////////////////////////////////////////////////////
  93. //
  94. // Protected member data
  95. //
  96. int m_iVertex;
  97. GrabHandlesClass * m_pParent;
  98. private:
  99. //////////////////////////////////////////////////////////
  100. //
  101. // Private member data
  102. //
  103. HITTESTINFO m_HitTestInfo;
  104. };
  105. /////////////////////////////////////////////////////////////////////////
  106. //
  107. // GrabHandlesClass
  108. //
  109. class GrabHandlesClass
  110. {
  111. public:
  112. //////////////////////////////////////////////////////////
  113. //
  114. // Public constructors/destructors
  115. //
  116. GrabHandlesClass (void);
  117. GrabHandlesClass (const GrabHandlesClass &ref);
  118. virtual ~GrabHandlesClass (void);
  119. //////////////////////////////////////////////////////////
  120. //
  121. // Public operators/methods
  122. //
  123. const GrabHandlesClass &operator= (const GrabHandlesClass &ref);
  124. void Position_Around_Node (NodeClass *pnode);
  125. void Remove_From_Scene (void);
  126. void Hide (bool bhide);
  127. //
  128. // Inline accessors
  129. //
  130. NodeClass * Get_Node (void) const { return m_pNode; }
  131. protected:
  132. //////////////////////////////////////////////////////////
  133. //
  134. // Protected methods
  135. //
  136. void Initialize (void);
  137. private:
  138. //////////////////////////////////////////////////////////
  139. //
  140. // Private member data
  141. //
  142. GrabHandlePhysClass *m_pHandles[8];
  143. bool m_bIsAddedToScene;
  144. NodeClass * m_pNode;
  145. };
  146. #endif //__GRABHANDLES_H