ClippingPoints.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. #ifndef CLIPPINGPOINTS_H
  2. #define CLIPPINGPOINTS_H
  3. /**
  4. * @brief The ClippingPoints class
  5. *
  6. * The class provides helpers to manage clipping points in force based layouts.
  7. */
  8. class ClippingPoints
  9. {
  10. public:
  11. /** @name Creators
  12. * The methods under this section are responsible for constructing or
  13. * destructing an instance of type ClippingPoints.
  14. */
  15. //@{
  16. /**
  17. Constructs new object of type ClippingPoints.
  18. @pre none
  19. @param none
  20. @return none
  21. @throw none
  22. */
  23. ClippingPoints();
  24. //@}
  25. /** @name Queries
  26. * The methods under this section are responsible for accessing
  27. * an instance of type ClippingPoints.
  28. */
  29. //@{
  30. /** Returns Clipping Points between two rectangles
  31. @pre
  32. -# dRectU and dRectV should be valid
  33. @param dRectU
  34. Ponter to rectangle U dimensions
  35. @param dRectV
  36. Ponter to rectangle V dimensions
  37. @param iCordinates
  38. Cordinates of edge
  39. @param iClipPoints
  40. Cordinates of found clip points
  41. @return true for intersection otherwise false
  42. @throws none
  43. */
  44. bool getClippingPoints(double* dRectU, double* dRectV, int* iCordinates, int* iClipPoints );
  45. /** Returns Cardinal Directions between two rectangles given Slope and Prime
  46. @pre
  47. -# Slope and Prime should be valid
  48. @param Slope
  49. Slope of the edge
  50. @param dSlopePrime
  51. Slope Prome for edge
  52. @param iLine
  53. Pointer to cordinates of line
  54. @return 0,1 or 2 as cardinal directions
  55. @throws none
  56. */
  57. int getCardinalDirections(double dSlope,double dSlopePrime, int iLine);
  58. /** Returns true if two line segments intersect
  59. @pre
  60. -# P and Q shold be valid
  61. @param P and Q
  62. Pointer to cordinates of Edges P and Q
  63. @return bool
  64. @throws none
  65. */
  66. bool doIntersect(int *iP , int*iQ);
  67. /** Returns Orientation between two rectangles.
  68. @pre
  69. -# Co ordinates should be consistent
  70. @param P , Q and R points
  71. @return int
  72. orientation value of rectangle
  73. @throws none
  74. */
  75. int orientation(int ipx, int ipy ,int iqx ,int iqy ,int irx ,int iry );
  76. /** Calculates intersection between two edges .
  77. @pre
  78. -# Edges should be valid
  79. @param Slope
  80. Slope of the edge
  81. @param dSlopePrime
  82. Slope Prome for edge
  83. @param iLine
  84. Pointer to cordinates of line
  85. @return none
  86. @throws none
  87. */
  88. void calcIntersection(int *iP , int* iEdge, int* iIntersection );
  89. //@}
  90. };
  91. #endif // CLIPPINGPOINTS_H