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
cVectorPosition.h
Go to the documentation of this file.
1 /**
2  * @class cVectorPosition
3  * file name: cVectorPosition.h
4  * @author Betti Oesterholz
5  * @date 11.05.2009
6  * @mail webmaster@BioKom.info
7  *
8  * System: C++
9  *
10  * This class represents a positions -fib -vector.
11  * Copyright (C) @c LGPL3 2009 Betti Oesterholz
12  *
13  * This program is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License (LGPL) as
15  * published by the Free Software Foundation, either version 3 of the
16  * License, or any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU Lesser General Public License for more details.
22  *
23  * You should have received a copy of the GNU Lesser General Public License
24  * along with this program. If not, see <http://www.gnu.org/licenses/>.
25  *
26  *
27  * This file contains the class of all Fib -positionvectors.
28  * Thes positionvectors are used in Fib pointelements, for the position of
29  * the point.
30  *
31  */
32 /*
33 History:
34 11.05.2009 Oesterholz created
35 */
36 
37 #ifndef ___C_VECTOR_POSITION_H__
38 #define ___C_VECTOR_POSITION_H__
39 
40 
41 #include "version.h"
42 #include "fibDatatyps.h"
43 
44 #include "cFibVector.h"
45 
46 using std::vector;
47 
48 
49 namespace fib{
50 
51 
53 
54 public:
55 
56 //TODO change cFibElement to cPoint
57  /**
58  * The constructor of the positionvector.
59  *
60  * @param definingPointElement the Fib -pointelement which defines/ uses
61  * the positionsvector
62  */
63  cVectorPosition( cFibElement & definingPointElement );
64 
65  /**
66  * The constructor of the positionvector.
67  *
68  * @param iNumberOfDimensions number of elements in the vector or the dimensions
69  * @param pDefiningPointElement the Fib -pointelement which defines/ uses
70  * the positionsvector
71  */
72  cVectorPosition( unsignedIntFib iNumberOfDimensions = 2,
73  cFibElement * pDefiningPointElement = NULL );
74 
75  /**
76  * The copy constructor of the vector.
77  *
78  * @param vector the vector from which to copy the data
79  * @param definingFibElement the Fib -element which defines/ uses
80  * the new vector
81  */
82  cVectorPosition( const cVectorPosition & vector,
83  cFibElement * definingFibElement = NULL );
84 
85  /**
86  * The constructor for restoring a vector from an TinyXml element.
87  *
88  * @param pXmlNode a pointer to the TinyXml node the vector is stored in
89  * @param outStatus An reference to an integervalue where the errorvalue
90  * can be stored to.
91  * possible errorvalues are:
92  * - 0 loading successful
93  * - -1 loading error, invalid pXmlElement
94  * - -2 loading error, invalid data in pXmlElement
95  * - 1 loading warning, invalid data in pXmlElement, error could be corrected
96  * - 2 loading warning, invalid data in pXmlElement, maybe the loaded
97  * object is wrong
98  * @param liDefinedVariables a list with the defined variables for the
99  * to restore vector, every variable should have it's number
100  * (the number under which it is stored) as it's value
101  */
102  cVectorPosition( const TiXmlElement * pXmlElement, intFib &outStatus,
103  list<cFibVariable*> & liDefinedVariables );
104 
105  /**
106  * This constructor restores a positionsvector from the stream where it is
107  * stored in the compressed fib -format.
108  *
109  * @param iBitStream the stream where this vector is stored to in,
110  * because this stream is an cReadBits, any number of bits can be
111  * readed from it
112  * @param outStatus An reference to an integervalue where the errorvalue
113  * can be stored to. If the pointer is NULL no errorvalue will be
114  * given back.
115  * possible errorvalues are:
116  * - 0 loading successful
117  * - -1 loading error, invalid stream
118  * - -2 loading error, invalid data in stream
119  * - 1 loading warning, invalid data in stream, error could be corrected
120  * - 2 loading warning, invalid data in stream, maybe the loaded
121  * object is wrong
122  * @param liDefinedVariables a list with the defined variables for the
123  * to restore vector, every variable should have it's number
124  * (the number under which it is stored) as it's value
125  * @param pInVectorDomain the domain for this vector
126  * @param pInDomainVariable the domain for variables
127  */
128  cVectorPosition( cReadBits & iBitStream, intFib & outStatus,
129  list<cFibVariable*> & liDefinedVariables,
130  const cDomain * pInVectorDomain, const cDomain * pInDomainVariable );
131 
132 
133 //TODO change cFibElement to cPoint
134  /**
135  * This method creates an instance of this vector type.
136  *
137  * @param iNumberOfDimensions number of elements in the vector
138  * @param definingPointElement the Fib -pointelement which defines/ uses
139  * the positionsvector
140  */
142  unsignedIntFib iNumberOfDimensions=2,
143  cFibElement *definingPointElement=NULL ) const;
144 
145  /**
146  * Sets the Fib -element which defines/ uses this vector.
147  * If the given pointer is the nullpointer (standardvalue), no
148  * Fib -element defines this vector.
149  *
150  * @param definingFibElement a pointer to the Fib -element which
151  * defines/ uses this vector
152  * @param bCheckDomains getthe domains of the defining element and
153  * check the vectorelements with it
154  */
155  virtual void setDefiningFibElement( cFibElement *fibElement=NULL,
156  bool bCheckDomains=true );
157 
158  /**
159  * Returns the type of the vector.
160  * You have to delete the returned object after usage.
161  *
162  * @return the type of the vector
163  */
164  virtual cTypeElement * getElementType( ) const;
165 
166  /**
167  * @return the name for the type of the vector
168  */
169  virtual string getVectorType() const;
170 
171 
172 };//end class cVectorPosition
173 
174 
175 }//end namespace fib
176 
177 #endif