41 #include <visp/vpConfig.h>
49 #include <libxml/xmlmemory.h>
51 #include <visp/vpMbXmlParser.h>
59 : cam(), angleAppear(70), angleDisappear(80),
60 hasNearClipping(false), nearClipping(false),
61 hasFarClipping(false), farClipping(false), fovClipping(false)
107 std::string file = filename;
132 bool camera_node =
false;
133 bool face_node =
false;
135 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
136 if(dataNode->type == XML_ELEMENT_NODE){
137 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
138 if(iter_data !=
nodeMap.end()){
139 switch (iter_data->second){
157 std::cout <<
"camera : u0 : "<< this->
cam.
get_u0() <<
" (default)" <<std::endl;
158 std::cout <<
"camera : v0 : "<< this->
cam.
get_v0() <<
" (default)" <<std::endl;
159 std::cout <<
"camera : px : "<< this->
cam.
get_px() <<
" (default)" <<std::endl;
160 std::cout <<
"camera : py : "<< this->
cam.
get_py() <<
" (default)" <<std::endl;
164 std::cout <<
"face : Angle Appear : "<<
angleAppear <<
" (default)" <<std::endl;
165 std::cout <<
"face : Angle Disappear : "<<
angleDisappear <<
" (default)" <<std::endl;
180 bool u0_node =
false;
181 bool v0_node =
false;
182 bool px_node =
false;
183 bool py_node =
false;
191 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
192 if(dataNode->type == XML_ELEMENT_NODE){
193 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
194 if(iter_data !=
nodeMap.end()){
195 switch (iter_data->second){
223 std::cout <<
"camera : u0 : "<< this->
cam.
get_u0() <<
" (default)" <<std::endl;
225 std::cout <<
"camera : u0 : "<< this->
cam.
get_u0() <<std::endl;
228 std::cout <<
"camera : v0 : "<< this->
cam.
get_v0() <<
" (default)" <<std::endl;
230 std::cout <<
"camera : v0 : "<< this->
cam.
get_v0() <<std::endl;
233 std::cout <<
"camera : px : "<< this->
cam.
get_px() <<
" (default)" <<std::endl;
235 std::cout <<
"camera : px : "<< this->
cam.
get_px() <<std::endl;
238 std::cout <<
"camera : py : "<< this->
cam.
get_py() <<
" (default)" <<std::endl;
240 std::cout <<
"camera : py : "<< this->
cam.
get_py() <<std::endl;
254 bool angle_appear_node =
false;
255 bool angle_disappear_node =
false;
256 bool near_clipping_node =
false;
257 bool far_clipping_node =
false;
258 bool fov_clipping_node =
false;
260 for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) {
261 if(dataNode->type == XML_ELEMENT_NODE){
262 std::map<std::string, int>::iterator iter_data= this->
nodeMap.find((
char*)dataNode->name);
263 if(iter_data !=
nodeMap.end()){
264 switch (iter_data->second){
267 angle_appear_node =
true;
271 angle_disappear_node =
true;
275 near_clipping_node =
true;
280 far_clipping_node =
true;
288 fov_clipping_node =
true;
298 if(!angle_appear_node)
299 std::cout <<
"face : Angle Appear : "<<
angleAppear <<
" (default)" <<std::endl;
301 std::cout <<
"face : Angle Appear : "<<
angleAppear <<std::endl;
303 if(!angle_disappear_node)
304 std::cout <<
"face : Angle Disappear : "<<
angleDisappear <<
" (default)" <<std::endl;
306 std::cout <<
"face : Angle Disappear : "<<
angleDisappear <<std::endl;
308 if(near_clipping_node)
309 std::cout <<
"face : Near Clipping : "<<
nearClipping <<std::endl;
311 if(far_clipping_node)
312 std::cout <<
"face : Far Clipping : "<<
farClipping <<std::endl;
314 if(fov_clipping_node) {
316 std::cout <<
"face : Fov Clipping : True" <<std::endl;
318 std::cout <<
"face : Fov Clipping : False" <<std::endl;
vpCameraParameters cam
Camera parameters.
void setMainTag(const std::string &tag)
double nearClipping
Near clipping distance.
double angleAppear
Angle to determine if a face appeared.
error that can be emited by ViSP classes.
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
void parse(const std::string &filename)