DGtalTools  1.5.beta
Public Types | Public Member Functions | Data Fields
RoundedCubeShape 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

 RoundedCubeShape (const Matrix &transform_, const double &size_, const double &radius_)
 
bool operator() (const Point &point) const
 

Data Fields

Matrix transform
 
double size
 
double radius
 

Detailed Description

Definition at line 6 of file shape.h.

Member Typedef Documentation

◆ Matrix

typedef Eigen::Matrix3d RoundedCubeShape::Matrix

Definition at line 10 of file shape.h.

◆ Point

Definition at line 8 of file shape.h.

◆ Vector

typedef Eigen::Vector3d RoundedCubeShape::Vector

Definition at line 9 of file shape.h.

Constructor & Destructor Documentation

◆ RoundedCubeShape()

RoundedCubeShape::RoundedCubeShape ( const Matrix transform_,
const double &  size_,
const double &  radius_ 
)
inline

Definition at line 12 of file shape.h.

12  : transform(transform_), size(size_), radius(radius_)
13  {
14  ASSERT( radius < size );
15  }
double radius
Definition: shape.h:32
double size
Definition: shape.h:31
Matrix transform
Definition: shape.h:30

References radius, and size.

Member Function Documentation

◆ operator()()

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

Definition at line 17 of file shape.h.

18  {
19  const Vector vector_(point[0], point[1], point[2]);
20  Vector vector = transform*vector_;
21  vector = vector.cwiseAbs();
22  if (vector.maxCoeff() <= size-radius) return true;
23  Vector projected = vector;
24  for (int kk=0; kk<projected.size(); kk++)
25  if (projected[kk] > size-radius)
26  projected[kk] = size-radius;
27  return (vector-projected).norm() <= radius;
28  }
Eigen::Vector3d Vector
Definition: shape.h:9

References radius, size, and transform.

Field Documentation

◆ radius

double RoundedCubeShape::radius

Definition at line 32 of file shape.h.

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

◆ size

double RoundedCubeShape::size

Definition at line 31 of file shape.h.

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

◆ transform

Matrix RoundedCubeShape::transform

Definition at line 30 of file shape.h.

Referenced by operator()().


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