Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plugin-Plane
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
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
OpenFlipper-Free
Plugin-Plane
Commits
9d0682ea
Commit
9d0682ea
authored
4 years ago
by
Zain Selman
Browse files
Options
Downloads
Patches
Plain Diff
additional cleanup
parent
7f582102
No related branches found
No related tags found
1 merge request
!2
Plane interaction
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
PlanePlugin.cc
+1
-14
1 addition, 14 deletions
PlanePlugin.cc
PlanePlugin.hh
+3
-2
3 additions, 2 deletions
PlanePlugin.hh
with
4 additions
and
16 deletions
PlanePlugin.cc
+
1
−
14
View file @
9d0682ea
...
...
@@ -182,16 +182,6 @@ void PlanePlugin::slotMouseEvent(QMouseEvent *_event) {
origPlane_
=
curPlane_
->
plane
();
QPoint
position
=
_event
->
pos
();
/// view coords in screenspace, with flipped y-axis at depth of
/// plane
const
auto
viewCoords
=
ACG
::
Vec3d
(
position
.
x
(),
PluginFunctions
::
viewerProperties
().
glState
().
context_height
()
-
position
.
y
(),
.5
);
viewStartCoord_
=
viewCoords
;
/// obtain the ray for intersecting with the quad/plane
ACG
::
Vec3d
origin
;
PluginFunctions
::
viewerProperties
().
glState
().
viewing_ray
(
...
...
@@ -284,7 +274,6 @@ void PlanePlugin::slotMouseEvent(QMouseEvent *_event) {
const
auto
xscale
=
scale
[
0
]
*
plane
.
xDirection
.
length
();
const
auto
yscale
=
scale
[
1
]
*
plane
.
yDirection
.
length
();
plane
.
setSize
(
xscale
,
yscale
);
plane
.
position
+=
worldSpaceUpdate
;
curPlane_
->
plane
()
=
plane
;
/// overwrite plane
...
...
@@ -292,19 +281,17 @@ void PlanePlugin::slotMouseEvent(QMouseEvent *_event) {
if
(
lastObjId_
>
0
)
emit
updatedObject
(
lastObjId_
,
UPDATE_GEOMETRY
);
else
std
::
cerr
<<
"COULD NOT UPDATE OBJECT"
<<
std
::
endl
;
emit
log
(
LOGERR
,
tr
(
"COULD NOT UPDATE OBJECT"
))
;
}
break
;
}
case
QEvent
::
MouseButtonRelease
:
{
std
::
cerr
<<
"Mouse_Release"
<<
std
::
endl
;
// Stop dragging operation reset all properties
dragging_
=
false
;
pickedCorner_
=
0
;
wMouseDownPosition_
=
ACG
::
Vec3d
{
.0
};
viewStartCoord_
=
ACG
::
Vec3d
{
.0
};
curPlane_
=
nullptr
;
lastObjId_
=
-
1
;
...
...
This diff is collapsed.
Click to expand it.
PlanePlugin.hh
+
3
−
2
View file @
9d0682ea
...
...
@@ -135,6 +135,7 @@ private:
QAction
*
planeNodeAction_
;
/// additional information
// In Picking Mode for plane resize, are we currently dragging or not
bool
dragging_
;
...
...
@@ -144,12 +145,12 @@ private:
// world space coords of the dragging start position (through raycast)
ACG
::
Vec3d
wMouseDownPosition_
{
.0
};
ACG
::
Vec3d
wCurrMousePos_
{
.0
};
// view space coords of the dragging start position
ACG
::
Vec3d
viewStartCoord_
{
.0
};
ACG
::
Vec3d
viewDirection_
{
.0
};
// currently dragged plane
PlaneObject
*
curPlane_
=
nullptr
;
// copy of the plane, to avoid getting lost in floating point error realm
Plane
origPlane_
;
// needed for notifying the renderer to draw the plane correctly
int
lastObjId_
=
-
1
;
/** @} */
...
...
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