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
9c8a49f8
Commit
9c8a49f8
authored
Mar 01, 2012
by
Anatoly Mihalchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SANKORE-459
parent
7f26289b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
501 additions
and
493 deletions
+501
-493
UBSvgSubsetAdaptor.h
src/adaptors/UBSvgSubsetAdaptor.h
+235
-225
UBGeometryUtils.cpp
src/frameworks/UBGeometryUtils.cpp
+224
-226
UBGeometryUtils.h
src/frameworks/UBGeometryUtils.h
+42
-42
No files found.
src/adaptors/UBSvgSubsetAdaptor.h
View file @
9c8a49f8
...
@@ -164,19 +164,29 @@ class UBSvgSubsetAdaptor
...
@@ -164,19 +164,29 @@ class UBSvgSubsetAdaptor
void
strokeToSvgPolyline
(
UBGraphicsStroke
*
stroke
,
bool
groupHoldsInfo
);
void
strokeToSvgPolyline
(
UBGraphicsStroke
*
stroke
,
bool
groupHoldsInfo
);
void
strokeToSvgPolygon
(
UBGraphicsStroke
*
stroke
,
bool
groupHoldsInfo
);
void
strokeToSvgPolygon
(
UBGraphicsStroke
*
stroke
,
bool
groupHoldsInfo
);
inline
QString
pointsToSvgPointsAttribute
(
const
QVector
<
QPointF
>
points
)
inline
QString
pointsToSvgPointsAttribute
(
QVector
<
QPointF
>
points
)
{
{
const
QVector
<
QPointF
>
crashedPoints
=
UBGeometryUtils
::
crashPointList
(
points
);
UBGeometryUtils
::
crashPointList
(
points
);
int
pointsCount
=
crashedPoints
.
size
();
int
pointsCount
=
points
.
size
();
QString
svgPoints
;
QString
svgPoints
;
int
length
=
0
;
int
length
=
0
;
QString
sBuf
;
QString
sBuf
;
for
(
int
j
=
0
;
j
<
pointsCount
;
j
++
)
for
(
int
j
=
0
;
j
<
pointsCount
;
j
++
)
{
{
const
QPointF
&
point
=
crashedPoints
.
at
(
j
);
sBuf
=
"%1,%2 "
;
sBuf
.
sprintf
(
"%.2f,%.2f "
,
point
.
x
(),
point
.
y
());
const
QPointF
&
point
=
points
.
at
(
j
);
QString
temp1
=
"%1"
,
temp2
=
"%2"
;
temp1
=
temp1
.
arg
(
point
.
x
());
temp2
=
temp2
.
arg
(
point
.
y
());
QLocale
loc
(
QLocale
::
C
);
sBuf
=
sBuf
.
arg
(
loc
.
toFloat
(
temp1
)).
arg
(
loc
.
toFloat
(
temp2
));
svgPoints
.
insert
(
length
,
sBuf
);
svgPoints
.
insert
(
length
,
sBuf
);
length
+=
sBuf
.
length
();
length
+=
sBuf
.
length
();
}
}
...
...
src/frameworks/UBGeometryUtils.cpp
View file @
9c8a49f8
...
@@ -205,22 +205,20 @@ QRectF UBGeometryUtils::lineToInnerRect(const QLineF& pLine, const qreal& pWidth
...
@@ -205,22 +205,20 @@ QRectF UBGeometryUtils::lineToInnerRect(const QLineF& pLine, const qreal& pWidth
}
}
QVector
<
QPointF
>
UBGeometryUtils
::
crashPointList
(
const
QVector
<
QPointF
>
points
)
void
UBGeometryUtils
::
crashPointList
(
QVector
<
QPointF
>
&
points
)
{
{
QVector
<
QPointF
>
result
(
points
);
// QVector<QPointF> result(points);
int
position
=
1
;
int
position
=
1
;
while
(
position
<
result
.
size
())
while
(
position
<
points
.
size
())
{
{
if
(
result
.
at
(
position
)
==
result
.
at
(
position
-
1
))
if
(
points
.
at
(
position
)
==
points
.
at
(
position
-
1
))
{
{
result
.
remove
(
position
);
points
.
remove
(
position
);
}
}
else
else
{
{
++
position
;
++
position
;
}
}
}
}
return
result
;
}
}
src/frameworks/UBGeometryUtils.h
View file @
9c8a49f8
...
@@ -36,7 +36,7 @@ class UBGeometryUtils
...
@@ -36,7 +36,7 @@ class UBGeometryUtils
static
QPointF
pointConstrainedInRect
(
QPointF
point
,
QRectF
rect
);
static
QPointF
pointConstrainedInRect
(
QPointF
point
,
QRectF
rect
);
static
QPoint
pointConstrainedInRect
(
QPoint
point
,
QRect
rect
);
static
QPoint
pointConstrainedInRect
(
QPoint
point
,
QRect
rect
);
static
QVector
<
QPointF
>
crashPointList
(
const
QVector
<
QPointF
>
points
);
static
void
crashPointList
(
QVector
<
QPointF
>
&
points
);
};
};
#endif
/* UBGEOMETRYUTILS_H_ */
#endif
/* UBGEOMETRYUTILS_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