All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::rp::SegmenterRegionGrowingSegmentsPool Class Reference

Segments pool. More...

#include <SegmenterRegionGrowingSegmentsPool.h>

Inheritance diagram for te::rp::SegmenterRegionGrowingSegmentsPool:

Public Member Functions

void clear ()
 Clear all stored segments. More...
 
SegmenterRegionGrowingSegmentgetNextSegment ()
 Retrive a stored segment. More...
 
SegmenterSegmentsBlock::SegmentIdDataType getSegmentsNumber () const
 Return the current allocated segments number. More...
 
Matrix
< SegmenterRegionGrowingSegment > & 
getSegsMatrix ()
 Return a reference to the internal segments matrix. More...
 
bool initialize (const SegmenterSegmentsBlock::SegmentIdDataType segsNumber, const unsigned int featuresNumber)
 Pool initialization. More...
 
void resetUseCounter ()
 Reset the segments use counter. More...
 
 SegmenterRegionGrowingSegmentsPool ()
 
 ~SegmenterRegionGrowingSegmentsPool ()
 

Protected Attributes

unsigned int m_featuresNumber
 The number of features for each created segment. More...
 
unsigned int m_getNextSegment_col
 
unsigned int m_getNextSegment_line
 
SegmenterSegmentsBlock::SegmentIdDataType m_nextUnusedSegmentIdx
 The next unused segment index. More...
 
Matrix
< SegmenterRegionGrowingSegment
m_segments
 Internal stored segments. More...
 
Matrix
< SegmenterRegionGrowingSegment::FeatureType
m_segmentsFeatures
 Internal stored segment features. More...
 
SegmenterSegmentsBlock::SegmentIdDataType m_segsNumber
 The number of segments allocated segments. More...
 

Detailed Description

Segments pool.

Note
The vector pointed by each SegmenterRegionGrowingSegment::m_neighborSegments will be deleted by the pool.

Definition at line 44 of file SegmenterRegionGrowingSegmentsPool.h.

Constructor & Destructor Documentation

te::rp::SegmenterRegionGrowingSegmentsPool::SegmenterRegionGrowingSegmentsPool ( )
te::rp::SegmenterRegionGrowingSegmentsPool::~SegmenterRegionGrowingSegmentsPool ( )

Definition at line 17 of file SegmenterRegionGrowingSegmentsPool.cpp.

References clear().

Member Function Documentation

void te::rp::SegmenterRegionGrowingSegmentsPool::clear ( )
SegmenterRegionGrowingSegment * te::rp::SegmenterRegionGrowingSegmentsPool::getNextSegment ( )

Retrive a stored segment.

Returns
A pointer to the next unused segment or null if all segments were used.

Definition at line 93 of file SegmenterRegionGrowingSegmentsPool.cpp.

References m_getNextSegment_col, m_getNextSegment_line, m_nextUnusedSegmentIdx, m_segments, and m_segsNumber.

Referenced by te::rp::SegmenterRegionGrowingStrategy::execute(), and te::rp::SegmenterRegionGrowingStrategy::initializeSegments().

SegmenterSegmentsBlock::SegmentIdDataType te::rp::SegmenterRegionGrowingSegmentsPool::getSegmentsNumber ( ) const

Return the current allocated segments number.

Definition at line 143 of file SegmenterRegionGrowingSegmentsPool.cpp.

References m_segsNumber.

Matrix< SegmenterRegionGrowingSegment >& te::rp::SegmenterRegionGrowingSegmentsPool::getSegsMatrix ( )
inline

Return a reference to the internal segments matrix.

Returns
Return a reference to the internal segments matrix.
Note
The number of matrix elemetns may be greater than the requested number of segments.

Definition at line 88 of file SegmenterRegionGrowingSegmentsPool.h.

bool te::rp::SegmenterRegionGrowingSegmentsPool::initialize ( const SegmenterSegmentsBlock::SegmentIdDataType  segsNumber,
const unsigned int  featuresNumber 
)

Pool initialization.

Parameters
segsNumberThe number of segments to allocate.
featuresNumberThe number of features for each created segment.
Returns
true if ok, false on errors.
Note
The segments pool will initiate just SegmenterRegionGrowingSegment::m_features vector and take the ownership of it.

Definition at line 22 of file SegmenterRegionGrowingSegmentsPool.cpp.

References clear(), m_featuresNumber, m_segments, m_segmentsFeatures, m_segsNumber, and resetUseCounter().

Referenced by te::rp::SegmenterRegionGrowingStrategy::execute().

void te::rp::SegmenterRegionGrowingSegmentsPool::resetUseCounter ( )

Reset the segments use counter.

Definition at line 138 of file SegmenterRegionGrowingSegmentsPool.cpp.

References m_nextUnusedSegmentIdx.

Referenced by initialize().

Member Data Documentation

unsigned int te::rp::SegmenterRegionGrowingSegmentsPool::m_featuresNumber
protected

The number of features for each created segment.

Definition at line 103 of file SegmenterRegionGrowingSegmentsPool.h.

Referenced by clear(), initialize(), and SegmenterRegionGrowingSegmentsPool().

unsigned int te::rp::SegmenterRegionGrowingSegmentsPool::m_getNextSegment_col
protected

Definition at line 117 of file SegmenterRegionGrowingSegmentsPool.h.

Referenced by getNextSegment().

unsigned int te::rp::SegmenterRegionGrowingSegmentsPool::m_getNextSegment_line
protected

Definition at line 116 of file SegmenterRegionGrowingSegmentsPool.h.

Referenced by getNextSegment().

SegmenterSegmentsBlock::SegmentIdDataType te::rp::SegmenterRegionGrowingSegmentsPool::m_nextUnusedSegmentIdx
protected

The next unused segment index.

Definition at line 108 of file SegmenterRegionGrowingSegmentsPool.h.

Referenced by clear(), getNextSegment(), resetUseCounter(), and SegmenterRegionGrowingSegmentsPool().

Matrix< SegmenterRegionGrowingSegment > te::rp::SegmenterRegionGrowingSegmentsPool::m_segments
protected

Internal stored segments.

Definition at line 110 of file SegmenterRegionGrowingSegmentsPool.h.

Referenced by clear(), getNextSegment(), and initialize().

Matrix< SegmenterRegionGrowingSegment::FeatureType > te::rp::SegmenterRegionGrowingSegmentsPool::m_segmentsFeatures
protected

Internal stored segment features.

Definition at line 112 of file SegmenterRegionGrowingSegmentsPool.h.

Referenced by clear(), and initialize().

SegmenterSegmentsBlock::SegmentIdDataType te::rp::SegmenterRegionGrowingSegmentsPool::m_segsNumber
protected

The number of segments allocated segments.

Definition at line 91 of file SegmenterRegionGrowingSegmentsPool.h.

Referenced by clear(), getNextSegment(), getSegmentsNumber(), initialize(), and SegmenterRegionGrowingSegmentsPool().


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