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.

76 lines
2.0 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ====
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef MAPSPHERE_H
  7. #define MAPSPHERE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "fgdlib/WCKeyValues.h"
  12. #include "MapHelper.h"
  13. #include "ToolInterface.h"
  14. class CToolSphere;
  15. class CHelperInfo;
  16. class CRender2D;
  17. class CRender3D;
  18. class IMesh;
  19. class CMapSphere : public CMapHelper
  20. {
  21. friend class CToolSphere;
  22. public:
  23. DECLARE_MAPCLASS(CMapSphere,CMapHelper)
  24. //
  25. // Factory for building from a list of string parameters.
  26. //
  27. static CMapClass *Create(CHelperInfo *pInfo, CMapEntity *pParent);
  28. //
  29. // Construction/destruction:
  30. //
  31. CMapSphere(void);
  32. ~CMapSphere(void);
  33. virtual void CalcBounds(BOOL bFullUpdate = FALSE);
  34. virtual CMapClass *Copy(bool bUpdateDependencies);
  35. virtual CMapClass *CopyFrom(CMapClass *pFrom, bool bUpdateDependencies);
  36. virtual void OnParentKeyChanged(const char *szKey, const char *szValue);
  37. virtual void Render2D(CRender2D *pRender);
  38. virtual void Render3D(CRender3D *pRender);
  39. virtual int SerializeRMF(std::fstream &File, BOOL bRMF) { return(0); }
  40. virtual int SerializeMAP(std::fstream &File, BOOL bRMF) { return(0); }
  41. virtual bool IsVisualElement(void) { return false; } // Only visible when the parent entity is selected.
  42. virtual bool IsScaleable(void) const { return false; } // TODO: allow for scaling the sphere by itself
  43. virtual bool IsClutter(void) const { return true; }
  44. virtual bool CanBeCulledByCordon() const { return false; } // We don't hide unless our parent hides.
  45. virtual CBaseTool *GetToolObject(int nHitData, bool bAttachObject );
  46. virtual bool HitTest2D(CMapView2D *pView, const Vector2D &point, HitInfo_t &HitData);
  47. virtual const char* GetDescription() { return "Sphere helper"; }
  48. protected:
  49. virtual void SetRadius(float flRadius);
  50. char m_szKeyName[KEYVALUE_MAX_KEY_LENGTH];
  51. float m_flRadius;
  52. };
  53. #endif // MAPSPHERE_H