dirtyedge.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. #ifndef DIRTYEDGE_H
  2. #define DIRTYEDGE_H
  3. #include <QString>
  4. #include <LayoutException/LayoutException.h>
  5. #include <ReaderWriterUtilities/AttributeConstants.h>
  6. #include <Common/GraphType.h>
  7. /**
  8. DirtyEdge : This class is for maintaining the attributes of edges as we cannot directly access
  9. the attributes of edges in the endElement part of the Sax Handler
  10. So store the attributes of edge into member variables of this class using set() functiionality.
  11. and have to fetch those attributes in endElement using get() functionality.
  12. */
  13. class DirtyEdge
  14. {
  15. private:
  16. QString m_sSourceId; /*!< String to store a ID of source nede of dirty edge*/
  17. QString m_sTargetId; /*!< String to store a ID of target nede of dirty edge*/
  18. QString m_sEdgeId; /*!< String to store a ID of the dirty edge*/
  19. BendPoints *m_strBendPoints; /*!< Structure to bound the bend point's x and y coordinates into single object and store it into the list. */
  20. public:
  21. bool m_bIsDirtyEdge; /*!< Boolean flag used to maintain the state for edge whether it should be added in the graph or not. */
  22. QVectorBendPoints m_vecBendPoints; /*!< List containing the objects of bendpoints. */
  23. /** @name Creators
  24. * The methods under this section are responsible for constructing
  25. * an instance of type DirtyEdge.
  26. */
  27. //@{
  28. /**
  29. Constructs new object of type DirtyEdge.
  30. @pre none
  31. @param none
  32. @return none
  33. @throw none
  34. */
  35. DirtyEdge();
  36. //@}
  37. /** @name Modifiers
  38. * The methods under this section are responsible for modifying
  39. * an instance of DirtyEdge.
  40. */
  41. //@{
  42. /**
  43. This method writes the souce and target id's of the edge
  44. @pre sSourceId.trimmed().isEmpty() == false
  45. sTargetId.trimmed().isEmpty() == false
  46. @param sSourceId
  47. @param sTargetId
  48. @return none
  49. @throw LayoutException
  50. -# INVALID_PARAMETER if invalid values is passsed to function.
  51. */
  52. void setSourceTarget(QString sSourceId , QString sTargetId);
  53. /**
  54. This method writes the edge id of the edge
  55. @pre sEdgeId.trimmed().isEmpty() == false
  56. @param sEdgeId
  57. @return none
  58. @throw none
  59. */
  60. void setId(QString sEdgeId);
  61. /**
  62. This method sets the bend points coordinates to the list
  63. @pre none
  64. @param iValueX
  65. X coordinate value
  66. @param iValueY
  67. Y coordinate value
  68. @return none
  69. @throw none
  70. */
  71. void setEdgeBendPointsCoordinates(int iValueX, int iValueY);
  72. //@}
  73. /** @name Queries
  74. * The methods under this section are responsible for accessing
  75. * an instance of type DirtyEdge.
  76. */
  77. //@{
  78. /**
  79. This method returns the source id of the edge
  80. @pre id should be written already
  81. @param sEdgeId
  82. value of edge id
  83. @return soruce id of a edge
  84. @throw none
  85. */
  86. QString getSource();
  87. /**
  88. This method returns the target id of the edge
  89. @pre id should be written already
  90. @param none
  91. @return target id of edge
  92. @throw none
  93. */
  94. QString getTarget();
  95. /**
  96. This method returns the edge id of the edge
  97. @pre id should be already written
  98. @param none
  99. @return id of edge
  100. @throw none
  101. */
  102. QString getId();
  103. //@}
  104. };
  105. #endif // DIRTYEDGE_H