Skip to content

Commit

Permalink
Merge pull request InsightSoftwareConsortium#10 from HastingsGreer/co…
Browse files Browse the repository at this point in the history
…mpilererrors2

 COMP: Various compiler errors
  • Loading branch information
aylward authored Feb 12, 2019
2 parents 33b245f + 33383c4 commit 3c5dd49
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 115 deletions.
4 changes: 2 additions & 2 deletions Modules/Core/SpatialObjects/include/itkDTITubeSpatialObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class ITK_TEMPLATE_EXPORT DTITubeSpatialObject:
using ConstPointer = SmartPointer< const Self >;

using DTITubePointType = DTITubeSpatialObjectPoint< TDimension >;

using DTITubePointListType = std::list< DTITubeSpatialObjectPoint< TDimension> >;

using PointType = typename Superclass::PointType;
using PointListType = typename Superclass::PointListType;
using TransformType = typename Superclass::TransformType;
using SpatialObjectPointType = typename Superclass::SpatialObjectPointType;
using PointContainerType = VectorContainer< IdentifierType, PointType >;
Expand Down
2 changes: 0 additions & 2 deletions Modules/Core/SpatialObjects/include/itkGroupSpatialObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ class ITK_TEMPLATE_EXPORT GroupSpatialObject:
using Pointer = SmartPointer< Self >;
using ConstPointer = SmartPointer< const Self >;
using ScalarType = double;
using TreeNodeType = typename Superclass::TreeNodeType;
using TreeNodeChildrenListType = typename TreeNodeType::ChildrenListType;

/** Method for creation through the object factory. */
itkNewMacro(Self);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ITK_TEMPLATE_EXPORT PointBasedSpatialObject:
using TransformType = typename Superclass::TransformType;
using VectorType = typename Superclass::VectorType;
using CovariantVectorType = typename Superclass::CovariantVectorType;

using BoundingBoxType = typename Superclass::BoundingBoxType;
/** Method for creation through the object factory. */
itkNewMacro(Self);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PointBasedSpatialObject< TDimension, TSpatialObjectPointType >
::~PointBasedSpatialObject() = default;


/** Print the object */
/** Set Points from a list */
template< unsigned int TDimension, class TSpatialObjectPointType >
void
PointBasedSpatialObject< TDimension, TSpatialObjectPointType >
Expand Down Expand Up @@ -82,7 +82,7 @@ PointBasedSpatialObject< TDimension, TSpatialObjectPointType >
typename SpatialObjectPoint< TDimension >::PointType curpos =
this->GetObjectToWorldTransform()->TransformPoint(
( *it ).GetPositionInObjectSpace() );
double curdistance = curpos.EuclideanDistanceTo(curPoint);
double curdistance = curpos.EuclideanDistanceTo(point);
if ( curdistance < closestPointDistance )
{
closestPoint = &(*it);
Expand Down Expand Up @@ -134,13 +134,13 @@ PointBasedSpatialObject< TDimension, TSpatialObjectPointType >
static_cast<typename PointsContainer::ElementIdentifier>(
corners->size() ) );

auto it = corners->begin();
auto itCorners = corners->begin();
auto itTrans = transformedCorners->begin();
while ( it != corners->end() )
while ( itCorners != corners->end() )
{
PointType pnt = this->GetObjectToWorldTransform()->TransformPoint(*it);
PointType pnt = this->GetObjectToWorldTransform()->TransformPoint(*itCorners);
*itTrans = pnt;
++it;
++itCorners;
++itTrans;
}

