Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
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
Model registry
Operate
Environments
Monitor
Incidents
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
Larry Price
gmsh
Commits
77cffba5
Commit
77cffba5
authored
16 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
quick hack for Ruth: sync rotation/scale between windows (press Alt
while clicking on rotation/1:1 button in status bar)
parent
2a895819
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Fltk/graphicWindow.cpp
+37
-11
37 additions, 11 deletions
Fltk/graphicWindow.cpp
doc/TODO.txt
+6
-1
6 additions, 1 deletion
doc/TODO.txt
with
43 additions
and
12 deletions
Fltk/graphicWindow.cpp
+
37
−
11
View file @
77cffba5
...
@@ -111,14 +111,24 @@ void status_xyz1p_cb(Fl_Widget *w, void *data)
...
@@ -111,14 +111,24 @@ void status_xyz1p_cb(Fl_Widget *w, void *data)
for
(
unsigned
int
i
=
0
;
i
<
gls
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
gls
.
size
();
i
++
){
drawContext
*
ctx
=
gls
[
i
]
->
getDrawContext
();
drawContext
*
ctx
=
gls
[
i
]
->
getDrawContext
();
if
(
!
strcmp
(
str
,
"r"
)){
// rotate 90 degress around axis perp to the screen
if
(
!
strcmp
(
str
,
"r"
)){
// rotate +90 or -90 (shift) degress around axis perp to the
// screen, or sync rotation with first window (alt)
double
axis
[
3
]
=
{
0.
,
0.
,
1.
};
double
axis
[
3
]
=
{
0.
,
0.
,
1.
};
if
(
!
Fl
::
event_state
(
FL_SHIFT
))
if
(
Fl
::
event_state
(
FL_ALT
)){
if
(
i
!=
0
){
drawContext
*
ctx0
=
gls
[
0
]
->
getDrawContext
();
ctx
->
setQuaternion
(
ctx0
->
quaternion
[
0
],
ctx0
->
quaternion
[
1
],
ctx0
->
quaternion
[
2
],
ctx0
->
quaternion
[
3
]);
}
}
else
if
(
!
Fl
::
event_state
(
FL_SHIFT
))
ctx
->
addQuaternionFromAxisAndAngle
(
axis
,
-
90.
);
ctx
->
addQuaternionFromAxisAndAngle
(
axis
,
-
90.
);
else
else
ctx
->
addQuaternionFromAxisAndAngle
(
axis
,
90.
);
ctx
->
addQuaternionFromAxisAndAngle
(
axis
,
90.
);
}
}
else
if
(
!
strcmp
(
str
,
"x"
)){
// X pointing out or into the screen
else
if
(
!
strcmp
(
str
,
"x"
)){
// set X-axis pointing out or into (shift) the screen
if
(
!
Fl
::
event_state
(
FL_SHIFT
)){
if
(
!
Fl
::
event_state
(
FL_SHIFT
)){
ctx
->
r
[
0
]
=
-
90.
;
ctx
->
r
[
1
]
=
0.
;
ctx
->
r
[
2
]
=
-
90.
;
ctx
->
r
[
0
]
=
-
90.
;
ctx
->
r
[
1
]
=
0.
;
ctx
->
r
[
2
]
=
-
90.
;
}
}
...
@@ -127,7 +137,8 @@ void status_xyz1p_cb(Fl_Widget *w, void *data)
...
@@ -127,7 +137,8 @@ void status_xyz1p_cb(Fl_Widget *w, void *data)
}
}
ctx
->
setQuaternionFromEulerAngles
();
ctx
->
setQuaternionFromEulerAngles
();
}
}
else
if
(
!
strcmp
(
str
,
"y"
)){
// Y pointing out or into the screen
else
if
(
!
strcmp
(
str
,
"y"
)){
// set Y-axis pointing out or into (shift) the screen
if
(
!
Fl
::
event_state
(
FL_SHIFT
)){
if
(
!
Fl
::
event_state
(
FL_SHIFT
)){
ctx
->
r
[
0
]
=
-
90.
;
ctx
->
r
[
1
]
=
0.
;
ctx
->
r
[
2
]
=
180.
;
ctx
->
r
[
0
]
=
-
90.
;
ctx
->
r
[
1
]
=
0.
;
ctx
->
r
[
2
]
=
180.
;
}
}
...
@@ -136,7 +147,8 @@ void status_xyz1p_cb(Fl_Widget *w, void *data)
...
@@ -136,7 +147,8 @@ void status_xyz1p_cb(Fl_Widget *w, void *data)
}
}
ctx
->
setQuaternionFromEulerAngles
();
ctx
->
setQuaternionFromEulerAngles
();
}
}
else
if
(
!
strcmp
(
str
,
"z"
)){
// Z pointing out or into the screen
else
if
(
!
strcmp
(
str
,
"z"
)){
// set Z-axis pointing out or into (shift) the screen
if
(
!
Fl
::
event_state
(
FL_SHIFT
)){
if
(
!
Fl
::
event_state
(
FL_SHIFT
)){
ctx
->
r
[
0
]
=
0.
;
ctx
->
r
[
1
]
=
0.
;
ctx
->
r
[
2
]
=
0.
;
ctx
->
r
[
0
]
=
0.
;
ctx
->
r
[
1
]
=
0.
;
ctx
->
r
[
2
]
=
0.
;
}
}
...
@@ -145,11 +157,25 @@ void status_xyz1p_cb(Fl_Widget *w, void *data)
...
@@ -145,11 +157,25 @@ void status_xyz1p_cb(Fl_Widget *w, void *data)
}
}
ctx
->
setQuaternionFromEulerAngles
();
ctx
->
setQuaternionFromEulerAngles
();
}
}
else
if
(
!
strcmp
(
str
,
"1:1"
)){
// reset translation and scaling
else
if
(
!
strcmp
(
str
,
"1:1"
)){
ctx
->
t
[
0
]
=
ctx
->
t
[
1
]
=
ctx
->
t
[
2
]
=
0.
;
// reset translation and scaling, or sync translation and
ctx
->
s
[
0
]
=
ctx
->
s
[
1
]
=
ctx
->
s
[
2
]
=
1.
;
// scaling with the first window (alt)
if
(
Fl
::
event_state
(
FL_ALT
)){
if
(
i
!=
0
){
drawContext
*
ctx0
=
gls
[
0
]
->
getDrawContext
();
for
(
int
j
=
0
;
j
<
3
;
j
++
){
ctx
->
t
[
j
]
=
ctx0
->
t
[
j
];
ctx
->
s
[
j
]
=
ctx0
->
s
[
j
];
}
}
}
else
{
ctx
->
t
[
0
]
=
ctx
->
t
[
1
]
=
ctx
->
t
[
2
]
=
0.
;
ctx
->
s
[
0
]
=
ctx
->
s
[
1
]
=
ctx
->
s
[
2
]
=
1.
;
}
}
}
else
if
(
!
strcmp
(
str
,
"reset"
)){
// reset everything
else
if
(
!
strcmp
(
str
,
"reset"
)){
// reset everything
ctx
->
t
[
0
]
=
ctx
->
t
[
1
]
=
ctx
->
t
[
2
]
=
0.
;
ctx
->
t
[
0
]
=
ctx
->
t
[
1
]
=
ctx
->
t
[
2
]
=
0.
;
ctx
->
s
[
0
]
=
ctx
->
s
[
1
]
=
ctx
->
s
[
2
]
=
1.
;
ctx
->
s
[
0
]
=
ctx
->
s
[
1
]
=
ctx
->
s
[
2
]
=
1.
;
ctx
->
r
[
0
]
=
ctx
->
r
[
1
]
=
ctx
->
r
[
2
]
=
0.
;
ctx
->
r
[
0
]
=
ctx
->
r
[
1
]
=
ctx
->
r
[
2
]
=
0.
;
...
@@ -360,11 +386,11 @@ graphicWindow::graphicWindow(bool main, int numTiles)
...
@@ -360,11 +386,11 @@ graphicWindow::graphicWindow(bool main, int numTiles)
x
+=
sw
;
x
+=
sw
;
butt
[
4
]
=
new
Fl_Button
(
x
,
glheight
+
2
,
sw
,
sht
,
"@-1gmsh_rotate"
);
butt
[
4
]
=
new
Fl_Button
(
x
,
glheight
+
2
,
sw
,
sht
,
"@-1gmsh_rotate"
);
butt
[
4
]
->
callback
(
status_xyz1p_cb
,
(
void
*
)
"r"
);
butt
[
4
]
->
callback
(
status_xyz1p_cb
,
(
void
*
)
"r"
);
butt
[
4
]
->
tooltip
(
"Rotate +90 or -90
degrees
"
);
butt
[
4
]
->
tooltip
(
"Rotate +90 or -90
(Shift) degrees, or sync rotations (Alt)
"
);
x
+=
sw
;
x
+=
sw
;
butt
[
3
]
=
new
Fl_Button
(
x
,
glheight
+
2
,
2
*
FL_NORMAL_SIZE
,
sht
,
"1:1"
);
butt
[
3
]
=
new
Fl_Button
(
x
,
glheight
+
2
,
2
*
FL_NORMAL_SIZE
,
sht
,
"1:1"
);
butt
[
3
]
->
callback
(
status_xyz1p_cb
,
(
void
*
)
"1:1"
);
butt
[
3
]
->
callback
(
status_xyz1p_cb
,
(
void
*
)
"1:1"
);
butt
[
3
]
->
tooltip
(
"Set unit scale"
);
butt
[
3
]
->
tooltip
(
"Set unit scale
, or sync scale (Alt)
"
);
x
+=
2
*
FL_NORMAL_SIZE
;
x
+=
2
*
FL_NORMAL_SIZE
;
butt
[
8
]
=
new
Fl_Button
(
x
,
glheight
+
2
,
sw
,
sht
,
"@-1gmsh_ortho"
);
butt
[
8
]
=
new
Fl_Button
(
x
,
glheight
+
2
,
sw
,
sht
,
"@-1gmsh_ortho"
);
butt
[
8
]
->
callback
(
status_options_cb
,
(
void
*
)
"p"
);
butt
[
8
]
->
callback
(
status_options_cb
,
(
void
*
)
"p"
);
...
...
This diff is collapsed.
Click to expand it.
doc/TODO.txt
+
6
−
1
View file @
77cffba5
$Id: TODO.txt,v 1.17 2009-02-05 06:47:19 geuzaine Exp $
$Id: TODO.txt,v 1.18 2009-03-01 18:27:01 geuzaine Exp $
********************************************************************
Store Octree in PViewDataList and modify OctreePost to use it (the
same way PViewDataGModel uses the Octree stored in GModel)
********************************************************************
********************************************************************
...
...
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