Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mag-core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Scientific Software
Takin
mag-core
Commits
643c34ea
Verified
Commit
643c34ea
authored
Oct 14, 2020
by
Tobias WEBER
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanups
parent
781672c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
20 deletions
+25
-20
tools/pol/CMakeLists.txt
tools/pol/CMakeLists.txt
+3
-2
tools/pol/pol.cpp
tools/pol/pol.cpp
+19
-15
tools/scanbrowser/CMakeLists.txt
tools/scanbrowser/CMakeLists.txt
+3
-3
No files found.
tools/pol/CMakeLists.txt
View file @
643c34ea
...
...
@@ -18,8 +18,9 @@ set(CMAKE_AUTOUIC TRUE)
set
(
CMAKE_AUTOMOC TRUE
)
set
(
CMAKE_CXX_STANDARD 20
)
add_definitions
(
-std=c++20
)
add_definitions
(
${
Boost_CXX_FLAGS
}
)
add_compile_options
(
-std=c++20
)
add_compile_options
(
${
Boost_CXX_FLAGS
}
)
add_compile_options
(
-Wall -Wextra
)
include_directories
(
"
${
PROJECT_SOURCE_DIR
}
"
"
${
Boost_INCLUDE_DIRS
}
/.."
"../.."
)
...
...
tools/pol/pol.cpp
View file @
643c34ea
...
...
@@ -18,6 +18,7 @@
#include <iostream>
#include <vector>
#include <string>
#include <optional>
#include "libs/glplot.h"
#include "libs/math20.h"
...
...
@@ -75,8 +76,8 @@ private:
bool
m_3dobjsReady
=
false
;
bool
m_mouseDown
[
3
]
=
{
false
,
false
,
false
};
long
m_curPickedObj
=
-
1
;
long
m_curDraggedObj
=
-
1
;
std
::
optional
<
std
::
size_t
>
m_curPickedObj
{}
;
std
::
optional
<
std
::
size_t
>
m_curDraggedObj
{}
;
protected:
...
...
@@ -172,19 +173,20 @@ protected slots:
*/
void
PickerIntersection
(
const
t_vec3_gl
*
pos
,
std
::
size_t
objIdx
,
const
t_vec3_gl
*
posSphere
)
{
m_curPickedObj
=
-
1
;
m_curPickedObj
.
reset
();
if
(
pos
)
{
// object selected?
m_curPickedObj
=
long
(
objIdx
)
;
m_curPickedObj
=
objIdx
;
if
(
objIdx
==
m_arrow_pi
)
m_labelStatus
->
setText
(
"P_i"
);
else
if
(
objIdx
==
m_arrow_pf
)
m_labelStatus
->
setText
(
"P_f"
);
else
if
(
objIdx
==
m_arrow_M_Re
)
m_labelStatus
->
setText
(
"Re{M_perp}"
);
else
if
(
objIdx
==
m_arrow_M_Im
)
m_labelStatus
->
setText
(
"Im{M_perp}"
);
else
m_curPickedObj
=
-
1
;
else
m_curPickedObj
.
reset
()
;
}
if
(
m_curPickedObj
>=
0
)
if
(
m_curPickedObj
)
{
setCursor
(
Qt
::
CrossCursor
);
}
...
...
@@ -195,26 +197,26 @@ protected slots:
}
if
(
posSphere
&&
m_mouseDown
[
0
])
if
(
posSphere
&&
m_mouseDown
[
0
]
&&
m_curDraggedObj
)
{
// picker intersecting unit sphere and mouse dragged?
t_vec3_gl
posSph
=
*
posSphere
;
if
(
m_curDraggedObj
==
m_arrow_pi
)
if
(
*
m_curDraggedObj
==
m_arrow_pi
)
{
m_editPiX
->
setText
(
QVariant
(
posSph
[
0
]).
toString
());
m_editPiY
->
setText
(
QVariant
(
posSph
[
1
]).
toString
());
m_editPiZ
->
setText
(
QVariant
(
posSph
[
2
]).
toString
());
CalcPol
();
}
else
if
(
m_curDraggedObj
==
m_arrow_M_Re
)
else
if
(
*
m_curDraggedObj
==
m_arrow_M_Re
)
{
m_editMPerpReX
->
setText
(
QVariant
(
posSph
[
0
]).
toString
());
m_editMPerpReY
->
setText
(
QVariant
(
posSph
[
1
]).
toString
());
m_editMPerpReZ
->
setText
(
QVariant
(
posSph
[
2
]).
toString
());
CalcPol
();
}
else
if
(
m_curDraggedObj
==
m_arrow_M_Im
)
else
if
(
*
m_curDraggedObj
==
m_arrow_M_Im
)
{
m_editMPerpImX
->
setText
(
QVariant
(
posSph
[
0
]).
toString
());
m_editMPerpImY
->
setText
(
QVariant
(
posSph
[
1
]).
toString
());
...
...
@@ -236,10 +238,12 @@ protected slots:
if
(
m_mouseDown
[
0
])
{
m_curDraggedObj
=
m_curPickedObj
;
auto
lenVec
=
GetArrowLen
(
m_curDraggedObj
);
if
(
lenVec
>
0.
)
m_plot
->
GetImpl
()
->
SetPickerSphereRadius
(
lenVec
);
if
((
m_curDraggedObj
=
m_curPickedObj
))
{
auto
lenVec
=
GetArrowLen
(
*
m_curDraggedObj
);
if
(
lenVec
>
0.
)
m_plot
->
GetImpl
()
->
SetPickerSphereRadius
(
lenVec
);
}
}
}
...
...
@@ -254,7 +258,7 @@ protected slots:
if
(
right
)
m_mouseDown
[
2
]
=
false
;
if
(
!
m_mouseDown
[
0
])
m_curDraggedObj
=
-
1
;
m_curDraggedObj
.
reset
()
;
}
...
...
tools/scanbrowser/CMakeLists.txt
View file @
643c34ea
...
...
@@ -23,9 +23,9 @@ add_compile_options(-Wall -Wextra)
# -----------------------------------------------------------------------------
# Boost
add_
defini
tions
(
-DBOOST_SYSTEM_NO_DEPRECATED
)
add_
compile_op
tions
(
-DBOOST_SYSTEM_NO_DEPRECATED
)
find_package
(
Boost REQUIRED COMPONENTS system filesystem iostreams REQUIRED
)
add_
defini
tions
(
${
Boost_CXX_FLAGS
}
)
add_
compile_op
tions
(
${
Boost_CXX_FLAGS
}
)
# Qt
find_package
(
Qt5 REQUIRED COMPONENTS Core Gui Widgets PrintSupport
)
...
...
@@ -99,10 +99,10 @@ add_executable(takin_scanbrowser
# ../../ext/qcp/qcustomplot.cpp ../../ext/qcp/qcustomplot.h
)
qt5_use_modules
(
takin_scanbrowser Core Gui Widgets OpenGL
)
target_link_libraries
(
takin_scanbrowser
${
Boost_LIBRARIES
}
Core Gui Widgets PrintSupport
${
QCP_LIBRARIES
}
${
Minuit2_LIBRARIES
}
Threads::Threads OpenMP::OpenMP_CXX
-ldl
...
...
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