Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
b485765e
Commit
b485765e
authored
Jun 30, 2011
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed some errors on OS other than win
parent
92b664b3
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
183 additions
and
186 deletions
+183
-186
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+4
-17
UBAbstractDrawRuler.h
src/tools/UBAbstractDrawRuler.h
+50
-49
UBGraphicsProtractor.cpp
src/tools/UBGraphicsProtractor.cpp
+122
-117
UBGraphicsProtractor.h
src/tools/UBGraphicsProtractor.h
+7
-3
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
b485765e
...
...
@@ -2576,31 +2576,18 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg()
graphicsItemFromSvg
(
triangle
);
//QStringRef angle = mXmlReader.attributes().value(mNamespaceUri, "angle");
//if (!angle.isNull())
//{
// protractor->setAngle(angle.toString().toFloat());
//}
//QStringRef markerAngle = mXmlReader.attributes().value(mNamespaceUri, "marker-angle");
//if (!markerAngle.isNull())
//{
// protractor->setMarkerAngle(markerAngle.toString().toFloat());
//}
QStringRef
svgX
=
mXmlReader
.
attributes
().
value
(
"x"
);
QStringRef
svgY
=
mXmlReader
.
attributes
().
value
(
"y"
);
QStringRef
svgWidth
=
mXmlReader
.
attributes
().
value
(
"width"
);
QStringRef
svgHeight
=
mXmlReader
.
attributes
().
value
(
"height"
);
UBGraphicsTriangle
::
UBGraphicsTriangleOrientation
orientation
=
UBGraphicsTriangle
::
orientationFromStr
((
mXmlReader
.
attributes
().
value
(
"orientation"
)));
QStringRef
orientationStringRef
=
mXmlReader
.
attributes
().
value
(
"orientation"
);
UBGraphicsTriangle
::
UBGraphicsTriangleOrientation
orientation
=
UBGraphicsTriangle
::
orientationFromStr
(
orientationStringRef
);
if
(
!
svgX
.
isNull
()
&&
!
svgY
.
isNull
()
&&
!
svgWidth
.
isNull
()
&&
!
svgHeight
.
isNull
())
{
triangle
->
setRect
(
svgX
.
toString
().
toFloat
(),
svgY
.
toString
().
toFloat
()
,
svgWidth
.
toString
().
toFloat
(),
svgHeight
.
toString
().
toFloat
(),
orientation
);
triangle
->
setRect
(
svgX
.
toString
().
toFloat
(),
svgY
.
toString
().
toFloat
(),
svgWidth
.
toString
().
toFloat
(),
svgHeight
.
toString
().
toFloat
(),
orientation
);
}
triangle
->
setVisible
(
true
);
...
...
src/tools/UBAbstractDrawRuler.h
View file @
b485765e
...
...
@@ -7,69 +7,70 @@ class QGraphicsSvgItem;
class
UBAbstractDrawRuler
:
public
QObject
{
Q_OBJECT
Q_OBJECT
public
:
UBAbstractDrawRuler
();
~
UBAbstractDrawRuler
();
public
:
UBAbstractDrawRuler
();
~
UBAbstractDrawRuler
();
void
create
(
QGraphicsItem
&
item
);
void
create
(
QGraphicsItem
&
item
);
virtual
void
StartLine
(
const
QPointF
&
position
,
qreal
width
);
virtual
void
DrawLine
(
const
QPointF
&
position
,
qreal
width
);
virtual
void
EndLine
();
protected
:
virtual
void
StartLine
(
const
QPointF
&
position
,
qreal
width
);
virtual
void
DrawLine
(
const
QPointF
&
position
,
qreal
width
);
virtual
void
EndLine
();
void
paint
();
protected
:
virtual
UBGraphicsScene
*
scene
()
const
=
0
;
void
paint
()
;
virtual
void
rotateAroundTopLeftOrigin
(
qreal
angle
)
=
0
;
virtual
UBGraphicsScene
*
scene
()
const
=
0
;
virtual
QPointF
topLeftOrigin
()
const
=
0
;
virtual
QRectF
resizeButtonRect
()
const
=
0
;
virtual
QRectF
closeButtonRect
()
const
=
0
;
virtual
QRectF
rotateButtonRect
()
const
=
0
;
virtual
void
rotateAroundTopLeftOrigin
(
qreal
angle
)
=
0
;
void
updateResizeCursor
(
QGraphicsItem
&
item
);
virtual
QPointF
topLeftOrigin
()
const
=
0
;
virtual
QRectF
resizeButtonRect
()
const
=
0
;
virtual
QRectF
closeButtonRect
()
const
=
0
;
virtual
QRectF
rotateButtonRect
()
const
=
0
;
bool
mResizing
;
bool
mRotating
;
bool
mShowButtons
;
QGraphicsSvgItem
*
mCloseSvgItem
;
QGraphicsSvgItem
*
mRotateSvgItem
;
QCursor
mResizeCursor
;
qreal
mAntiScaleRatio
;
void
updateResizeCursor
(
QGraphicsItem
&
item
);
QPointF
startDrawPosition
;
bool
mResizing
;
bool
mRotating
;
bool
mShowButtons
;
QGraphicsSvgItem
*
mCloseSvgItem
;
QGraphicsSvgItem
*
mRotateSvgItem
;
QCursor
mResizeCursor
;
qreal
mAntiScaleRatio
;
QCursor
moveCursor
()
const
;
QCursor
resizeCursor
()
const
;
QCursor
rotateCursor
()
const
;
QCursor
closeCursor
()
const
;
QCursor
drawRulerLineCursor
()
const
;
QPointF
startDrawPosition
;
QColor
drawColor
()
const
;
QColor
middleFillColor
()
const
;
QColor
edgeFillColor
()
const
;
QFont
font
()
const
;
QCursor
moveCursor
()
const
;
QCursor
resizeCursor
()
const
;
QCursor
rotateCursor
()
const
;
QCursor
closeCursor
()
const
;
QCursor
drawRulerLineCursor
()
const
;
static
const
QColor
sLightBackgroundEdgeFillColor
;
static
const
QColor
sLightBackgroundMiddleFillColor
;
static
const
QColor
sLightBackgroundDrawColor
;
static
const
QColor
sDarkBackgroundEdgeFillColor
;
static
const
QColor
sDarkBackgroundMiddleFillColor
;
static
const
QColor
sDarkBackgroundDrawColor
;
QColor
drawColor
()
const
;
QColor
middleFillColor
()
const
;
QColor
edgeFillColor
()
const
;
QFont
font
()
const
;
static
const
int
sLeftEdgeMargin
=
10
;
static
const
int
sMinLength
=
150
;
static
const
int
sDegreeToQtAngleUnit
=
16
;
static
const
int
sRotationRadius
=
15
;
static
const
int
sPixelsPerMillimeter
=
5
;
static
const
int
sFillTransparency
=
127
;
static
const
int
sDrawTransparency
=
192
;
static
const
int
sRoundingRadius
=
sLeftEdgeMargin
/
2
;
static
const
QColor
sLightBackgroundEdgeFillColor
;
static
const
QColor
sLightBackgroundMiddleFillColor
;
static
const
QColor
sLightBackgroundDrawColor
;
static
const
QColor
sDarkBackgroundEdgeFillColor
;
static
const
QColor
sDarkBackgroundMiddleFillColor
;
static
const
QColor
sDarkBackgroundDrawColor
;
static
const
int
sLeftEdgeMargin
=
10
;
static
const
int
sMinLength
=
150
;
static
const
int
sDegreeToQtAngleUnit
=
16
;
static
const
int
sRotationRadius
=
15
;
static
const
int
sPixelsPerMillimeter
=
5
;
static
const
int
sFillTransparency
=
127
;
static
const
int
sDrawTransparency
=
192
;
static
const
int
sRoundingRadius
=
sLeftEdgeMargin
/
2
;
};
#endif
\ No newline at end of file
#endif
src/tools/UBGraphicsProtractor.cpp
View file @
b485765e
This diff is collapsed.
Click to expand it.
src/tools/UBGraphicsProtractor.h
View file @
b485765e
...
...
@@ -58,6 +58,7 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse
virtual
void
hoverMoveEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
QPainterPath
shape
()
const
;
QRectF
boundingRect
()
const
;
private
:
// Helpers
void
paintGraduations
(
QPainter
*
painter
);
...
...
@@ -90,10 +91,13 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse
QGraphicsSvgItem
*
mResizeSvgItem
;
QGraphicsSvgItem
*
mMarkerSvgItem
;
static
const
QRectF
sDefaultRect
;
static
const
QRectF
sDefaultRect
;
virtual
void
rotateAroundTopLeftOrigin
(
qreal
angle
);
virtual
QPointF
topLeftOrigin
()
const
;
virtual
void
rotateAroundTopLeftOrigin
(
qreal
angle
)
;
virtual
QPointF
topLeftOrigin
()
const
;
int
sFillTransparency
;
int
sDrawTransparency
;
};
#endif
/* UBGRAPHICSPROTRACTOR_H_ */
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