Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
Takin
mag-core
Commits
f2831db7
Commit
f2831db7
authored
Dec 16, 2019
by
Tobias WEBER
Browse files
added selection option
parent
67e00e03
Changes
2
Show whitespace changes
Inline
Side-by-side
tools/moldyn/moldyn.cpp
View file @
f2831db7
...
...
@@ -196,6 +196,8 @@ MolDynDlg::MolDynDlg(QWidget* pParent) : QMainWindow{pParent},
m_atomContextMenu
->
addAction
(
"Delete Atom"
,
this
,
&
MolDynDlg
::
DeleteAtomUnderCursor
);
m_atomContextMenu
->
addAction
(
"Delete All Atoms Of Selected Type"
,
this
,
&
MolDynDlg
::
DeleteAllAtomsOfSameType
);
m_atomContextMenu
->
addAction
(
"Only Keep Atoms Of Selected Type"
,
this
,
&
MolDynDlg
::
KeepAtomsOfSameType
);
m_atomContextMenu
->
addSeparator
();
m_atomContextMenu
->
addAction
(
"Select All Atoms of Same Type"
,
this
,
&
MolDynDlg
::
SelectAtomsOfSameType
);
}
...
...
@@ -944,6 +946,26 @@ MolDynDlg::GetAtomIndexFromHandle(std::size_t handle) const
}
/**
* select all atoms of the same type as the one under the cursor
*/
void
MolDynDlg
::
SelectAtomsOfSameType
()
{
// nothing under cursor
if
(
m_curPickedObj
<=
0
)
return
;
// atom type to be selected
const
std
::
string
&
atomLabel
=
m_plot
->
GetImpl
()
->
GetObjectDataString
(
m_curPickedObj
);
for
(
auto
handle
:
m_sphereHandles
)
if
(
m_plot
->
GetImpl
()
->
GetObjectDataString
(
handle
)
==
atomLabel
)
m_plot
->
GetImpl
()
->
SetObjectHighlight
(
handle
,
1
);
m_plot
->
update
();
}
/**
* delete one atom
*/
...
...
tools/moldyn/moldyn.h
View file @
f2831db7
...
...
@@ -52,17 +52,18 @@ protected:
void
PickerIntersection
(
const
t_vec3_gl
*
pos
,
std
::
size_t
objIdx
,
const
t_vec3_gl
*
posSphere
);
void
AfterGLInitialisation
();
void
SliderValueChanged
(
int
val
);
void
SelectAll
();
void
SelectNone
();
std
::
tuple
<
bool
,
std
::
size_t
,
std
::
size_t
,
std
::
size_t
>
GetAtomIndexFromHandle
(
std
::
size_t
handle
)
const
;
void
CalculateDistanceBetweenAtoms
();
void
CalculatePositionsOfAtoms
();
void
CalculateDeltaDistancesOfAtoms
();
void
SliderValueChanged
(
int
val
);
void
SelectAll
();
void
SelectNone
();
void
SelectAtomsOfSameType
();
void
DeleteAtomUnderCursor
();
void
DeleteAllAtomsOfSameType
();
void
KeepAtomsOfSameType
();
...
...
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