DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SurfelAdjacency.ih
1 
29 
30 // IMPLEMENTATION of inline methods.
32 
34 #include <cstdlib>
36 
37 
38 
40 // Implementation of inline methods //
41 //-----------------------------------------------------------------------------
42 template <Dimension dim>
43 inline
46 {}
47 //-----------------------------------------------------------------------------
48 template <Dimension dim>
49 inline
51 SurfelAdjacency( bool int2ext )
52  : myInt2Ext()
53 {
54  Dimension offset = 0;
55  for ( Dimension j = 0; j < dim; ++j )
56  for ( Dimension i = 0; i < dim; ++i )
57  myInt2Ext[ offset++ ] = int2ext;
58 }
59 
60 //-----------------------------------------------------------------------------
61 template <Dimension dim>
62 inline
65  : myInt2Ext( other.myInt2Ext )
66 {
67 }
68 //-----------------------------------------------------------------------------
69 template <Dimension dim>
70 inline
73 operator= ( const SurfelAdjacency & other )
74 {
75  if ( this != &other )
76  myInt2Ext = other.myInt2Ext;
77  return *this;
78 }
79 //-----------------------------------------------------------------------------
80 template <Dimension dim>
81 inline
82 void
84 setAdjacency( Dimension i, Dimension j, bool int2ext )
85 {
86  myInt2Ext[ i * dim + j ] = int2ext;
87  myInt2Ext[ j * dim + i ] = int2ext;
88 }
89 //-----------------------------------------------------------------------------
90 template <Dimension dim>
91 inline
92 bool
95 {
96  return myInt2Ext[ i * dim + j ];
97 }
98 //-----------------------------------------------------------------------------
99 template <Dimension dim>
100 inline
101 void
103 selfDisplay ( std::ostream & out ) const
104 {
105  out << "[SurfelAdjacency]";
106 }
107 //-----------------------------------------------------------------------------
108 template <Dimension dim>
109 inline
110 bool
112 isValid() const
113 {
114  return true;
115 }
116 
117 
118 
120 // Implementation of inline functions and external operators //
121 
128 template <Dimension dim>
129 inline
130 std::ostream&
131 DGtal::operator<< ( std::ostream & out,
132  const SurfelAdjacency<dim> & object )
133 {
134  object.selfDisplay ( out );
135  return out;
136 }
137 
138 // //
140 
141