DGtalTools  1.2.0
Public Types | Public Member Functions | Data Fields
CapsuleShape Struct Reference

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

Public Types

typedef DGtal::Z3i::Point Point
 
typedef DGtal::Z3i::RealPoint RealPoint
 

Public Member Functions

 CapsuleShape (const double &radius_, const double &length_, const RealPoint &direction_)
 
bool operator() (const Point &point) const
 

Data Fields

double radius
 
double length
 
RealPoint direction
 

Detailed Description

Definition at line 80 of file shape.h.

Member Typedef Documentation

◆ Point

typedef DGtal::Z3i::Point CapsuleShape::Point

Definition at line 82 of file shape.h.

◆ RealPoint

typedef DGtal::Z3i::RealPoint CapsuleShape::RealPoint

Definition at line 83 of file shape.h.

Constructor & Destructor Documentation

◆ CapsuleShape()

CapsuleShape::CapsuleShape ( const double &  radius_,
const double &  length_,
const RealPoint direction_ 
)
inline

Definition at line 85 of file shape.h.

85  : radius(radius_), length(length_), direction(direction_)
86  {
87  if (direction.norm() > 0) direction /= direction.norm();
88  }
double radius
Definition: shape.h:98
double length
Definition: shape.h:99
RealPoint direction
Definition: shape.h:100

References direction.

Member Function Documentation

◆ operator()()

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

Definition at line 90 of file shape.h.

91  {
92  double alpha = direction.dot(point);
93  if (alpha > length/2) alpha = length/2;
94  if (alpha < -length/2) alpha = -length/2;
95  return (point-alpha*direction).norm() <= radius;
96  }

References direction, length, and radius.

Field Documentation

◆ direction

RealPoint CapsuleShape::direction

Definition at line 100 of file shape.h.

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

◆ length

double CapsuleShape::length

Definition at line 99 of file shape.h.

Referenced by operator()().

◆ radius

double CapsuleShape::radius

Definition at line 98 of file shape.h.

Referenced by operator()().


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