All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SegmenterRegionGrowingSegment.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/rp/SegmenterRegionGrowingSegment.h
22  \brief Region Growing segment.
23  */
24 
25 #ifndef __TERRALIB_RP_INTERNAL_SEGMENTERREGIONGROWINGSEGMENT_H
26 #define __TERRALIB_RP_INTERNAL_SEGMENTERREGIONGROWINGSEGMENT_H
27 
28  #include "Config.h"
29  #include "SegmenterSegmentsBlock.h"
30 
31  #include <limits>
32 
33  namespace te
34  {
35  namespace rp
36  {
37  /*!
38  \brief Region Growing segment.
39  */
41  {
42  /*!
43  \brief Feature type definition.
44  */
45  typedef float FeatureType;
46 
47  /*!
48  \brief Feature type definition.
49  */
50  typedef unsigned short int IterationCounterType;
51 
52  /*!
53  \brief Segment ID.
54  */
56 
57  /*!
58  \brief Segment area (pixels number).
59  */
60  unsigned int m_size;
61 
62  /*!
63  \brief Segment left X coordinate box over the label image.
64  */
65  unsigned int m_xStart;
66 
67  /*!
68  \brief Segment lower bound X coordinate box over the label image.
69  */
70  unsigned int m_xBound;
71 
72  /*!
73  \brief Segment upper Y coordinate box over the label image.
74  */
75  unsigned int m_yStart;
76 
77  /*!
78  \brief Segment lower bound Y coordinate box over the label image.
79  */
80  unsigned int m_yBound;
81 
82  /*!
83  \brief Neighborhood segments pointers (some pointers can be null) or a null pointer if there is no neighborhood.
84  \note The segments pool will delete the vector pointed by this pointer at this segment deletion time.
85  */
87 
88  /*!
89  \brief The current size of m_neighborSegments.
90  */
91  unsigned int m_neighborSegmentsSize;
92 
93  /*!
94  \brief A pointer to the previous active segment.
95  */
97 
98  /*!
99  \brief A pointer to the next active segment.
100  */
102 
103  /*!
104  \brief A pionter to a fixed size vector of segment features.
105  \note The segments pool have the ownership of this vector.
106  */
108 
109  /*!
110  \brief The current size of m_features.
111  */
112  unsigned int m_featuresSize;
113 
114  /*!
115  \brief The current merge iteration.
116  \note Disabled: std::numeric_limits< SegmenterRegionGrowingSegment::IterationCounterType>::max()
117  */
119 
120  //overload
122 
123  /*!
124  \brief Add a pointer of a neighbor segment (if it is not already there).
125  */
126  void addNeighborSegment( SegmenterRegionGrowingSegment * const nSegPtr );
127 
128  /*!
129  \brief Remove all occurrences of a neighbor segment.
130  */
131  void removeNeighborSegment( SegmenterRegionGrowingSegment * const nSegPtr );
132 
133  /*!
134  \brief Remove all neighbor segments.
135  */
136  void clearNeighborSegments();
137 
138  /*!
139  \brief Disable this segment ( same as m_mergetIteration = std::numeric_limits< SegmenterRegionGrowingSegment::IterationCounterType>::max() ).
140  */
141  inline void disable() { m_mergetIteration = std::numeric_limits< IterationCounterType>::max(); };
142 
143  /*!
144  \brief Returns true if this segment is enabled.
145  \returns Returns true if this segment is enabled.
146  */
147  inline bool isEnabled() const { return m_mergetIteration != std::numeric_limits< IterationCounterType>::max(); };
148 
149  };
150  } // namespace rp
151  } // namespace te
152 
153 #endif
unsigned int m_neighborSegmentsSize
The current size of m_neighborSegments.
void disable()
Disable this segment ( same as m_mergetIteration = std::numeric_limits< SegmenterRegionGrowingSegment...
unsigned int m_yBound
Segment lower bound Y coordinate box over the label image.
unsigned int m_xStart
Segment left X coordinate box over the label image.
IterationCounterType m_mergetIteration
The current merge iteration.
unsigned int m_xBound
Segment lower bound X coordinate box over the label image.
SegmenterRegionGrowingSegment * m_nextActiveSegment
A pointer to the next active segment.
SegmenterRegionGrowingSegment * m_prevActiveSegment
A pointer to the previous active segment.
unsigned short int IterationCounterType
Feature type definition.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:141
FeatureType * m_features
A pionter to a fixed size vector of segment features.
SegmenterRegionGrowingSegment ** m_neighborSegments
Neighborhood segments pointers (some pointers can be null) or a null pointer if there is no neighborh...
unsigned int m_size
Segment area (pixels number).
unsigned int m_featuresSize
The current size of m_features.
Configuration flags for the Raster Processing module of TerraLib.
unsigned int m_yStart
Segment upper Y coordinate box over the label image.
Segments block.
bool isEnabled() const
Returns true if this segment is enabled.
SegmenterSegmentsBlock::SegmentIdDataType m_id
Segment ID.