Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
SuperElastix
Commits
eb744278
Commit
eb744278
authored
Feb 02, 2016
by
Floris Berendsen
Browse files
ENH: renamed ConnectFrom to AcceptConnectionFrom
And added Fixed/Moving image interfaces
parent
4ae7eee3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Modules/Core/ComponentInterface/include/ComponentBase.h
View file @
eb744278
...
...
@@ -36,8 +36,8 @@ namespace selx
enum
interfaceStatus
{
success
,
noaccepter
,
noprovider
};
virtual
interfaceStatus
ConnectFrom
(
const
char
*
,
ComponentBase
*
)
=
0
;
virtual
int
ConnectFrom
(
ComponentBase
*
)
=
0
;
virtual
interfaceStatus
Accept
Connect
ion
From
(
const
char
*
,
ComponentBase
*
)
=
0
;
virtual
int
Accept
Connect
ion
From
(
ComponentBase
*
)
=
0
;
/** if there is any failed criterion, return false (like a short - circuit AND) */
bool
MeetsCriteria
(
const
CriteriaType
&
criteria
);
...
...
Modules/Core/ComponentInterface/include/Interfaces.h
View file @
eb744278
...
...
@@ -59,6 +59,20 @@ namespace selx
virtual
typename
itk
::
ImageSource
<
itk
::
Image
<
TPixel
,
Dimensionality
>>::
Pointer
GetItkImageSource
()
=
0
;
};
template
<
int
Dimensionality
,
class
TPixel
>
class
itkImageSourceMovingInterface
{
// An interface that exposes that its internal filter which is derived from itkImageSource
public:
virtual
typename
itk
::
ImageSource
<
itk
::
Image
<
TPixel
,
Dimensionality
>>::
Pointer
GetItkImageSourceMoving
()
=
0
;
};
template
<
int
Dimensionality
,
class
TPixel
>
class
itkImageSourceFixedInterface
{
// An interface that exposes that its internal filter which is derived from itkImageSource
public:
virtual
typename
itk
::
ImageSource
<
itk
::
Image
<
TPixel
,
Dimensionality
>>::
Pointer
GetItkImageSourceFixed
()
=
0
;
};
class
SourceInterface
{
// A special interface: the Overlord checks components for this type of interface.
// By this interface only Source Components can to talk to the Overlord.
...
...
@@ -136,8 +150,8 @@ template<typename AcceptingInterfaces, typename ProvidingInterfaces>
class
Implements
:
public
AcceptingInterfaces
,
public
ProvidingInterfaces
,
public
ComponentBase
{
public:
virtual
interfaceStatus
ConnectFrom
(
const
char
*
,
ComponentBase
*
);
virtual
int
ConnectFrom
(
ComponentBase
*
);
virtual
interfaceStatus
Accept
Connect
ion
From
(
const
char
*
,
ComponentBase
*
);
virtual
int
Accept
Connect
ion
From
(
ComponentBase
*
);
protected:
virtual
bool
HasAcceptingInterface
(
const
char
*
);
virtual
bool
HasProvidingInterface
(
const
char
*
);
...
...
Modules/Core/ComponentInterface/include/Interfaces.hxx
View file @
eb744278
...
...
@@ -20,13 +20,13 @@ int InterfaceAcceptor<InterfaceT>::Connect(ComponentBase* providerComponent){
}
//////////////////////////////////////////////////////////////////////////
template
<
typename
AcceptingInterfaces
,
typename
ProvidingInterfaces
>
ComponentBase
::
interfaceStatus
Implements
<
AcceptingInterfaces
,
ProvidingInterfaces
>::
ConnectFrom
(
const
char
*
interfacename
,
ComponentBase
*
other
)
ComponentBase
::
interfaceStatus
Implements
<
AcceptingInterfaces
,
ProvidingInterfaces
>::
Accept
Connect
ion
From
(
const
char
*
interfacename
,
ComponentBase
*
other
)
{
return
AcceptingInterfaces
::
ConnectFromImpl
(
interfacename
,
other
);
}
template
<
typename
AcceptingInterfaces
,
typename
ProvidingInterfaces
>
int
Implements
<
AcceptingInterfaces
,
ProvidingInterfaces
>::
ConnectFrom
(
ComponentBase
*
other
)
int
Implements
<
AcceptingInterfaces
,
ProvidingInterfaces
>::
Accept
Connect
ion
From
(
ComponentBase
*
other
)
{
return
AcceptingInterfaces
::
ConnectFromImpl
(
other
);
}
...
...
Write
Preview
Supports
Markdown
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