Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
25027100
Commit
25027100
authored
Oct 30, 2008
by
Julien Michel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: Adding antoher constructor to specify a different source to watch
parent
4fc9a572
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
96 additions
and
4 deletions
+96
-4
Code/Common/otbStandardWriterWatcher.cxx
Code/Common/otbStandardWriterWatcher.cxx
+8
-0
Code/Common/otbStandardWriterWatcher.h
Code/Common/otbStandardWriterWatcher.h
+2
-0
Code/Common/otbWriterWatcherBase.cxx
Code/Common/otbWriterWatcherBase.cxx
+55
-0
Code/Common/otbWriterWatcherBase.h
Code/Common/otbWriterWatcherBase.h
+5
-1
Code/Gui/otbFltkWriterWatcher.cxx
Code/Gui/otbFltkWriterWatcher.cxx
+19
-3
Code/Gui/otbFltkWriterWatcher.h
Code/Gui/otbFltkWriterWatcher.h
+7
-0
No files found.
Code/Common/otbStandardWriterWatcher.cxx
View file @
25027100
...
@@ -31,6 +31,14 @@ StandardWriterWatcher
...
@@ -31,6 +31,14 @@ StandardWriterWatcher
m_StarsCount
=
50
;
m_StarsCount
=
50
;
}
}
StandardWriterWatcher
::
StandardWriterWatcher
(
itk
::
ProcessObject
*
process
,
itk
::
ProcessObject
*
source
,
const
char
*
comment
)
:
WriterWatcherBase
(
process
,
source
,
comment
)
{
m_StarsCount
=
50
;
}
StandardWriterWatcher
StandardWriterWatcher
::
StandardWriterWatcher
(
const
StandardWriterWatcher
&
watch
)
::
StandardWriterWatcher
(
const
StandardWriterWatcher
&
watch
)
{
{
...
...
Code/Common/otbStandardWriterWatcher.h
View file @
25027100
...
@@ -54,6 +54,8 @@ namespace otb
...
@@ -54,6 +54,8 @@ namespace otb
* comment string that is prepended to each event message. */
* comment string that is prepended to each event message. */
StandardWriterWatcher
(
itk
::
ProcessObject
*
process
,
StandardWriterWatcher
(
itk
::
ProcessObject
*
process
,
const
char
*
comment
=
""
);
const
char
*
comment
=
""
);
StandardWriterWatcher
(
itk
::
ProcessObject
*
process
,
itk
::
ProcessObject
*
source
,
const
char
*
comment
=
""
);
/** Copy constructor */
/** Copy constructor */
StandardWriterWatcher
(
const
StandardWriterWatcher
&
);
StandardWriterWatcher
(
const
StandardWriterWatcher
&
);
...
...
Code/Common/otbWriterWatcherBase.cxx
View file @
25027100
...
@@ -88,6 +88,61 @@ WriterWatcherBase
...
@@ -88,6 +88,61 @@ WriterWatcherBase
}
}
}
}
WriterWatcherBase
::
WriterWatcherBase
(
itk
::
ProcessObject
*
process
,
itk
::
ProcessObject
*
source
,
const
char
*
comment
)
{
// Initialize state
m_Process
=
process
;
m_Comment
=
comment
;
// Create a series of commands
m_StartWriterCommand
=
CommandType
::
New
();
m_EndWriterCommand
=
CommandType
::
New
();
m_ProgressWriterCommand
=
CommandType
::
New
();
m_StartFilterCommand
=
CommandType
::
New
();
m_EndFilterCommand
=
CommandType
::
New
();
m_ProgressFilterCommand
=
CommandType
::
New
();
// Assign the callbacks
m_StartFilterCommand
->
SetCallbackFunction
(
this
,
&
WriterWatcherBase
::
StartFilter
);
m_EndFilterCommand
->
SetCallbackFunction
(
this
,
&
WriterWatcherBase
::
EndFilter
);
m_ProgressFilterCommand
->
SetCallbackFunction
(
this
,
&
WriterWatcherBase
::
ShowFilterProgress
);
m_StartWriterCommand
->
SetCallbackFunction
(
this
,
&
WriterWatcherBase
::
StartWriter
);
m_EndWriterCommand
->
SetCallbackFunction
(
this
,
&
WriterWatcherBase
::
EndWriter
);
m_ProgressWriterCommand
->
SetCallbackFunction
(
this
,
&
WriterWatcherBase
::
ShowWriterProgress
);
// Add the commands as observers
m_StartWriterTag
=
m_Process
->
AddObserver
(
itk
::
StartEvent
(),
m_StartWriterCommand
);
m_EndWriterTag
=
m_Process
->
AddObserver
(
itk
::
EndEvent
(),
m_EndWriterCommand
);
m_ProgressWriterTag
=
m_Process
->
AddObserver
(
itk
::
ProgressEvent
(),
m_ProgressWriterCommand
);
m_SourceProcess
=
source
;
m_SourceProcess
=
m_Process
->
GetInputs
()[
0
]
->
GetSource
();
// Add the commands as observers
m_StartFilterTag
=
m_SourceProcess
->
AddObserver
(
itk
::
StartEvent
(),
m_StartFilterCommand
);
m_EndFilterTag
=
m_SourceProcess
->
AddObserver
(
itk
::
EndEvent
(),
m_EndFilterCommand
);
m_ProgressFilterTag
=
m_SourceProcess
->
AddObserver
(
itk
::
ProgressEvent
(),
m_ProgressFilterCommand
);
}
WriterWatcherBase
WriterWatcherBase
::
WriterWatcherBase
(
const
WriterWatcherBase
&
watch
)
::
WriterWatcherBase
(
const
WriterWatcherBase
&
watch
)
{
{
...
...
Code/Common/otbWriterWatcherBase.h
View file @
25027100
...
@@ -49,7 +49,11 @@ namespace otb
...
@@ -49,7 +49,11 @@ namespace otb
* comment string that is prepended to each event message. */
* comment string that is prepended to each event message. */
WriterWatcherBase
(
itk
::
ProcessObject
*
process
,
WriterWatcherBase
(
itk
::
ProcessObject
*
process
,
const
char
*
comment
=
""
);
const
char
*
comment
=
""
);
/** This other constructor is provided so that the user can set a different processing filter than the one
just before process in the pipeline */
WriterWatcherBase
(
itk
::
ProcessObject
*
process
,
itk
::
ProcessObject
*
source
,
const
char
*
comment
=
""
);
/** Default constructor */
/** Default constructor */
WriterWatcherBase
();
WriterWatcherBase
();
...
...
Code/Gui/otbFltkWriterWatcher.cxx
View file @
25027100
...
@@ -29,10 +29,27 @@ FltkWriterWatcher
...
@@ -29,10 +29,27 @@ FltkWriterWatcher
const
char
*
comment
)
const
char
*
comment
)
:
WriterWatcherBase
(
process
,
comment
)
:
WriterWatcherBase
(
process
,
comment
)
{
{
m_Window
=
new
Fl_Window
(
x
,
y
,
w
+
10
,
h
+
15
);
this
->
BuildGUI
(
x
,
y
,
w
,
h
,
comment
);
}
FltkWriterWatcher
::
FltkWriterWatcher
(
itk
::
ProcessObject
*
process
,
itk
::
ProcessObject
*
source
,
int
x
,
int
y
,
int
w
,
int
h
,
const
char
*
comment
)
:
WriterWatcherBase
(
process
,
source
,
comment
)
{
this
->
BuildGUI
(
x
,
y
,
w
,
h
,
comment
);
}
void
FltkWriterWatcher
::
BuildGUI
(
int
x
,
int
y
,
int
w
,
int
h
,
const
char
*
comment
)
{
m_Window
=
new
Fl_Window
(
x
,
y
,
w
+
10
,
h
+
15
);
m_Window
->
label
(
m_Comment
.
c_str
());
m_Window
->
label
(
m_Comment
.
c_str
());
m_Window
->
begin
();
m_Window
->
begin
();
m_FilterProgress
=
new
Fl_Progress
(
5
,
5
,
w
,
h
/
2
);
m_FilterProgress
=
new
Fl_Progress
(
5
,
5
,
w
,
h
/
2
);
m_FilterProgress
->
selection_color
(
FL_DARK_BLUE
);
m_FilterProgress
->
selection_color
(
FL_DARK_BLUE
);
m_FilterProgress
->
minimum
(
0
);
m_FilterProgress
->
minimum
(
0
);
...
@@ -47,7 +64,6 @@ FltkWriterWatcher
...
@@ -47,7 +64,6 @@ FltkWriterWatcher
m_WriterProgress
->
label
(
"writing"
);
m_WriterProgress
->
label
(
"writing"
);
m_WriterProgress
->
align
(
FL_ALIGN_INSIDE
);
m_WriterProgress
->
align
(
FL_ALIGN_INSIDE
);
m_Window
->
end
();
m_Window
->
end
();
}
}
FltkWriterWatcher
FltkWriterWatcher
...
...
Code/Gui/otbFltkWriterWatcher.h
View file @
25027100
...
@@ -46,6 +46,12 @@ public:
...
@@ -46,6 +46,12 @@ public:
FltkWriterWatcher
(
itk
::
ProcessObject
*
process
,
FltkWriterWatcher
(
itk
::
ProcessObject
*
process
,
int
x
,
int
y
,
int
w
,
int
h
,
int
x
,
int
y
,
int
w
,
int
h
,
const
char
*
comment
=
""
);
const
char
*
comment
=
""
);
FltkWriterWatcher
(
itk
::
ProcessObject
*
process
,
itk
::
ProcessObject
*
source
,
int
x
,
int
y
,
int
w
,
int
h
,
const
char
*
comment
=
""
);
/** Destructor. */
/** Destructor. */
virtual
~
FltkWriterWatcher
();
virtual
~
FltkWriterWatcher
();
...
@@ -98,6 +104,7 @@ protected:
...
@@ -98,6 +104,7 @@ protected:
m_WriterProgress
->
show
();
m_WriterProgress
->
show
();
}
}
void
BuildGUI
(
int
x
,
int
y
,
int
w
,
int
h
,
const
char
*
comment
);
private:
private:
...
...
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