Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
213
Issues
213
List
Boards
Labels
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
3507ce17
Commit
3507ce17
authored
Feb 27, 2014
by
Stéphane Albert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: Implemented mouse-click and -move in Quicklook-view.
parent
25af7ab3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
92 additions
and
28 deletions
+92
-28
Code/Application/Monteverdi2/mvdMainWindow.cxx
Code/Application/Monteverdi2/mvdMainWindow.cxx
+24
-1
Code/Common/Gui/mvdAbstractImageViewManipulator.h
Code/Common/Gui/mvdAbstractImageViewManipulator.h
+11
-6
Code/Common/Gui/mvdImageViewManipulator.h
Code/Common/Gui/mvdImageViewManipulator.h
+3
-3
Code/Common/Gui/mvdImageViewWidget.cxx
Code/Common/Gui/mvdImageViewWidget.cxx
+12
-2
Code/Common/Gui/mvdImageViewWidget.h
Code/Common/Gui/mvdImageViewWidget.h
+6
-1
Code/Common/Gui/mvdQuicklookViewManipulator.cxx
Code/Common/Gui/mvdQuicklookViewManipulator.cxx
+33
-14
Code/Common/Gui/mvdQuicklookViewManipulator.h
Code/Common/Gui/mvdQuicklookViewManipulator.h
+3
-1
No files found.
Code/Application/Monteverdi2/mvdMainWindow.cxx
View file @
3507ce17
...
...
@@ -474,6 +474,14 @@ MainWindow
//
// Connect image-views for ROI-changed events.
assert
(
m_ImageView
!=
NULL
);
const
AbstractImageViewManipulator
*
imageViewManipulator
=
m_ImageView
->
GetManipulator
();
assert
(
imageViewManipulator
!=
NULL
);
ImageViewWidget
*
quicklookView
=
GetQuicklookView
();
assert
(
quicklookView
!=
NULL
);
...
...
@@ -482,7 +490,6 @@ MainWindow
assert
(
quicklookManipulator
!=
NULL
);
assert
(
m_ImageView
!=
NULL
);
QObject
::
connect
(
m_ImageView
,
...
...
@@ -495,6 +502,22 @@ MainWindow
OnRoiChanged
(
const
PointType
&
,
const
SizeType
&
,
const
SpacingType
&
)
)
);
QObject
::
connect
(
quicklookView
,
SIGNAL
(
CenterRoiRequested
(
const
PointType
&
)
),
// to:
imageViewManipulator
,
SLOT
(
CenterOn
(
const
PointType
&
)
)
);
QObject
::
connect
(
quicklookManipulator
,
SIGNAL
(
RefreshViewRequested
()
),
// to:
m_ImageView
,
SLOT
(
updateGL
()
)
);
}
#endif // USE_ICE_IMAGE_VIEW
...
...
Code/Common/Gui/mvdAbstractImageViewManipulator.h
View file @
3507ce17
...
...
@@ -121,9 +121,6 @@ public:
SetupRenderingContext
(
AbstractImageViewRenderer
::
RenderingContext
*
const
)
const
=
0
;
/**
*/
virtual
void
CenterOn
(
const
PointType
&
point
)
=
0
;
/**
*/
virtual
void
ZoomIn
()
=
0
;
...
...
@@ -160,6 +157,9 @@ public:
//
// Public SLOTS.
public
slots
:
/**
*/
virtual
void
CenterOn
(
const
PointType
&
point
)
=
0
;
/*-[ SIGNALS SECTION ]-----------------------------------------------------*/
...
...
@@ -169,15 +169,20 @@ signals:
/**
*/
void
RefreshViewRequested
();
/**
*/
void
RoiChanged
(
PointType
origin
,
SizeType
size
,
SpacingType
spacing
);
/**
*/
void
ZoomToExtentRequested
();
/**
*/
void
ZoomToFullResolutionRequested
();
/**
*/
void
CenterRoiRequested
(
const
PointType
&
center
);
/**
*/
void
RoiChanged
(
const
PointType
&
origin
,
const
SizeType
&
size
,
const
SpacingType
&
spacing
);
/*-[ PROTECTED SECTION ]---------------------------------------------------*/
...
...
Code/Common/Gui/mvdImageViewManipulator.h
View file @
3507ce17
...
...
@@ -186,6 +186,9 @@ protected:
/**
*/
QPoint
m_MousePressPosition
;
/**
*/
otb
::
ViewSettings
::
Pointer
m_ViewSettings
;
/*-[ PRIVATE SLOTS SECTION ]-----------------------------------------------*/
...
...
@@ -213,9 +216,6 @@ private:
//
// Private attributes.
private:
/**
*/
otb
::
ViewSettings
::
Pointer
m_ViewSettings
;
/**
*/
otb
::
ViewSettings
::
PointType
m_MousePressOrigin
;
...
...
Code/Common/Gui/mvdImageViewWidget.cxx
View file @
3507ce17
...
...
@@ -188,9 +188,19 @@ ImageViewWidget
);
QObject
::
connect
(
m_Manipulator
,
SIGNAL
(
RoiChanged
(
PointType
,
SizeType
,
SpacingType
)
),
m_Manipulator
,
SIGNAL
(
CenterRoiRequested
(
const
PointType
&
)
),
// to:
this
,
SIGNAL
(
RoiChanged
(
PointType
,
SizeType
,
SpacingType
)
)
this
,
SIGNAL
(
CenterRoiRequested
(
const
PointType
&
)
)
);
QObject
::
connect
(
m_Manipulator
,
SIGNAL
(
RoiChanged
(
const
PointType
&
,
const
SizeType
&
,
const
SpacingType
&
)
),
// to:
this
,
SIGNAL
(
RoiChanged
(
const
PointType
&
,
const
SizeType
&
,
const
SpacingType
&
)
)
);
QObject
::
connect
(
...
...
Code/Common/Gui/mvdImageViewWidget.h
View file @
3507ce17
...
...
@@ -162,7 +162,12 @@ public slots:
signals:
/**
*/
void
RoiChanged
(
PointType
origin
,
SizeType
size
,
SpacingType
spacing
);
void
CenterRoiRequested
(
const
PointType
&
center
);
/**
*/
void
RoiChanged
(
const
PointType
&
origin
,
const
SizeType
&
size
,
const
SpacingType
&
spacing
);
/*-[ PROTECTED SECTION ]---------------------------------------------------*/
...
...
Code/Common/Gui/mvdQuicklookViewManipulator.cxx
View file @
3507ce17
...
...
@@ -138,7 +138,25 @@ QuicklookViewManipulator
// qDebug() << this << ":" << event;
Qt
::
MouseButtons
buttons
=
event
->
buttons
();
Qt
::
KeyboardModifiers
modifiers
=
event
->
modifiers
();
if
(
buttons
==
Qt
::
LeftButton
&&
modifiers
==
Qt
::
NoModifier
)
{
assert
(
!
m_ViewSettings
.
IsNull
()
);
PointType
center
;
m_ViewSettings
->
ScreenToViewPortTransform
(
static_cast
<
double
>
(
m_MousePressPosition
.
x
()
),
static_cast
<
double
>
(
m_MousePressPosition
.
y
()
),
center
[
0
],
center
[
1
]
);
emit
CenterRoiRequested
(
center
);
}
}
/******************************************************************************/
...
...
@@ -155,21 +173,20 @@ QuicklookViewManipulator
if
(
buttons
==
Qt
::
LeftButton
&&
modifiers
==
Qt
::
NoModifier
)
{
// Cursor moves from press position to current position;
// Image moves the same direction, so apply the negative translation.
m_RoiOrigin
=
ImageViewManipulator
::
Translate
(
event
->
pos
()
-
m_MousePressPosition
,
m_RoiOrigin
,
m_RoiSpacing
);
assert
(
!
m_ViewSettings
.
IsNull
()
);
m_MousePressPosition
=
event
->
pos
();
PointType
center
;
m_ViewSettings
->
ScreenToViewPortTransform
(
static_cast
<
double
>
(
m_MousePressPosition
.
x
()
),
static_cast
<
double
>
(
m_MousePressPosition
.
y
()
),
center
[
0
],
center
[
1
]
);
emit
RefreshViewRequested
();
m_MousePressPosition
=
event
->
pos
();
emit
RoiChanged
(
m_RoiOrigin
,
m_RoiSize
,
m_RoiSpacing
);
emit
CenterRoiRequested
(
center
);
}
}
...
...
@@ -228,7 +245,9 @@ QuicklookViewManipulator
/*****************************************************************************/
void
QuicklookViewManipulator
::
OnRoiChanged
(
PointType
origin
,
SizeType
size
,
SpacingType
spacing
)
::
OnRoiChanged
(
const
PointType
&
origin
,
const
SizeType
&
size
,
const
SpacingType
&
spacing
)
{
qDebug
()
<<
this
<<
":OnRoiChanged()"
;
qDebug
()
<<
"origin :"
<<
origin
[
0
]
<<
","
<<
origin
[
1
];
...
...
Code/Common/Gui/mvdQuicklookViewManipulator.h
View file @
3507ce17
...
...
@@ -173,7 +173,9 @@ private:
private
slots
:
/**
*/
void
OnRoiChanged
(
PointType
origin
,
SizeType
size
,
SpacingType
spacing
);
void
OnRoiChanged
(
const
PointType
&
origin
,
const
SizeType
&
size
,
const
SpacingType
&
spacing
);
};
}
// end namespace 'mvd'
...
...
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