Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
pymsc
Commits
4450cb6d
Commit
4450cb6d
authored
Nov 21, 2014
by
Maxime Perrotin
Browse files
Add antialiasing to MSC graphs
parent
092b282f
Changes
3
Hide whitespace changes
Inline
Side-by-side
mscgraphics/basicmscgraph/mscArrowHead.py
View file @
4450cb6d
...
...
@@ -25,9 +25,7 @@
# */
#******************************************************************************
from
PySide.QtCore
import
Qt
from
PySide.QtGui
import
QPen
from
PySide.QtGui
import
QPainterPath
from
PySide.QtGui
import
QGraphicsPathItem
from
PySide.QtGui
import
QPen
,
QPainterPath
,
QGraphicsPathItem
,
QPainter
class
MscArrowHead
(
QGraphicsPathItem
):
...
...
@@ -80,3 +78,7 @@ class MscArrowHead(QGraphicsPathItem):
self
.
drawOriginX
=
self
.
width
self
.
drawOriginY
=
-
(
self
.
height
/
2.0
)
self
.
updatePath
()
def
paint
(
self
,
painter
,
option
,
widget
):
painter
.
setRenderHint
(
QPainter
.
Antialiasing
,
True
)
super
(
MscArrowHead
,
self
).
paint
(
painter
,
option
,
widget
)
mscgraphics/basicmscgraph/mscGraphCondition.py
View file @
4450cb6d
...
...
@@ -25,7 +25,7 @@
# Copyright (c) 2012 European Space Agency
#
#******************************************************************************
from
PySide.QtGui
import
QPainterPath
,
QPen
,
QBrush
,
QColor
from
PySide.QtGui
import
QPainterPath
,
QPen
,
QBrush
,
QColor
,
QPainter
from
PySide.QtCore
import
Qt
,
Slot
,
QPointF
from
msccore
import
MscCondition
...
...
@@ -133,7 +133,7 @@ class MscGraphCondition(MscGraphItem):
# Paint Functions
#**************************************************************************
def
initilizeGraphics
(
self
):
self
.
color
=
Qt
.
bl
ue
self
.
color
=
Qt
.
bl
ack
self
.
pen
=
QPen
(
self
.
color
,
1
,
Qt
.
SolidLine
,
Qt
.
RoundCap
,
Qt
.
RoundJoin
)
self
.
brush
=
QBrush
(
QColor
(
255
,
255
,
202
))
...
...
@@ -154,12 +154,22 @@ class MscGraphCondition(MscGraphItem):
Create the path of Timer
"""
self
.
path
=
QPainterPath
()
self
.
path
.
addRect
(
-
self
.
DefaultWidth
/
2
,
0
,
self
.
DefaultWidth
,
self
.
DefaultHeight
)
self
.
path
.
moveTo
(
5
,
0
)
self
.
path
.
lineTo
(
0
,
self
.
DefaultHeight
/
2
)
self
.
path
.
lineTo
(
5
,
self
.
DefaultHeight
)
self
.
path
.
lineTo
(
self
.
DefaultWidth
-
5
,
self
.
DefaultHeight
)
self
.
path
.
lineTo
(
self
.
DefaultWidth
,
self
.
DefaultHeight
/
2
)
self
.
path
.
lineTo
(
self
.
DefaultWidth
-
5
,
0
)
self
.
path
.
lineTo
(
5
,
0
)
self
.
path
.
translate
(
-
self
.
DefaultWidth
/
2
,
0
)
#self.path.addRect(-self.DefaultWidth / 2, 0,
# self.DefaultWidth, self.DefaultHeight)
# Set correct values of x, y, width and height
self
.
updateBounding
()
def
paint
(
self
,
painter
,
option
,
widget
):
painter
.
setPen
(
self
.
pen
)
painter
.
setBrush
(
self
.
brush
)
painter
.
setRenderHint
(
QPainter
.
Antialiasing
,
True
)
painter
.
drawPath
(
self
.
path
)
mscgraphics/basicmscgraph/mscGraphInstance.py
View file @
4450cb6d
...
...
@@ -24,8 +24,7 @@
# Copyright (c) 2012 European Space Agency
#
#******************************************************************************
from
PySide.QtGui
import
QPen
,
QGraphicsRectItem
from
PySide.QtGui
import
QLinearGradient
from
PySide.QtGui
import
QPen
,
QGraphicsRectItem
,
QLinearGradient
,
QPainter
from
PySide.QtCore
import
Qt
,
QPointF
,
Slot
import
msccore
...
...
@@ -322,6 +321,7 @@ class MscGraphInstance(MscGraphItem):
def
paint
(
self
,
painter
,
option
,
widget
=
None
):
''' Paint the instance Axis Symbol '''
painter
.
setPen
(
QPen
(
self
.
pen
).
setColor
(
Qt
.
black
))
painter
.
setRenderHint
(
QPainter
.
Antialiasing
,
True
)
painter
.
drawLine
(
0
,
0
,
0
,
self
.
bodySize
)
#**************************************************************************
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment