Public Member Functions | Protected Member Functions | Protected Attributes

BendPointFinderBase Class Reference

Inheritance diagram for BendPointFinderBase:
ParallelTask Task NamedObject CallBacker BendPointFinder2D BendPointFinder3D

List of all members.

Public Member Functions

const TypeSet< int > & bendPoints () const

Protected Member Functions

 BendPointFinderBase (int sz, float eps)
od_int64 nrIterations () const
bool doWork (od_int64, od_int64, int)
virtual float getMaxSqDistToLine (int &idx, int start, int stop) const =0
void findInSegment (int, int)
bool doPrepare (int)
bool doFinish (bool)

Protected Attributes

TypeSet< int > bendpts_
TypeSet< Interval< int > > queue_
Threads::ConditionVar lock_
bool finished_
int nrwaiting_
int nrthreads_
int sz_
const float epssq_

Detailed Description

Base class that does the majority of the work finding bendpoints. Adaptions to different data-types are done in subclasses.


Constructor & Destructor Documentation

BendPointFinderBase::BendPointFinderBase ( int  sz,
float  eps 
) [protected]

Member Function Documentation

const TypeSet<int>& BendPointFinderBase::bendPoints (  )  const [inline]
bool BendPointFinderBase::doFinish ( bool   )  [protected, virtual]

Reimplemented from ParallelTask.

bool BendPointFinderBase::doPrepare ( int   )  [protected, virtual]

Reimplemented from ParallelTask.

bool BendPointFinderBase::doWork ( od_int64  ,
od_int64  ,
int   
) [protected]
void BendPointFinderBase::findInSegment ( int  ,
int   
) [protected]
virtual float BendPointFinderBase::getMaxSqDistToLine ( int &  idx,
int  start,
int  stop 
) const [protected, pure virtual]

Give the index of the point that is furthest from the line from start to stop.

Returns:
the squre of the largest distance

Implemented in BendPointFinder2D, and BendPointFinder3D.

od_int64 BendPointFinderBase::nrIterations (  )  const [inline, protected, virtual]

Implements ParallelTask.


Member Data Documentation

const float BendPointFinderBase::epssq_ [protected]
int BendPointFinderBase::sz_ [protected]