diff options
author | brenda-br | 2023-02-20 16:30:27 +0530 |
---|---|---|
committer | brenda-br | 2023-02-20 16:30:27 +0530 |
commit | 0812086cb71a6c1e714c8bf0d115868b8d1f81d7 (patch) | |
tree | 8a3046f96c8068ca076d90c11f93a24767f5132b /src/main | |
parent | e816c10f23eda7f8727ee691d89921b7f8f462b6 (diff) | |
download | Chemical-PFD-0812086cb71a6c1e714c8bf0d115868b8d1f81d7.tar.gz Chemical-PFD-0812086cb71a6c1e714c8bf0d115868b8d1f81d7.tar.bz2 Chemical-PFD-0812086cb71a6c1e714c8bf0d115868b8d1f81d7.zip |
Reattaching Node Line to Node Item(Revised)
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/python/shapes/line.py | 51 | ||||
-rw-r--r-- | src/main/python/shapes/rLGPlus.txt | 58 | ||||
-rw-r--r-- | src/main/python/shapes/shapes.py | 2 |
3 files changed, 56 insertions, 55 deletions
diff --git a/src/main/python/shapes/line.py b/src/main/python/shapes/line.py index 4e5271a..ba0c564 100644 --- a/src/main/python/shapes/line.py +++ b/src/main/python/shapes/line.py @@ -808,31 +808,6 @@ class Line(QGraphicsPathItem): def updatePath(self): """ update path when svg item moves """ - #Adjusting line for repositioned retangular grips - if self.startGripItem.parentItem().__class__.__name__ in list(rLGPlus.keys()): - for tgrip in rLGPlus[self.startGripItem.parentItem().__class__.__name__]: - if(float(tgrip[3]) == 0): - if self.startGripItem.m_location == tgrip[0]: - tempx,tempy = int(tgrip[1]),int(tgrip[2]) - self.startPoint.setX(self.startPoint.x()+tempx) - self.startPoint.setY(self.startPoint.y()+tempy) - else: - if self.startGripItem.m_location == tgrip[0] and self.startGripItem.size == float(tgrip[3]): - tempx,tempy = int(tgrip[1]),int(tgrip[2]) - self.startPoint.setX(self.startPoint.x()+tempx) - self.startPoint.setY(self.startPoint.y()+tempy) - if self.endGripItem.parentItem().__class__.__name__ in list(rLGPlus.keys()): - for tgrip in rLGPlus[self.endGripItem.parentItem().__class__.__name__]: - if(float(tgrip[3]) == 0): - if self.endGripItem.m_location == tgrip[0]: - tempx,tempy = int(tgrip[1]),int(tgrip[2]) - self.endPoint.setX(self.endPoint.x()+tempx) - self.endPoint.setY(self.endPoint.y()+tempy) - else: - if self.endGripItem.m_location == tgrip[0] and self.endGripItems.size == float(tgrip[3]): - tempx,tempy = int(tgrip[1]),int(tgrip[2]) - self.endPoint.setX(self.endPoint.x()+tempx) - self.endPoint.setY(self.endPoint.y()+tempy) path = QPainterPath(self.startPoint) self.updatePoints() @@ -973,6 +948,19 @@ class Line(QGraphicsPathItem): startPoint.setY( startPoint.y() - self.startGap * item.boundingRect().height()) self.startPoint = startPoint + #Adjusting line for repositioned retangular grips + if self.startGripItem.parentItem().__class__.__name__ in list(rLGPlus.keys()): + for tgrip in rLGPlus[self.startGripItem.parentItem().__class__.__name__]: + if(float(tgrip[3]) == 0): + if self.startGripItem.m_location == tgrip[0]: + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.startPoint.setX(self.startPoint.x()+tempx) + self.startPoint.setY(self.startPoint.y()+tempy) + else: + if self.startGripItem.m_location == tgrip[0] and self.startGripItem.size == float(tgrip[3]): + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.startPoint.setX(self.startPoint.x()+tempx) + self.startPoint.setY(self.startPoint.y()+tempy) # end point on line if self.endGripItem: item = self.endGripItem @@ -985,6 +973,19 @@ class Line(QGraphicsPathItem): endPoint.setY( endPoint.y() - self.endGap * item.boundingRect().height()) self.endPoint = endPoint + #Adjusting line for repositioned retangular grips + if self.endGripItem.parentItem().__class__.__name__ in list(rLGPlus.keys()): + for tgrip in rLGPlus[self.endGripItem.parentItem().__class__.__name__]: + if(float(tgrip[3]) == 0): + if self.endGripItem.m_location == tgrip[0]: + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.endPoint.setX(self.endPoint.x()+tempx) + self.endPoint.setY(self.endPoint.y()+tempy) + else: + if self.endGripItem.m_location == tgrip[0] and self.endGripItem.size == float(tgrip[3]): + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.endPoint.setX(self.endPoint.x()+tempx) + self.endPoint.setY(self.endPoint.y()+tempy) self.updatePath() # end point on other line elif self.refLine: diff --git a/src/main/python/shapes/rLGPlus.txt b/src/main/python/shapes/rLGPlus.txt index 4cf8534..0cd2e86 100644 --- a/src/main/python/shapes/rLGPlus.txt +++ b/src/main/python/shapes/rLGPlus.txt @@ -1,41 +1,41 @@ #Contains data of the distance rectangular line grips were extended className:direction,x,y,width OilGasOrPulverizedFuelFurnace -left,5,0,0 -right,-5,0,0 -bottom,0,-10,0 +left,4,0,0 +right,-4,0,0 +bottom,0,-8,0 SolidFuelFurnace -left,5,0,0 -right,-5,0,0 -bottom,0,-10,0 +left,4,0,0 +right,-4,0,0 +bottom,0,-8,0 HorizontalVessel -top,0,10,0 -bottom,0,-10,0 +top,0,6,0 +bottom,0,-6,0 PackedVessel -left,10,0,0 -right,-10,0,0 +left,6,0,0 +right,-6,0,0 VerticalVessel -left,10,0,0 -right,-10,0,0 -FixedRoofTank left,6,0,0 -right,-7,0,0 -bottom,0,-10,0 +right,-6,0,0 +FixedRoofTank +left,5,0,0 +right,-6,0,0 +bottom,0,-8,0 FloatingRoofTank -left,7,0,0 -right,-7,0,0 -bottom,0,-10,0 +left,6,0,0 +right,-6,0,0 +bottom,0,-8,0 SeparatorsForLiquidsDecanter -top,0,10,0 -left,10,0,0 -right,-10,0,0 -bottom,0,-10,0 +top,0,8,0 +left,8,0,0 +right,-8,0,0 +bottom,0,-8,0 OneCellFiredHeaterFurnace -left,7,0,50 -right,-7,0,50 -bottom,0,-10,0 +left,5,0,50 +right,-5,0,50 +bottom,0,-8,0 TwoCellFiredHeaterFurnace -left,5,0,66.66 -right,-5,0,66.66 -bottom,0,-10,33.33 +left,3,0,66.66 +right,-3,0,66.66 +bottom,0,-8,33.33 ContinuousDryer -top,0,10,0
\ No newline at end of file +top,0,8,0
\ No newline at end of file diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index afd25b8..d14eee6 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -474,7 +474,7 @@ class LineGripItem(QGraphicsPathItem): def show(self): """ shows line grip item """ - self.setPen(QPen(QColor("black"), 2)) + self.setPen(QPen(QColor(0,0,0,150), 1.5)) self.setBrush(QColor(140,199,198,255)) def hide(self): |