38 #include <visp3/core/vpConfig.h> 45 #include <libxml/xmlmemory.h> 47 #include <visp3/mbt/vpMbXmlParser.h> 54 : cam(), angleAppear(70), angleDisappear(80), hasNearClipping(false), nearClipping(false), hasFarClipping(false),
55 farClipping(false), fovClipping(false), useLod(false), minLineLengthThreshold(50.0), minPolygonAreaThreshold(2500.0)
101 std::string file = filename;
124 bool camera_node =
false;
125 bool face_node =
false;
126 bool lod_node =
false;
128 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
129 if (dataNode->type == XML_ELEMENT_NODE) {
130 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
131 if (iter_data !=
nodeMap.end()) {
132 switch (iter_data->second) {
155 std::cout <<
"camera : u0 : " << this->
cam.
get_u0() <<
" (default)" << std::endl;
156 std::cout <<
"camera : v0 : " << this->
cam.
get_v0() <<
" (default)" << std::endl;
157 std::cout <<
"camera : px : " << this->
cam.
get_px() <<
" (default)" << std::endl;
158 std::cout <<
"camera : py : " << this->
cam.
get_py() <<
" (default)" << std::endl;
162 std::cout <<
"face : Angle Appear : " <<
angleAppear <<
" (default)" << std::endl;
163 std::cout <<
"face : Angle Disappear : " <<
angleDisappear <<
" (default)" << std::endl;
167 std::cout <<
"lod : use lod : " <<
useLod <<
" (default)" << std::endl;
183 bool u0_node =
false;
184 bool v0_node =
false;
185 bool px_node =
false;
186 bool py_node =
false;
194 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
195 if (dataNode->type == XML_ELEMENT_NODE) {
196 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
197 if (iter_data !=
nodeMap.end()) {
198 switch (iter_data->second) {
227 std::cout <<
"camera : u0 : " << this->
cam.
get_u0() <<
" (default)" << std::endl;
229 std::cout <<
"camera : u0 : " << this->
cam.
get_u0() << std::endl;
232 std::cout <<
"camera : v0 : " << this->
cam.
get_v0() <<
" (default)" << std::endl;
234 std::cout <<
"camera : v0 : " << this->
cam.
get_v0() << std::endl;
237 std::cout <<
"camera : px : " << this->
cam.
get_px() <<
" (default)" << std::endl;
239 std::cout <<
"camera : px : " << this->
cam.
get_px() << std::endl;
242 std::cout <<
"camera : py : " << this->
cam.
get_py() <<
" (default)" << std::endl;
244 std::cout <<
"camera : py : " << this->
cam.
get_py() << std::endl;
257 bool angle_appear_node =
false;
258 bool angle_disappear_node =
false;
259 bool near_clipping_node =
false;
260 bool far_clipping_node =
false;
261 bool fov_clipping_node =
false;
263 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
264 if (dataNode->type == XML_ELEMENT_NODE) {
265 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
266 if (iter_data !=
nodeMap.end()) {
267 switch (iter_data->second) {
270 angle_appear_node =
true;
274 angle_disappear_node =
true;
278 near_clipping_node =
true;
283 far_clipping_node =
true;
291 fov_clipping_node =
true;
302 if (!angle_appear_node)
303 std::cout <<
"face : Angle Appear : " <<
angleAppear <<
" (default)" << std::endl;
305 std::cout <<
"face : Angle Appear : " <<
angleAppear << std::endl;
307 if (!angle_disappear_node)
308 std::cout <<
"face : Angle Disappear : " <<
angleDisappear <<
" (default)" << std::endl;
310 std::cout <<
"face : Angle Disappear : " <<
angleDisappear << std::endl;
312 if (near_clipping_node)
313 std::cout <<
"face : Near Clipping : " <<
nearClipping << std::endl;
315 if (far_clipping_node)
316 std::cout <<
"face : Far Clipping : " <<
farClipping << std::endl;
318 if (fov_clipping_node) {
320 std::cout <<
"face : Fov Clipping : True" << std::endl;
322 std::cout <<
"face : Fov Clipping : False" << std::endl;
328 bool use_lod_node =
false;
329 bool min_line_length_threshold_node =
false;
330 bool min_polygon_area_threshold_node =
false;
332 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
333 if (dataNode->type == XML_ELEMENT_NODE) {
334 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
335 if (iter_data !=
nodeMap.end()) {
336 switch (iter_data->second) {
343 min_line_length_threshold_node =
true;
347 min_polygon_area_threshold_node =
true;
359 std::cout <<
"lod : use lod : " <<
useLod <<
" (default)" << std::endl;
361 std::cout <<
"lod : use lod : " <<
useLod << std::endl;
363 if (!min_line_length_threshold_node)
368 if (!min_polygon_area_threshold_node)
374 #elif !defined(VISP_BUILD_SHARED_LIBS) 377 void dummy_vpMbXmlParser(){};
vpCameraParameters cam
Camera parameters.
void setMainTag(const std::string &tag)
void read_lod(xmlDocPtr doc, xmlNodePtr node)
double nearClipping
Near clipping distance.
double angleAppear
Angle to determine if a face appeared.
error that can be emited by ViSP classes.
double minLineLengthThreshold
Minimum line length to track a segment when LOD is enabled.
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)
double xmlReadDoubleChild(xmlDocPtr doc, xmlNodePtr node)
bool hasFarClipping
Is far clipping distance specified?
double angleDisappear
Angle to determine if a face disappeared.
void initPersProjWithoutDistortion(const double px, const double py, const double u0, const double v0)
double farClipping
Near clipping distance.
void read_camera(xmlDocPtr doc, xmlNodePtr node)
void writeMainClass(xmlNodePtr node)
int xmlReadIntChild(xmlDocPtr doc, xmlNodePtr node)
void read_face(xmlDocPtr doc, xmlNodePtr node)
bool hasNearClipping
Is near clipping distance specified?
void parse(const char *filename)
bool fovClipping
Fov Clipping.
std::map< std::string, int > nodeMap
double minPolygonAreaThreshold
Minimum polygon area to track a face when LOD is enabled.
bool useLod
If true, the LOD is enabled, otherwise it is not.
void parse(const std::string &filename)