bpick.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. /* $Header: /Commando/Code/Tools/max2w3d/bpick.h 6 10/28/97 6:08p Greg_h $ */
  19. /***********************************************************************************************
  20. *** Confidential - Westwood Studios ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Commando Tools - WWSkin *
  24. * *
  25. * $Archive:: /Commando/Code/Tools/max2w3d/bpick.h $*
  26. * *
  27. * $Author:: Greg_h $*
  28. * *
  29. * $Modtime:: 10/21/97 2:05p $*
  30. * *
  31. * $Revision:: 6 $*
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef BPICK_H
  37. #define BPICK_H
  38. #include "Max.h"
  39. //#include "dllmain.h"
  40. //#include "resource.h"
  41. /*
  42. ** To use the Bone picking class, you should inherit from this class
  43. ** and implement the User_Picked... functions.
  44. */
  45. class BonePickerUserClass
  46. {
  47. public:
  48. virtual void User_Picked_Bone(INode * node) = 0;
  49. virtual void User_Picked_Bones(INodeTab & nodetab) = 0;
  50. };
  51. /*
  52. ** BonePickerClass
  53. ** Uses Max's interface to let the user pick bones out of the scene
  54. ** or by using a dialog box to pick by name.
  55. */
  56. class BonePickerClass : public PickNodeCallback, public PickModeCallback, public HitByNameDlgCallback
  57. {
  58. public:
  59. BonePickerClass(void) : User(NULL), BoneList(NULL), SinglePick(FALSE) {}
  60. /*
  61. ** Tell this class who is using it and optionally the list
  62. ** of bones to allow the user to select from.
  63. ** Call this before giving this class to MAX...
  64. */
  65. void Set_User(BonePickerUserClass * user,int singlepick = FALSE, INodeTab * bonelist = NULL) { User = user; SinglePick = singlepick; BoneList = bonelist; }
  66. /*
  67. ** From BonePickNodeCallback:
  68. */
  69. BOOL Filter(INode *node);
  70. /*
  71. ** From BonePickModeCallback:
  72. */
  73. BOOL HitTest(IObjParam *ip,HWND hWnd,ViewExp *vpt,IPoint2 m,int flags);
  74. BOOL Pick(IObjParam *ip,ViewExp *vpt);
  75. void EnterMode(IObjParam *ip) { }
  76. void ExitMode(IObjParam *ip) { }
  77. PickNodeCallback * GetFilter() {return this;}
  78. BOOL RightClick(IObjParam *ip,ViewExp *vpt) { return TRUE; }
  79. /*
  80. ** From HitByNameDlgCallback
  81. */
  82. virtual TCHAR * dialogTitle(void);
  83. virtual TCHAR * buttonText(void);
  84. virtual BOOL singleSelect(void) { return SinglePick; }
  85. virtual BOOL useFilter(void) { return TRUE; }
  86. virtual BOOL useProc(void) { return TRUE; }
  87. virtual BOOL doCustomHilite(void) { return FALSE; }
  88. virtual BOOL filter(INode * inode);
  89. virtual void proc(INodeTab & nodeTab);
  90. protected:
  91. /*
  92. ** The bone picker will pass the bones on to the "user" of
  93. ** the class.
  94. */
  95. BonePickerUserClass * User;
  96. /*
  97. ** List of bones that the user is being allowed to pick from.
  98. ** If this is NULL, then the user can pick any bone
  99. */
  100. INodeTab * BoneList;
  101. /*
  102. ** Flag for whether to allow multiple selection or not
  103. */
  104. int SinglePick;
  105. };
  106. extern BonePickerClass TheBonePicker;
  107. #endif