Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
igl::geodesic::Interval Class Reference
+ Inheritance diagram for igl::geodesic::Interval:
+ Collaboration diagram for igl::geodesic::Interval:

Public Types

enum  DirectionType { FROM_FACE_0 , FROM_FACE_1 , FROM_SOURCE , UNDEFINED_DIRECTION }
 

Public Member Functions

 Interval ()
 
 ~Interval ()
 
double signal (double x)
 
double max_distance (double end)
 
void compute_min_distance (double stop)
 
bool operator() (interval_pointer const x, interval_pointer const y) const
 
double stop ()
 
double hypotenuse (double a, double b)
 
void find_closest_point (double const x, double const y, double &offset, double &distance)
 
double & start ()
 
double & d ()
 
double & pseudo_x ()
 
double & pseudo_y ()
 
double & min ()
 
interval_pointernext ()
 
edge_pointeredge ()
 
DirectionTypedirection ()
 
bool visible_from_source ()
 
unsigned & source_index ()
 
void initialize (edge_pointer edge, SurfacePoint *point=NULL, unsigned source_index=0)
 

Protected Attributes

double m_start
 
double m_d
 
double m_pseudo_x
 
double m_pseudo_y
 
double m_min
 
interval_pointer m_next
 
edge_pointer m_edge
 
unsigned m_source_index
 
DirectionType m_direction
 

Detailed Description

Member Enumeration Documentation

◆ DirectionType

Enumerator
FROM_FACE_0 
FROM_FACE_1 
FROM_SOURCE 
UNDEFINED_DIRECTION 
1201 {
1206 };
@ FROM_FACE_1
Definition exact_geodesic.cpp:1203
@ UNDEFINED_DIRECTION
Definition exact_geodesic.cpp:1205
@ FROM_FACE_0
Definition exact_geodesic.cpp:1202
@ FROM_SOURCE
Definition exact_geodesic.cpp:1204

Constructor & Destructor Documentation

◆ Interval()

igl::geodesic::Interval::Interval ( )
inline
1197{};

◆ ~Interval()

igl::geodesic::Interval::~Interval ( )
inline
1198{};

Member Function Documentation

◆ compute_min_distance()

void igl::geodesic::Interval::compute_min_distance ( double  stop)
inline
1247 {
1248 assert(stop > m_start);
1249
1250 if(m_d == GEODESIC_INF)
1251 {
1253 }
1254 else if(m_start > m_pseudo_x)
1255 {
1256 m_min = signal(m_start);
1257 }
1258 else if(stop < m_pseudo_x)
1259 {
1260 m_min = signal(stop);
1261 }
1262 else
1263 {
1264 assert(m_pseudo_y<=0);
1265 m_min = m_d - m_pseudo_y;
1266 }
1267 }
double m_pseudo_x
Definition exact_geodesic.cpp:1318
double m_d
Definition exact_geodesic.cpp:1317
double m_min
Definition exact_geodesic.cpp:1320
double stop()
Definition exact_geodesic.cpp:1285
double m_start
Definition exact_geodesic.cpp:1316
double m_pseudo_y
Definition exact_geodesic.cpp:1319
double signal(double x)
Definition exact_geodesic.cpp:1208
double const GEODESIC_INF
Definition exact_geodesic.cpp:32

References igl::geodesic::GEODESIC_INF, m_d, m_min, m_pseudo_x, m_pseudo_y, m_start, signal(), and stop().

Referenced by initialize(), igl::geodesic::GeodesicAlgorithmExact::initialize_propagation_data(), and igl::geodesic::GeodesicAlgorithmExact::update_list_and_queue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ d()

double & igl::geodesic::Interval::d ( )
inline
1301{return m_d;};

References m_d.

Referenced by igl::geodesic::GeodesicAlgorithmExact::intersect_intervals(), and igl::geodesic::GeodesicAlgorithmExact::propagate().

+ Here is the caller graph for this function:

◆ direction()

