AGX Dynamics  2.37.2.0
SolveMaterial32Entity.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
9 having been advised so by Algoryx Simulation AB for a time limited evaluation,
10 or having purchased a 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 
18 // AUTOMATICALLY GENERATED ENTITY, DO NOT EDIT! //
20 
21 #ifndef GENERATED_AGX_PHYSICS_SOLVEMATERIAL32_H_PLUGIN
22 #define GENERATED_AGX_PHYSICS_SOLVEMATERIAL32_H_PLUGIN
23 
24 #define AGX_ENTITY_WRAPPER 1
25 
26 
27 #ifdef _MSC_VER
28 # pragma warning(push)
29 // warning C4505: 'agxData::VectorAttributeT<T>::print' : unreferenced local function has been removed
30 # pragma warning( disable : 4505 )
31 // warning C4251: 'X' : class 'Y' needs to have dll-interface to be used by clients of class 'Z'
32 # pragma warning( disable : 4251 )
33 // warning C4355: 'this' : used in base member initializer list
34 # pragma warning( disable : 4355 )
35 // marked as __forceinline not inlined
36 # pragma warning( disable: 4714 )
37 #endif
38 
39 #include <agxData/EntityModel.h>
40 #include <agxData/EntityStorage.h>
41 #include <agxData/EntityRef.h>
42 #include <agxData/EntityPtr.h>
43 #include <agxData/EntityInstance.h>
44 #include <agx/Integer.h>
45 #include <agx/Real.h>
46 #include <agx/macros.h>
47 #include <agx/Real.h>
48 #include <agx/Vec2.h>
49 
50 
51 namespace agx
52 {
53  namespace Physics
54  {
55 
56  class SolveMaterial32Model;
57  class SolveMaterial32Data;
58  class SolveMaterial32Ptr;
59  class SolveMaterial32Instance;
60  class SolveMaterial32Semantics;
61 
62 
64 
69  {
70  public:
72 
73  SolveMaterial32Model(const agx::String& name = "SolveMaterial32");
74 
76  static SolveMaterial32Model* instance();
77 
79  static SolveMaterial32Ptr createInstance();
80 
82  static agxData::EntityStorage* defaultStorage();
83 
85  virtual void shutdownCleanup() override;
86 
87 
88 
89  /* Attributes */
92 
93  protected:
94  virtual ~SolveMaterial32Model();
95  virtual agxData::EntityData* createData(agxData::EntityStorage* storage) override;
96  virtual void configure(agx::TiXmlElement* eEntity) override;
97  virtual void initAttributeAccessors() override;
98  virtual void construct(agxData::EntityPtr instance) override;
99  void construct(agx::Physics::SolveMaterial32Ptr solveMaterial32);
100  };
101 
102 
104  #ifndef AGX_PHYSICS_SOLVEMATERIAL32_DATA_SET_OVERRIDE
105  #define AGX_PHYSICS_SOLVEMATERIAL32_DATA_SET
106  class AGXPHYSICS_EXPORT SolveMaterial32Data : public agxData::EntityData
107  {
108  public:
109  SolveMaterial32Instance operator[] (size_t index);
110 
111  public:
113  agxData::Array< agx::Real32 > adhesiveImpulse;
115 
116  public:
117  typedef agx::Real32 adhesiveImpulseType;
118  typedef agx::Vec2f frictionType;
119 
120  public:
121  SolveMaterial32Data(agxData::EntityStorage* storage);
122  SolveMaterial32Data();
123 
124  protected:
125  virtual ~SolveMaterial32Data() {}
126  virtual void setNumElements(agx::Index numElements) override;
127 
128  private:
129  SolveMaterial32Data& operator= (const SolveMaterial32Data&) { return *this; }
130 
131  };
132  #endif
134 
135 
137  class AGXPHYSICS_EXPORT SolveMaterial32Semantics : protected agxData::EntityPtr
138  {
139  public:
140 
141  // Automatic getters
142  agx::Real32 const& getAdhesiveImpulse() const;
143  agx::Vec2f const& getFriction() const;
144 
145  // Semantics defined by explicit kernels
146 
147  // Automatic setters
148  void setAdhesiveImpulse(agx::Real32 const& value);
149  void setFriction(agx::Vec2f const& value);
150 
151 
152  protected:
153  friend class SolveMaterial32Ptr;
154  friend class SolveMaterial32Instance;
155  SolveMaterial32Semantics();
156  };
158 
159 
160 
163  class CALLABLE SolveMaterial32Ptr : public agxData::EntityPtr
164  {
165  public:
167  typedef SolveMaterial32Data DataType;
168  typedef SolveMaterial32Instance InstanceType;
169 
170  public:
176  AGXPHYSICS_EXPORT SolveMaterial32Ptr& operator= (const agxData::EntityInstance& instance);
177  AGXPHYSICS_EXPORT SolveMaterial32Instance instance();
178  AGXPHYSICS_EXPORT const SolveMaterial32Instance instance() const;
179 
180  AGXPHYSICS_EXPORT SolveMaterial32Semantics* operator->();
181  AGXPHYSICS_EXPORT const SolveMaterial32Semantics* operator->() const;
182 
183  SolveMaterial32Data* getData();
184  const SolveMaterial32Data* getData() const;
185 
186 
188  AGXPHYSICS_EXPORT agx::Real32& adhesiveImpulse();
190  AGXPHYSICS_EXPORT agx::Real32 const& adhesiveImpulse() const;
191 
193  AGXPHYSICS_EXPORT agx::Vec2f& friction();
195  AGXPHYSICS_EXPORT agx::Vec2f const& friction() const;
196 
197  };
198 
199 
201  class AGXPHYSICS_EXPORT SolveMaterial32Instance : public agxData::EntityInstance
202  {
203  public:
204  SolveMaterial32Instance();
205  SolveMaterial32Instance(SolveMaterial32Data* data, agx::Index index);
206  SolveMaterial32Instance(agxData::EntityStorage *storage, agx::Index index);
207  SolveMaterial32Instance(const agxData::EntityInstance& other);
208  SolveMaterial32Instance(const agxData::EntityPtr& ptr);
209 
210  SolveMaterial32Data* getData();
211  const SolveMaterial32Data* getData() const;
212 
213  public:
215  agx::Real32& adhesiveImpulse();
217  agx::Real32 const& adhesiveImpulse() const;
218 
220  agx::Vec2f& friction();
222  agx::Vec2f const& friction() const;
223 
224  };
226 
227 
228 
231 
232 
233 
235  /* Implementation */
236  //-----------------------------------------------------------------------------------------------------
237  //-----------------------------------------------------------------------------------------------------
238  inline SolveMaterial32Instance agx::Physics::SolveMaterial32Data::operator[] (size_t index) { return SolveMaterial32Instance(this, (agx::Index)index); }
239  //-----------------------------------------------------------------------------------------------------
243  {
245  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
247  }
248 
250  {
251  agxAssertN(!instance || instance.isInstanceOf(SolveMaterial32Model::instance()),
252  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
254  }
255 
257  {
260  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
262  return *this;
263  }
264 
266  {
268  agxAssertN(!instance || instance.isInstanceOf(SolveMaterial32Model::instance()),
269  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
271  return *this;
272  }
273 
274  inline SolveMaterial32Instance SolveMaterial32Ptr::instance() { return agxData::EntityPtr::instance(); }
275  inline const SolveMaterial32Instance SolveMaterial32Ptr::instance() const { return agxData::EntityPtr::instance(); }
276  AGX_FORCE_INLINE SolveMaterial32Semantics* SolveMaterial32Ptr::operator->() { return (SolveMaterial32Semantics* )this; }
277  AGX_FORCE_INLINE const SolveMaterial32Semantics* SolveMaterial32Ptr::operator->() const { return (const SolveMaterial32Semantics* )this; }
278  AGX_FORCE_INLINE SolveMaterial32Data* SolveMaterial32Ptr::getData() { return static_cast<SolveMaterial32Data* >(agxData::EntityPtr::getData()); }
279  AGX_FORCE_INLINE const SolveMaterial32Data* SolveMaterial32Ptr::getData() const { return static_cast<const SolveMaterial32Data* >(agxData::EntityPtr::getData()); }
280 
281  AGX_FORCE_INLINE agx::Real32& SolveMaterial32Ptr::adhesiveImpulse() { verifyIndex(); return getData()->adhesiveImpulse[calculateIndex()]; }
282  AGX_FORCE_INLINE agx::Real32 const& SolveMaterial32Ptr::adhesiveImpulse() const { verifyIndex(); return getData()->adhesiveImpulse[calculateIndex()]; }
283 
284  AGX_FORCE_INLINE agx::Vec2f& SolveMaterial32Ptr::friction() { verifyIndex(); return getData()->friction[calculateIndex()]; }
285  AGX_FORCE_INLINE agx::Vec2f const& SolveMaterial32Ptr::friction() const { verifyIndex(); return getData()->friction[calculateIndex()]; }
286 
287  //-----------------------------------------------------------------------------------------------------
288  AGX_FORCE_INLINE SolveMaterial32Instance::SolveMaterial32Instance() {}
289  AGX_FORCE_INLINE SolveMaterial32Instance::SolveMaterial32Instance(SolveMaterial32Data* data, agx::Index index) : agxData::EntityInstance(data, index) {}
290  AGX_FORCE_INLINE SolveMaterial32Instance::SolveMaterial32Instance(agxData::EntityStorage* storage, agx::Index index) : agxData::EntityInstance(storage, index) {}
291  AGX_FORCE_INLINE SolveMaterial32Instance::SolveMaterial32Instance(const agxData::EntityInstance& other) : agxData::EntityInstance(other)
292  {
294  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
296  }
297 
298  AGX_FORCE_INLINE SolveMaterial32Instance::SolveMaterial32Instance(const agxData::EntityPtr& ptr) : agxData::EntityInstance(ptr)
299  {
301  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
303  }
304 
305 
306  AGX_FORCE_INLINE SolveMaterial32Data* SolveMaterial32Instance::getData() { return static_cast<SolveMaterial32Data* >(agxData::EntityInstance::getData()); }
307  AGX_FORCE_INLINE const SolveMaterial32Data* SolveMaterial32Instance::getData() const { return static_cast<const SolveMaterial32Data* >(agxData::EntityInstance::getData()); }
308 
309  AGX_FORCE_INLINE agx::Real32& SolveMaterial32Instance::adhesiveImpulse() { verifyIndex(); return getData()->adhesiveImpulse[getIndex()]; }
310  AGX_FORCE_INLINE agx::Real32 const& SolveMaterial32Instance::adhesiveImpulse() const { verifyIndex(); return getData()->adhesiveImpulse[getIndex()]; }
311 
312  AGX_FORCE_INLINE agx::Vec2f& SolveMaterial32Instance::friction() { verifyIndex(); return getData()->friction[getIndex()]; }
313  AGX_FORCE_INLINE agx::Vec2f const& SolveMaterial32Instance::friction() const { verifyIndex(); return getData()->friction[getIndex()]; }
314 
315  //-----------------------------------------------------------------------------------------------------
316  AGX_FORCE_INLINE SolveMaterial32Semantics::SolveMaterial32Semantics() {}
317  //-----------------------------------------------------------------------------------------------------
319  }
320 }
321 
322 AGX_TYPE_BINDING(agx::Physics::SolveMaterial32Ptr, "Physics.SolveMaterial32Ptr")
323 AGX_TYPE_BINDING(agx::Physics::SolveMaterial32Instance, "Physics.SolveMaterial32Instance")
324 
325 #ifdef _MSC_VER
326 # pragma warning(pop)
327 #endif
328 
329 #undef AGX_ENTITY_WRAPPER
330 #undef AGX_ENTITY_NAMESPACE
331 #endif
332 
AGXPHYSICS_EXPORT SolveMaterial32Ptr()
float Real32
Definition: Real.h:44
agxData::EntityData * getData()
agxData::EntityInstance instance()
Definition: EntityPtr.h:269
AGXPHYSICS_EXPORT agx::Real32 & adhesiveImpulse()
static SolveMaterial32Model * instance()
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:72
#define agxAssertN(expr, format,...)
Definition: debug.h:145
agxData::EntityData * getData()
agx::String fullPath() const
#define AGX_TYPE_BINDING(_Type, _Name)
Definition: Type.h:179
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())
Definition: Object.h:363
#define AGXPHYSICS_EXPORT
Entity instance provides access to a single instance in an EntityStorage.
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
Definition: EntityPtr.h:51
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
bool isInstanceOf(agxData::EntityModel *model) const
AGXPHYSICS_EXPORT SolveMaterial32Instance instance()
#define AGX_FORCE_INLINE
Definition: Object.h:59
AGXPHYSICS_EXPORT agx::Vec2f & friction()
Type-specific Array used for fast access into the data held by a Buffer.
Definition: agxData.h:30
Abstract description of the data attributes for the Physics.SolveMaterial32 entity.
Vector containing &#39;raw&#39; data.
Definition: Vector.h:245
EntityPtr & operator=(const EntityPtr &other)=default
SolveMaterial32Data * getData()
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
AGXPHYSICS_EXPORT SolveMaterial32Ptr & operator=(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT SolveMaterial32Semantics * operator->()
static agxData::ScalarAttributeT< agx::Real32 > * adhesiveImpulseAttribute
Contains classes for low level data storage for AGX.
Definition: Container.h:23
UInt32 Index
Definition: Integer.h:52
An abstract description of a data entity stored using SOA (structure of arrays) pattern in a EntitySt...
Definition: EntityModel.h:63
#define CALLABLE
Definition: Object.h:73
Pointer to a entity instance of type Physics.SolveMaterial32.
bool isInstanceOf(agxData::EntityModel *model) const
static agxData::ScalarAttributeT< agx::Vec2f > * frictionAttribute
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97