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
Main Repositories
otb
Commits
295518ab
Commit
295518ab
authored
Aug 25, 2016
by
Stéphane Albert
Browse files
ENH: Moved otb::DynamicCast<> and otb::ConstCast<> into Core/Common module.
parent
df049a1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Modules/
Visualization/MonteverdiCore
/include/
itk
Cast
s
.h
→
Modules/
Core/Common
/include/
otb
Cast.h
View file @
295518ab
/*=========================================================================
* TODO: Add licence notice.
*=======================================================================*/
// Submitted by Stéphane ALBERT (otb.salbert@gmail.com).
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 __
itk
Cast
s
_h
#define __
itk
Cast
s
_h
#ifndef __
otb
Cast_h
#define __
otb
Cast_h
#include
"itkSmartPointer.h"
namespace
itk
namespace
otb
{
/**
* \brief dynamic_cast<>() like operator to work with itk::SmartPointer<>.
...
...
@@ -79,6 +91,6 @@ ConstCast( const itk::SmartPointer< const T1 > & p1 )
);
}
}
// end namespace
itk
.
}
// end namespace
otb
.
#endif // __
itk
Cast
s
_h
#endif // __
otb
Cast_h
Modules/Visualization/MonteverdiCore/include/mvdTypes.h
View file @
295518ab
...
...
@@ -51,73 +51,16 @@
//
// OTB includes (sorted by alphabetic order)
#ifndef Q_MOC_RUN // See: https://bugreports.qt-project.org/browse/QTBUG-22829 //tag=QT4-boost-compatibility
#ifndef Q_MOC_RUN // See:
// https://bugreports.qt-project.org/browse/QTBUG-22829
// //tag=QT4-boost-compatibility
#include
<otbCast.h>
#include
<otbImage.h>
#include
<otbImageFileReader.h>
#include
<otbImageFileWriter.h>
#include
<otbVectorImage.h>
#endif //tag=QT4-boost-compatibility
////
//// O T B
////
// TODO: Contribute to OTB!
namespace
otb
{
/**
*/
template
<
typename
T2
,
typename
T1
>
inline
itk
::
SmartPointer
<
T2
>
DynamicCast
(
const
itk
::
SmartPointer
<
T1
>&
p1
)
{
return
typename
itk
::
SmartPointer
<
T2
>
(
dynamic_cast
<
typename
itk
::
SmartPointer
<
T2
>::
ObjectType
*
>
(
p1
.
GetPointer
()
)
);
}
/**
*/
template
<
typename
T2
,
typename
T1
>
inline
itk
::
SmartPointer
<
const
T2
>
ConstCast
(
const
itk
::
SmartPointer
<
T1
>&
p1
)
{
return
typename
itk
::
SmartPointer
<
const
T2
>
(
const_cast
<
typename
itk
::
SmartPointer
<
const
T2
>::
ObjectType
*
>
(
p1
.
GetPointer
()
)
);
}
/**
*/
template
<
typename
T2
,
typename
T1
>
inline
itk
::
SmartPointer
<
T2
>
ConstCast
(
const
itk
::
SmartPointer
<
const
T1
>&
p1
)
{
return
typename
itk
::
SmartPointer
<
T2
>
(
const_cast
<
typename
itk
::
SmartPointer
<
T2
>::
ObjectType
*
>
(
p1
.
GetPointer
()
)
);
}
}
// end of namespace otb.
////
//// M V D 2
////
//
// Monteverdi includes (sorted by alphabetic order)
...
...
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