SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
CParserSai.hpp
1 /* This file is part of scl, a control and simulation library
2 for robots and biomechanical models.
3 
4 scl is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 3 of the License, or (at your option) any later version.
8 
9 Alternatively, you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of
12 the License, or (at your option) any later version.
13 
14 scl is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU Lesser General Public
20 License and a copy of the GNU General Public License along with
21 scl. If not, see <http://www.gnu.org/licenses/>.
22 */
23 /* \file CParserSai.hpp
24  *
25  * Created on: Jan, 2011
26  *
27  * Copyright (C) 2011
28  *
29  * Author: Samir Menon <smenon@stanford.edu>
30  */
31 
32 #ifndef CPARSERSAI_HPP_
33 #define CPARSERSAI_HPP_
34 
35 #include <scl/parser/CParserBase.hpp>
36 
37 //The tinyxml parser implementation for sai xml files
38 #include <scl_tinyxml/scl_tinyxml.h>
39 
40 namespace scl {
41 
48 class CParserSai: public CParserBase {
49 public:
50  CParserSai():root_link_name_("ground"){}
51  virtual ~CParserSai(){}
52 
53  virtual bool listRobotsInFile(const std::string& arg_file,
54  std::vector<std::string>& arg_robot_names)
55  { return false; }
56 
77  virtual bool readRobotFromFile(const std::string& arg_file,
79  const std::string& arg_robot_name,
80  scl::SRobotParsed& arg_robot_object);
81 
82  virtual bool saveRobotToFile(scl::SRobotParsed& arg_robot,
83  const std::string &arg_file)
84  { return false; }
85 
86  virtual bool listGraphicsInFile(const std::string& arg_file,
87  std::vector<std::string>& arg_graphics_names)
88  { return false; }
89 
90  virtual bool readGraphicsFromFile(const std::string &arg_file,
91  const std::string &arg_graphics_name, scl::SGraphicsParsed& arg_graphics)
92  { return false; }
93 
94 private:
96  bool readLink(const scl_tinyxml::TiXmlHandle& arg_tiHndl_link, const bool arg_is_root,
97  const std::string& arg_parent_lnk_name, scl::SRobotParsed& arg_robot);
98 
99  const std::string root_link_name_;
100 };
101 
102 }
103 
104 #endif /*CPARSERSAI_HPP_*/
virtual bool listRobotsInFile(const std::string &arg_file, std::vector< std::string > &arg_robot_names)
Definition: CParserSai.hpp:53
virtual bool saveRobotToFile(scl::SRobotParsed &arg_robot, const std::string &arg_file)
Definition: CParserSai.hpp:82
virtual bool readGraphicsFromFile(const std::string &arg_file, const std::string &arg_graphics_name, scl::SGraphicsParsed &arg_graphics)
Definition: CParserSai.hpp:90
Definition: SRobotParsed.hpp:51
Definition: CParserBase.hpp:56
virtual bool readRobotFromFile(const std::string &arg_file, const std::string &arg_robot_name, scl::SRobotParsed &arg_robot_object)
Definition: CParserSai.cpp:48
Definition: CParserSai.hpp:48
virtual bool listGraphicsInFile(const std::string &arg_file, std::vector< std::string > &arg_graphics_names)
Definition: CParserSai.hpp:86
Definition: SGraphicsParsed.hpp:48
bool readLink(const scl_tinyxml::TiXmlHandle &arg_tiHndl_link, const bool arg_is_root, const std::string &arg_parent_lnk_name, scl::SRobotParsed &arg_robot)
Definition: CParserSai.cpp:99