Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JGEOMETRY3D::JOmega3D_t Struct Reference

Base class for direction set. More...

#include <JOmega3D.hh>

Inheritance diagram for JGEOMETRY3D::JOmega3D_t:
std::vector< JAngle3D > JGEOMETRY3D::JOmega3D

Public Types

typedef std::pair< double, double > range_type
 

Public Member Functions

int find (const JAngle3D &dir) const
 Get index of direction closest to given direction.
 

Detailed Description

Base class for direction set.

Definition at line 29 of file JOmega3D.hh.

Member Typedef Documentation

◆ range_type

Definition at line 32 of file JOmega3D.hh.

Member Function Documentation

◆ find()

int JGEOMETRY3D::JOmega3D_t::find ( const JAngle3D & dir) const
inline

Get index of direction closest to given direction.

Parameters
dirdirection
Returns
index (-1 if error)

Definition at line 41 of file JOmega3D.hh.

42 {
43 double dot = -1.0;
44 int index = -1;
45
46 for (const_iterator i = this->begin(); i != this->end(); ++i) {
47
48 const double x = dir.getDot(*i);
49
50 if (x > dot) {
51 dot = x;
52 index = std::distance(this->begin(), i);
53 }
54 }
55
56 return index;
57 }

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