DirectionType & igl::geodesic::Interval::direction ( )
inline
1307{return m_direction;};
DirectionType m_direction
Definition exact_geodesic.cpp:1325

References m_direction.

Referenced by igl::geodesic::GeodesicAlgorithmExact::construct_propagated_intervals(), igl::geodesic::GeodesicAlgorithmExact::initialize_propagation_data(), and igl::geodesic::GeodesicAlgorithmExact::propagate().

+ Here is the caller graph for this function:

◆ edge()

edge_pointer & igl::geodesic::Interval::edge ( )
inline
1306{return m_edge;};
edge_pointer m_edge
Definition exact_geodesic.cpp:1323

References m_edge.

Referenced by igl::geodesic::GeodesicAlgorithmExact::construct_propagated_intervals(), initialize(), igl::geodesic::GeodesicAlgorithmExact::intersect_intervals(), igl::geodesic::GeodesicAlgorithmExact::propagate(), and igl::geodesic::GeodesicAlgorithmExact::trace_back().

+ Here is the caller graph for this function:

◆ find_closest_point()

void igl::geodesic::Interval::find_closest_point ( double const  x,
double const  y,
double &  offset,
double &  distance 
)
inline
1513 {
1514 if(m_d == GEODESIC_INF)
1515 {
1516 r = GEODESIC_INF;
1517 d_out = GEODESIC_INF;
1518 return;
1519 }
1520
1521 double hc = -m_pseudo_y;
1522 double rc = m_pseudo_x;
1523 double end = stop();
1524
1525 double local_epsilon = SMALLEST_INTERVAL_RATIO*m_edge->length();
1526 if(std::abs(hs+hc) < local_epsilon)
1527 {
1528 if(rs<=m_start)
1529 {
1530 r = m_start;
1531 d_out = signal(m_start) + std::abs(rs - m_start);
1532 }
1533 else if(rs>=end)
1534 {
1535 r = end;
1536 d_out = signal(end) + fabs(end - rs);
1537 }
1538 else
1539 {
1540 r = rs;
1541 d_out = signal(rs);
1542 }
1543 }
1544 else
1545 {
1546 double ri = (rs*hc + hs*rc)/(hs+hc);
1547
1548 if(ri<m_start)
1549 {
1550 r = m_start;
1551 d_out = signal(m_start) + hypotenuse(m_start - rs, hs);
1552 }
1553 else if(ri>end)
1554 {
1555 r = end;
1556 d_out = signal(end) + hypotenuse(end - rs, hs);
1557 }
1558 else
1559 {
1560 r = ri;
1561 d_out = m_d + hypotenuse(rc - rs, hc + hs);
1562 }
1563 }
1564 }
double & length()
Definition exact_geodesic.cpp:484
double hypotenuse(double a, double b)
Definition exact_geodesic.cpp:1290
double const SMALLEST_INTERVAL_RATIO
Definition exact_geodesic.cpp:36
S::iterator end(S &sh, const PathTag &)
Definition geometry_traits.hpp:620

References igl::geodesic::GEODESIC_INF, hypotenuse(), igl::geodesic::Edge::length(), m_d, m_edge, m_pseudo_x, m_pseudo_y, m_start, signal(), igl::geodesic::SMALLEST_INTERVAL_RATIO, and stop().

Referenced by igl::geodesic::IntervalList::find_closest_point().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hypotenuse()

double igl::geodesic::Interval::hypotenuse ( double  a,
double  b 
)
inline
1291 {
1292 return sqrt(a*a + b*b);
1293 }
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
Definition ArrayCwiseUnaryOps.h:152

References sqrt().

Referenced by find_closest_point().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize()

