DGtal  1.5.beta
SpaceND.h
1 
17 #pragma once
18 
33 #if defined(SpaceND_RECURSES)
34 #error Recursive header files inclusion detected in SpaceND.h
35 #else // defined(SpaceND_RECURSES)
37 #define SpaceND_RECURSES
38 
39 #if !defined SpaceND_h
41 #define SpaceND_h
42 
44 // Inclusions
45 #include <iostream>
46 #include "DGtal/base/Common.h"
47 #include "DGtal/kernel/CInteger.h"
48 #include "DGtal/kernel/PointVector.h"
50 
51 namespace DGtal
52 {
53 
55  // class SpaceND
93  template < Dimension dim,
94  typename TInteger = DGtal::int32_t >
95  class SpaceND
96  {
97  //Integer must be a model of the concept CInteger.
99 
100  public:
102  typedef TInteger Integer;
105 
107  typedef size_t Size;
108 
111 
114 
118 
122 
126  typedef Space Self;
127 
130 
132  static const Dimension dimension=dim;
133 
135  template <Dimension codimension>
136  struct Subcospace
137  {
138  typedef SpaceND < dim - codimension, Integer > Type;
139  };
140 
142  template <Dimension subdimension>
143  struct Subspace
144  {
146  };
147 
148 
149  // ----------------------- Standard services ------------------------------
150  public:
151 
152  // ----------------------- Interface --------------------------------------
153  public:
154 
159  static void selfDisplay( std::ostream & out )
160  {
161  out << "[SpaceND dim=" << dimension << " size of Integers=" << sizeof( Integer ) << " ]";
162  }
163 
164  private:
171  SpaceND & operator=( const SpaceND & other );
172 
173  private:
179 
184 
185 
186  // ------------------------- Internals ------------------------------------
187  private:
188 
189  }; // end of class SpaceND
190 
191  // ///static constants to store the dimension.
192  // template < Dimension dim,
193  // typename TInteger >
194  // const Dimension SpaceND<dim, TInteger>::dimension = dim;
195 
196 
197 } // namespace DGtal
198 
199 
200 // //
202 
203 #endif // !defined SpaceND_h
204 
205 #undef SpaceND_RECURSES
206 #endif // else defined(SpaceND_RECURSES)
Space Self
Defined for convenience (same as Space).
Definition: SpaceND.h:126
TInteger Integer
Arithmetic ring induced by (+,-,*) and Integer numbers.
Definition: SpaceND.h:102
PointVector< dim, Integer > Point
Points in DGtal::SpaceND.
Definition: SpaceND.h:110
NumberTraits< Integer >::UnsignedVersion UnsignedInteger
Unsigned version of the Integers.
Definition: SpaceND.h:104
size_t Size
Type used to represent sizes in the digital space.
Definition: SpaceND.h:107
PointVector< dim, double > RealPoint
Definition: SpaceND.h:117
SpaceND< dim, Integer > Space
Type to denote the space itself.
Definition: SpaceND.h:124
static const Dimension dimension
static constants to store the dimension.
Definition: SpaceND.h:132
PointVector< dim, double > RealVector
Definition: SpaceND.h:121
PointVector< dim, Integer > Vector
Vectors in DGtal::SpaceND.
Definition: SpaceND.h:113
DGtal::Dimension Dimension
Copy of the type used for the dimension.
Definition: SpaceND.h:129
static void selfDisplay(std::ostream &out)
Definition: SpaceND.h:159
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
SpaceND & operator=(const SpaceND &other)
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::uint32_t Dimension
Definition: Common.h:136
boost::int32_t int32_t
signed 32-bit integer.
Definition: BasicTypes.h:72
std::decay< T >::type UnsignedVersion
Alias to the unsigned version of the number type.
Definition: NumberTraits.h:90
Define the type of a sub co-Space.
Definition: SpaceND.h:137
SpaceND< dim - codimension, Integer > Type
Definition: SpaceND.h:138
Define the type of a subspace.
Definition: SpaceND.h:144
SpaceND< subdimension, Integer > Type
Definition: SpaceND.h:145
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Definition: CInteger.h:88
unsigned int dim(const Vector &z)