AGXDynamics  2.35.0.2
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 
118  AGXPHYSICS_EXPORT bool createCompressedArchive(const agx::String& archiveName, const agx::StringVector& files);
119 
135  AGXPHYSICS_EXPORT bool decompressArchive(const agx::String& archiveFile, const agx::String& directory);
136 }
137 
138 #endif
agxPhysics_export.h
agxIO::writeFile
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.
agxIO::createCompressedArchive
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.
agx::Vector< AgXString< std::string > >
Simulation.h
agxIO::FILETYPE_AAGX
@ FILETYPE_AAGX
Definition: agxIO/ReaderWriter.h:60
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agxIO::readFile
void AGXCORE_EXPORT readFile(agx::String &result, const agx::String &filePath)
agxSDK::Assembly
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
Definition: Assembly.h:66
Vec3.h
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
agxSDK::Simulation::READ_DEFAULT
@ READ_DEFAULT
Definition: Simulation.h:1019
agxIO::FileType
FileType
Specify the type of file.
Definition: agxIO/ReaderWriter.h:58
agx::UInt
uint32_t UInt
Definition: Integer.h:34
String.h
agx::AgXString
Definition: String.h:31
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
agx::Vec3T< Real >
agxIO::FILETYPE_POV
@ FILETYPE_POV
Definition: agxIO/ReaderWriter.h:61
agxIO::decompressArchive
AGXPHYSICS_EXPORT bool decompressArchive(const agx::String &archiveFile, const agx::String &directory)
Function which will de-compress an archive to a target directory.
agxIO
The agxIO namespace contains classes for reading, writing and finding files.
Definition: Material.h:41
agxIO::FILETYPE_AGX
@ FILETYPE_AGX
Definition: agxIO/ReaderWriter.h:59