DGtalTools  0.9.4
Public Types | Public Member Functions | Data Fields
TorusShape Struct Reference

#include <estimators/volSurfaceRegularization-details/shape.h>

Public Types

typedef DGtal::Z3i::Point Point
 
typedef Eigen::Vector3d Vector
 
typedef Eigen::Matrix3d Matrix
 

Public Member Functions

 TorusShape (const Matrix &transform_, const double &radius_large_, const double &radius_small_)
 
bool operator() (const Point &point) const
 

Data Fields

Matrix transform
 
double radius_large
 
double radius_small
 

Detailed Description

Definition at line 35 of file shape.h.

Member Typedef Documentation

typedef Eigen::Matrix3d TorusShape::Matrix

Definition at line 39 of file shape.h.

Definition at line 37 of file shape.h.

typedef Eigen::Vector3d TorusShape::Vector

Definition at line 38 of file shape.h.

Constructor & Destructor Documentation

TorusShape::TorusShape ( const Matrix transform_,
const double &  radius_large_,
const double &  radius_small_ 
)
inline

Definition at line 41 of file shape.h.

References radius_large, and radius_small.

41  : transform(transform_), radius_large(radius_large_), radius_small(radius_small_)
42  {
43  ASSERT( radius_small < radius_large );
44  }
double radius_large
Definition: shape.h:58
Matrix transform
Definition: shape.h:57
double radius_small
Definition: shape.h:59

Member Function Documentation

bool TorusShape::operator() ( const Point point) const
inline

Definition at line 46 of file shape.h.

References radius_large, radius_small, and transform.

47  {
48  const Vector vector_(point[0], point[1], point[2]);
49  const Vector vector = transform*vector_;
50  Vector projected = vector;
51  projected[1] = 0;
52  if (projected.norm() == 0) return false;
53  projected *= radius_large/projected.norm();
54  return (vector-projected).norm() <= radius_small;
55  }
double radius_large
Definition: shape.h:58
Matrix transform
Definition: shape.h:57
Eigen::Vector3d Vector
Definition: shape.h:38
double radius_small
Definition: shape.h:59

Field Documentation

double TorusShape::radius_large

Definition at line 58 of file shape.h.

Referenced by operator()(), and TorusShape().

double TorusShape::radius_small

Definition at line 59 of file shape.h.

Referenced by operator()(), and TorusShape().

Matrix TorusShape::transform

Definition at line 57 of file shape.h.

Referenced by operator()().


The documentation for this struct was generated from the following file: