Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.4 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #ifndef DISPMANAGER_H
  14. #define DISPMANAGER_H
  15. #pragma once
  16. class CMapDisp;
  17. //=============================================================================
  18. //
  19. // Global Displacement Manager
  20. //
  21. typedef unsigned short EditDispHandle_t;
  22. enum
  23. {
  24. EDITDISPHANDLE_INVALID = ( EditDispHandle_t )~0
  25. };
  26. class IEditDispMgr
  27. {
  28. public:
  29. // creation/destruction
  30. virtual EditDispHandle_t Create( void ) = 0;
  31. virtual void Destroy( EditDispHandle_t handle ) = 0;
  32. virtual CMapDisp *GetDisp( EditDispHandle_t handle ) = 0;
  33. };
  34. IEditDispMgr *EditDispMgr( void );
  35. //=============================================================================
  36. //
  37. // World Displacement Manager(s)
  38. //
  39. class IWorldEditDispMgr
  40. {
  41. public:
  42. virtual ~IWorldEditDispMgr() {}
  43. //
  44. // World List
  45. //
  46. virtual int WorldCount( void ) = 0;
  47. virtual CMapDisp *GetFromWorld( int iWorldList ) = 0;
  48. virtual CMapDisp *GetFromWorld( EditDispHandle_t handle ) = 0;
  49. virtual void AddToWorld( EditDispHandle_t handle ) = 0;
  50. virtual void RemoveFromWorld( EditDispHandle_t handle ) = 0;
  51. virtual void FindWorldNeighbors( EditDispHandle_t handle ) = 0;
  52. //
  53. // Selection List
  54. //
  55. virtual int SelectCount( void ) = 0;
  56. virtual void SelectClear( void ) = 0;
  57. virtual CMapDisp *GetFromSelect( int iSelectList ) = 0;
  58. virtual void AddToSelect( EditDispHandle_t handle ) = 0;
  59. virtual void RemoveFromSelect( EditDispHandle_t handle ) = 0;
  60. virtual bool IsInSelect( EditDispHandle_t handle ) = 0;
  61. virtual void CatmullClarkSubdivide( void ) = 0;
  62. //
  63. // Undo
  64. //
  65. virtual void PreUndo( const char *pszMarkName ) = 0;
  66. virtual void Undo( EditDispHandle_t handle, bool bAddNeighbors ) = 0;
  67. virtual void PostUndo( void ) = 0;
  68. //
  69. // Helpers.
  70. //
  71. // Return the # of points that these disps share (1=corner neighbors, 2=edge neighbors).
  72. virtual int NumSharedPoints( CMapDisp *pDisp, CMapDisp *pNeighborDisp, int *edge1, int *edge2 ) = 0;
  73. };
  74. //
  75. // Global functions.
  76. //
  77. IWorldEditDispMgr *CreateWorldEditDispMgr( void );
  78. void DestroyWorldEditDispMgr( IWorldEditDispMgr **pDispMgr );
  79. #endif // DISPMANAGER_H