Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ImageINSA_Tanguy
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
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
Tanguy.Raufflet
ImageINSA_Tanguy
Commits
abfbe8ea
Commit
abfbe8ea
authored
12 years ago
by
Sacha Percot-Tétu
Browse files
Options
Downloads
Patches
Plain Diff
Improved the operation's output
parent
7d3a20a1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/Operation.h
+16
-6
16 additions, 6 deletions
core/Operation.h
core/PlugOperation.cpp
+4
-6
4 additions, 6 deletions
core/PlugOperation.cpp
core/PlugOperation.h
+1
-1
1 addition, 1 deletion
core/PlugOperation.h
with
21 additions
and
13 deletions
core/Operation.h
+
16
−
6
View file @
abfbe8ea
...
...
@@ -27,30 +27,40 @@
#include
"Image.h"
class
QWidget
;
class
EIImageService
;
namespace
genericinterface
{
class
ImageWindow
;
}
class
GenericOperation
{
public:
GenericOperation
(
std
::
string
name
)
:
_name
(
name
)
{}
GenericOperation
(
std
::
string
name
)
:
_name
(
name
)
,
_ws
(
NULL
)
{}
inline
std
::
string
getName
()
{
return
_name
;
}
virtual
std
::
vector
<
QWidget
*>
operator
()(
const
genericinterface
::
ImageWindow
*
currentWnd
,
std
::
map
<
const
genericinterface
::
ImageWindow
*
,
std
::
string
>&
)
=
0
;
virtual
void
operator
()(
const
genericinterface
::
ImageWindow
*
currentWnd
,
std
::
vector
<
genericinterface
::
ImageWindow
*>&
)
=
0
;
virtual
void
operator
()(
EIImageService
*
);
virtual
bool
needCurrentImg
()
const
=
0
;
virtual
bool
isValidImgWnd
(
const
genericinterface
::
ImageWindow
*
imgWnd
)
const
=
0
;
protected
:
void
outImage
(
imagein
::
Image
*
,
std
::
string
title
=
""
);
void
outDoubleImage
(
imagein
::
Image_t
<
double
>*
,
std
::
string
title
=
""
,
bool
norm
=
false
,
bool
log
=
false
);
void
outText
(
std
::
string
);
std
::
string
_name
;
EIImageService
*
_ws
;
private
:
void
outImgWnd
(
genericinterface
::
ImageWindow
*
imgWnd
,
std
::
string
title
);
};
class
Operation
:
public
GenericOperation
{
public:
Operation
(
std
::
string
name
)
:
GenericOperation
(
name
)
{}
virtual
std
::
vector
<
QWidget
*>
operator
()(
const
genericinterface
::
ImageWindow
*
currentWnd
,
std
::
map
<
const
genericinterface
::
ImageWindow
*
,
std
::
string
>&
);
virtual
std
::
vector
<
QWidget
*>
operator
()(
const
imagein
::
Image
*
,
const
std
::
map
<
const
imagein
::
Image
*
,
std
::
string
>&
)
=
0
;
virtual
void
operator
()(
const
genericinterface
::
ImageWindow
*
currentWnd
,
std
::
vector
<
genericinterface
::
ImageWindow
*>&
);
virtual
void
operator
()(
const
imagein
::
Image
*
,
const
std
::
map
<
const
imagein
::
Image
*
,
std
::
string
>&
)
=
0
;
virtual
bool
isValidImgWnd
(
const
genericinterface
::
ImageWindow
*
imgWnd
)
const
;
protected
:
imagein
::
Image
*
_currentImg
;
...
...
@@ -59,8 +69,8 @@ class Operation : public GenericOperation {
class
DoubleOperation
:
public
GenericOperation
{
public:
DoubleOperation
(
std
::
string
name
)
:
GenericOperation
(
name
)
{}
virtual
std
::
vector
<
QWidget
*>
operator
()(
const
genericinterface
::
ImageWindow
*
currentWnd
,
std
::
map
<
const
genericinterface
::
ImageWindow
*
,
std
::
string
>&
);
virtual
std
::
vector
<
QWidget
*>
operator
()(
const
imagein
::
Image_t
<
double
>*
,
const
std
::
map
<
const
imagein
::
Image_t
<
double
>*
,
std
::
string
>&
)
=
0
;
virtual
void
operator
()(
const
genericinterface
::
ImageWindow
*
currentWnd
,
std
::
vector
<
genericinterface
::
ImageWindow
*>&
);
virtual
void
operator
()(
const
imagein
::
Image_t
<
double
>*
,
const
std
::
map
<
const
imagein
::
Image_t
<
double
>*
,
std
::
string
>&
)
=
0
;
virtual
bool
isValidImgWnd
(
const
genericinterface
::
ImageWindow
*
imgWnd
)
const
;
protected
:
imagein
::
Image_t
<
double
>*
_currentImg
;
...
...
This diff is collapsed.
Click to expand it.
core/PlugOperation.cpp
+
4
−
6
View file @
abfbe8ea
...
...
@@ -44,11 +44,10 @@ void PlugOperation::addOutput(const Output& output) {
}
std
::
vector
<
QWidget
*>
PlugOperation
::
operator
()(
const
Image
*
currentImg
,
const
std
::
map
<
const
Image
*
,
std
::
string
>&
)
{
vector
<
QWidget
*>
result
;
void
PlugOperation
::
operator
()(
const
Image
*
currentImg
,
const
std
::
map
<
const
Image
*
,
std
::
string
>&
)
{
if
(
this
->
needCurrentImg
())
{
if
(
currentImg
==
NULL
)
return
result
;
if
(
currentImg
==
NULL
)
return
;
*
_currentImg
=
*
currentImg
;
}
...
...
@@ -72,7 +71,7 @@ std::vector<QWidget*> PlugOperation::operator()(const Image* currentImg, const s
cout
<<
code
<<
endl
;
if
(
code
!=
QDialog
::
Accepted
)
{
return
result
;
return
;
}
for
(
vector
<
Input
*>::
iterator
it
=
_inputs
.
begin
();
it
<
_inputs
.
end
();
++
it
)
{
...
...
@@ -85,7 +84,6 @@ std::vector<QWidget*> PlugOperation::operator()(const Image* currentImg, const s
this
->
operation
();
for
(
vector
<
Output
*>::
iterator
it
=
_outputs
.
begin
();
it
<
_outputs
.
end
();
++
it
)
{
result
.
push_back
((
*
it
)
->
getWidget
());
//
result.push_back((*it)->getWidget());
}
return
result
;
}
This diff is collapsed.
Click to expand it.
core/PlugOperation.h
+
1
−
1
View file @
abfbe8ea
...
...
@@ -44,7 +44,7 @@ class PlugOperation : public Operation {
public
:
PlugOperation
(
std
::
string
name
);
std
::
vector
<
QWidget
*>
operator
()(
const
imagein
::
Image
*
,
const
std
::
map
<
const
imagein
::
Image
*
,
std
::
string
>&
);
void
operator
()(
const
imagein
::
Image
*
,
const
std
::
map
<
const
imagein
::
Image
*
,
std
::
string
>&
);
inline
bool
needCurrentImg
()
{
return
_needCurrentImg
;
}
...
...
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