ViSP  2.6.2
vpMbtXmlParser.h
1 /****************************************************************************
2  *
3  * $Id: vpMbtXmlParser.h 3530 2012-01-03 10:52:12Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2012 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 DOXYGEN_SHOULD_SKIP_THIS
50 
51 #ifndef vpMbtXmlParser_HH
52 #define vpMbtXmlParser_HH
53 
54 #include <visp/vpConfig.h>
55 
56 #ifdef VISP_HAVE_XML2
57 
58 #include <libxml/xmlmemory.h> /* Fonctions de la lib XML. */
59 
60 #include <visp/vpXmlParser.h>
61 #include <visp/vpMe.h>
62 #include <visp/vpCameraParameters.h>
63 
64 
65 
73 class VISP_EXPORT vpMbtXmlParser: public vpXmlParser
74 {
75 protected:
77  vpMe m_ecm;
80 
81  typedef enum{
82  conf,
83  ecm,
84  mask,
85  size,
86  nb_mask,
87  range,
88  tracking,
89  contrast,
90  edge_threshold,
91  mu1,
92  mu2,
93  sample,
94  step,
95  nb_sample,
96  camera,
97  height,
98  width,
99  u0,
100  v0,
101  px,
102  py
103  } dataToParse;
104 
105 
106 public:
107 
108  vpMbtXmlParser();
109  virtual ~vpMbtXmlParser();
110 
111  void parse(const char * filename);
112 
113  void readMainClass(xmlDocPtr doc, xmlNodePtr node);
114  void writeMainClass(xmlNodePtr node);
115 
116  void lecture_ecm (xmlDocPtr doc, xmlNodePtr node);
117  void lecture_sample (xmlDocPtr doc, xmlNodePtr node);
118  void lecture_camera (xmlDocPtr doc, xmlNodePtr node);
119  void lecture_mask (xmlDocPtr doc, xmlNodePtr node);
120  void lecture_range (xmlDocPtr doc, xmlNodePtr node);
121  void lecture_contrast (xmlDocPtr doc, xmlNodePtr node);
122 
123  void getCameraParameters(vpCameraParameters& _cam) const { _cam = this->cam;}
124  void getMe(vpMe& _ecm) const { _ecm = this->m_ecm;}
125 
126 protected:
127  void init();
128 
129 };
130 
131 #endif
132 
133 #endif
134 
135 #endif /* NMBTXMLPARSER_H_ */
136 
137 
138 
virtual void writeMainClass(xmlNodePtr node)=0
Contains predetermined masks for sites and holds moving edges tracking parameters.
Definition: vpMe.h:70
This class intends to simplify the creation of xml parser based on the libxml2 third party library...
Definition: vpXmlParser.h:178
Generic class defining intrinsic camera parameters.
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)=0
void parse(const std::string &filename)