30 #ifndef _LibDEM_ToolT_T
31 #define _LibDEM_ToolT_T
33 #include <boost/serialization/version.hpp>
34 #include <boost/serialization/map.hpp>
58 GRANOO_OBJECT_FACTORY(
ToolT);
62 static bool exist(
const std::string& ID);
71 virtual std::string
info()
const;
82 virtual std::ostream&
write_ascii (std::ostream& out)
const;
83 virtual std::istream&
read_ascii (std::istream& in);
93 template<
class Archive>
void serialize(Archive&,
const unsigned int);
99 for (
unsigned int i = 0; i<set.
size(); ++i) {
103 UserAssert(0,
"can't find discrete shape " +
id);
107 template<
typename shape>
bool
110 for (
unsigned int i = 0; i<set.
size(); ++i) {
118 template<
class shape>
121 :
Tool(*this, id, p, q, mass, tensor),
122 shape(
Tool::local_frame()) {
125 template<
class shape>
127 :
ToolT(
"", Geom::global::center, Geom::global::quaternion, 0., Geom::null::tensor) {
130 template<
class shape>
136 return Node::local_frame();
140 template<
class shape> std::string
142 std::ostringstream os;
148 template<
class shape>
void
151 shape::read_xml_element(el);
154 template<
class shape> std::string
156 return shape::class_ID();
159 template<
class shape> std::ostream&
162 shape::write_ascii(out);
166 template<
class shape> std::istream&
169 shape::read_ascii(in);
173 template<
class shape> std::ostream&
175 shape::write_ascii(out);
179 template<
class shape> std::istream&
181 shape::read_ascii(in);
185 template<
class shape>
template<
class Archive>
void
187 ar & boost::serialization::base_object<Tool>(*
this);
188 ar & boost::serialization::base_object<shape>(*
this);
191 template<
class shape>
void
194 Drawable::apply_color();
196 glMultMatrixd(local_frame().get_glMatrix());
202 template<
class shape>
void
205 Drawable::apply_color();
207 glMultMatrixd(local_frame().get_glMatrix());
208 shape::draw_gl_edge();
224 template<
class shape>
225 struct Read<DEM::ToolT<shape> >
240 GRANOO_CLASS_DECLARE_TPL(DEM::ToolT<Shape::Sphere>);
241 GRANOO_CLASS_DECLARE_TPL(DEM::ToolT<Shape::Box>);
242 GRANOO_CLASS_DECLARE_TPL(DEM::ToolT<Shape::Cylinder>);
243 GRANOO_CLASS_DECLARE_TPL(DEM::ToolT<Shape::Cone>);
244 GRANOO_CLASS_DECLARE_TPL(DEM::ToolT<Shape::Polyhedron>);
#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: Tensor.hpp:62
Definition: Common.hpp:198
Definition: SetOfManager.hpp:63