AGX Dynamics  2.37.2.0
agxIO/ReaderWriter.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 {
50  AGXPHYSICS_EXPORT bool readFile(const agx::String& filename, agxSDK::Simulation* simulation,
51  agxSDK::Assembly* parent = nullptr,
53 
55  enum FileType {
56  FILETYPE_AGX, /*<! .agx binary format */
57  FILETYPE_AAGX, /*<! .aagx ascii format */
58  FILETYPE_POV /*<! Povray file format */
59  };
60 
74  AGXPHYSICS_EXPORT bool writeFile(FileType type, std::ostream& outStream,
75  agxSDK::Simulation* simulation, agx::Vec3 from = agx::Vec3(),
76  agx::Vec3 at = agx::Vec3(), agx::Vec3 up = agx::Vec3(),
77  double fovy = 0, double aspectRatio = 0 );
78 
94  AGXPHYSICS_EXPORT bool writeFile(const agx::String& filename, agxSDK::Simulation* simulation,
95  agx::Vec3 from = agx::Vec3(), agx::Vec3 at = agx::Vec3(),
96  agx::Vec3 up = agx::Vec3(), double fovy = 0, double aspectRatio = 0 );
97 
98 
99 
114  AGXPHYSICS_EXPORT bool createCompressedArchive(const agx::String& archiveName, const agx::StringVector& files);
115 
129  AGXPHYSICS_EXPORT bool decompressArchive(const agx::String& archiveFile, const agx::String& directory);
130 }
131 
132 #endif
FileType
Specify the type of file.
The agxIO namespace contains classes for reading, writing and finding files.
Definition: Material.h:41
#define AGXPHYSICS_EXPORT
uint32_t UInt
Definition: Integer.h:34
AGXPHYSICS_EXPORT bool writeFile(const agx::String &filename, 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 into various files:
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...
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
AGXPHYSICS_EXPORT bool readFile(const agx::String &filename, agxSDK::Simulation *simulation, agxSDK::Assembly *parent=nullptr, agx::UInt selection=agxSDK::Simulation::READ_DEFAULT)
Utility function for reading various files:
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints, geometries.
Definition: Assembly.h:66
AGXPHYSICS_EXPORT bool decompressArchive(const agx::String &archiveFile, const agx::String &directory)
Function which will de-compress an archive to a target directory.