Caribou
IsoSurface.h
1 #pragma once
2 
3 #include <sofa/core/objectmodel/BaseObject.h>
4 #include <Eigen/Dense>
5 
6 namespace SofaCaribou::topology {
7 
8 template<class DataTypes>
9 class IsoSurface : public sofa::core::objectmodel::BaseObject {
10 public:
11  SOFA_CLASS(SOFA_TEMPLATE(IsoSurface, DataTypes), sofa::core::objectmodel::BaseObject);
12  static constexpr unsigned char Dimension = DataTypes::spatial_dimensions;
13  using Real = typename DataTypes::Real;
14  using Coord = typename DataTypes::Coord;
15 
19  inline Real iso_value(const Coord & x) const {
20  Eigen::Map<Eigen::Matrix<Real, Dimension, 1>> mapped_x(&x[0]);
21  iso_value(mapped_x);
22  };
23 
27  virtual Real iso_value(const Eigen::Matrix<Real, Dimension, 1> & x) const = 0;
28 };
29 
30 }
SofaCaribou::topology::IsoSurface::iso_value
Real iso_value(const Coord &x) const
Definition: IsoSurface.h:19
SofaCaribou::topology::IsoSurface
Definition: IsoSurface.h:9
SofaCaribou::topology::IsoSurface::iso_value
virtual Real iso_value(const Eigen::Matrix< Real, Dimension, 1 > &x) const =0