34 #ifndef _LibPhysic_GroundT_H
35 #define _LibPhysic_GroundT_H
37 #include <boost/serialization/version.hpp>
38 #include <boost/serialization/map.hpp>
74 static bool exist(
const std::string&);
84 virtual std::string
info()
const;
108 template<
class Archive>
void serialize(Archive&,
const unsigned int);
111 #ifndef DOXYGEN_SHOULD_SKIP_THIS
113 template<
typename shape>
117 for (
unsigned int i = 0; i<set.
size(); ++i) {
121 UserAssert(0,
"can't find discrete shape " +
id);
125 template<
typename shape>
128 Core::SetOf< GroundT<shape> >& set = Core::SetOf< GroundT<shape> >::get_global_set();
129 for (
unsigned int i = 0; i<set.size(); ++i) {
137 template<
class shape>
141 shape(Ground::local_frame()) {
144 template<
class shape>
147 : GroundT(
"", Geom::global::center, Geom::global::quaternion) {
150 template<
class shape>
155 template<
class shape>
158 return Ground::local_frame();
161 template<
class shape>
162 inline const Shape::Base&
167 template<
class shape>
173 template<
class shape>
176 std::ostringstream os;
182 template<
class shape>
186 shape::read_xml_element(el);
189 template<
class shape>
192 return shape::class_ID();
195 template<
class shape>
199 shape::write_ascii(out);
203 template<
class shape>
207 shape::read_ascii(in);
211 template<
class shape>
212 template<
class Archive>
215 ar & boost::serialization::base_object<Ground>(*
this);
216 ar & boost::serialization::base_object<shape>(*
this);
219 template<
class shape>
223 Drawable::apply_color();
225 glMultMatrixd(local_frame().get_glMatrix());
232 template<
class shape>
236 Drawable::apply_color();
238 glMultMatrixd(local_frame().get_glMatrix());
239 shape::draw_gl_edge();
253 GRANOO_CLASS_DECLARE_TPL(Physic::GroundT<Shape::Sphere>);
254 GRANOO_CLASS_DECLARE_TPL(Physic::GroundT<Shape::Box>);
255 GRANOO_CLASS_DECLARE_TPL(Physic::GroundT<Shape::Cylinder>);
256 GRANOO_CLASS_DECLARE_TPL(Physic::GroundT<Shape::Cone>);
257 GRANOO_CLASS_DECLARE_TPL(Physic::GroundT<Shape::ConeTruncated>);
258 GRANOO_CLASS_DECLARE_TPL(Physic::GroundT<Shape::Polyhedron>);
267 template<
class shape>
268 struct Read<Physic::GroundT<shape> >
#define UserAssert(condition, message)
Definition: Macro.hpp:54
virtual const std::string & get_ID() const
Definition: Base.hpp:144
Definition: ObjectFactory.hpp:235
Definition: SetOf.hpp:346
Definition: SetOf.hpp:236
Definition: Quaternion.hpp:54
Definition: Ground.hpp:61
virtual std::ostream & write_ascii(std::ostream &out) const
Definition: Ground.cpp:120
virtual std::string info() const
Definition: Ground.hpp:206
virtual std::istream & read_ascii(std::istream &in)
Definition: Ground.cpp:128
virtual void read_xml_element(const TiXmlElement *el)
Definition: GroundT.hpp:67
const Geom::Frame & local_frame() const
void read_xml_element(const TiXmlElement *el)
virtual std::ostream & write_ascii(std::ostream &out) const
void serialize(Archive &, const unsigned int)
GroundT(const GroundT &)=delete
virtual std::istream & read_ascii(std::istream &in)
virtual const Shape::Base & to_base_shape() const
GroundT(const std::string &, const Geom::Point &p, const Geom::Quaternion &q)
static bool exist(const std::string &)
GroundT & operator=(const GroundT &)=delete
static GroundT< shape > & get(const std::string &)
std::string shape_class_ID() const
virtual std::string info() const
friend class boost::serialization::access
Definition: GroundT.hpp:107
virtual Shape::Base & to_base_shape()
Definition: Common.hpp:198
static Base * new_object(const std::string &classID, std::istream &in)
Definition: GroundT.hpp:270
Definition: SetOfManager.hpp:63