DGtalTools  0.9.4
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

Definition at line 82 of file shape.h.

Definition at line 83 of file shape.h.

Constructor & Destructor Documentation

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

Definition at line 85 of file shape.h.

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

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

Member Function Documentation

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

Definition at line 90 of file shape.h.

References direction, DGtal::PointVector< dim, TEuclideanRing, TContainer >::dot(), length, and radius.

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  }
RealPoint direction
Definition: shape.h:100
double radius
Definition: shape.h:98
double length
Definition: shape.h:99
Component dot(const Self &v) const

Field Documentation

RealPoint CapsuleShape::direction

Definition at line 100 of file shape.h.

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

double CapsuleShape::length

Definition at line 99 of file shape.h.

Referenced by operator()().

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: