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
K
kumir2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kumir
kumir2
Commits
a850ff9a
Commit
a850ff9a
authored
Oct 16, 2020
by
Alexander A. Maly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clearing warnings in IsometricRobot
parent
e3a37c9c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
42 deletions
+16
-42
src/actors/isometricrobot/cellgraphicsitem.cpp
src/actors/isometricrobot/cellgraphicsitem.cpp
+1
-8
src/actors/isometricrobot/cellgraphicsitem.h
src/actors/isometricrobot/cellgraphicsitem.h
+5
-11
src/actors/isometricrobot/robotview.cpp
src/actors/isometricrobot/robotview.cpp
+10
-23
No files found.
src/actors/isometricrobot/cellgraphicsitem.cpp
View file @
a850ff9a
...
...
@@ -13,20 +13,13 @@ CellGraphicsItem::CellGraphicsItem(
const
QPolygonF
&
polyEast
,
const
QPolygonF
&
polyNorth
,
const
QPolygonF
&
polyWest
,
bool
editable
,
int
cellX
,
int
cellY
,
RobotView
*
view
,
QGraphicsItem
*
parent
)
:
QGraphicsPolygonItem
(
poly
,
parent
),
p_south
(
polySouth
),
p_east
(
polyEast
),
p_north
(
polyNorth
),
p_west
(
polyWest
),
i_cellX
(
cellX
),
i_cellY
(
cellY
),
m_view
(
view
)
p_west
(
polyWest
)
{
}
...
...
src/actors/isometricrobot/cellgraphicsitem.h
View file @
a850ff9a
...
...
@@ -17,27 +17,21 @@ public:
const
QPolygonF
&
polyEast
,
const
QPolygonF
&
polyNorth
,
const
QPolygonF
&
polyWest
,
bool
editable
,
int
cellX
,
int
cellY
,
RobotView
*
view
,
QGraphicsItem
*
parent
=
0
);
protected:
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
private:
//int whichWall(const QPointF &p) const;
QPolygonF
p_south
;
QPolygonF
p_east
;
QPolygonF
p_north
;
QPolygonF
p_west
;
bool
b_editable
;
int
i_cellX
;
int
i_cellY
;
RobotView
*
m_view
;
};
}
// namespace Robot25D
...
...
src/actors/isometricrobot/robotview.cpp
View file @
a850ff9a
...
...
@@ -466,11 +466,12 @@ QBrush RobotView::wallBrush()
return
QBrush
(
QColor
(
"sandybrown"
),
Qt
::
Dense4Pattern
);
}
QRectF
RobotView
::
createEmptyCell
(
int
x
,
int
y
,
bool
painted
,
bool
pointed
,
bool
isBorder
)
{
QRectF
RobotView
::
createEmptyCell
(
int
x
,
int
y
,
bool
painted
,
bool
pointed
,
bool
isBorder
)
{
qreal
x1_isometric
=
CellSize
*
x
;
qreal
y1_isometric
=
CellSize
*
y
;
qreal
z1_isometric
=
0.0
;
...
...
@@ -555,28 +556,16 @@ QRectF RobotView::createEmptyCell(int x, int y,
east
<<
mapToIsometricCoordinates
(
x2_isometric
+
CellSize
/
4
,
y3_isometric
,
z3_isometric
);
east
<<
mapToIsometricCoordinates
(
x2_isometric
-
CellSize
/
4
,
y4_isometric
,
z4_isometric
);
QPolygonF
polygon
(
points
);
QPolygonF
ps
(
south
);
QPolygonF
pe
(
east
);
QPolygonF
pn
(
north
);
QPolygonF
pw
(
west
);
int
cellX
=
-
1
,
cellY
=
-
1
;
if
(
x
!=
-
1
&&
y
!=
-
1
)
{
cellX
=
x
;
cellY
=
y
;
}
if
(
y
>=
_model
->
field
().
size
()
||
x
>=
_model
->
field
()[
0
].
size
())
{
cellX
=
-
1
;
cellY
=
-
1
;
}
CellGraphicsItem
*
result
=
new
CellGraphicsItem
(
polygon
,
ps
,
pe
,
pn
,
pw
,
false
,
cellX
,
cellY
,
this
);
CellGraphicsItem
*
result
=
new
CellGraphicsItem
(
polygon
,
ps
,
pe
,
pn
,
pw
);
_allItems
<<
result
;
result
->
setParentItem
(
this
);
...
...
@@ -611,8 +600,6 @@ QRectF RobotView::createEmptyCell(int x, int y,
points
[
2
]
=
mapToIsometricCoordinates
(
CellSize
*
(
x
+
1
)
-
OFFSET
,
CellSize
*
(
y
+
1
)
-
OFFSET
,
0
);
points
[
3
]
=
mapToIsometricCoordinates
(
CellSize
*
x
+
OFFSET
,
CellSize
*
(
y
+
1
)
-
OFFSET
,
0
);
QAbstractGraphicsShapeItem
*
item
=
new
QGraphicsPolygonItem
(
QPolygonF
(
points
));
item
->
setBrush
(
QColor
(
255
,
255
,
255
,
100
));
...
...
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