DGtalTools  1.5.beta
Public Types | Public Member Functions | Data Fields
CapsuleShape Struct Reference

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

Collaboration diagram for CapsuleShape:
Collaboration graph
[legend]

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

Definition at line 82 of file shape.h.

◆ 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 norm(const NormType type=L_2) const
double radius
Definition: shape.h:98
double length
Definition: shape.h:99
RealPoint direction
Definition: shape.h:100

References direction, and DGtal::PointVector< dim, TEuclideanRing, TContainer >::norm().

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  }
Component dot(const Self &v) const

References direction, DGtal::PointVector< dim, TEuclideanRing, TContainer >::dot(), 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: