Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
a80d296b
Commit
a80d296b
authored
14 years ago
by
Tobias Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
add clipping widget to menubar
parent
0b2cccfb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/gfx/pymod/export_scene.cc
+1
-0
1 addition, 0 deletions
modules/gfx/pymod/export_scene.cc
modules/gfx/src/scene.hh
+3
-0
3 additions, 0 deletions
modules/gfx/src/scene.hh
modules/gui/pymod/dng/menu.py
+64
-0
64 additions, 0 deletions
modules/gui/pymod/dng/menu.py
with
68 additions
and
0 deletions
modules/gfx/pymod/export_scene.cc
+
1
−
0
View file @
a80d296b
...
...
@@ -81,6 +81,7 @@ void export_Scene()
.
def
(
"Autoslab"
,
&
Scene
::
Autoslab
,
scene_autoslab_overloads
())
.
def
(
"AutoAutoslab"
,
&
Scene
::
AutoAutoslab
)
.
def
(
"GetAutoAutoslab"
,
&
Scene
::
GetAutoAutoslab
)
.
def
(
"AutoslabMax"
,
&
Scene
::
AutoslabMax
)
.
def
(
"Remove"
,
remove1
)
.
def
(
"Remove"
,
remove2
)
...
...
This diff is collapsed.
Click to expand it.
modules/gfx/src/scene.hh
+
3
−
0
View file @
a80d296b
...
...
@@ -181,6 +181,9 @@ class DLLEXPORT_OST_GFX Scene {
void
AutoAutoslab
(
bool
f
);
//@}
/// \brief get current state of automatic auto-slabbing
bool
GetAutoAutoslab
()
const
{
return
auto_autoslab_
;
}
/// \brief set stereo mode
/// one of 0 (off), 1 (quad-buffered) 2 (interlaced (for special monitors))
void
SetStereoMode
(
unsigned
int
mode
);
...
...
This diff is collapsed.
Click to expand it.
modules/gui/pymod/dng/menu.py
+
64
−
0
View file @
a80d296b
...
...
@@ -24,7 +24,66 @@ class FileMenu(QMenu):
'
%s.pdb
'
%
sel_node
.
name
)
io
.
SavePDB
(
sel_node
.
view
,
str
(
filename
))
class
ClipWidget
(
QWidget
):
def
__init__
(
self
,
width
=
500
,
height
=
500
):
QWidget
.
__init__
(
self
)
self
.
setWindowFlags
(
Qt
.
Tool
)
l
=
QGridLayout
(
self
)
l
.
addWidget
(
QLabel
(
"
Near
"
),
0
,
0
)
l
.
addWidget
(
QLabel
(
"
Far
"
),
1
,
0
)
bounds_near
=
QLineEdit
(
str
(
0
))
bounds_near
.
setValidator
(
QIntValidator
(
0
,
9999
,
bounds_near
))
bounds_near
.
setMaxLength
(
4
)
bounds_near
.
setMaximumWidth
(
50
)
bounds_far
=
QLineEdit
(
str
(
200
))
bounds_far
.
setValidator
(
QIntValidator
(
0
,
9999
,
bounds_far
))
bounds_far
.
setMaxLength
(
4
)
bounds_far
.
setMaximumWidth
(
50
)
l
.
addWidget
(
bounds_near
,
0
,
1
,
2
,
1
)
l
.
addWidget
(
bounds_far
,
0
,
3
,
2
,
1
)
self
.
near_
=
QSlider
(
Qt
.
Horizontal
)
self
.
near_
.
setMinimum
(
int
(
bounds_near
.
text
()))
self
.
near_
.
setMaximum
(
int
(
bounds_far
.
text
()))
self
.
near_
.
setValue
(
int
(
gfx
.
Scene
().
near
))
self
.
far_
=
QSlider
(
Qt
.
Horizontal
)
self
.
far_
.
setMinimum
(
int
(
bounds_near
.
text
()))
self
.
far_
.
setMaximum
(
int
(
bounds_far
.
text
()))
far
=
int
(
gfx
.
Scene
().
far
)
if
far
>
sys
.
maxint
:
far
=
sys
.
maxint
self
.
far_
.
setValue
(
far
)
self
.
auto_
=
QCheckBox
(
"
Continuous Automatic Clipping
"
)
self
.
auto_
.
setChecked
(
gfx
.
Scene
().
GetAutoAutoslab
())
l
.
addWidget
(
self
.
near_
,
0
,
2
)
l
.
addWidget
(
self
.
far_
,
1
,
2
)
l
.
addWidget
(
self
.
auto_
,
2
,
0
,
1
,
4
)
self
.
connect
(
self
.
near_
,
SIGNAL
(
'
valueChanged(int)
'
),
self
.
SetNear
)
self
.
connect
(
self
.
far_
,
SIGNAL
(
'
valueChanged(int)
'
),
self
.
SetFar
)
self
.
connect
(
self
.
auto_
,
SIGNAL
(
'
stateChanged(int)
'
),
self
.
SetAuto
)
self
.
connect
(
bounds_near
,
SIGNAL
(
'
textEdited(QString)
'
),
self
.
SetNearBounds
)
self
.
connect
(
bounds_far
,
SIGNAL
(
'
textEdited(QString)
'
),
self
.
SetFarBounds
)
def
SetNear
(
self
,
val
):
gfx
.
Scene
().
near
=
val
def
SetFar
(
self
,
val
):
gfx
.
Scene
().
far
=
val
def
SetAuto
(
self
,
val
):
gfx
.
Scene
().
AutoAutoslab
(
val
)
gfx
.
Scene
().
near
=
int
(
self
.
near_
.
value
())
gfx
.
Scene
().
far
=
int
(
self
.
far_
.
value
())
def
SetNearBounds
(
self
,
text
):
if
text
!=
''
:
self
.
near_
.
setMinimum
(
int
(
text
))
self
.
far_
.
setMinimum
(
int
(
text
))
def
SetFarBounds
(
self
,
text
):
if
text
!=
''
:
self
.
near_
.
setMaximum
(
int
(
text
))
self
.
far_
.
setMaximum
(
int
(
text
))
class
ExportSceneDialog
(
QDialog
):
def
__init__
(
self
,
width
=
500
,
height
=
500
):
...
...
@@ -76,6 +135,7 @@ class SceneMenu(QMenu):
gui
.
AddMenuAction
(
self
,
'
Fit To Screen
'
,
self
.
_FitToScreen
,
enabled
=
gui
.
OneOf
(
gfx
.
Entity
))
gui
.
AddMenuAction
(
self
,
'
Save Snapshot
'
,
self
.
_ExportScene
)
gui
.
AddMenuAction
(
self
,
'
Scene Clipping
'
,
self
.
_ClipScene
,
shortcut
=
'
Ctrl+Shift+C
'
)
def
_ExportScene
(
self
):
qd
=
ExportSceneDialog
()
...
...
@@ -86,6 +146,10 @@ class SceneMenu(QMenu):
if
filename
:
gfx
.
Scene
().
Export
(
str
(
filename
),
qd
.
width
,
qd
.
height
,
qd
.
transparent
)
def
_ClipScene
(
self
):
self
.
cw
=
ClipWidget
()
self
.
cw
.
show
()
def
_AboutToShow
(
self
):
self
.
fog_action
.
setChecked
(
gfx
.
Scene
().
fog
)
...
...
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