174 virtual std::ostream&
write(std::ostream& str);
180 virtual std::istream&
read(std::istream& str);
182 inline Mode getMode()
const;
193 virtual void read(
char& val);
194 virtual void read(
bool& val);
197 virtual void read(
float& val,
bool readAsFloat =
false);
199 virtual void read(
double& val,
bool readAsFloat =
false);
201 virtual void read(std::string& val);
227 virtual void write(
char val);
228 virtual void write(
bool val);
235 virtual void write(
double val,
FloatMode writeAsFloat = AS_DOUBLE);
237 virtual void write(
const std::string& val);
264 void beginBlock(
const char* blockName);
270 bool endBlock(
const char* blockName);
272 void skipBlock(
const char* blockName);
295 const char* m_blockName;
310 std::stringstream &getStream();
311 const std::stringstream &getStream()
const;
316 void readHeader(std::istream& str);
317 void writeHeader(std::ostream& str,
const char* data);
322 void checkMode(
Mode newMode);
336 StorageStack(std::shared_ptr<std::stringstream>
root);
340 virtual ~StorageStack();
343 std::string name()
const;
346 std::shared_ptr<std::stringstream> top();
348 std::shared_ptr<const std::stringstream> top()
const;
351 uint32_t size() {
return uint32_t(m_stack.size()); }
354 void push(
const std::string& blockName, std::shared_ptr<std::stringstream>);
360 void clear(std::shared_ptr <std::stringstream> root);
364 std::shared_ptr<std::stringstream> getNewStream();
371 void writeBuffer(
const char* data,
size_t numBytes, std::stringstream* stream);
373 typedef std::stack<std::pair<std::string, std::shared_ptr<std::stringstream> > > StreamStack;
375 std::shared_ptr<std::stringstream> m_root;
376 std::stack<std::shared_ptr<std::stringstream> > m_streamPool;
390 agx::UInt8 m_generation, m_major, m_minor, m_patch;
397 std::shared_ptr<std::stringstream> m_data;
400 StorageStack m_stack;
450 uint64_t readVal = 0;
452 val = size_t(readVal);
459 uint64_t readVal = 0;
567 out.
write(int32_t(val));
573 out.
write(uint64_t(val));
580 out.
write(uint64_t(val));
605 out.
write(const_cast< agx::RigidBody* >(rb));
611 out.
write(const_cast< agxCollide::Geometry* >(geometry));
653 out.
write(const_cast< agxWire::Node* >(node));
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
AGXTERRAIN_EXPORT void clear()
bool AGXPHYSICS_EXPORT read(const std::string &filename, agxStream::SerializablePtrVector &readObjects)
Open and read serializable objects from a file on disk with previously stored objects.
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive...
void setEnableMD5(bool flag)
Enable/Disable the MD5 check of the data.
This namespace consists of a set of classes for handling geometric intersection tests including boole...
#define AGXPHYSICS_EXPORT
Ties a beginBlock/endBlock pair to a scope.
The geometry representation used by the collision detection engine.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Implements a Wire model with adaptive resolution.
The object holding quaternions and providing operations on these.
Matrix class for rigid transformations (translation, rotation).
std::istream & operator>>(std::istream &input, Vec2 &vec)
bool AGXPHYSICS_EXPORT write(const std::string &filename, const agxStream::Serializable *data)
Write a Serializable object to a file.
std::ostream & operator<<(std::ostream &os, const agx::AddedMassInteraction::Matrix6x6 &m)
The rigid body class, combining a geometric model and a frame of reference.
A class holding 3 dimensional vectors and providing basic arithmetic.
StorageStream(const StorageStream &)
Abstract base class for storing/restoring a line/drums with version control.
Class defining a node that is part of a wire.
AGXCORE_EXPORT Component * root()
bool getEnableMD5() const
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
bool write(agx::Vector< char > &buffer)
Write data from the stream into the buffer for external storage.
bool read(const agx::Vector< char > &buffer)
Read data from the buffer into the stream for restore.