The Fib multimedia system
Fib is a system for storing multimedia data (like images or films).
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cImageStructure.h
Go to the documentation of this file.
1 /**
2  * @file cImageStructure
3  * file name: cImageStructure.h
4  * @author Betti Oesterholz
5  * @date 22.08.2012
6  * @mail Oesterholz@Fib-development.org
7  *
8  * System: C++
9  *
10  * This header specifies a class to store the data of a structure in an image.
11  *
12  * Copyright (C) @c GPL3 2012 Betti Oesterholz
13  *
14  * This program is free software: you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License (GPL) as
16  * published by the Free Software Foundation, either version 3 of the
17  * License, or any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU Lesser General Public License for more details.
23  *
24  * This header specifies a class to store the data of a structure in an image.
25  * If you want to convert an image to Fib structures, you have to search
26  * the image for structures, which can be converted to Fib.
27  * For this structures you can use this class.
28  */
29 /*
30 History:
31 22.08.2012 Oesterholz created
32 */
33 
34 
35 #ifndef ___C_IMAGE_STRUCTURE_H__
36 #define ___C_IMAGE_STRUCTURE_H__
37 
38 #include "version.h"
39 
40 #include "cVectorPosition.h"
41 
42 #include <set>
43 #include <string>
44 
45 
46 using namespace std;
47 
48 
49 namespace fib{
50 
51 namespace algorithms{
52 
53 namespace nConvertToFib{
54 
55 namespace nImage{
56 
57 namespace nStructureData{
58 
59 
61 protected:
62 
63  /**
64  * All points in the image structure.
65  */
66  set<cVectorPosition> structurePoints;
67 
68  /**
69  * Points which are in the structure, but have neighbour points which
70  * are not in the structure.
71  * @see structureNeighbourPoints
72  * @see structurePoints
73  */
74  set<cVectorPosition> structureBorderPoints;
75 
76  /**
77  * Points which are neighbours of points of the structure, but not in it.
78  * @see structureBorderPoints
79  * @see structurePoints
80  */
81  set<cVectorPosition> structureNeighbourPoints;
82 
83 
84  /**
85  * If the border points of the structure should be antialised.
86  */
88 
89 public:
90 
91  /**
92  * standard constructor
93  */
95 
96  /**
97  * copy constructor
98  *
99  * @param structureToCopy the image structure to copy
100  */
101  cImageStructure( const cImageStructure & structureToCopy );
102 
103 
104  /**
105  * destructor
106  */
107  virtual ~cImageStructure();
108 
109 
110  /**
111  * @return the name of the image structure (class name without the leading 'c')
112  */
113  virtual string getName() const;
114 
115  /**
116  * @return the set with the points of the structure
117  * @see structurePoints
118  */
119  set<cVectorPosition> getStructurePoints() const;
120 
121  /**
122  * @return the set with the points of the structure
123  * @see structurePoints
124  */
125  const set<cVectorPosition> & getStructurePointsConst() const;
126 
127  /**
128  * @return the set with the points which are in the structure, but have
129  * neighbour points which are not in the structure
130  * @see structureBorderPoints
131  */
132  set<cVectorPosition> getStructureBorderPoints() const;
133 
134  /**
135  * @return the set with the points which are in the structure, but have
136  * neighbour points which are not in the structure
137  * @see structureBorderPoints
138  */
139  const set<cVectorPosition> & getStructureBorderPointsConst() const;
140 
141  /**
142  * @return the set with the points which are neighbours of points of the
143  * structure, but not in it
144  * @see structureNeighbourPoints
145  */
146  set<cVectorPosition> getStructureNeighbourPoints() const;
147 
148  /**
149  * @return the set with the points which are neighbours of points of the
150  * structure, but not in it
151  * @see structureNeighbourPoints
152  */
153  const set<cVectorPosition> & getStructureNeighbourPointsConst() const;
154 
155 
156  /**
157  * This method sets the points of the structure to the given points.
158  *
159  * @see structurePoints
160  * @param setInStructurePoints the set with the points of the structure
161  */
162  void setStructurePoints( const set<cVectorPosition> & setInStructurePoints );
163 
164  /**
165  * This method sets the points which are in the structure, but have
166  * neighbour points which are not in the structure.
167  *
168  * @see structureBorderPoints
169  * @param setInStructureBorderPoints the set with the points which are
170  * in the structure, but have neighbour points which are not in the
171  * structure
172  */
173  void setStructureBorderPoints( const set<cVectorPosition> & setInStructureBorderPoints );
174 
175  /**
176  * This method sets the points which are neighbours of points of the
177  * structure, but not in it.
178  *
179  * @see structureNeighbourPoints
180  * @param setInStructureBorderPoints the set with the points which are
181  * neighbours of points of the structure
182  */
183  void setStructureNeighbourPoints( const set<cVectorPosition> & setInStructureNeighbourPoints );
184 
185  /**
186  * This method adds the given the given points to the structure.
187  *
188  * @see structurePoints
189  * @param setInStructurePoints the set with the points to add to the
190  * points of the structure
191  */
192  void addStructurePoints( const set<cVectorPosition> & setInStructurePoints );
193 
194  /**
195  * This method adds the given points to the points which are in the
196  * structure, but have neighbour points which are not in the structure.
197  *
198  * @see structureBorderPoints
199  * @param setInStructureBorderPoints the set with the points which to
200  * add to the structure of points, which have neighbour points which
201  * are not in the structure
202  */
203  void addStructureBorderPoints( const set<cVectorPosition> & setInStructureBorderPoints );
204 
205  /**
206  * This method adds the given points to the points which are neighbours
207  * of points of the structure, but not in it.
208  *
209  * @see structureNeighbourPoints
210  * @param setInStructureBorderPoints the set with the points to add as
211  * the neighbours of points of the structure
212  */
213  void addStructureNeighbourPoints( const set<cVectorPosition> & setInStructureNeighbourPoints );
214 
215  /**
216  * This method adds the given the given point to the structure.
217  *
218  * @see structurePoints
219  * @param setInStructurePoints the point to add to the structure
220  */
221  void addStructurePoints( const cVectorPosition & pointInStructurePoints );
222 
223  /**
224  * This method adds the given point to the points which are in the
225  * structure, but have neighbour points, which are not in the structure.
226  *
227  * @see structureBorderPoints
228  * @param setInStructureBorderPoints the point which to add to the
229  * structure of points which have neighbour points, which are not in
230  * the structure
231  */
232  void addStructureBorderPoints( const cVectorPosition & pointInStructureBorderPoints );
233 
234  /**
235  * This method adds the given point to the points, which are neighbours
236  * of points of the structure, but not in it.
237  *
238  * @see structureNeighbourPoints
239  * @param setInStructureBorderPoints the points to add to the
240  * neighbours of points of the structure
241  */
242  void addStructureNeighbourPoints( const cVectorPosition & pointInStructureNeighbourPoints );
243 
244 
245  /**
246  * This method deletes the given points from the structure.
247  *
248  * @see structurePoints
249  * @param setInStructurePoints the set with the points to delete from the
250  * points of the structure
251  */
252  void deleteStructurePoints( const set<cVectorPosition> & setInStructurePoints );
253 
254  /**
255  * This method deletes the given points from the points which are in the
256  * structure, but have neighbour points, which are not in the structure.
257  *
258  * @see structureBorderPoints
259  * @param setInStructureBorderPoints the set with the points which to
260  * delete from the structure of points which have neighbour points, which
261  * are not in the structure
262  */
263  void deleteStructureBorderPoints( const set<cVectorPosition> & setInStructureBorderPoints );
264 
265  /**
266  * This method deletes the given points from the points which are neighbours
267  * of points of the structure, but not in it.
268  *
269  * @see structureNeighbourPoints
270  * @param setInStructureBorderPoints the set with the points to delete
271  * of the neighbours of points of the structure
272  */
273  void deleteStructureNeighbourPoints( const set<cVectorPosition> & setInStructureNeighbourPoints );
274 
275  /**
276  * This method deletes the given the given point from the structure.
277  *
278  * @see structurePoints
279  * @param setInStructurePoints the point to delete from the structure
280  */
281  void deleteStructurePoints( const cVectorPosition & pointInStructurePoints );
282 
283  /**
284  * This method deletes the given point from the points which are in the
285  * structure, but have neighbour points, which are not in the structure.
286  *
287  * @see structureBorderPoints
288  * @param setInStructureBorderPoints the point which to delete from the
289  * structure of points which have neighbour points, which are not in
290  * the structure
291  */
292  void deleteStructureBorderPoints( const cVectorPosition & pointInStructureBorderPoints );
293 
294  /**
295  * This method deletes the given point from the points which are neighbours
296  * of points of the structure, but not in it.
297  *
298  * @see structureNeighbourPoints
299  * @param setInStructureBorderPoints the points to delete from the
300  * neighbours of points of the structure
301  */
302  void deleteStructureNeighbourPoints( const cVectorPosition & pointInStructureNeighbourPoints );
303 
304 
305  /**
306  * @see bIsAntialised
307  * @return if the structure border is antialised
308  */
309  bool isAntialised() const;
310 
311  /**
312  * Set if the border as antialised.
313  *
314  * @see bIsAntialised
315  * @param bInIsAntialised if true the structure border will be set to
316  * antialised or if false, it will be to set to not antialised
317  */
318  void setAntialised( const bool bInIsAntialised = true );
319 
320 
321 };//class cImageStructure
322 
323 };//end namespace nStructureData
324 };//end namespace nImage
325 };//end namespace nConvertToFib
326 };//end namespace algorithms
327 };//end namespace fib
328 
329 
330 #endif //___C_IMAGE_STRUCTURE_H__