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.

86 lines
2.4 KiB

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