Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
b9dd9823
Commit
b9dd9823
authored
Jun 12, 2015
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
execPythonCmd
parent
47bdc707
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
4 deletions
+30
-4
CGoGN/include/Geometry/bounding_box.hpp
CGoGN/include/Geometry/bounding_box.hpp
+1
-1
SCHNApps/include/schnapps.h
SCHNApps/include/schnapps.h
+6
-1
SCHNApps/src/schnapps.cpp
SCHNApps/src/schnapps.cpp
+21
-0
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+2
-2
No files found.
CGoGN/include/Geometry/bounding_box.hpp
View file @
b9dd9823
...
...
@@ -116,7 +116,7 @@ template <typename VEC>
typename
VEC
::
DATA_TYPE
BoundingBox
<
VEC
>::
diagSize
()
const
{
assert
(
m_initialized
||
!
"Bounding box not initialized"
);
return
VEC
::
DATA_TYPE
((
m_pMax
-
m_pMin
).
norm
());
return
typename
VEC
::
DATA_TYPE
((
m_pMax
-
m_pMin
).
norm
());
}
template
<
typename
VEC
>
...
...
SCHNApps/include/schnapps.h
View file @
b9dd9823
...
...
@@ -147,6 +147,8 @@ public slots:
void
loadPythonScriptFromFile
(
const
QString
&
fileName
);
void
execPythonCmd
(
const
QString
&
fileName
);
void
statusBarMessage
(
const
QString
&
msg
,
int
msec
);
QString
openFileDialog
(
const
QString
&
title
,
const
QString
&
dir
=
QString
(),
const
QString
&
filter
=
QString
());
...
...
@@ -171,7 +173,7 @@ protected:
private
slots
:
void
pyRecording
();
void
appendPyRecording
();
//
void endPyRecording();
//
void endPyRecording();
public:
inline
QTextStream
*
pythonStreamRecorder
()
{
return
m_pyRecording
;
}
...
...
@@ -224,6 +226,9 @@ protected:
QMap
<
Plugin
*
,
QList
<
QWidget
*>
>
m_pluginTabs
;
QMap
<
Plugin
*
,
QList
<
QAction
*>
>
m_pluginMenuActions
;
QMap
<
int
,
QString
>
m_pythonShortCuts
;
CameraSet
m_cameras
;
ViewSet
m_views
;
PluginSet
m_plugins
;
...
...
SCHNApps/src/schnapps.cpp
View file @
b9dd9823
...
...
@@ -968,6 +968,27 @@ void SCHNApps::showHidePythonDock()
m_pythonDock
->
setVisible
(
m_pythonDock
->
isHidden
());
}
void
SCHNApps
::
execPythonCmd
(
const
QString
&
cmd
)
{
#ifdef WIN32
QString
line
=
cmd
;
if
(
line
.
size
()
>=
2
)
{
int
j
=
0
;
while
(
line
[
j
]
==
' '
)
++
j
;
QString
spaces
(
4
-
j
,
QChar
(
' '
));
// need 4 spaces at begin of line
line
.
replace
(
QChar
(
'\\'
),
QChar
(
'/'
));
// replace \ by / in win path
m_pythonConsole
.
consoleMessage
(
spaces
+
line
);
m_pythonConsole
.
executeLine
(
false
);
}
#else
m_pythonConsole
.
consoleMessage
(
cmd
);
m_pythonConsole
.
executeLine
(
false
);
#endif
}
void
SCHNApps
::
loadPythonScriptFromFile
(
const
QString
&
fileName
)
{
#ifdef WIN32
...
...
SCHNApps/src/view.cpp
View file @
b9dd9823
...
...
@@ -529,11 +529,11 @@ int View::scaleIntSlideVal(float v)
void
View
::
keyPressEvent
(
QKeyEvent
*
event
)
{
switch
(
event
->
key
())
{
case
Qt
::
Key_Z
:
{
// m_schnapps->execPythonCmd("schnapps.getSelectedView().setViewScaling(1.,0.5,1.0);schnapps.getSelectedView().updateGL()");
int
isX
=
scaleIntSlideVal
(
m_scaleView
[
0
][
0
]);
int
isY
=
scaleIntSlideVal
(
m_scaleView
[
1
][
1
]);
int
isZ
=
scaleIntSlideVal
(
m_scaleView
[
2
][
2
]);
...
...
@@ -541,7 +541,7 @@ void View::keyPressEvent(QKeyEvent* event)
Utils
::
QT
::
inputValues
(
Utils
::
QT
::
VarSlider
(
0
,
100
,
isX
,
"Scale X"
,
Utils
::
QT
::
VarSlider
(
0
,
100
,
isY
,
"Scale Y"
,
Utils
::
QT
::
VarSlider
(
0
,
100
,
isZ
,
"Scale Z"
))));
Utils
::
QT
::
VarSlider
(
0
,
100
,
isZ
,
"Scale Z"
)))
,
"Scaling view"
);
float
sx
=
scaleRealSlideVal
(
isX
);
float
sy
=
scaleRealSlideVal
(
isY
);
...
...
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