Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
3926ee3c
Commit
3926ee3c
authored
2 years ago
by
Mikhail Svechnikov
Committed by
Mikhail Svechnikov
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
PolygonPointItems are in OwningVector
parent
ec1c913c
No related branches found
No related tags found
1 merge request
!1339
GUI: fix masks and projections
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/Model/Device/MaskItems.cpp
+3
-8
3 additions, 8 deletions
GUI/Model/Device/MaskItems.cpp
GUI/Model/Device/MaskItems.h
+1
-2
1 addition, 2 deletions
GUI/Model/Device/MaskItems.h
with
4 additions
and
10 deletions
GUI/Model/Device/MaskItems.cpp
+
3
−
8
View file @
3926ee3c
...
...
@@ -511,7 +511,7 @@ void PolygonItem::setIsClosed(bool closed)
QVector
<
PolygonPointItem
*>
PolygonItem
::
points
()
const
{
return
m_points
;
return
QVector
<
PolygonPointItem
*>
(
m_points
.
begin
(),
m_points
.
end
())
;
}
void
PolygonItem
::
addPoint
(
double
x
,
double
y
)
...
...
@@ -519,7 +519,7 @@ void PolygonItem::addPoint(double x, double y)
auto
*
pointItem
=
new
PolygonPointItem
;
pointItem
->
setPosX
(
x
);
pointItem
->
setPosY
(
y
);
m_points
.
push
_back
(
pointItem
);
// TODO: check whether the order of points matter
m_points
.
emplace
_back
(
pointItem
);
// TODO: check whether the order of points matter
}
void
PolygonItem
::
writeTo
(
QXmlStreamWriter
*
w
)
const
...
...
@@ -537,7 +537,7 @@ void PolygonItem::writeTo(QXmlStreamWriter* w) const
w
->
writeEndElement
();
// polygon points
for
(
const
auto
*
p
:
points
()
)
{
for
(
const
auto
*
p
:
m_
points
)
{
w
->
writeStartElement
(
Tag
::
PolygonPoint
);
p
->
writeTo
(
w
);
w
->
writeEndElement
();
...
...
@@ -579,11 +579,6 @@ void PolygonItem::readFrom(QXmlStreamReader* r)
}
}
PolygonItem
::~
PolygonItem
()
{
qDeleteAll
(
m_points
);
// TODO: check this!
}
/* ------------------------------------------------------------------------- */
VerticalLineItem
::
VerticalLineItem
()
...
...
This diff is collapsed.
Click to expand it.
GUI/Model/Device/MaskItems.h
+
1
−
2
View file @
3926ee3c
...
...
@@ -118,7 +118,6 @@ private:
class
PolygonItem
:
public
MaskItem
{
public:
PolygonItem
();
~
PolygonItem
();
std
::
unique_ptr
<
IShape2D
>
createShape
(
double
scale
)
const
override
;
bool
isClosed
()
const
;
...
...
@@ -132,7 +131,7 @@ public:
private:
bool
m_isClosed
=
false
;
Q
Vector
<
PolygonPointItem
*
>
m_points
;
Owning
Vector
<
PolygonPointItem
>
m_points
;
};
class
VerticalLineItem
:
public
MaskItem
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment