SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
CGraphicsBase.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 CGraphicsBase.hpp
24  *
25  * Created on: Aug 27, 2010
26  *
27  * Copyright (C) 2010
28  *
29  * Author: Samir Menon <smenon@stanford.edu>
30  */
31 
32 #ifndef CGRAPHICSBASE_HPP_
33 #define CGRAPHICSBASE_HPP_
34 
35 #include <scl/DataTypes.hpp>
36 #include <scl/data_structs/SObject.hpp>
37 
38 #include <string>
39 
40 #include <Eigen/Eigen>
41 
42 namespace scl
43 {
44 
45 struct SRigidBody;
46 struct SRobotSensors;
47 
48 class CGraphicsBase : public SObject
49 {
50 public:
52  CGraphicsBase() : SObject("CGraphicsBase") {}
53 
55  virtual ~CGraphicsBase(){}
56 
57  /********************************************************
58  * Initialization Functions: Sets up a scenegraph, camera
59  * etc..
60  *********************************************************/
67  virtual sBool initGraphics(
69  const SGraphicsParsed* arg_gr_ds)=0;
70 
72  virtual sBool hasBeenInit() { return has_been_init_; }
73 
75  virtual sBool destroyGraphics()=0;
76 
82  virtual sBool addRobotToRender(
84  const SRobotParsed *arg_rob_parsed,
86  const SRobotIO* arg_rob_io)=0;
87 
94  const std::string& arg_robot)=0;
95 
100  virtual sBool addMeshToRender(
101  const std::string& arg_mesh_name,
102  const std::string& arg_mesh_file,
103  const Eigen::Vector3d& arg_pos,
104  const Eigen::Matrix3d& arg_rot)=0;
105 
110  virtual sBool removeMeshFromRender(const std::string& arg_mesh_name)=0;
111 
117  virtual sBool addMusclesToRender(
119  const std::string& arg_robot,
121  const SActuatorSetMuscleParsed& arg_mset,
122  const sBool add_musc_via_points)=0;
123 
130  const std::string& arg_robot,
131  const std::string& arg_mset)=0;
132 
133 
134  /********************************************************
135  * Rendering Functions: Will actually render the scene
136  * A set of OpenGL calls.
137  *********************************************************/
141  virtual sBool updateGraphics()=0;
142 
145  virtual sBool updateGraphicsForRobots()=0;
146 
149  virtual bool updateGraphicsForMeshes()=0;
150 
153  virtual bool updateGraphicsForMuscles()=0;
154 };
155 
156 }
157 
158 #endif /* CGRAPHICSBASE_HPP_ */
virtual sBool removeRobotFromRender(const std::string &arg_robot)=0
virtual sBool addMusclesToRender(const std::string &arg_robot, const SActuatorSetMuscleParsed &arg_mset, const sBool add_musc_via_points)=0
Definition: SRobotIO.hpp:107
virtual bool updateGraphicsForMuscles()=0
virtual sBool destroyGraphics()=0
Definition: SRobotParsed.hpp:51
virtual sBool removeMeshFromRender(const std::string &arg_mesh_name)=0
virtual sBool addMeshToRender(const std::string &arg_mesh_name, const std::string &arg_mesh_file, const Eigen::Vector3d &arg_pos, const Eigen::Matrix3d &arg_rot)=0
virtual sBool addRobotToRender(const SRobotParsed *arg_rob_parsed, const SRobotIO *arg_rob_io)=0
virtual sBool initGraphics(const SGraphicsParsed *arg_gr_ds)=0
virtual sBool removeMusclesFromRender(const std::string &arg_robot, const std::string &arg_mset)=0
Definition: SActuatorSetMuscleParsed.hpp:124
virtual sBool updateGraphicsForRobots()=0
bool sBool
Definition: DataTypes.hpp:54
sBool has_been_init_
Definition: SObject.hpp:72
Definition: CGraphicsBase.hpp:48
virtual sBool hasBeenInit()
Definition: CGraphicsBase.hpp:72
Definition: SGraphicsParsed.hpp:48
CGraphicsBase()
Definition: CGraphicsBase.hpp:52
virtual ~CGraphicsBase()
Definition: CGraphicsBase.hpp:55
virtual bool updateGraphicsForMeshes()=0
virtual sBool updateGraphics()=0
Definition: SObject.hpp:43