void igl::geodesic::Interval::initialize ( edge_pointer  edge,
SurfacePoint point = NULL,
unsigned  source_index = 0 
)
inline
1570{
1571 m_next = NULL;
1572 //m_geodesic_previous = NULL;
1574 m_edge = edge;
1576
1577 m_start = 0.0;
1578 //m_stop = edge->length();
1579 if(!source)
1580 {
1581 m_d = GEODESIC_INF;
1583 return;
1584 }
1585 m_d = 0;
1586
1587 if(source->base_element()->type() == VERTEX)
1588 {
1589 if(source->base_element()->id() == edge->v0()->id())
1590 {
1591 m_pseudo_x = 0.0;
1592 m_pseudo_y = 0.0;
1593 m_min = 0.0;
1594 return;
1595 }
1596 else if(source->base_element()->id() == edge->v1()->id())
1597 {
1598 m_pseudo_x = stop();
1599 m_pseudo_y = 0.0;
1600 m_min = 0.0;
1601 return;
1602 }
1603 }
1604
1607
1609}
void local_coordinates(Point3D *point, double &x, double &y)
Definition exact_geodesic.cpp:520
vertex_pointer v1()
Definition exact_geodesic.cpp:518
vertex_pointer v0()
Definition exact_geodesic.cpp:517
unsigned & source_index()
Definition exact_geodesic.cpp:1309
edge_pointer & edge()
Definition exact_geodesic.cpp:1306
unsigned m_source_index
Definition exact_geodesic.cpp:1324
void compute_min_distance(double stop)
Definition exact_geodesic.cpp:1246
interval_pointer m_next
Definition exact_geodesic.cpp:1322
unsigned & id()
Definition exact_geodesic.cpp:350
@ VERTEX
Definition exact_geodesic.cpp:328

References igl::geodesic::SurfacePoint::base_element(), compute_min_distance(), edge(), igl::geodesic::GEODESIC_INF, igl::geodesic::MeshElementBase::id(), igl::geodesic::Edge::local_coordinates(), m_d, m_direction, m_edge, m_min, m_next, m_pseudo_x, m_pseudo_y, m_source_index, m_start, source_index(), stop(), igl::geodesic::MeshElementBase::type(), UNDEFINED_DIRECTION, igl::geodesic::Edge::v0(), igl::geodesic::Edge::v1(), and igl::geodesic::VERTEX.

Referenced by igl::geodesic::GeodesicAlgorithmExact::initialize_propagation_data().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ max_distance()

double igl::geodesic::Interval::max_distance ( double  end)
inline
1231 {
1232 if(m_d == GEODESIC_INF)
1233 {
1234 return GEODESIC_INF;
1235 }
1236 else
1237 {
1238 double a = std::abs(m_start - m_pseudo_x);
1239 double b = std::abs(end - m_pseudo_x);
1240
1241 return a > b ? m_d + sqrt(a*a + m_pseudo_y*m_pseudo_y):
1243 }
1244 }

References igl::geodesic::GEODESIC_INF, m_d, m_pseudo_x, m_pseudo_y, m_start, and sqrt().

+ Here is the call graph for this function:

◆ min()

double & igl::geodesic::Interval::min ( )
inline
1304{return m_min;};

References m_min.

Referenced by igl::geodesic::GeodesicAlgorithmExact::construct_propagated_intervals(), igl::geodesic::GeodesicAlgorithmExact::erase_from_queue(), igl::geodesic::IntervalList::find_closest_point(), and igl::geodesic::GeodesicAlgorithmExact::intersect_intervals().

+ Here is the caller graph for this function:

◆ next()

◆ operator()()

bool igl::geodesic::Interval::operator() ( interval_pointer const  x,
interval_pointer const  y 
) const
inline
1270 {
1271 if(x->min() != y->min())
1272 {
1273 return x->min() < y->min();
1274 }
1275 else if(x->start() != y->start())
1276 {
1277 return x->start() < y->start();
1278 }
1279 else
1280 {
1281 return x->edge()->id() < y->edge()->id();
1282 }
1283 }
const Scalar & y
Definition MathFunctions.h:552
TCoord< P > x(const P &p)
Definition geometry_traits.hpp:297

◆ pseudo_x()

double & igl::geodesic::Interval::pseudo_x ( )
inline
1302{return m_pseudo_x;};

References m_pseudo_x.

