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
d8eb79f5
Commit
d8eb79f5
authored
2 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
ba3d model: rename -> m_objects etc, provide accessors
parent
7d8d7bc2
No related branches found
No related tags found
1 merge request
!1067
break include cycle in ba3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/ba3d/model/model.cpp
+17
-17
17 additions, 17 deletions
GUI/ba3d/model/model.cpp
GUI/ba3d/model/model.h
+5
-1
5 additions, 1 deletion
GUI/ba3d/model/model.h
with
22 additions
and
18 deletions
GUI/ba3d/model/model.cpp
+
17
−
17
View file @
d8eb79f5
...
...
@@ -26,12 +26,12 @@ Model::Model()
Model
::~
Model
()
{
for
(
auto
*
o
:
objects
)
{
for
(
auto
*
o
:
m_
objects
)
{
o
->
model
=
nullptr
;
delete
o
;
}
for
(
auto
*
o
:
objectsBlend
)
{
for
(
auto
*
o
:
m_
objectsBlend
)
{
o
->
model
=
nullptr
;
delete
o
;
}
...
...
@@ -39,15 +39,15 @@ Model::~Model()
void
Model
::
clearOpaque
()
{
while
(
!
objects
.
isEmpty
())
delete
objects
.
first
();
while
(
!
m_
objects
.
isEmpty
())
delete
m_
objects
.
first
();
emit
updated
(
false
);
}
void
Model
::
clearBlend
()
{
while
(
!
objectsBlend
.
isEmpty
())
delete
objectsBlend
.
first
();
while
(
!
m_
objectsBlend
.
isEmpty
())
delete
m_
objectsBlend
.
first
();
emit
updated
(
false
);
}
...
...
@@ -131,7 +131,7 @@ void Model::add(Object* o)
ASSERT
(
o
);
ASSERT
(
!
o
->
model
);
o
->
model
=
this
;
objects
.
append
(
o
);
m_
objects
.
append
(
o
);
}
void
Model
::
addBlend
(
Object
*
o
)
...
...
@@ -139,15 +139,15 @@ void Model::addBlend(Object* o)
ASSERT
(
o
);
ASSERT
(
!
o
->
model
);
o
->
model
=
this
;
objectsBlend
.
append
(
o
);
m_
objectsBlend
.
append
(
o
);
}
void
Model
::
rem
(
Object
*
o
)
{
if
(
int
i
=
objects
.
indexOf
(
o
);
i
>=
0
)
objects
.
remove
(
i
);
else
if
(
int
i
=
objectsBlend
.
indexOf
(
o
);
i
>=
0
)
objectsBlend
.
remove
(
i
);
if
(
int
i
=
m_
objects
.
indexOf
(
o
);
i
>=
0
)
m_
objects
.
remove
(
i
);
else
if
(
int
i
=
m_
objectsBlend
.
indexOf
(
o
);
i
>=
0
)
m_
objectsBlend
.
remove
(
i
);
else
ASSERT
(
false
);
// object not found, should not happen, bad caller!
...
...
@@ -157,26 +157,26 @@ void Model::rem(Object* o)
void
Model
::
releaseGeometries
()
{
for
(
auto
*
o
:
objects
)
for
(
auto
*
o
:
m_
objects
)
o
->
releaseGeometry
();
for
(
auto
*
o
:
objectsBlend
)
for
(
auto
*
o
:
m_
objectsBlend
)
o
->
releaseGeometry
();
}
bool
Model
::
modelIsEmpty
()
{
return
objects
.
isEmpty
()
&&
objectsBlend
.
isEmpty
();
return
m_
objects
.
isEmpty
()
&&
m_
objectsBlend
.
isEmpty
();
}
void
Model
::
draw
(
Canvas
&
canvas
)
const
{
for
(
auto
*
o
:
objects
)
for
(
auto
*
o
:
objects
()
)
canvas
.
drawObject
(
*
o
);
}
void
Model
::
drawBlend
(
Canvas
&
canvas
)
const
{
for
(
auto
*
o
:
objectsBlend
)
for
(
auto
*
o
:
objectsBlend
()
)
canvas
.
drawObject
(
*
o
);
}
...
...
This diff is collapsed.
Click to expand it.
GUI/ba3d/model/model.h
+
5
−
1
View file @
d8eb79f5
...
...
@@ -51,11 +51,15 @@ public:
Position
defCamPos
;
//!< default camera params
const
QVector
<
Object
*>&
objects
()
const
{
return
m_objects
;
}
const
QVector
<
Object
*>&
objectsBlend
()
const
{
return
m_objectsBlend
;
}
signals
:
void
updated
(
bool
withEye
);
private
:
QVector
<
Object
*>
objects
,
objectsBlend
;
QVector
<
Object
*>
m_objects
;
QVector
<
Object
*>
m_objectsBlend
;
void
draw
(
Canvas
&
)
const
;
void
drawBlend
(
Canvas
&
)
const
;
...
...
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