namedsel.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. /* $Header: /Commando/Code/Tools/max2w3d/namedsel.h 4 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/namedsel.h $*
  26. * *
  27. * $Author:: Greg_h $*
  28. * *
  29. * $Modtime:: 10/21/97 2:05p $*
  30. * *
  31. * $Revision:: 4 $*
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef NAMEDSEL_H
  37. #define NAMEDSEL_H
  38. #include "Max.h"
  39. /*
  40. ** This is a class for containing bit arrays for
  41. ** the named selection sets. I stole it from
  42. ** the Edit Mesh modifier code...
  43. ** It is basically a dynamically sized array
  44. ** of bitarrays.
  45. */
  46. class NamedSelSetList
  47. {
  48. public:
  49. Tab<BitArray*> Sets;
  50. Tab<TSTR*> Names;
  51. ~NamedSelSetList();
  52. BitArray & operator[](int i) { return *Sets[i]; }
  53. int Count() { return Sets.Count(); }
  54. int Find_Set(TSTR & setname);
  55. void Delete_Set(int i);
  56. void Delete_Set(TSTR & setname);
  57. void Reset(void);
  58. void Append_Set(BitArray & nset,TSTR & setname);
  59. IOResult Load(ILoad * iload);
  60. IOResult Save(ISave * isave);
  61. IOResult Load_Set(ILoad * iload);
  62. void Set_Size(int size);
  63. NamedSelSetList & operator=(NamedSelSetList & from);
  64. enum {
  65. NAMED_SEL_SET_CHUNK = 0x0021,
  66. NAMED_SEL_BITS_CHUNK = 0x0022,
  67. NAMED_SEL_NAME_CHUNK = 0x0023
  68. };
  69. };
  70. #endif /*NAMEDSEL_H*/