Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pymsc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
TASTE
pymsc
Commits
4450cb6d
Commit
4450cb6d
authored
Nov 21, 2014
by
Maxime Perrotin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add antialiasing to MSC graphs
parent
092b282f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
9 deletions
+21
-9
mscgraphics/basicmscgraph/mscArrowHead.py
mscgraphics/basicmscgraph/mscArrowHead.py
+5
-3
mscgraphics/basicmscgraph/mscGraphCondition.py
mscgraphics/basicmscgraph/mscGraphCondition.py
+14
-4
mscgraphics/basicmscgraph/mscGraphInstance.py
mscgraphics/basicmscgraph/mscGraphInstance.py
+2
-2
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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