17 #ifndef AGXIO_POV_EXPORTER_H
18 #define AGXIO_POV_EXPORTER_H
35 class PropertyContainer;
37 class ContactMaterial;
40 namespace agxCollide {
67 agx::Vec3 up,
double fovy,
double aspectRatio );
82 agx::Vec3 up,
double fovy,
double aspectRatio );
87 static void setEnableFocalBlur(
bool enable );
95 out.resize(in.size());
97 for(
size_t i=0; i < in.size(); i++)
99 if (isalnum(static_cast<unsigned char>(in[i])))
108 bool exportRigidBodies();
110 bool exportAssemblies();
112 bool exportGeometries(
const agx::String& parentMaterial );
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); \
164 GET_NAME(agxCollide::Geometry, Geometries)
165 GET_NAME(agxSDK::Assembly, Assemblies)
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...
static agx::Real m_variance
static agx::Real m_aperture
AssemblyPtrHashSet m_exportedAssemblies
agxSDK::Simulation * m_simulation
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...
agx::String cleanupString(const agx::String &in)
Translate any non-alphanumeric letters into '_'.
agx::HashSet< agx::RigidBody * > RigidBodyPtrHashSet
agx::HashSet< agxSDK::Assembly * > AssemblyPtrHashSet
GeometryPtrHashSet m_exportedGeometries
Class for exporting a simulation into AGX .pov format.
std::ostream * m_outStream
#define AGXPHYSICS_EXPORT
The geometry representation used by the collision detection engine.
#define GET_NAME(TYPE, NAME)
static bool m_focalBlurEnable
RigidBodyPtrHashSet m_exportedBodies
agx::HashSet< agxCollide::Geometry * > GeometryPtrHashSet
bool AGXPHYSICS_EXPORT write(const std::string &filename, const agxStream::Serializable *data)
Write a Serializable object to a file.
GeometryPtrHashSet m_geometryHasMaterial
static agx::Real m_focalDistance
The rigid body class, combining a geometric model and a frame of reference.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints, geometries.