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
31fb1ac8
Commit
31fb1ac8
authored
10 years ago
by
Van Herck, Walter
Browse files
Options
Downloads
Patches
Plain Diff
Based ParticleCollectionItem on ParticleLayoutItem
parent
c4bb20c7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/coregui/Models/ParticleCollectionItem.cpp
+0
-40
0 additions, 40 deletions
GUI/coregui/Models/ParticleCollectionItem.cpp
GUI/coregui/Models/ParticleCollectionItem.h
+0
-9
0 additions, 9 deletions
GUI/coregui/Models/ParticleCollectionItem.h
with
0 additions
and
49 deletions
GUI/coregui/Models/ParticleCollectionItem.cpp
+
0
−
40
View file @
31fb1ac8
...
@@ -17,10 +17,6 @@
...
@@ -17,10 +17,6 @@
#include
"ParticleItem.h"
#include
"ParticleItem.h"
#include
"ComboProperty.h"
#include
"ComboProperty.h"
const
QString
ParticleCollectionItem
::
P_DISTRIBUTED_PARAMETER
=
"Distributed parameter"
;
const
QString
ParticleCollectionItem
::
NO_SELECTION
=
"No selection"
;
ParticleCollectionItem
::
ParticleCollectionItem
(
ParameterizedItem
*
parent
)
ParticleCollectionItem
::
ParticleCollectionItem
(
ParameterizedItem
*
parent
)
:
ParameterizedGraphicsItem
(
Constants
::
ParticleDistributionType
,
parent
)
:
ParameterizedGraphicsItem
(
Constants
::
ParticleDistributionType
,
parent
)
{
{
...
@@ -29,45 +25,9 @@ ParticleCollectionItem::ParticleCollectionItem(ParameterizedItem *parent)
...
@@ -29,45 +25,9 @@ ParticleCollectionItem::ParticleCollectionItem(ParameterizedItem *parent)
addToValidChildren
(
Constants
::
ParticleType
,
PortInfo
::
PORT_0
);
addToValidChildren
(
Constants
::
ParticleType
,
PortInfo
::
PORT_0
);
addToValidChildren
(
Constants
::
ParticleCoreShellType
,
PortInfo
::
PORT_0
);
addToValidChildren
(
Constants
::
ParticleCoreShellType
,
PortInfo
::
PORT_0
);
ComboProperty
par_prop
;
registerProperty
(
P_DISTRIBUTED_PARAMETER
,
par_prop
.
getVariant
());
updateParameterList
();
}
}
ParticleCollectionItem
::~
ParticleCollectionItem
()
ParticleCollectionItem
::~
ParticleCollectionItem
()
{
{
}
}
void
ParticleCollectionItem
::
onPropertyChange
(
const
QString
&
name
)
{
ParameterizedItem
::
onPropertyChange
(
name
);
if
(
name
==
P_DISTRIBUTED_PARAMETER
&&
isRegisteredProperty
(
P_DISTRIBUTED_PARAMETER
)
)
{
QVariant
par_var
=
getRegisteredProperty
(
P_DISTRIBUTED_PARAMETER
);
ComboProperty
par_prop
=
par_var
.
value
<
ComboProperty
>
();
}
}
void
ParticleCollectionItem
::
onChildPropertyChange
()
{
updateParameterList
();
ParameterizedItem
::
onChildPropertyChange
();
}
void
ParticleCollectionItem
::
updateParameterList
()
{
if
(
!
isRegisteredProperty
(
P_DISTRIBUTED_PARAMETER
))
return
;
QVariant
par_prop
=
getRegisteredProperty
(
P_DISTRIBUTED_PARAMETER
);
QString
selected_par
=
par_prop
.
value
<
ComboProperty
>
().
getValue
();
ComboProperty
updated_prop
;
if
(
childItems
().
size
()
>
0
)
{
QStringList
par_names
=
childItems
()[
0
]
->
getParameterTreeList
();
par_names
.
prepend
(
NO_SELECTION
);
par_names
.
removeAll
(
ParticleItem
::
P_ABUNDANCE
);
updated_prop
=
ComboProperty
(
par_names
);
}
else
{
updated_prop
<<
NO_SELECTION
;
}
setRegisteredProperty
(
P_DISTRIBUTED_PARAMETER
,
updated_prop
.
getVariant
());
}
This diff is collapsed.
Click to expand it.
GUI/coregui/Models/ParticleCollectionItem.h
+
0
−
9
View file @
31fb1ac8
...
@@ -24,17 +24,8 @@ class BA_CORE_API_ ParticleCollectionItem : public ParameterizedGraphicsItem
...
@@ -24,17 +24,8 @@ class BA_CORE_API_ ParticleCollectionItem : public ParameterizedGraphicsItem
{
{
Q_OBJECT
Q_OBJECT
public:
public:
static
const
QString
P_DISTRIBUTED_PARAMETER
;
explicit
ParticleCollectionItem
(
ParameterizedItem
*
parent
=
0
);
explicit
ParticleCollectionItem
(
ParameterizedItem
*
parent
=
0
);
~
ParticleCollectionItem
();
~
ParticleCollectionItem
();
void
onPropertyChange
(
const
QString
&
name
);
void
onChildPropertyChange
();
public
slots
:
void
updateParameterList
();
private:
static
const
QString
NO_SELECTION
;
};
};
#endif // PARTICLECOLLECTIONITEM_H
#endif // PARTICLECOLLECTIONITEM_H
...
...
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