AGXDynamics  2.35.0.2
agx.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 #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 #include <agx/config.h>
26 #include <agx/macros.h>
27 #include <agx/build_flags.h>
28 
29 #include <agx/agxPhysics_export.h>
30 #include <agx/agxCore_export.h>
31 #include <string.h>
32 
33 #include <agx/Math.h>
34 #include <agx/stdint.h>
35 #include <agx/debug.h>
36 
37 // Workaround for a bug in Visual Studio 2008-2013 where a C2039 could be issued when referencing a function foo
38 // defined in the same unnamed namespace with ::foo.
39 // See http://stackoverflow.com/questions/5503901/how-to-correctly-reference-a-function-in-an-anonymous-namespace
40 namespace {}
41 
46 namespace agx
47 {
51  void AGXPHYSICS_EXPORT init();
52 
57 
62 
74  {
75  public:
76  AutoInit();
77  ~AutoInit();
78  };
79 
80 
81 
106  };
107 
110 
111 
117 
122  void AGXCORE_EXPORT setNumThreads(size_t numThreads);
123 
129 
135 
136  class Thread;
141 
142 
149 
154 
159 
164 
170  template <typename T>
171  AGX_FORCE_INLINE operator T() const {
172  return (T) - 1;
173  }
174 
175  // Comparison operators
176  template <typename T>
177  AGX_FORCE_INLINE bool operator == (T val) const {
178  return val == (T) - 1;
179  }
180 
181  template <typename T>
182  AGX_FORCE_INLINE bool operator != (T val) const {
183  return val != (T) - 1;
184  }
185  };
186 
187 
188  // Comparison operators
189  template <typename T>
191  {
192  return val == (T) - 1;
193  }
194 
195  template <typename T>
197  {
198  return val != (T) - 1;
199  }
200 
201  extern AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex;
202 }
203 
210 namespace agxCore
211 {
215  void AGXCORE_EXPORT init();
216 
220  void AGXCORE_EXPORT shutdown();
221 
225  bool AGXCORE_EXPORT isShutdown();
226 }
227 
228 #ifdef _MSC_VER
229 # pragma warning(pop)
230 #endif
231 
232 #endif
agxPhysics_export.h
agx::UInt64
uint64_t UInt64
Definition: Integer.h:41
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:169
agx::USE_OPENGL_INSTANCING
@ USE_OPENGL_INSTANCING
Definition: agx.h:86
agx::USE_ASSIMP
@ USE_ASSIMP
Definition: agx.h:104
build_flags.h
agx::USE_AGXCALLABLE
@ USE_AGXCALLABLE
Definition: agx.h:98
agx::USE_PREFETCHING
@ USE_PREFETCHING
Definition: agx.h:87
agx::USE_DEBUG
@ USE_DEBUG
Definition: agx.h:101
agx::getNumThreads
agx::Index AGXCORE_EXPORT getNumThreads()
agx::SABRE_USE_PADDING
@ SABRE_USE_PADDING
Definition: agx.h:90
macros.h
agx::getBuildConfigurationString
std::string AGXCORE_EXPORT getBuildConfigurationString(BuildConfiguration config)
agx::USE_PARTICLE_SYSTEM
@ USE_PARTICLE_SYSTEM
Definition: agx.h:99
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:89
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agx::UNITTEST_ENABLED
@ UNITTEST_ENABLED
Definition: agx.h:96
agx::USE_OPENGL
@ USE_OPENGL
Definition: agx.h:94
agx::USE_TINYXML
@ USE_TINYXML
Definition: agx.h:93
agx::USE_OSG
@ USE_OSG
Definition: agx.h:95
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:105
agx::USE_64BIT_ARCHITECTURE
@ USE_64BIT_ARCHITECTURE
Definition: agx.h:84
agx::shutdown
void AGXPHYSICS_EXPORT shutdown()
Shutdown agx.
Math.h
agx::USE_OPENCL
@ USE_OPENCL
Definition: agx.h:100
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:52
agx::USE_AGXSENSOR
@ USE_AGXSENSOR
Definition: agx.h:97
agx::getCurrentThread
AGXCORE_EXPORT Thread * getCurrentThread()
agx::USE_COMPOSITE
@ USE_COMPOSITE
Definition: agx.h:102
agx::USE_LUA
@ USE_LUA
Definition: agx.h:91
agx::WINDOWS_PLATFORM
@ WINDOWS_PLATFORM
Definition: agx.h:103
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:196
agx::SABRE_USE_METIS
@ SABRE_USE_METIS
Definition: agx.h:85
agxCore::isShutdown
bool AGXCORE_EXPORT isShutdown()
agx::AutoInit
Convenience class to automatically call agx::init / agx::shutdown.
Definition: agx.h:73
agx::operator==
bool operator==(T val, InvalidIndexStruct)
Definition: agx.h:190
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.
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:83
agx::getNumThreadsIncludingRegistered
agx::Index AGXCORE_EXPORT getNumThreadsIncludingRegistered()
agx::getEntityCreationThreadSafe
AGXCORE_EXPORT bool getEntityCreationThreadSafe()
agx::USE_TOLUA
@ USE_TOLUA
Definition: agx.h:92
agx::isShutdown
bool AGXPHYSICS_EXPORT isShutdown()
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:88
debug.h