MeshDeformPanel.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. ** Command & Conquer Generals(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. *** Confidential - Westwood Studios ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Commando / G 3D engine *
  23. * *
  24. * File Name : MeshDeformPanel.H *
  25. * *
  26. * Programmer : Patrick Smith *
  27. * *
  28. * Start Date : 04/22/99 *
  29. * *
  30. * Last Update :
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef __MESH_DEFORM_PANEL_H
  36. #define __MESH_DEFORM_PANEL_H
  37. #include <Max.h>
  38. #include "Resource.H"
  39. // Forward declarations
  40. class MeshDeformClass;
  41. ///////////////////////////////////////////////////////////////////////////
  42. //
  43. // MeshDeformPanelClass
  44. //
  45. ///////////////////////////////////////////////////////////////////////////
  46. class MeshDeformPanelClass
  47. {
  48. public:
  49. //////////////////////////////////////////////////////////////////////
  50. // Public constructors/destructors
  51. //////////////////////////////////////////////////////////////////////
  52. MeshDeformPanelClass (HWND hwnd)
  53. : m_hWnd (hwnd),
  54. m_pColorSwatch (NULL),
  55. m_pMaxSetsSpin (NULL),
  56. m_pMeshDeformer (NULL),
  57. m_pLockSetsButton (NULL),
  58. m_pMaxSetsEdit (NULL) { }
  59. virtual ~MeshDeformPanelClass (void) { }
  60. //////////////////////////////////////////////////////////////////////
  61. // Public methods
  62. //////////////////////////////////////////////////////////////////////
  63. // Inline accessors
  64. IColorSwatch * Get_Color_Swatch (void) const { return m_pColorSwatch; }
  65. COLORREF Get_Vertex_Color (void) const { return m_pColorSwatch->GetColor (); }
  66. void Set_Vertex_Color (COLORREF color) { m_pColorSwatch->SetColor (color); }
  67. void Set_Deformer (MeshDeformClass *obj);
  68. BOOL Is_Edit_Mode (void) const { return (::SendDlgItemMessage (m_hWnd, IDC_STATE_SLIDER, TBM_GETPOS, 0, 0L) > 0); }
  69. BOOL Are_Sets_Tied (void) const { return m_pLockSetsButton->IsChecked (); }
  70. int Get_Current_Set (void) const { return ::SendDlgItemMessage (m_hWnd, IDC_CURRENT_SET_SLIDER, TBM_GETPOS, 0, 0L); }
  71. void Set_Current_Set (int set, bool notify = false);
  72. void Set_Max_Sets (int max, bool notify = false);
  73. void Set_Current_State (float state);
  74. void Set_Auto_Apply_Check (bool onoff) { ::SendDlgItemMessage (m_hWnd, IDC_MANUALAPPLY, BM_SETCHECK, (WPARAM)(!onoff), 0L); }
  75. bool Get_Auto_Apply_Check (void) const { return ::SendDlgItemMessage (m_hWnd, IDC_MANUALAPPLY, BM_GETCHECK, 0, 0L) == 0; }
  76. // Update methods
  77. void Update_Vertex_Color (void);
  78. //////////////////////////////////////////////////////////////////////
  79. // Static methods
  80. //////////////////////////////////////////////////////////////////////
  81. static BOOL WINAPI Message_Proc (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
  82. static MeshDeformPanelClass * Get_Object (HWND hwnd);
  83. protected:
  84. //////////////////////////////////////////////////////////////////////
  85. // Protected methods
  86. //////////////////////////////////////////////////////////////////////
  87. BOOL On_Message (UINT message, WPARAM wparam, LPARAM lparam);
  88. void On_Command (WPARAM wparam, LPARAM lparam);
  89. private:
  90. //////////////////////////////////////////////////////////////////////
  91. // Private member data
  92. //////////////////////////////////////////////////////////////////////
  93. HWND m_hWnd;
  94. IColorSwatch * m_pColorSwatch;
  95. ICustEdit * m_pMaxSetsEdit;
  96. ISpinnerControl * m_pMaxSetsSpin;
  97. ICustButton * m_pLockSetsButton;
  98. MeshDeformClass * m_pMeshDeformer;
  99. };
  100. #endif //__MESH_DEFORM_PANEL_H