DGtal  1.5.beta
VectorField.h
1 
17 #pragma once
18 
31 #if defined(VectorField_RECURSES)
32 #error Recursive header files inclusion detected in VectorField.h
33 #else // defined(VectorField_RECURSES)
35 #define VectorField_RECURSES
36 
37 #if !defined VectorField_h
39 #define VectorField_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/ConstAlias.h"
46 #include "DGtal/base/ConstAlias.h"
47 #include "DGtal/dec/Duality.h"
48 #include "DGtal/dec/KForm.h"
49 #include "DGtal/kernel/PointVector.h"
51 
52 namespace DGtal
53 {
54 
56  // template class VectorField
66 template <typename TCalculus, Duality duality>
68  {
69  // ----------------------- Standard services ------------------------------
70  public:
71  typedef TCalculus Calculus;
72 
73  typedef typename Calculus::Scalar Scalar;
74  typedef typename Calculus::SCell SCell;
75  typedef typename Calculus::Index Index;
77 
80 
86 
93 
100 
106  SCell getSCell(const Index& index) const;
107 
112  Index length() const;
113 
118  Vector getVector(const Index& index) const;
119 
125  void setVector(const Index& index, const Vector& vector);
126 
127  // ----------------------- Interface --------------------------------------
128  public:
129 
134 
139 
144  void selfDisplay(std::ostream& out) const;
145 
149  std::string className() const;
150 
156 
162 
166  void clear();
167 
174 
179  bool isValid() const;
180 
181 
182  // ------------------------- Private Datas --------------------------------
183  private:
184 
185  // ------------------------- Hidden services ------------------------------
186  protected:
187 
193 
194  // ------------------------- Internals ------------------------------------
195  private:
196 
197  }; // end of class VectorField
198 
199 
206  template <typename Calculus, Duality duality>
207  std::ostream&
208  operator<<(std::ostream& out, const VectorField<Calculus, duality>& object);
209 
216  template <typename Calculus, Duality duality>
218  operator+(const VectorField<Calculus, duality>& vector_field_a, const VectorField<Calculus, duality>& vector_field_b);
219 
226  template <typename Calculus, Duality duality>
228  operator-(const VectorField<Calculus, duality>& vector_field_a, const VectorField<Calculus, duality>& vector_field_b);
229 
236  template <typename Calculus, Duality duality>
238  operator*(const typename Calculus::Scalar& scalar, const VectorField<Calculus, duality>& vector_field);
239 
245  template <typename Calculus, Duality duality>
248 
249 } // namespace DGtal
250 
251 
253 // Includes inline functions.
254 #include "DGtal/dec/VectorField.ih"
255 
256 // //
258 
259 #endif // !defined VectorField_h
260 
261 #undef VectorField_RECURSES
262 #endif // else defined(VectorField_RECURSES)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:187
Aim: KForm represents discrete kforms in the dec package.
Definition: KForm.h:66
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:593
Aim: VectorField represents a discrete vector field in the dec package. Vector field values are attac...
Definition: VectorField.h:68
Calculus::Scalar Scalar
Definition: VectorField.h:73
VectorField(ConstAlias< Calculus > calculus)
Index length() const
Calculus::DenseMatrix Coordinates
Definition: VectorField.h:78
TCalculus Calculus
Definition: VectorField.h:71
const Calculus * myCalculus
Definition: VectorField.h:138
void selfDisplay(std::ostream &out) const
bool isValid() const
Vector getVector(const Index &index) const
KForm< Calculus, 0, duality > intensity(const typename Vector::NormType norm_type=Vector::L_2) const
KForm< Calculus, 0, duality > coordAlongDirection(const Dimension &dir) const
VectorField(ConstAlias< Calculus > calculus, const Container &container)
Coordinates Container
Definition: VectorField.h:79
Calculus::SCell SCell
Definition: VectorField.h:74
SCell getSCell(const Index &index) const
Coordinates myCoordinates
Definition: VectorField.h:133
void setVector(const Index &index, const Vector &vector)
VectorField< TCalculus, duality > normalized(const Scalar &epsilon=0) const
VectorField & operator=(const VectorField &other)
Calculus::Index Index
Definition: VectorField.h:75
std::string className() const
DGtal::PointVector< Calculus::dimensionAmbient, Scalar > Vector
Definition: VectorField.h:76
PolyCalculus * calculus
Z3i::SCell SCell
SMesh::Index Index
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::uint32_t Dimension
Definition: Common.h:136
KForm< Calculus, order, duality > operator*(const typename Calculus::Scalar &scalar, const KForm< Calculus, order, duality > &form)
KForm< Calculus, order, duality > operator-(const KForm< Calculus, order, duality > &form_a, const KForm< Calculus, order, duality > &form_b)
Circulator< TIterator > operator+(typename IteratorCirculatorTraits< TIterator >::Difference d, Circulator< TIterator > &object)
Definition: Circulator.h:453
EigenLinearAlgebraBackend::DenseMatrix DenseMatrix