ViSP  2.7.0
vpMbtXmlParser.h
1 /****************************************************************************
2  *
3  * $Id: vpMbtXmlParser.h 4056 2013-01-05 13:04:42Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2013 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  * Make the complete tracking of an object by using its CAD model
36  *
37  * Authors:
38  * Nicolas Melchior
39  * Romain Tallonneau
40  * Eric Marchand
41  *
42  *****************************************************************************/
43 
49 #ifndef vpMbtXmlParser_HH
50 #define vpMbtXmlParser_HH
51 
52 #include <visp/vpConfig.h>
53 
54 #ifdef VISP_HAVE_XML2
55 
56 #include <libxml/xmlmemory.h> /* Fonctions de la lib XML. */
57 
58 #include <visp/vpXmlParser.h>
59 #include <visp/vpMe.h>
60 #include <visp/vpCameraParameters.h>
61 
62 
63 
72 class VISP_EXPORT vpMbtXmlParser: public vpXmlParser
73 {
74 protected:
80  double angleAppear;
83 
84  typedef enum{
86  ecm,
94  mu1,
95  mu2,
105  u0,
106  v0,
107  px,
108  py
109  } dataToParse;
110 
111 
112 public:
113 
114  vpMbtXmlParser();
115  virtual ~vpMbtXmlParser();
116 
122  inline double getAngleAppear() const {return angleAppear;}
123 
129  inline double getAngleDisappear() const {return angleDisappear;}
130 
131  void getCameraParameters(vpCameraParameters& _cam) const { _cam = this->cam;}
132  void getMe(vpMe& _ecm) const { _ecm = this->m_ecm;}
133 
134  void parse(const char * filename);
135 
136  void readMainClass(xmlDocPtr doc, xmlNodePtr node);
137  void read_ecm (xmlDocPtr doc, xmlNodePtr node);
138  void read_sample (xmlDocPtr doc, xmlNodePtr node);
139  void read_camera (xmlDocPtr doc, xmlNodePtr node);
140  void read_mask (xmlDocPtr doc, xmlNodePtr node);
141  void read_range (xmlDocPtr doc, xmlNodePtr node);
142  void read_contrast (xmlDocPtr doc, xmlNodePtr node);
143  void read_face(xmlDocPtr doc, xmlNodePtr node);
144 
150  inline void setAngleAppear(const double &aappear) {angleAppear = aappear;}
151 
157  inline void setAngleDisappear(const double &adisappear) {angleDisappear = adisappear;}
158 
159  void setCameraParameters(const vpCameraParameters &_cam){ cam = _cam; }
160  void setMovingEdge(const vpMe &_ecm){ m_ecm = _ecm; }
161 
162  void writeMainClass(xmlNodePtr node);
163 
164 protected:
165  void init();
166 
167 };
168 
169 #endif
170 
171 #endif /* NMBTXMLPARSER_H_ */
172 
173 
174 
void setCameraParameters(const vpCameraParameters &_cam)
double getAngleAppear() const
vpCameraParameters cam
Camera parameters.
Parse an Xml file to extract configuration parameters of a mbtConfig object.Data parser for the model...
void setAngleDisappear(const double &adisappear)
void getMe(vpMe &_ecm) const
virtual void writeMainClass(xmlNodePtr node)=0
Contains predetermined masks for sites and holds moving edges tracking parameters.
Definition: vpMe.h:70
double getAngleDisappear() const
This class intends to simplify the creation of xml parser based on the libxml2 third party library...
Definition: vpXmlParser.h:178
vpMe m_ecm
Moving edges parameters.
double angleAppear
Angle to determine if a face appeared.
Generic class defining intrinsic camera parameters.
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)=0
double angleDisappear
Angle to determine if a face disappeared.
void getCameraParameters(vpCameraParameters &_cam) const
void setMovingEdge(const vpMe &_ecm)
void setAngleAppear(const double &aappear)
void parse(const std::string &filename)