DTrainDrawer.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. BobToolz plugin for GtkRadiant
  3. Copyright (C) 2001 Gordon Biggans
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  15. */
  16. // DTrainDrawer.h: interface for the DTrainDrawer class.
  17. //
  18. //////////////////////////////////////////////////////////////////////
  19. #if !defined(AFX_TRAINDRAWER_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_)
  20. #define AFX_TRAINDRAWER_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_
  21. #if _MSC_VER > 1000
  22. #pragma once
  23. #endif // _MSC_VER > 1000
  24. typedef struct {
  25. char strName[64];
  26. vec3_t vOrigin;
  27. } controlPoint_t;
  28. typedef struct {
  29. controlPoint_t point;
  30. char strControl[64];
  31. char strTarget[64];
  32. list<controlPoint_t> m_pointList;
  33. list<DPoint> m_vertexList;
  34. controlPoint_t* pTarget;
  35. } splinePoint_t;
  36. class DTrainDrawer :
  37. public IGL2DWindow,
  38. public IGL3DWindow
  39. {
  40. private:
  41. list<splinePoint_t*> m_splineList;
  42. list<controlPoint_t*> m_pointList;
  43. int refCount;
  44. bool m_bHooked;
  45. bool m_bDisplay;
  46. public:
  47. void UnRegister();
  48. void Register();
  49. DTrainDrawer();
  50. virtual ~DTrainDrawer(void);
  51. void Draw3D();
  52. void Draw2D(VIEWTYPE vt);
  53. void IncRef() { refCount++; }
  54. void DecRef() { refCount--; if (refCount <= 0) delete this; }
  55. void ClearSplines();
  56. void ClearPoints();
  57. void BuildPaths();
  58. void AddControlPoint(const char* name, vec_t* origin);
  59. splinePoint_t* AddSplinePoint(const char* name, const char* target, vec_t* origin);
  60. controlPoint_t* FindControlPoint(const char* name);
  61. };
  62. #endif // !defined(AFX_TRAINDRAWER_H__6E36062A_EF0B_11D4_ACF7_004095A18133__INCLUDED_)