DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CanonicDigitalSurfaceEmbedder.ih
1 
29 
30 // IMPLEMENTATION of inline methods.
32 
34 #include <cstdlib>
35 #include <cmath>
36 #include "DGtal/kernel/NumberTraits.h"
38 
39 
40 
42 // Implementation of inline methods //
43 //-----------------------------------------------------------------------------
44 template <typename TDigitalSurface>
45 inline
48 {}
49 //-----------------------------------------------------------------------------
50 template <typename TDigitalSurface>
51 inline
54  : mySurface( 0 )
55 {}
56 //-----------------------------------------------------------------------------
57 template <typename TDigitalSurface>
58 inline
61  : mySurface( &aSurface )
62 {}
63 //-----------------------------------------------------------------------------
64 template <typename TDigitalSurface>
65 inline
68  : mySurface( other.mySurface )
69 {}
70 //-----------------------------------------------------------------------------
71 template <typename TDigitalSurface>
72 inline
75 operator=( const Self & other )
76 {
77  mySurface = other.mySurface;
78  return *this;
79 }
80 //-----------------------------------------------------------------------------
81 template <typename TDigitalSurface>
82 inline
85 {
86  ASSERT( this->isValid() );
87  return *mySurface;
88 }
89 //-----------------------------------------------------------------------------
90 template <typename TDigitalSurface>
91 inline
94 {
95  return this->operator()( scell );
96 }
97 //-----------------------------------------------------------------------------
98 template <typename TDigitalSurface>
99 inline
102 {
103  ASSERT( this->isValid() );
104  Point dp = mySurface->container().space().sKCoords( scell );
105  RealPoint p;
106  for ( Dimension i = 0; i < dp.size(); ++i )
107  p[ i ] = NumberTraits<Integer>::castToDouble( dp[ i ] ) / 2;
108  return p;
109 }
110 //-----------------------------------------------------------------------------
111 template <typename TDigitalSurface>
112 inline
113 bool
115 {
116  return mySurface != 0;
117 }
119 // Implementation of inline functions and external operators //
120 
127 template <typename TDigitalSurface>
128 inline
129 std::ostream&
130 DGtal::operator<< ( std::ostream & out,
132 {
133  object.selfDisplay ( out );
134  return out;
135 }
136 
137 // //
139 
140