1 #ifndef __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__HXX__
2 #define __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__HXX__
4 // -------------------------------------------------------------------------
5 template< unsigned int D >
7 void cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
8 SetCenter( const P& p )
10 for( unsigned int d = 0; d < D; ++d )
11 this->m_Center[ d ] = ScalarType( p[ d ] );
15 // -------------------------------------------------------------------------
16 template< unsigned int D >
18 void cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
19 SetNormal( const N& n )
21 for( unsigned int d = 0; d < D; ++d )
22 this->m_Normal[ d ] = ScalarType( n[ d ] );
23 ScalarType nn = this->m_Normal.GetNorm( );
24 if( nn > ScalarType( 0 ) )
29 // -------------------------------------------------------------------------
30 template< unsigned int D >
31 bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
33 const PointType& point, double& value, unsigned int depth, char* name
36 value = this->m_Normal * ( point - this->m_Center );
37 return( value >= double( 0 ) );
40 // -------------------------------------------------------------------------
41 template< unsigned int D >
42 bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
44 const PointType& point, unsigned int depth, char* name
48 return( this->ValueAt( point, value, depth, name ) );
51 // -------------------------------------------------------------------------
52 template< unsigned int D >
53 bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
55 const PointType& point, unsigned int depth, char* name
59 return( this->ValueAt( point, value, depth, name ) );
62 // -------------------------------------------------------------------------
63 template< unsigned int D >
64 bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
65 IsInside( const PointType& point ) const
68 return( this->ValueAt( point, value, 0, NULL ) );
71 // -------------------------------------------------------------------------
72 template< unsigned int D >
73 bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
74 ComputeLocalBoundingBox( ) const
79 // -------------------------------------------------------------------------
80 template< unsigned int D >
81 cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
82 InfinitePlaneSpatialObject( )
85 this->m_Center.Fill( ScalarType( 0 ) );
86 this->m_Normal.Fill( ScalarType( 0 ) );
87 this->m_Normal[ 0 ] = ScalarType( 1 );
90 // -------------------------------------------------------------------------
91 template< unsigned int D >
92 cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
93 ~InfinitePlaneSpatialObject( )
97 // -------------------------------------------------------------------------
98 template< unsigned int D >
99 void cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
100 PrintSelf( std::ostream& os, itk::Indent indent ) const
102 this->Superclass::PrintSelf( os, indent );
103 os << indent << "Center: " << this->m_Center << std::endl;
104 os << indent << "Normal: " << this->m_Normal << std::endl;
107 #endif // __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__HXX__