Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
c512d102
Commit
c512d102
authored
18 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
Oubli.
parent
aec8abdf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Visu/otbImageViewerFullWidget.h
+135
-0
135 additions, 0 deletions
Code/Visu/otbImageViewerFullWidget.h
with
135 additions
and
0 deletions
Code/Visu/otbImageViewerFullWidget.h
0 → 100644
+
135
−
0
View file @
c512d102
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef _otbImageViewerFullWidget_h
#define _otbImageViewerFullWidget_h
#include
"otbFullResolutionImageWidget.h"
namespace
otb
{
template
<
class
TPixel
>
class
ImageViewer
;
template
<
class
TPixel
>
class
ITK_EXPORT
ImageViewerFullWidget
:
public
FullResolutionImageWidget
<
TPixel
>
{
public:
/** Standard class typedefs */
typedef
ImageViewerFullWidget
Self
;
typedef
FullResolutionImageWidget
<
TPixel
>
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
/** Method for creation through the object factory. */
itkNewMacro
(
Self
);
/** Run-time type information (and related methods). */
itkTypeMacro
(
ImageViewerFullWidget
,
FullResolutionImageWidget
);
typedef
TPixel
PixelType
;
typedef
typename
Superclass
::
IndexType
IndexType
;
typedef
typename
Superclass
::
SizeType
SizeType
;
typedef
ImageViewer
<
PixelType
>
ParentType
;
typedef
typename
ParentType
::
Pointer
ParentPointerType
;
itkSetObjectMacro
(
Parent
,
ParentType
);
itkGetObjectMacro
(
Parent
,
ParentType
);
/** Handle method */
virtual
int
handle
(
int
event
)
{
switch
(
event
)
{
case
FL_PUSH
:
{
int
x
=
Fl
::
event_x
();
int
y
=
Fl
::
event_y
();
IndexType
clickedIndex
;
clickedIndex
[
0
]
=
x
;
clickedIndex
[
1
]
=
y
;
clickedIndex
=
this
->
WindowToImageCoordinates
(
clickedIndex
);
m_Parent
->
ChangeZoomViewedRegion
(
clickedIndex
);
return
1
;
}
case
FL_ENTER
:
{
m_MouseIn
=
true
;
return
1
;
}
case
FL_LEAVE
:
{
m_MouseIn
=
false
;
m_Parent
->
PrintPixLocVal
(
""
);
return
1
;
}
case
FL_MOVE
:
{
m_MouseIn
=
true
;
if
(
m_MouseMoveCount
%
m_ValueUpdateFrequency
==
0
)
{
m_MousePos
[
0
]
=
Fl
::
event_x
();
m_MousePos
[
1
]
=
Fl
::
event_y
();
std
::
stringstream
oss
;
IndexType
newIndex
=
this
->
WindowToImageCoordinates
(
m_MousePos
);
oss
<<
"Location: "
<<
newIndex
<<
", Values: "
<<
this
->
GetInput
()
->
GetPixel
(
newIndex
);
m_Parent
->
PrintPixLocVal
(
oss
.
str
());
m_MouseMoveCount
=
0
;
}
m_MouseMoveCount
++
;
return
1
;
}
}
return
0
;
}
virtual
void
resize
(
int
x
,
int
y
,
int
w
,
int
h
)
{
Superclass
::
resize
(
x
,
y
,
w
,
h
);
if
(
m_Parent
->
GetBuilt
())
m_Parent
->
UpdateScrollWidget
();
}
protected
:
/**
* Constructor.
*/
ImageViewerFullWidget
()
{
m_MouseIn
=
false
;
m_MousePos
.
Fill
(
0
);
m_MouseMoveCount
=
0
;
m_ValueUpdateFrequency
=
5
;
};
/**
* Destructor.
*/
~
ImageViewerFullWidget
(){};
private
:
ParentPointerType
m_Parent
;
IndexType
m_MousePos
;
bool
m_MouseIn
;
unsigned
int
m_MouseMoveCount
;
unsigned
int
m_ValueUpdateFrequency
;
};
}
// end namespace otb
#endif
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