AGX Dynamics  2.38.0.2
agx.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 #ifdef _MSC_VER
18 # pragma warning(push)
19 # pragma warning(disable: 4251) // warning C4251: class X needs to have dll-interface to be used by clients of class Y
20 #endif
21 
22 #ifndef AGX_AGX_H
23 #define AGX_AGX_H
24 
25 
26 
27 #include <agx/config.h>
28 #include <agx/macros.h>
29 #include <agx/build_flags.h>
30 
31 #include <agx/agxPhysics_export.h>
32 #include <agx/agxCore_export.h>
33 #include <string.h>
34 
35 #include <agx/Math.h>
36 #include <agx/stdint.h>
37 #include <agx/debug.h>
38 
39 // Workaround for a bug in Visual Studio 2008-2013 where a C2039 could be issued when referencing a function foo
40 // defined in the same unnamed namespace with ::foo.
41 // See http://stackoverflow.com/questions/5503901/how-to-correctly-reference-a-function-in-an-anonymous-namespace
42 namespace {}
43 
48 namespace agx
49 {
54  void AGXPHYSICS_EXPORT init();
55 
63 
68 
75 
89  {
90  public:
91  AutoInit();
92  ~AutoInit();
93  };
94 
117  };
118 
121 
122 
128 
133  void AGXCORE_EXPORT setNumThreads(size_t numThreads);
134 
140 
146 
147  class Thread;
152 
153 
160 
165 
170 
175 
181  template <typename T>
182  AGX_FORCE_INLINE operator T() const {
183  return (T) - 1;
184  }
185 
186  // Comparison operators
187  template <typename T>
188  AGX_FORCE_INLINE bool operator == (T val) const {
189  return val == (T) - 1;
190  }
191 
192  template <typename T>
193  AGX_FORCE_INLINE bool operator != (T val) const {
194  return val != (T) - 1;
195  }
196  };
197 
198 
199  // Comparison operators
200  template <typename T>
202  {
203  return val == (T) - 1;
204  }
205 
206  template <typename T>
208  {
209  return val != (T) - 1;
210  }
211 
212  extern AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex;
213 }
214 
221 namespace agxCore
222 {
226  void AGXCORE_EXPORT init();
227 
231  void AGXCORE_EXPORT shutdown();
232 
236  bool AGXCORE_EXPORT isShutdown();
237 }
238 
239 #endif
agxPhysics_export.h
agx::UInt64
uint64_t UInt64
Definition: Integer.h:33
AGXCORE_EXPORT
#define AGXCORE_EXPORT
agx::getStartTick
UInt64 AGXCORE_EXPORT getStartTick()
agx::isBuiltWith
bool AGXCORE_EXPORT isBuiltWith(BuildConfiguration config)
agx::InvalidIndexStruct
Tag for invalid UInt values.
Definition: agx.h:180
agx::USE_OPENGL_INSTANCING
@ USE_OPENGL_INSTANCING
Definition: agx.h:99
agx::USE_ASSIMP
@ USE_ASSIMP
Definition: agx.h:115
build_flags.h
agx::USE_AGXCALLABLE
@ USE_AGXCALLABLE
Definition: agx.h:109
agx::USE_PREFETCHING
@ USE_PREFETCHING
Definition: agx.h:100
agx::USE_DEBUG
@ USE_DEBUG
Definition: agx.h:112
agx::getNumThreads
agx::Index AGXCORE_EXPORT getNumThreads()
agx::SABRE_USE_PADDING
@ SABRE_USE_PADDING
Definition: agx.h:103
macros.h
agx::getBuildConfigurationString
std::string AGXCORE_EXPORT getBuildConfigurationString(BuildConfiguration config)
agx::USE_PARTICLE_SYSTEM
@ USE_PARTICLE_SYSTEM
Definition: agx.h:110
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
agx::SABRE_USE_SSE3
@ SABRE_USE_SSE3
Definition: agx.h:102
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agx::UNITTEST_ENABLED
@ UNITTEST_ENABLED
Definition: agx.h:107
agx::USE_OPENGL
@ USE_OPENGL
Definition: agx.h:105
agx::USE_TINYXML
@ USE_TINYXML
Definition: agx.h:104
agx::USE_OSG
@ USE_OSG
Definition: agx.h:106
agx::setEntityCreationThreadSafe
AGXCORE_EXPORT void setEntityCreationThreadSafe(bool)
Iff true you can move the entity to another thread (but you may only use it from one thread at the ti...
agx::NUM_BUILD_CONFIGURATIONS
@ NUM_BUILD_CONFIGURATIONS
Definition: agx.h:116
agx::USE_64BIT_ARCHITECTURE
@ USE_64BIT_ARCHITECTURE
Definition: agx.h:97
agx::isInitialized
bool AGXPHYSICS_EXPORT isInitialized()
agx::shutdown
void AGXPHYSICS_EXPORT shutdown()
Shutdown of the AGX Dynamics API will be done when the number of shutdown matches the number of calls...
Math.h
agx::USE_OPENCL
@ USE_OPENCL
Definition: agx.h:111
agx::setNumThreads
void AGXCORE_EXPORT setNumThreads(size_t numThreads)
Set the number of threads to use (including the main thread).
agx::Index
UInt32 Index
Definition: Integer.h:44
agx::USE_AGXSENSOR
@ USE_AGXSENSOR
Definition: agx.h:108
agx::getCurrentThread
AGXCORE_EXPORT Thread * getCurrentThread()
agx::USE_COMPOSITE
@ USE_COMPOSITE
Definition: agx.h:113
agx::WINDOWS_PLATFORM
@ WINDOWS_PLATFORM
Definition: agx.h:114
stdint.h
agx::resetStartTick
void AGXCORE_EXPORT resetStartTick()
Reset the startTick value to the current tick.
agxCore_export.h
agx::operator!=
bool operator!=(T val, InvalidIndexStruct)
Definition: agx.h:207
agx::SABRE_USE_METIS
@ SABRE_USE_METIS
Definition: agx.h:98
agxCore::isShutdown
bool AGXCORE_EXPORT isShutdown()
agx::AutoInit
Convenience class to automatically call agx::init / agx::shutdown.
Definition: agx.h:88
agx::operator==
bool operator==(T val, InvalidIndexStruct)
Definition: agx.h:201
agxCore
Contains function for initialization and shutdown of agxCore library when agxPhysics is not used.
agxCore::shutdown
void AGXCORE_EXPORT shutdown()
Shutdown the AGX API, after this call no AGX API calls should be done.
agx::init
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API.
agx::InvalidIndex
const AGXCORE_EXPORT InvalidIndexStruct InvalidIndex
agx::BuildConfiguration
BuildConfiguration
Specifies flags set at build time. Used when querying what is enabled in this current build.
Definition: agx.h:96
agx::getNumThreadsIncludingRegistered
agx::Index AGXCORE_EXPORT getNumThreadsIncludingRegistered()
agx::getEntityCreationThreadSafe
AGXCORE_EXPORT bool getEntityCreationThreadSafe()
agx::isShutdown
bool AGXPHYSICS_EXPORT isShutdown()
This method indicates if agx::shutdown() has been started or already done.
agxCore::init
void AGXCORE_EXPORT init()
Deprecated, no need for explicit initialization.
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition: macros.h:58
agx::USE_SSE
@ USE_SSE
Definition: agx.h:101
debug.h