SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
CParserScl.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 CParserScl.hpp
24  *
25  * Created on: May, 2010
26  *
27  * Copyright (C) 2010
28  *
29  * Author: Samir Menon <smenon@stanford.edu>
30  */
31 
32 #ifndef CPARSERSCL_HPP_
33 #define CPARSERSCL_HPP_
34 
35 #include <scl/parser/CParserBase.hpp>
36 
37 #include <scl/data_structs/SRobotParsed.hpp>
38 #include <scl/data_structs/SGraphicsParsed.hpp>
39 
40 namespace scl {
41 
49 class CParserScl: public CParserBase {
50 public:
51  CParserScl(){}
52  virtual ~CParserScl(){}
53 
54  virtual bool listRobotsInFile(const std::string& arg_file,
55  std::vector<std::string>& arg_robot_names);
56 
57  virtual bool readRobotFromFile(const std::string& arg_file,
58  const std::string& arg_robot_name,
59  scl::SRobotParsed& arg_robot_object);
60 
61  virtual bool saveRobotToFile(scl::SRobotParsed& arg_robot,
62  const std::string &arg_file);
63 
64  virtual bool listGraphicsInFile(const std::string& arg_file,
65  std::vector<std::string>& arg_graphics_names);
66 
67  virtual bool readGraphicsFromFile(const std::string &arg_file,
68  const std::string &arg_graphics_name,
69  scl::SGraphicsParsed& arg_graphics);
70 
71  virtual bool listUISpecsInFile(const std::string& arg_file,
72  std::vector<std::string>& arg_ui_spec_names);
73 
74  virtual bool readUISpecFromFile(const std::string &arg_file,
75  const std::string &arg_ui_spec_name,
76  scl::SUIParsed& arg_ui_spec);
77 
78  virtual bool listControllersInFile(const std::string &arg_file,
79  std::vector<std::pair<std::string,std::string> > &arg_ctrl_name_and_type);
80 
81  virtual bool readGcControllerFromFile(const std::string &arg_file,
82  const std::string &arg_ctrl_name,
83  std::string &ret_must_use_robot,
84  scl::SControllerGc& arg_ctrl);
85 
86  virtual bool readTaskControllerFromFile(const std::string &arg_file,
87  const std::string &arg_ctrl_name,
88  std::string &ret_must_use_robot,
92  std::vector<scl::STaskBase*> &ret_taskvec,
93  std::vector<scl::SNonControlTaskBase*> &ret_task_non_ctrl_vec);
94 
95 private:
97  bool readRobotSpecFromFile(const std::string& arg_spec_file,
98  const std::string& arg_robot_spec_name,
99  scl::SRobotParsed& arg_robot);
100 
106  virtual bool readActuatorSetMuscleFromFile(const std::string& arg_spec_file,
107  const std::string& arg_muscle_set_name,
109 };
110 
111 }
112 
113 #endif /*CPARSERSCL_HPP_*/
virtual bool listUISpecsInFile(const std::string &arg_file, std::vector< std::string > &arg_ui_spec_names)
Definition: CParserScl.cpp:1526
virtual bool saveRobotToFile(scl::SRobotParsed &arg_robot, const std::string &arg_file)
Definition: CParserScl.cpp:861
virtual bool readRobotFromFile(const std::string &arg_file, const std::string &arg_robot_name, scl::SRobotParsed &arg_robot_object)
Definition: CParserScl.cpp:140
virtual bool readActuatorSetMuscleFromFile(const std::string &arg_spec_file, const std::string &arg_muscle_set_name, scl::SActuatorSetMuscleParsed &ret_mset)
Definition: CParserScl.cpp:755
Definition: SRobotParsed.hpp:51
virtual bool listRobotsInFile(const std::string &arg_file, std::vector< std::string > &arg_robot_names)
Definition: CParserScl.cpp:89
Definition: CParserScl.hpp:49
virtual bool readTaskControllerFromFile(const std::string &arg_file, const std::string &arg_ctrl_name, std::string &ret_must_use_robot, std::vector< scl::STaskBase * > &ret_taskvec, std::vector< scl::SNonControlTaskBase * > &ret_task_non_ctrl_vec)
Definition: CParserScl.cpp:1844
Definition: CParserBase.hpp:56
virtual bool readGraphicsFromFile(const std::string &arg_file, const std::string &arg_graphics_name, scl::SGraphicsParsed &arg_graphics)
Definition: CParserScl.cpp:1034
Definition: SActuatorSetMuscleParsed.hpp:124
Definition: SUIParsed.hpp:55
virtual bool readGcControllerFromFile(const std::string &arg_file, const std::string &arg_ctrl_name, std::string &ret_must_use_robot, scl::SControllerGc &arg_ctrl)
Definition: CParserScl.cpp:1637
virtual bool listControllersInFile(const std::string &arg_file, std::vector< std::pair< std::string, std::string > > &arg_ctrl_name_and_type)
Definition: CParserScl.cpp:1585
bool readRobotSpecFromFile(const std::string &arg_spec_file, const std::string &arg_robot_spec_name, scl::SRobotParsed &arg_robot)
Definition: CParserScl.cpp:653
Definition: SGraphicsParsed.hpp:48
Definition: SControllerGc.hpp:55
virtual bool readUISpecFromFile(const std::string &arg_file, const std::string &arg_ui_spec_name, scl::SUIParsed &arg_ui_spec)
Definition: CParserScl.cpp:1191
virtual bool listGraphicsInFile(const std::string &arg_file, std::vector< std::string > &arg_graphics_names)
Definition: CParserScl.cpp:1467