Expand Down Expand Up @@ -174,7 +174,7 @@ PointBasedSpatialObject< TDimension, TSpatialObjectPointType >
while ( it != itEnd )
{
bool equals = true;
for( unsigned int i=0; i<ObjectDimension; ++i )
for( unsigned int i=0; i<TDimension; ++i )
{
if( ! Math::AlmostEquals( transformedPoint[i],
it->GetPositionInObjectSpace()[i] ) )
Expand Down
10 changes: 5 additions & 5 deletions Modules/Core/SpatialObjects/include/itkSpatialObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,7 @@ class ITK_TEMPLATE_EXPORT SpatialObject:
* and conditional iterators for defining regions of interest.
*/
bool Evaluate(const PointType & point) const
{
return this->IsInside(point);
}
{ return this->IsInside(point); }


protected:
Expand All @@ -486,9 +484,11 @@ class ITK_TEMPLATE_EXPORT SpatialObject:

itkSetMacro(TypeName, std::string);

itkGetModifiableObjectMacro(MyBoundingBox, BoundingBoxType);
virtual BoundingBoxType * GetModifiableMyBoundingBox()
{ return m_MyBoundingBox.GetPointer(); }

itkGetModifiableObjectMacro(FamilyBoundingBox, BoundingBoxType);
virtual BoundingBoxType * GetModifiableFamilyBoundingBox()
{ return m_FamilyBoundingBox.GetPointer(); }

private:

Expand Down
25 changes: 13 additions & 12 deletions Modules/Core/SpatialObjects/include/itkSpatialObject.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <algorithm>
#include <string>
#include "itkMath.h"
#include "itkImageBase.h"

namespace itk
{
Expand Down Expand Up @@ -352,7 +353,7 @@ SpatialObject< TDimension >
typename ChildrenListType::iterator it = m_ChildrenList.begin();
while( it != m_ChildrenList.end() )
{
Self * oldChild = (*it)->Get();
Self * oldChild = (*it);
it = m_ChildrenList.erase( it );
oldChild->SetParent( nullptr );
if( depth > 0 )
Expand All @@ -379,8 +380,8 @@ SpatialObject< TDimension >
throw e;
}

m_ObjectToParentTransform->CopyInFixedParameters( transform );
m_ObjectToParentTransform->CopyInParameters( transform );
m_ObjectToParentTransform->SetFixedParameters( transform->GetFixedParameters() );
m_ObjectToParentTransform->SetParameters( transform->GetParameters() );

ComputeObjectToWorldTransform();

Expand All @@ -398,10 +399,10 @@ void
SpatialObject< TDimension >
::ComputeObjectToWorldTransform()
{
m_ObjectToWorldTransform->CopyInFixedParameters(
this->GetObjectToParentTransform() );
m_ObjectToWorldTransform->CopyInParameters(
this->GetObjectToParentTransform() );
m_ObjectToWorldTransform->SetFixedParameters(
this->GetObjectToParentTransform()->GetFixedParameters() );
m_ObjectToWorldTransform->SetParameters(
this->GetObjectToParentTransform()->GetFixedParameters() );
if( this->HasParent() )
{
m_ObjectToWorldTransform->Compose( this->GetParent()->
Expand Down Expand Up @@ -455,8 +456,8 @@ SpatialObject< TDimension >
throw e;
}

m_ObjectToWorldTransform->CopyInFixedParameters( transform );
m_ObjectToWorldTransform->CopyInParameters( transform );
m_ObjectToWorldTransform->SetFixedParameters(transform->GetFixedParameters());
m_ObjectToWorldTransform->SetParameters( transform->GetParameters());

ComputeObjectToParentTransform();
}
Expand All @@ -468,8 +469,8 @@ void
SpatialObject< TDimension >
::ComputeObjectToParentTransform()
{
m_ObjectToParentTransform->CopyInFixedParameters( m_ObjectToWorldTransform );
m_ObjectToParentTransform->CopyInParameters( m_ObjectToWorldTransform );
m_ObjectToParentTransform->SetFixedParameters( m_ObjectToWorldTransform->GetFixedParameters() );
m_ObjectToParentTransform->SetParameters( m_ObjectToWorldTransform->GetParameters() );

if( this->HasParent() )
{
Expand Down Expand Up @@ -1107,7 +1108,7 @@ SpatialObject< TDimension >
::SetRequestedRegion(const DataObject *data)
{
const auto * soData = dynamic_cast< const SpatialObject * >( data );
const auto * imgData = dynamic_cast< const ImageBase * >( data );
const auto * imgData = dynamic_cast< const ImageBase<TDimension> * >( data );

if( soData != nullptr )
{
Expand Down
11 changes: 7 additions & 4 deletions Modules/Core/SpatialObjects/include/itkSpatialObjectPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "vnl/vnl_vector_fixed.h"
#include "itkRGBAPixel.h"


namespace itk
{
/** \class SpatialObjectPoint
Expand All @@ -35,8 +36,10 @@ namespace itk
* \ingroup ITKSpatialObjects
*/

template< unsigned int TPointDimension = 3,
class TSpatialObjectType = SpatialObject< TPointDimension> >
template < unsigned int TDimension, class TSpatialObjectPointType>
class PointBasedSpatialObject;

template< unsigned int TPointDimension = 3>
class ITK_TEMPLATE_EXPORT SpatialObjectPoint
{
public:
Expand All @@ -49,7 +52,7 @@ class ITK_TEMPLATE_EXPORT SpatialObjectPoint

using Self = SpatialObjectPoint;

using SpatialObjectType = TSpatialObjectType;
using SpatialObjectType = PointBasedSpatialObject<TPointDimension, Self>;

using PointType = Point< double, TPointDimension >;
using VectorType = vnl_vector< double >;
Expand Down Expand Up @@ -142,7 +145,7 @@ class ITK_TEMPLATE_EXPORT SpatialObjectPoint
virtual void PrintSelf(std::ostream & os, Indent indent) const;

/** A unique ID assigned to this SpatialObjectPoint */
int m_ID;
int m_Id;

/** Position of the point */
PointType m_PositionInObjectSpace;
Expand Down
28 changes: 14 additions & 14 deletions Modules/Core/SpatialObjects/include/itkSpatialObjectPoint.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
namespace itk
{
/** Constructor */
template< unsigned int TPointDimension, class TSpatialObjectType >
SpatialObjectPoint< TPointDimension, TSpatialObjectType >
template< unsigned int TPointDimension >
SpatialObjectPoint< TPointDimension >
::SpatialObjectPoint()
{
m_Id = -1;
Expand All @@ -39,9 +39,9 @@ SpatialObjectPoint< TPointDimension, TSpatialObjectType >
m_SpatialObject = nullptr;
}

template< unsigned int TPointDimension, class TSpatialObjectType >
template< unsigned int TPointDimension >
void
SpatialObjectPoint< TPointDimension, TSpatialObjectType >
SpatialObjectPoint< TPointDimension >
::SetPosition( const PointType & point )
{
if( m_SpatialObject == nullptr )
Expand All @@ -56,9 +56,9 @@ SpatialObjectPoint< TPointDimension, TSpatialObjectType >
GetInverseTransform()->TransformPoint( point );
}

template< unsigned int TPointDimension, class TSpatialObjectType >
typename SpatialObjectPoint< TPointDimension, TSpatialObjectType >::PointType
SpatialObjectPoint< TPointDimension, TSpatialObjectType >
template< unsigned int TPointDimension >
typename SpatialObjectPoint< TPointDimension >::PointType
SpatialObjectPoint< TPointDimension >
::GetPosition() const
{
if( m_SpatialObject == nullptr )
Expand All @@ -74,9 +74,9 @@ SpatialObjectPoint< TPointDimension, TSpatialObjectType >
}

/** Set the color of the point */
template< unsigned int TPointDimension, class TSpatialObjectType >
template< unsigned int TPointDimension >
void
SpatialObjectPoint< TPointDimension, TSpatialObjectType >
SpatialObjectPoint< TPointDimension >
::SetColor(float r, float g, float b, float a)
{
m_Color.SetRed(r);
Expand All @@ -85,9 +85,9 @@ SpatialObjectPoint< TPointDimension, TSpatialObjectType >
m_Color.SetAlpha(a);
}

template< unsigned int TPointDimension, class TSpatialObjectType >
typename SpatialObjectPoint< TPointDimension, TSpatialObjectType >::Self &
SpatialObjectPoint< TPointDimension, TSpatialObjectType >
template< unsigned int TPointDimension >
typename SpatialObjectPoint< TPointDimension >::Self &
SpatialObjectPoint< TPointDimension >
::operator=(const SpatialObjectPoint & rhs)
{
if(this != &rhs)
Expand All @@ -101,9 +101,9 @@ SpatialObjectPoint< TPointDimension, TSpatialObjectType >


/** PrintSelfMethod */
template< unsigned int TPointDimension, class TSpatialObjectType >
template< unsigned int TPointDimension >
void
SpatialObjectPoint< TPointDimension, TSpatialObjectType >
SpatialObjectPoint< TPointDimension >
::PrintSelf(std::ostream & os, Indent indent) const
{
os << indent << "Id: " << m_Id << std::endl;
Expand Down
5 changes: 3 additions & 2 deletions Modules/Core/SpatialObjects/include/itkTubeSpatialObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ class ITK_TEMPLATE_EXPORT TubeSpatialObject:

/** Returns true if the point is inside the tube, false otherwise. */
bool IsInside(const PointType & point, unsigned int depth = 0,
const std::string & name) const override;
const std::string & name = "") const override;

void DeepCopy( const TubeSpatialObject * tube );

void DeepCopy( const DataObject * tube );

protected:
int m_ParentPoint;
Expand Down
Loading

0 comments on commit 3c5dd49

Please sign in to comment.