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)
112 bool camera_node =
false;
113 bool face_node =
false;
114 bool lod_node =
false;
116 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
117 if (dataNode->type == XML_ELEMENT_NODE) {
118 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
119 if (iter_data !=
nodeMap.end()) {
120 switch (iter_data->second) {
143 std::cout <<
"camera : u0 : " << this->
cam.
get_u0() <<
" (default)" << std::endl;
144 std::cout <<
"camera : v0 : " << this->
cam.
get_v0() <<
" (default)" << std::endl;
145 std::cout <<
"camera : px : " << this->
cam.
get_px() <<
" (default)" << std::endl;
146 std::cout <<
"camera : py : " << this->
cam.
get_py() <<
" (default)" << std::endl;
150 std::cout <<
"face : Angle Appear : " <<
angleAppear <<
" (default)" << std::endl;
151 std::cout <<
"face : Angle Disappear : " <<
angleDisappear <<
" (default)" << std::endl;
155 std::cout <<
"lod : use lod : " <<
useLod <<
" (default)" << std::endl;
171 bool u0_node =
false;
172 bool v0_node =
false;
173 bool px_node =
false;
174 bool py_node =
false;
182 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
183 if (dataNode->type == XML_ELEMENT_NODE) {
184 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
185 if (iter_data !=
nodeMap.end()) {
186 switch (iter_data->second) {
215 std::cout <<
"camera : u0 : " << this->
cam.
get_u0() <<
" (default)" << std::endl;
217 std::cout <<
"camera : u0 : " << this->
cam.
get_u0() << std::endl;
220 std::cout <<
"camera : v0 : " << this->
cam.
get_v0() <<
" (default)" << std::endl;
222 std::cout <<
"camera : v0 : " << this->
cam.
get_v0() << std::endl;
225 std::cout <<
"camera : px : " << this->
cam.
get_px() <<
" (default)" << std::endl;
227 std::cout <<
"camera : px : " << this->
cam.
get_px() << std::endl;
230 std::cout <<
"camera : py : " << this->
cam.
get_py() <<
" (default)" << std::endl;
232 std::cout <<
"camera : py : " << this->
cam.
get_py() << std::endl;
245 bool angle_appear_node =
false;
246 bool angle_disappear_node =
false;
247 bool near_clipping_node =
false;
248 bool far_clipping_node =
false;
249 bool fov_clipping_node =
false;
251 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
252 if (dataNode->type == XML_ELEMENT_NODE) {
253 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
254 if (iter_data !=
nodeMap.end()) {
255 switch (iter_data->second) {
258 angle_appear_node =
true;
262 angle_disappear_node =
true;
266 near_clipping_node =
true;
271 far_clipping_node =
true;
279 fov_clipping_node =
true;
290 if (!angle_appear_node)
291 std::cout <<
"face : Angle Appear : " <<
angleAppear <<
" (default)" << std::endl;
293 std::cout <<
"face : Angle Appear : " <<
angleAppear << std::endl;
295 if (!angle_disappear_node)
296 std::cout <<
"face : Angle Disappear : " <<
angleDisappear <<
" (default)" << std::endl;
298 std::cout <<
"face : Angle Disappear : " <<
angleDisappear << std::endl;
300 if (near_clipping_node)
301 std::cout <<
"face : Near Clipping : " <<
nearClipping << std::endl;
303 if (far_clipping_node)
304 std::cout <<
"face : Far Clipping : " <<
farClipping << std::endl;
306 if (fov_clipping_node) {
308 std::cout <<
"face : Fov Clipping : True" << std::endl;
310 std::cout <<
"face : Fov Clipping : False" << std::endl;
316 bool use_lod_node =
false;
317 bool min_line_length_threshold_node =
false;
318 bool min_polygon_area_threshold_node =
false;
320 for (xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
321 if (dataNode->type == XML_ELEMENT_NODE) {
322 std::map<std::string, int>::iterator iter_data = this->
nodeMap.find((
char *)dataNode->name);
323 if (iter_data !=
nodeMap.end()) {
324 switch (iter_data->second) {
331 min_line_length_threshold_node =
true;
335 min_polygon_area_threshold_node =
true;
347 std::cout <<
"lod : use lod : " <<
useLod <<
" (default)" << std::endl;
349 std::cout <<
"lod : use lod : " <<
useLod << std::endl;
351 if (!min_line_length_threshold_node)
356 if (!min_polygon_area_threshold_node)
362 #elif !defined(VISP_BUILD_SHARED_LIBS) 365 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?
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.