Old fashion design for PC-104
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.

94 lines
1.8 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 06/02/2002
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: LgPolygon.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of LgPolygon.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "..\LgLib\Version.h"
  16. #include "LgPolygon.h"
  17. CLgPolygon::CLgPolygon()
  18. {
  19. m_pPoint = NULL;
  20. m_nCount = 0;
  21. }
  22. CLgPolygon::~CLgPolygon()
  23. {
  24. RemoveAll();
  25. }
  26. BOOL CLgPolygon::Add( CLgDPoint &dp )
  27. {
  28. m_pPoint = (CLgDPoint*)realloc( m_pPoint, sizeof(CLgDPoint) * ( m_nCount + 1 ) );
  29. if( !m_pPoint )
  30. {
  31. m_nCount = 0;
  32. return FALSE;
  33. }
  34. m_pPoint[m_nCount++] = dp;
  35. return TRUE;
  36. }
  37. void CLgPolygon::RemoveAll()
  38. {
  39. if( m_pPoint )
  40. {
  41. free( m_pPoint );
  42. m_pPoint = NULL;
  43. }
  44. m_nCount = 0;
  45. }
  46. //--------------------------------
  47. CLgPolyPolygon::CLgPolyPolygon()
  48. {
  49. }
  50. CLgPolyPolygon::~CLgPolyPolygon()
  51. {
  52. }
  53. /*
  54. typedef enum
  55. {
  56. LGCPPCPT_GET_COUNT, // get number of points in polygon
  57. LGCPPCPT_GET_POINT, // get exact point in poligon
  58. LGCPPCPT_SET_LINE // return line segment
  59. }LGCPPCPT;
  60. typedef struct
  61. {
  62. LGCPPCPT nType;
  63. // used with LGCPPCPT_GET_COUNT and LGCPPCPT_GET_POINT
  64. INT nPolygon;
  65. INT nCount;
  66. INT nPoint;
  67. double X;
  68. double Y;
  69. // used with LGCPPCPT_SET_LINE
  70. INT nLine;
  71. double R1;
  72. double R2;
  73. }LGCPPCPARAM, *PLGCPPCPARAM;
  74. typedef BOOL (PLGCUTPOLYPOLYGONCALLBACK)( PLGCPPCPARAM );
  75. BOOL LgCutPolyPolygon( INT nLines, INT nPolyCount, INT **ppCounts, double **ppPoints, )
  76. BOOL LgCutPolyPolygon( INT nLines, INT nPolyCount, PLGCUTPOLYPOLYGONCALLBACK pCallback )
  77. {
  78. }
  79. */