Referenced by igl::geodesic::GeodesicAlgorithmExact::construct_propagated_intervals(), igl::geodesic::GeodesicAlgorithmExact::intersect_intervals(), and igl::geodesic::GeodesicAlgorithmExact::propagate().

+ Here is the caller graph for this function:

◆ pseudo_y()

double & igl::geodesic::Interval::pseudo_y ( )
inline
1303{return m_pseudo_y;};

References m_pseudo_y.

Referenced by igl::geodesic::GeodesicAlgorithmExact::intersect_intervals(), and igl::geodesic::GeodesicAlgorithmExact::propagate().

+ Here is the caller graph for this function:

◆ signal()

double igl::geodesic::Interval::signal ( double  x)
inline
1209 {
1210 assert(x>=0.0 && x <= m_edge->length());
1211
1212 if(m_d == GEODESIC_INF)
1213 {
1214 return GEODESIC_INF;
1215 }
1216 else
1217 {
1218 double dx = x - m_pseudo_x;
1219 if(m_pseudo_y == 0.0)
1220 {
1221 return m_d + std::abs(dx);
1222 }
1223 else
1224 {
1225 return m_d + sqrt(dx*dx + m_pseudo_y*m_pseudo_y);
1226 }
1227 }
1228 }
double length(std::vector< SurfacePoint > &path)
Definition exact_geodesic.cpp:1682

References igl::geodesic::GEODESIC_INF, igl::geodesic::length(), m_d, m_pseudo_x, m_pseudo_y, and sqrt().

Referenced by igl::geodesic::GeodesicAlgorithmExact::best_first_interval(), compute_min_distance(), find_closest_point(), igl::geodesic::GeodesicAlgorithmExact::intersect_intervals(), and igl::geodesic::IntervalList::signal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ source_index()

unsigned & igl::geodesic::Interval::source_index ( )
inline
1309{return m_source_index;};

References m_source_index.

Referenced by igl::geodesic::GeodesicAlgorithmExact::best_first_interval(), igl::geodesic::GeodesicAlgorithmExact::construct_propagated_intervals(), initialize(), igl::geodesic::GeodesicAlgorithmExact::trace_back(), and igl::geodesic::GeodesicAlgorithmExact::visible_from_source().

+ Here is the caller graph for this function:

◆ start()

double & igl::geodesic::Interval::start ( )
inline

◆ stop()

double igl::geodesic::Interval::stop ( )
inline
1286 {
1287 return m_next ? m_next->start() : m_edge->length();
1288 }
double & start()
Definition exact_geodesic.cpp:1300

References igl::geodesic::Edge::length(), m_edge, m_next, and start().

Referenced by compute_min_distance(), igl::geodesic::IntervalList::covering_interval(), find_closest_point(), initialize(), igl::geodesic::GeodesicAlgorithmExact::intersect_intervals(), igl::geodesic::GeodesicAlgorithmExact::propagate(), and igl::geodesic::GeodesicAlgorithmExact::update_list_and_queue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ visible_from_source()

bool igl::geodesic::Interval::visible_from_source ( )
inline
1308{return m_direction == FROM_SOURCE;};

References FROM_SOURCE, and m_direction.

Referenced by igl::geodesic::GeodesicAlgorithmExact::visible_from_source().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_d

double igl::geodesic::Interval::m_d
protected

◆ m_direction

DirectionType igl::geodesic::Interval::m_direction
protected

◆ m_edge

edge_pointer igl::geodesic::Interval::m_edge
protected

◆ m_min

double igl::geodesic::Interval::m_min
protected

◆ m_next

interval_pointer igl::geodesic::Interval::m_next
protected

Referenced by initialize(), next(), and stop().

◆ m_pseudo_x

double igl::geodesic::Interval::m_pseudo_x
protected

◆ m_pseudo_y

double igl::geodesic::Interval::m_pseudo_y
protected

◆ m_source_index

unsigned igl::geodesic::Interval::m_source_index
protected

Referenced by initialize(), and source_index().

◆ m_start

double igl::geodesic::Interval::m_start
protected

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