ViSP  2.9.0
vpMbXmlParser.h
1 /****************************************************************************
2  *
3  * $Id: vpMbXmlParser.h 4574 2014-01-09 08:48:51Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2014 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Load XML Parameter for Model Based Tracker.
36  *
37  * Authors:
38  * Aurelien Yol
39  *
40  *****************************************************************************/
41 
47 #ifndef vpMbXmlParser_HH
48 #define vpMbXmlParser_HH
49 
50 #include <visp/vpConfig.h>
51 
52 #ifdef VISP_HAVE_XML2
53 
54 #include <libxml/xmlmemory.h> /* Fonctions de la lib XML. */
55 
56 #include <visp/vpXmlParser.h>
57 #include <visp/vpCameraParameters.h>
58 
67 class VISP_EXPORT vpMbXmlParser: public vpXmlParser
68 {
69 protected:
73  double angleAppear;
79  double nearClipping;
83  double farClipping;
86 
87  typedef enum{
98  u0,
99  v0,
100  px,
101  py,
102  last
103  } dataToParseMb;
104 
105 
106 public:
107 
108  vpMbXmlParser();
109  virtual ~vpMbXmlParser();
110 
116  inline double getAngleAppear() const {return angleAppear;}
117 
123  inline double getAngleDisappear() const {return angleDisappear;}
124 
125  void getCameraParameters(vpCameraParameters& _cam) const { _cam = this->cam;}
126 
132  inline double getFarClippingDistance() const {return farClipping;}
133 
139  inline bool getFovClipping() const {return fovClipping;}
140 
146  inline double getNearClippingDistance() const {return nearClipping;}
147 
153  inline bool hasFarClippingDistance() const {return hasFarClipping;}
154 
160  inline bool hasNearClippingDistance() const {return hasNearClipping;}
161 
162  void parse(const char * filename);
163 
164  virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node);
165  void read_camera (xmlDocPtr doc, xmlNodePtr node);
166  void read_face(xmlDocPtr doc, xmlNodePtr node);
167 
173  inline void setAngleAppear(const double &aappear) {angleAppear = aappear;}
174 
180  inline void setAngleDisappear(const double &adisappear) {angleDisappear = adisappear;}
181 
182  void setCameraParameters(const vpCameraParameters &_cam){ cam = _cam; }
183 
189  inline void setFarClippingDistance(const double &fclip) {farClipping = fclip;}
190 
196  inline void setNearClippingDistance(const double &nclip) {nearClipping = nclip;}
197 
198  void writeMainClass(xmlNodePtr node);
199 
200 protected:
201  void init();
202 
203 };
204 
205 #endif
206 
207 #endif /* NMBXMLPARSER_H_ */
208 
209 
210 
vpCameraParameters cam
Camera parameters.
Definition: vpMbXmlParser.h:71
void getCameraParameters(vpCameraParameters &_cam) const
double nearClipping
Near clipping distance.
Definition: vpMbXmlParser.h:79
double angleAppear
Angle to determine if a face appeared.
Definition: vpMbXmlParser.h:73
double getNearClippingDistance() const
virtual void writeMainClass(xmlNodePtr node)=0
bool hasFarClipping
Is far clipping distance specified?
Definition: vpMbXmlParser.h:81
double angleDisappear
Angle to determine if a face disappeared.
Definition: vpMbXmlParser.h:75
bool hasNearClippingDistance() const
This class intends to simplify the creation of xml parser based on the libxml2 third party library...
Definition: vpXmlParser.h:178
double getFarClippingDistance() const
bool hasFarClippingDistance() const
double farClipping
Near clipping distance.
Definition: vpMbXmlParser.h:83
double getAngleDisappear() const
void setAngleDisappear(const double &adisappear)
Generic class defining intrinsic camera parameters.
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)=0
void setCameraParameters(const vpCameraParameters &_cam)
bool hasNearClipping
Is near clipping distance specified?
Definition: vpMbXmlParser.h:77
Parse an Xml file to extract configuration parameters of a mbtConfig object.Data parser for the model...
Definition: vpMbXmlParser.h:67
void setNearClippingDistance(const double &nclip)
void setAngleAppear(const double &aappear)
bool fovClipping
Fov Clipping.
Definition: vpMbXmlParser.h:85
double getAngleAppear() const
bool getFovClipping() const
void setFarClippingDistance(const double &fclip)
void parse(const std::string &filename)