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
cEvalueUnderObjects.h
Go to the documentation of this file.
1 /**
2  * @class cEvalueUnderObjects
3  * file name: cEvalueUnderObjects.h
4  * @author Betti Oesterholz
5  * @date 08.12.2010
6  * @mail webmaster@BioKom.info
7  *
8  * System: C++
9  *
10  * This is a helpclass to evalue the positions with ther properties and
11  * the number of underobjects in which they are contained.
12  *
13  * Copyright (C) @c LGPL3 2010 Betti Oesterholz
14  *
15  * This program is free software: you can redistribute it and/or modify
16  * it under the terms of the GNU Lesser General Public License (LGPL) as
17  * published by the Free Software Foundation, either version 3 of the
18  * License, or any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU Lesser General Public License for more details.
24  *
25  * You should have received a copy of the GNU Lesser General Public License
26  * along with this program. If not, see <http://www.gnu.org/licenses/>.
27  *
28  *
29  * This is a helpclass to evalue the positions with ther properties and
30  * the number of underobjects in which they are contained.
31  *
32  */
33 /*
34 History:
35 08.12.2010 Oesterholz created
36 */
37 
38 
39 #ifndef ___N_NEEDED_UNDEROBJECTS_C_EVALUE_UNDER_OBJECTS_H__
40 #define ___N_NEEDED_UNDEROBJECTS_C_EVALUE_UNDER_OBJECTS_H__
41 
42 
43 #include "version.h"
44 #include "fibDatatyps.h"
45 
46 #include "cPositionData.h"
47 #include "cPointData.h"
48 #include "cPropertyData.h"
49 #include "cUnderobject.h"
50 
51 #include "cFibElement.h"
52 #include "cPoint.h"
53 #include "cProperty.h"
54 #include "cDomainVectorBasis.h"
55 #include "cVectorPosition.h"
56 
57 
58 #include <list>
59 #include <map>
60 
61 using namespace std;
62 
63 
64 namespace fib{
65 namespace algorithms{
66 namespace nEvalueFibObject{
67 namespace nNeededUnderobjects{
68 
69 
71 public:
72 
73 
74  /**
75  * The set for the evalued fib -object position data.
76  */
77  map< cVectorPosition, cPositionData > mapEvaluedPositionData;
78 
79 
80  /**
81  * The set for the property data.
82  */
83  map< cProperty*, cPropertyData > mapPropertyData;
84 
85  /**
86  * The set for the point data.
87  */
88  map< cPoint*, cPointData > mapPointData;
89 
90  /**
91  * The list with the properties for the next evalued position.
92  */
93  list< pair< cProperty *, cVectorProperty > > liActualProperties;
94 
95  /**
96  * The dimensions in which bounderies the positions should lay.
97  */
99 
100 private:
101 
102  /**
103  * List with the fib-element typs to evalue.
104  * To speed evaluation up.
105  */
106  list<char> liCFibElementTyps;
107 
108 public:
109 
110  /**
111  * standardconstructor
112  *
113  * @param pInVecDomainDimension The dimension domain for the positions.
114  * No position outside this domain will be added.
115  * If NULL no check will be executed. (@see pVecDomainDimension)
116  */
117  cEvalueUnderObjects( const cDomainVectorBasis * pInVecDomainDimension = NULL );
118 
119  /**
120  * desconstructor
121  */
123 
124  /**
125  * The method with wich the evalued fib -elements with ther properties
126  * are inserted /evalued. Everytime a fib -element of the choosen type
127  * (to evalue) is reached in the evaluation, this method is called with
128  * the fib -element and the properties of the fib -element.
129  *
130  * @param pFibElement the fib -element to evalue
131  * @param vProperties a list with the properties of the fib -element
132  */
133  bool evalueElement( cFibElement & fibElement,
134  const list<cVectorProperty> & vProperties );
135 
136  /**
137  * This method finds all the property- and pointelements in the given
138  * fib -object and adds them to the datasets.
139  *
140  * @see mapPropertyData
141  * @see mapPointData
142  * @param pFibObject the fib -object, wher to find the fib -element data
143  */
144  void findAllFibElementData( cFibElement & pFibObject );
145 
146  /**
147  * This function creates the underobject tree for the evalued points.
148  * Beware: You have to care that the created underobject tree will
149  * be deleted.
150  *
151  * @return a pointer to the created underobject tree
152  */
153  cUnderobject<cPointData> * createUnderobjectTree();
154 
155  /**
156  * This method marks all the property- and pointelements wich aren't
157  * needed.
158  *
159  * This are:
160  * - all overwritten properties
161  * - all properties, wich overwrites the background, but are also equal to it
162  * - all points which have no properties, which are not overwritten
163  *
164  * @see mapPropertyData
165  * @see mapPointData
166  * @see mapEvaluedPositionData
167  * @return true if some fib -elements wher marked, else false
168  */
169  bool markOverwrittenFibElements();
170 
171 //TODO
172  /**
173  * This method marks all the property- and pointelements wich aren't
174  * needed if the given properties are the background properties.
175  * This are all properties, wich overwrites the given background
176  * properties, but are also equal to it.
177  * Beware: Call @see markOverwrittenFibElements() befor calling this method.
178  *
179  * @see mapPropertyData
180  * @see mapPointData
181  * @see mapEvaluedPositionData
182  * @param liBackgroundProperties the background properties
183  * @return true if some fib -elements wher marked, else false
184  */
185  bool markOverwrittenByBgFibElements(
186  const list<cVectorProperty> & liBackgroundProperties);
187 
188 /*TODO bool markOverwrittenByBgFibElements(
189  const list<cVectorProperty> & liBackgroundProperties, doubleFib dDistance );
190 */
191 
192 //background methods
193 
194  /**
195  * This method evalues wich propertys can remove how many
196  * propertyelements(of the evalued data) as a background property.
197  * You should call the @see markOverwrittenFibElements() methods befor
198  * jusing this method.
199  *
200  * @return a list with the pairs:
201  * - first: a property vector(without variables)
202  * - second: how many fib property elements can be removed, if this
203  * property is used as an background property
204  */
205  list< pair< cVectorProperty, unsigned long> >
206  countPropertyElementsOverwritebelByBg() const;
207 
208 
209 
210 #ifdef DEBUG
211  /**
212  * Prints the evalued data.
213  *
214  * @param stream the strem wher to print the data to
215  */
216  void print( ostream & stream ) const;
217 #endif //DEBUG
218 
219 };//class cEvalueUnderObjects
220 
221 
222 
223 }//end namespace nNeededUnderobjects
224 }//end namespace nEvalueFibObject
225 }//end namespace algorithms
226 }//end namespace fib
227 
228 
229 
230 #endif //___N_NEEDED_UNDEROBJECTS_C_EVALUE_UNDER_OBJECTS_H__