17 #ifndef AGXIO_POV_EXPORTER_H
18 #define AGXIO_POV_EXPORTER_H
20 #include <agx/config.h>
35 class PropertyContainer;
37 class ContactMaterial;
67 agx::Vec3 up,
double fovy,
double aspectRatio );
82 agx::Vec3 up,
double fovy,
double aspectRatio );
95 out.resize(
in.size());
97 for(
size_t i=0; i <
in.size(); i++)
99 if (isalnum(
static_cast<unsigned char>(
in[i])))
125 #define GET_NAME(TYPE, NAME) \
126 typedef agx::HashTable<const TYPE *, agx::String> NameTable ##NAME; \
127 typedef agx::HashSet<agx::String> UniqueNameTable ##NAME; \
128 NameTable ##NAME m_exportedName ##NAME; \
129 UniqueNameTable ##NAME m_uniqueNames ##NAME; \
131 inline agx::String getName( const TYPE *item ) \
133 agx::String name = item->getName(); \
134 NameTable ##NAME::const_iterator nameIt = m_exportedName ##NAME.find(item); \
135 if (nameIt != m_exportedName ##NAME.end()) \
136 return cleanupString(nameIt->second); \
137 if (name.empty()) { \
138 std::stringstream str; \
139 str << #NAME << "_" << item->getIndex(); \
141 m_exportedName ##NAME.insert(item, name); \
142 m_uniqueNames ##NAME.insert(name); \
143 return cleanupString(name); \
146 UniqueNameTable ##NAME::const_iterator it = m_uniqueNames ##NAME.find(name); \
147 if (it == m_uniqueNames ##NAME.end() ) \
149 m_uniqueNames ##NAME.insert(name); \
150 m_exportedName ##NAME.insert(item, name); \
151 return cleanupString(name); \
154 std::stringstream str; \
155 str << name << "_" << item->getIndex();
\
157 m_exportedName ##NAME.insert(item, name); \
158 m_uniqueNames ##NAME.insert(name); \
160 return cleanupString(name); \
#define GET_NAME(TYPE, NAME)
#define AGXPHYSICS_EXPORT
The geometry representation used by the collision detection engine.
Class for exporting a simulation into AGX .pov format.
static void setFocalSettings(agx::Real distance, agx::Real aperture, int blur_samples, agx::Real variance)
GeometryPtrHashSet m_geometryHasMaterial
std::ostream * m_outStream
static agx::Real m_aperture
bool exportRigidBody(agx::RigidBody *body)
static agx::Real m_variance
agxSDK::Simulation * m_simulation
static void setEnableFocalBlur(bool enable)
AssemblyPtrHashSet m_exportedAssemblies
agx::HashSet< agxSDK::Assembly * > AssemblyPtrHashSet
agx::HashSet< agxCollide::Geometry * > GeometryPtrHashSet
static bool m_focalBlurEnable
agx::HashSet< agx::RigidBody * > RigidBodyPtrHashSet
RigidBodyPtrHashSet m_exportedBodies
bool exportShape(const agx::AffineMatrix4x4 &t, const agxCollide::Shape *shape, const agx::String &parentMaterial)
bool exportGeometries(const agx::String &parentMaterial)
bool write(const agx::String &filename, agxSDK::Simulation *simulation, agx::Vec3 from, agx::Vec3 at, agx::Vec3 up, double fovy, double aspectRatio)
Write a simulation into the Pov-ray file format for rendering.
static agx::Real m_focalDistance
agx::String cleanupString(const agx::String &in)
Translate any non-alphanumeric letters into '_'.
bool exportAssembly(agxSDK::Assembly *assembly)
bool write(std::ostream &outStream, agxSDK::Simulation *simulation, agx::Vec3 from, agx::Vec3 at, agx::Vec3 up, double fovy, double aspectRatio)
Write a simulation in .pov format to a stream.
GeometryPtrHashSet m_exportedGeometries
bool exportGeometry(agxCollide::Geometry *geometry, const agx::String &parentMaterial)
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
The rigid body class, combining a geometric model and a frame of reference.
This namespace consists of a set of classes for handling geometric intersection tests including boole...
The agxIO namespace contains classes for reading, writing and finding files.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
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...
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.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.