SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
CParserBase.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 CParserBase.hpp
24  *
25  * Created on: May, 2010
26  *
27  * Copyright (C) 2010
28  *
29  * Author: Samir Menon <smenon@stanford.edu>
30  */
31 
32 #ifndef CPARSERBASE_HPP_
33 #define CPARSERBASE_HPP_
34 
35 //Data structures passed to the branching template
36 #include <scl/data_structs/SRigidBody.hpp>
37 #include <scl/data_structs/SRobotParsed.hpp>
38 #include <scl/data_structs/SGraphicsParsed.hpp>
39 #include <scl/data_structs/SActuatorSetMuscleParsed.hpp>
40 #include <scl/data_structs/SUIParsed.hpp>
41 
42 #include <scl/control/gc/data_structs/SControllerGc.hpp>
43 #include <scl/control/task/data_structs/SControllerMultiTask.hpp>
44 
45 #include <string>
46 #include <vector>
47 #include <Eigen/Eigen>
48 #include <scl/DataTypes.hpp>
49 
50 namespace scl
51 {
57  {
58  public:
61 
63  virtual ~CParserBase(){}
64 
67  virtual bool listRobotsInFile(const std::string& arg_file,
68  std::vector<std::string>& arg_robot_names)=0;
69 
85  virtual bool readRobotFromFile(const std::string& arg_file,
87  const std::string& arg_robot_name,
90  scl::SRobotParsed& arg_robot)=0;
91 
97  virtual bool saveRobotToFile(scl::SRobotParsed& arg_robot,
98  const std::string &arg_file)
99  { return false; }
100 
103  virtual bool listMuscleSysInFile(const std::string& arg_file,
104  std::vector<std::string>& arg_msys_names)
105  { return S_NULL; }
106 
108  virtual bool readMuscleSysFromFile(const std::string& arg_file,
109  const std::string& arg_msys_name,
111  { return false; }
112 
115  virtual bool listGraphicsInFile(const std::string& arg_file,
116  std::vector<std::string>& arg_graphics_names)
117  { return false; }
118 
121  virtual bool readGraphicsFromFile(const std::string &arg_file,
122  const std::string &arg_graphics_name,
125  scl::SGraphicsParsed& arg_graphics)
126  { return false; }
127 
130  virtual bool listUISpecsInFile(const std::string& arg_file,
131  std::vector<std::string>& arg_ui_spec_names)
132  { return false; }
133 
136  virtual bool readUISpecFromFile(const std::string &arg_file,
137  const std::string &arg_ui_spec_name,
138  scl::SUIParsed& arg_ui_spec)
139  { return false; }
140 
144  virtual bool listControllersInFile(const std::string &arg_file,
145  std::vector<std::pair<std::string,std::string> > &arg_ctrl_name_and_type)
146  { return false; }
147 
151  virtual bool readGcControllerFromFile(const std::string &arg_file,
152  const std::string &arg_ctrl_name,
153  std::string &ret_must_use_robot,
154  scl::SControllerGc& arg_ctrl)
155  { return false; }
156 
160  virtual bool readTaskControllerFromFile(const std::string &arg_file,
161  const std::string &arg_ctrl_name,
162  std::string &ret_must_use_robot,
166  std::vector<scl::STaskBase*> &ret_taskvec,
167  std::vector<scl::SNonControlTaskBase*> &ret_task_non_ctrl_vec)
168  { return false; }
169 };
170 
171 }//End of namespace scl_parser
172 
173 #endif /*CPARSERBASE_HPP_*/
virtual bool listGraphicsInFile(const std::string &arg_file, std::vector< std::string > &arg_graphics_names)
Definition: CParserBase.hpp:115
virtual ~CParserBase()
Definition: CParserBase.hpp:63
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: CParserBase.hpp:151
virtual bool listUISpecsInFile(const std::string &arg_file, std::vector< std::string > &arg_ui_spec_names)
Definition: CParserBase.hpp:130
Definition: SRobotParsed.hpp:51
virtual bool readRobotFromFile(const std::string &arg_file, const std::string &arg_robot_name, scl::SRobotParsed &arg_robot)=0
virtual bool listRobotsInFile(const std::string &arg_file, std::vector< std::string > &arg_robot_names)=0
Definition: CParserBase.hpp:56
virtual bool readUISpecFromFile(const std::string &arg_file, const std::string &arg_ui_spec_name, scl::SUIParsed &arg_ui_spec)
Definition: CParserBase.hpp:136
virtual bool readGraphicsFromFile(const std::string &arg_file, const std::string &arg_graphics_name, scl::SGraphicsParsed &arg_graphics)
Definition: CParserBase.hpp:121
Definition: SActuatorSetMuscleParsed.hpp:124
Definition: SUIParsed.hpp:55
virtual bool listMuscleSysInFile(const std::string &arg_file, std::vector< std::string > &arg_msys_names)
Definition: CParserBase.hpp:103
virtual bool listControllersInFile(const std::string &arg_file, std::vector< std::pair< std::string, std::string > > &arg_ctrl_name_and_type)
Definition: CParserBase.hpp:144
virtual bool readMuscleSysFromFile(const std::string &arg_file, const std::string &arg_msys_name, scl::SActuatorSetMuscleParsed &arg_msys)
Definition: CParserBase.hpp:108
Definition: SGraphicsParsed.hpp:48
Definition: SControllerGc.hpp:55
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: CParserBase.hpp:160
CParserBase()
Definition: CParserBase.hpp:60
virtual bool saveRobotToFile(scl::SRobotParsed &arg_robot, const std::string &arg_file)
Definition: CParserBase.hpp:97