AGX Dynamics  2.35.0.1
agxIO/ReaderWriter.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXIO_READERWRITER_H
18 #define AGXIO_READERWRITER_H
19 
20 #include <agx/agxPhysics_export.h>
21 #include <string>
22 #include <agx/String.h>
23 #include <agx/Vec3.h>
24 #include <agxSDK/Simulation.h>
25 
26 namespace agxSDK
27 {
28  class Assembly;
29 }
30 
31 namespace agxIO
32 {
53  AGXPHYSICS_EXPORT bool readFile(const agx::String& filename, agxSDK::Simulation* simulation,
54  agxSDK::Assembly* parent = nullptr,
56 
58  enum FileType {
59  FILETYPE_AGX, /*<! .agx binary format */
60  FILETYPE_AAGX, /*<! .aagx ascii format */
61  FILETYPE_POV /*<! Povray file format */
62  };
63 
77  AGXPHYSICS_EXPORT bool writeFile(FileType type, std::ostream& outStream,
78  agxSDK::Simulation* simulation, agx::Vec3 from = agx::Vec3(),
79  agx::Vec3 at = agx::Vec3(), agx::Vec3 up = agx::Vec3(),
80  double fovy = 0, double aspectRatio = 0 );
81 
97  AGXPHYSICS_EXPORT bool writeFile(const agx::String& filename, agxSDK::Simulation* simulation,
98  agx::Vec3 from = agx::Vec3(), agx::Vec3 at = agx::Vec3(),
99  agx::Vec3 up = agx::Vec3(), double fovy = 0, double aspectRatio = 0 );
100 
101 
102 
119 
135  AGXPHYSICS_EXPORT bool decompressArchive(const agx::String& archiveFile, const agx::String& directory);
136 }
137 
138 #endif
#define AGXPHYSICS_EXPORT
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
Definition: Assembly.h:67
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
The agxIO namespace contains classes for reading, writing and finding files.
Definition: Material.h:42
void AGXCORE_EXPORT readFile(agx::String &result, const agx::String &filePath)
AGXPHYSICS_EXPORT bool createCompressedArchive(const agx::String &archiveName, const agx::StringVector &files)
Function which will create a zipped file of name archiveName containing the files listed in files.
FileType
Specify the type of file.
AGXPHYSICS_EXPORT bool decompressArchive(const agx::String &archiveFile, const agx::String &directory)
Function which will de-compress an archive to a target directory.
AGXPHYSICS_EXPORT bool writeFile(FileType type, std::ostream &outStream, agxSDK::Simulation *simulation, agx::Vec3 from=agx::Vec3(), agx::Vec3 at=agx::Vec3(), agx::Vec3 up=agx::Vec3(), double fovy=0, double aspectRatio=0)
Utility function for write a simulation to a stream.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:31
uint32_t UInt
Definition: Integer.h:34