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
cebf640b
Commit
cebf640b
authored
3 years ago
by
Matthias Puchner
Browse files
Options
Downloads
Patches
Plain Diff
enhance VectorDescriptor
parent
20cdbde5
No related branches found
No related tags found
1 merge request
!570
remove SessionModel/Item from SampleModel and all related items
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GUI/Model/Types/VectorDescriptor.h
+35
-0
35 additions, 0 deletions
GUI/Model/Types/VectorDescriptor.h
with
35 additions
and
0 deletions
GUI/Model/Types/VectorDescriptor.h
+
35
−
0
View file @
cebf640b
...
...
@@ -25,6 +25,8 @@
//! of three doubles, three double members, or any other construction to hold the three values.
class
VectorDescriptor
{
public:
VectorDescriptor
()
=
default
;
//! Operates on a VectorItem.
//!
//! The settings (like decimals, limits) are taken from the item.
...
...
@@ -74,6 +76,7 @@ public:
z
.
label
=
label
+
" (z)"
;
}
// #baMigration used?
VectorDescriptor
(
const
QString
&
label
,
const
QString
&
tooltip
,
const
R3
*
vec
,
const
variant
<
QString
,
Unit
>&
unit
)
:
label
(
label
),
tooltip
(
tooltip
)
...
...
@@ -104,6 +107,38 @@ public:
z
.
path
=
[
=
]
{
return
uid
()
+
"z"
;
};
}
void
init
(
const
QString
&
_label
,
const
QString
&
_tooltip
,
const
R3
*
vec
,
const
variant
<
QString
,
Unit
>&
_unit
)
{
label
=
_label
;
tooltip
=
_tooltip
;
x
.
limits
=
RealLimits
::
limitless
();
y
.
limits
=
RealLimits
::
limitless
();
z
.
limits
=
RealLimits
::
limitless
();
x
.
decimals
=
3
;
y
.
decimals
=
3
;
z
.
decimals
=
3
;
x
.
tooltip
=
tooltip
;
y
.
tooltip
=
tooltip
;
z
.
tooltip
=
tooltip
;
x
.
unit
=
_unit
;
y
.
unit
=
_unit
;
z
.
unit
=
_unit
;
x
.
label
=
label
+
" (x)"
;
y
.
label
=
label
+
" (y)"
;
z
.
label
=
label
+
" (z)"
;
x
.
set
=
[
=
](
double
v
)
{
const_cast
<
R3
*>
(
vec
)
->
setX
(
v
);
};
x
.
get
=
[
=
]()
{
return
vec
->
x
();
};
x
.
path
=
[
=
]
{
return
uid
()
+
"x"
;
};
y
.
set
=
[
=
](
double
v
)
{
const_cast
<
R3
*>
(
vec
)
->
setY
(
v
);
};
y
.
get
=
[
=
]()
{
return
vec
->
y
();
};
y
.
path
=
[
=
]
{
return
uid
()
+
"y"
;
};
z
.
set
=
[
=
](
double
v
)
{
const_cast
<
R3
*>
(
vec
)
->
setZ
(
v
);
};
z
.
get
=
[
=
]()
{
return
vec
->
z
();
};
z
.
path
=
[
=
]
{
return
uid
()
+
"z"
;
};
}
QString
label
;
//!< A label text (short, no trailing colon)
QString
tooltip
;
//!< Tooltip text
DoubleDescriptor
x
;
...
...
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