AGXDynamics  2.31.1.0
GeometryParticleContactListEntity.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. 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_GEOMETRYPARTICLECONTACTLIST_H_PLUGIN
22 #define GENERATED_AGX_PHYSICS_GEOMETRYPARTICLECONTACTLIST_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>
50 #include <agx/Vec3.h>
51 #include <agx/Integer.h>
53 
54 namespace agx { namespace Physics { class GeometryPtr; }}
55 namespace agx { namespace Physics { class RigidBodyPtr; }}
56 namespace agx { namespace Physics { class ParticleGeometryContactPtr; }}
57 
58 namespace agx
59 {
60  namespace Physics
61  {
62 
63  class GeometryParticleContactListModel;
64  class GeometryParticleContactListData;
65  class GeometryParticleContactListPtr;
66  class GeometryParticleContactListInstance;
67  class GeometryParticleContactListSemantics;
68 
69 
71 
76  {
77  public:
79 
80  GeometryParticleContactListModel(const agx::String& name = "GeometryParticleContactList");
81 
83  static GeometryParticleContactListModel* instance();
84 
86  static GeometryParticleContactListPtr createInstance();
87 
89  static agxData::EntityStorage* defaultStorage();
90 
92  virtual void shutdownCleanup() override;
93 
94 
95 
96  /* Attributes */
103 
104  protected:
106  virtual agxData::EntityData* createData(agxData::EntityStorage* storage) override;
107  virtual void configure(agx::TiXmlElement* eEntity) override;
108  virtual void initAttributeAccessors() override;
109  virtual void construct(agxData::EntityPtr instance) override;
110  void construct(agx::Physics::GeometryParticleContactListPtr geometryParticleContactList);
111  };
112 
113 
115  #ifndef AGX_PHYSICS_GEOMETRYPARTICLECONTACTLIST_DATA_SET_OVERRIDE
116  #define AGX_PHYSICS_GEOMETRYPARTICLECONTACTLIST_DATA_SET
117  class AGXPHYSICS_EXPORT GeometryParticleContactListData : public agx::Physics::InteractionData
118  {
119  public:
120  GeometryParticleContactListInstance operator[] (size_t index);
121 
122  public:
126  agxData::Array< agx::Vec3 > bodyForce;
127  agxData::Array< agx::Vec3 > bodyTorque;
128  agxData::Array< agx::Bool > isImpacting;
130 
131  public:
132  typedef agx::Physics::GeometryPtr geometryType;
133  typedef agx::Physics::RigidBodyPtr bodyType;
134  typedef agx::Vec3 bodyForceType;
135  typedef agx::Vec3 bodyTorqueType;
136  typedef agx::Bool isImpactingType;
138 
139  public:
140  GeometryParticleContactListData(agxData::EntityStorage* storage);
141  GeometryParticleContactListData();
142 
143  protected:
144  virtual ~GeometryParticleContactListData() {}
145  virtual void setNumElements(agx::Index numElements) override;
146 
147  private:
148  GeometryParticleContactListData& operator= (const GeometryParticleContactListData&) { return *this; }
149 
150  };
151  #endif
153 
154 
156  class AGXPHYSICS_EXPORT GeometryParticleContactListSemantics : public agx::Physics::InteractionSemantics
157  {
158  public:
159 
160  // Automatic getters
161  agx::Physics::GeometryPtr const& getGeometry() const;
162  agx::Physics::RigidBodyPtr const& getBody() const;
163  agx::Vec3 const& getBodyForce() const;
164  agx::Vec3 const& getBodyTorque() const;
165  agx::Bool const& getIsImpacting() const;
167 
168  // Semantics defined by explicit kernels
169 
170  // Automatic setters
171  void setGeometry(agx::Physics::GeometryPtr const& value);
172  void setBody(agx::Physics::RigidBodyPtr const& value);
173  void setBodyForce(agx::Vec3 const& value);
174  void setBodyTorque(agx::Vec3 const& value);
175  void setIsImpacting(agx::Bool const& value);
176  void setContacts(agxData::Array< agx::Physics::ParticleGeometryContactPtr > const& value);
177 
178 
179  protected:
180  friend class GeometryParticleContactListPtr;
181  friend class GeometryParticleContactListInstance;
182  GeometryParticleContactListSemantics();
183  };
185 
186 
187 
191  {
192  public:
194  typedef GeometryParticleContactListData DataType;
195  typedef GeometryParticleContactListInstance InstanceType;
196 
197  public:
204  AGXPHYSICS_EXPORT GeometryParticleContactListInstance instance();
205  AGXPHYSICS_EXPORT const GeometryParticleContactListInstance instance() const;
206 
207  AGXPHYSICS_EXPORT GeometryParticleContactListSemantics* operator->();
208  AGXPHYSICS_EXPORT const GeometryParticleContactListSemantics* operator->() const;
209 
210  GeometryParticleContactListData* getData();
211  const GeometryParticleContactListData* getData() const;
212 
213 
217  AGXPHYSICS_EXPORT agx::Physics::GeometryPtr const& geometry() const;
218 
222  AGXPHYSICS_EXPORT agx::Physics::RigidBodyPtr const& body() const;
223 
225  AGXPHYSICS_EXPORT agx::Vec3& bodyForce();
227  AGXPHYSICS_EXPORT agx::Vec3 const& bodyForce() const;
228 
230  AGXPHYSICS_EXPORT agx::Vec3& bodyTorque();
232  AGXPHYSICS_EXPORT agx::Vec3 const& bodyTorque() const;
233 
235  AGXPHYSICS_EXPORT agx::Bool& isImpacting();
237  AGXPHYSICS_EXPORT agx::Bool const& isImpacting() const;
238 
243 
245  // Only used by tolua!
246  #ifdef AGX_GENERATED_TOLUA_WRAPPER
247  inline agx::Physics::GeometryPtr const& getGeometry() const { return (*this)->getGeometry(); }
248  inline agx::Physics::RigidBodyPtr const& getBody() const { return (*this)->getBody(); }
249  inline agx::Vec3 const& getBodyForce() const { return (*this)->getBodyForce(); }
250  inline agx::Vec3 const& getBodyTorque() const { return (*this)->getBodyTorque(); }
251  inline agx::Bool const& getIsImpacting() const { return (*this)->getIsImpacting(); }
252  inline agxData::Array< agx::Physics::ParticleGeometryContactPtr > const& getContacts() const { return (*this)->getContacts(); }
253 
254 
255  inline void setGeometry(agx::Physics::GeometryPtr const& value) { (*this)->setGeometry(value); }
256  inline void setBody(agx::Physics::RigidBodyPtr const& value) { (*this)->setBody(value); }
257  inline void setBodyForce(agx::Vec3 const& value) { (*this)->setBodyForce(value); }
258  inline void setBodyTorque(agx::Vec3 const& value) { (*this)->setBodyTorque(value); }
259  inline void setIsImpacting(agx::Bool const& value) { (*this)->setIsImpacting(value); }
260  inline void setContacts(agxData::Array< agx::Physics::ParticleGeometryContactPtr > const& value) { (*this)->setContacts(value); }
261  #endif
263 
264  };
265 
266 
268  class AGXPHYSICS_EXPORT GeometryParticleContactListInstance : public agx::Physics::InteractionInstance
269  {
270  public:
271  GeometryParticleContactListInstance();
272  GeometryParticleContactListInstance(GeometryParticleContactListData* data, agx::Index index);
273  GeometryParticleContactListInstance(agxData::EntityStorage *storage, agx::Index index);
274  GeometryParticleContactListInstance(const agxData::EntityInstance& other);
275  GeometryParticleContactListInstance(const agxData::EntityPtr& ptr);
276 
277  GeometryParticleContactListData* getData();
278  const GeometryParticleContactListData* getData() const;
279 
280  public:
282  agx::Physics::GeometryPtr& geometry();
284  agx::Physics::GeometryPtr const& geometry() const;
285 
289  agx::Physics::RigidBodyPtr const& body() const;
290 
292  agx::Vec3& bodyForce();
294  agx::Vec3 const& bodyForce() const;
295 
297  agx::Vec3& bodyTorque();
299  agx::Vec3 const& bodyTorque() const;
300 
302  agx::Bool& isImpacting();
304  agx::Bool const& isImpacting() const;
305 
310 
311  };
313 
314 
315 
318 
319 
320 
322  /* Implementation */
323  //-----------------------------------------------------------------------------------------------------
324  //-----------------------------------------------------------------------------------------------------
325  inline GeometryParticleContactListInstance agx::Physics::GeometryParticleContactListData::operator[] (size_t index) { return GeometryParticleContactListInstance(this, (agx::Index)index); }
326  //-----------------------------------------------------------------------------------------------------
330  {
332  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
334  }
335 
337  {
339  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
341  }
342 
344  {
347  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
349  return *this;
350  }
351 
353  {
356  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
358  return *this;
359  }
360 
361  inline GeometryParticleContactListInstance GeometryParticleContactListPtr::instance() { return agxData::EntityPtr::instance(); }
362  inline const GeometryParticleContactListInstance GeometryParticleContactListPtr::instance() const { return agxData::EntityPtr::instance(); }
363  AGX_FORCE_INLINE GeometryParticleContactListSemantics* GeometryParticleContactListPtr::operator->() { return (GeometryParticleContactListSemantics* )this; }
364  AGX_FORCE_INLINE const GeometryParticleContactListSemantics* GeometryParticleContactListPtr::operator->() const { return (const GeometryParticleContactListSemantics* )this; }
365  AGX_FORCE_INLINE GeometryParticleContactListData* GeometryParticleContactListPtr::getData() { return static_cast<GeometryParticleContactListData* >(agxData::EntityPtr::getData()); }
366  AGX_FORCE_INLINE const GeometryParticleContactListData* GeometryParticleContactListPtr::getData() const { return static_cast<const GeometryParticleContactListData* >(agxData::EntityPtr::getData()); }
367 
368  AGX_FORCE_INLINE agx::Physics::GeometryPtr& GeometryParticleContactListPtr::geometry() { verifyIndex(); return getData()->geometry[calculateIndex()]; }
369  AGX_FORCE_INLINE agx::Physics::GeometryPtr const& GeometryParticleContactListPtr::geometry() const { verifyIndex(); return getData()->geometry[calculateIndex()]; }
370 
371  AGX_FORCE_INLINE agx::Physics::RigidBodyPtr& GeometryParticleContactListPtr::body() { verifyIndex(); return getData()->body[calculateIndex()]; }
372  AGX_FORCE_INLINE agx::Physics::RigidBodyPtr const& GeometryParticleContactListPtr::body() const { verifyIndex(); return getData()->body[calculateIndex()]; }
373 
374  AGX_FORCE_INLINE agx::Vec3& GeometryParticleContactListPtr::bodyForce() { verifyIndex(); return getData()->bodyForce[calculateIndex()]; }
375  AGX_FORCE_INLINE agx::Vec3 const& GeometryParticleContactListPtr::bodyForce() const { verifyIndex(); return getData()->bodyForce[calculateIndex()]; }
376 
377  AGX_FORCE_INLINE agx::Vec3& GeometryParticleContactListPtr::bodyTorque() { verifyIndex(); return getData()->bodyTorque[calculateIndex()]; }
378  AGX_FORCE_INLINE agx::Vec3 const& GeometryParticleContactListPtr::bodyTorque() const { verifyIndex(); return getData()->bodyTorque[calculateIndex()]; }
379 
380  AGX_FORCE_INLINE agx::Bool& GeometryParticleContactListPtr::isImpacting() { verifyIndex(); return getData()->isImpacting[calculateIndex()]; }
381  AGX_FORCE_INLINE agx::Bool const& GeometryParticleContactListPtr::isImpacting() const { verifyIndex(); return getData()->isImpacting[calculateIndex()]; }
382 
383  AGX_FORCE_INLINE agxData::Array< agx::Physics::ParticleGeometryContactPtr >& GeometryParticleContactListPtr::contacts() { verifyIndex(); return getData()->contacts[calculateIndex()]; }
384  AGX_FORCE_INLINE agxData::Array< agx::Physics::ParticleGeometryContactPtr > const& GeometryParticleContactListPtr::contacts() const { verifyIndex(); return getData()->contacts[calculateIndex()]; }
385 
386  //-----------------------------------------------------------------------------------------------------
387  AGX_FORCE_INLINE GeometryParticleContactListInstance::GeometryParticleContactListInstance() {}
388  AGX_FORCE_INLINE GeometryParticleContactListInstance::GeometryParticleContactListInstance(GeometryParticleContactListData* data, agx::Index index) : agx::Physics::InteractionInstance(data, index) {}
389  AGX_FORCE_INLINE GeometryParticleContactListInstance::GeometryParticleContactListInstance(agxData::EntityStorage* storage, agx::Index index) : agx::Physics::InteractionInstance(storage, index) {}
390  AGX_FORCE_INLINE GeometryParticleContactListInstance::GeometryParticleContactListInstance(const agxData::EntityInstance& other) : agx::Physics::InteractionInstance(other)
391  {
393  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
395  }
396 
397  AGX_FORCE_INLINE GeometryParticleContactListInstance::GeometryParticleContactListInstance(const agxData::EntityPtr& ptr) : agx::Physics::InteractionInstance(ptr)
398  {
400  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
402  }
403 
404 
405  AGX_FORCE_INLINE GeometryParticleContactListData* GeometryParticleContactListInstance::getData() { return static_cast<GeometryParticleContactListData* >(agxData::EntityInstance::getData()); }
406  AGX_FORCE_INLINE const GeometryParticleContactListData* GeometryParticleContactListInstance::getData() const { return static_cast<const GeometryParticleContactListData* >(agxData::EntityInstance::getData()); }
407 
408  AGX_FORCE_INLINE agx::Physics::GeometryPtr& GeometryParticleContactListInstance::geometry() { verifyIndex(); return getData()->geometry[getIndex()]; }
409  AGX_FORCE_INLINE agx::Physics::GeometryPtr const& GeometryParticleContactListInstance::geometry() const { verifyIndex(); return getData()->geometry[getIndex()]; }
410 
411  AGX_FORCE_INLINE agx::Physics::RigidBodyPtr& GeometryParticleContactListInstance::body() { verifyIndex(); return getData()->body[getIndex()]; }
412  AGX_FORCE_INLINE agx::Physics::RigidBodyPtr const& GeometryParticleContactListInstance::body() const { verifyIndex(); return getData()->body[getIndex()]; }
413 
414  AGX_FORCE_INLINE agx::Vec3& GeometryParticleContactListInstance::bodyForce() { verifyIndex(); return getData()->bodyForce[getIndex()]; }
415  AGX_FORCE_INLINE agx::Vec3 const& GeometryParticleContactListInstance::bodyForce() const { verifyIndex(); return getData()->bodyForce[getIndex()]; }
416 
417  AGX_FORCE_INLINE agx::Vec3& GeometryParticleContactListInstance::bodyTorque() { verifyIndex(); return getData()->bodyTorque[getIndex()]; }
418  AGX_FORCE_INLINE agx::Vec3 const& GeometryParticleContactListInstance::bodyTorque() const { verifyIndex(); return getData()->bodyTorque[getIndex()]; }
419 
420  AGX_FORCE_INLINE agx::Bool& GeometryParticleContactListInstance::isImpacting() { verifyIndex(); return getData()->isImpacting[getIndex()]; }
421  AGX_FORCE_INLINE agx::Bool const& GeometryParticleContactListInstance::isImpacting() const { verifyIndex(); return getData()->isImpacting[getIndex()]; }
422 
423  AGX_FORCE_INLINE agxData::Array< agx::Physics::ParticleGeometryContactPtr >& GeometryParticleContactListInstance::contacts() { verifyIndex(); return getData()->contacts[getIndex()]; }
424  AGX_FORCE_INLINE agxData::Array< agx::Physics::ParticleGeometryContactPtr > const& GeometryParticleContactListInstance::contacts() const { verifyIndex(); return getData()->contacts[getIndex()]; }
425 
426  //-----------------------------------------------------------------------------------------------------
427  AGX_FORCE_INLINE GeometryParticleContactListSemantics::GeometryParticleContactListSemantics() {}
428  //-----------------------------------------------------------------------------------------------------
430  }
431 }
432 
433 AGX_TYPE_BINDING(agx::Physics::GeometryParticleContactListPtr, "Physics.GeometryParticleContactListPtr")
434 AGX_TYPE_BINDING(agx::Physics::GeometryParticleContactListInstance, "Physics.GeometryParticleContactListInstance")
435 
436 #ifdef _MSC_VER
437 # pragma warning(pop)
438 #endif
439 
440 #undef AGX_ENTITY_WRAPPER
441 #undef AGX_ENTITY_NAMESPACE
442 #endif
443 
agxData::EntityData * getData()
AGXPHYSICS_EXPORT agx::Vec3 & bodyForce()
AGXPHYSICS_EXPORT agx::Vec3 & bodyTorque()
AGXPHYSICS_EXPORT agx::Physics::RigidBodyPtr & body()
agxData::EntityInstance instance()
Definition: EntityPtr.h:269
static agxData::ScalarAttributeT< agx::Vec3 > * bodyTorqueAttribute
static agxData::ScalarAttributeT< agx::Bool > * isImpactingAttribute
bool Bool
Definition: Integer.h:48
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:73
AGXPHYSICS_EXPORT agx::Bool & isImpacting()
#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:364
GeometryParticleContactListData * getData()
Pointer to a entity instance of type Physics.Interaction.
#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:248
bool isInstanceOf(agxData::EntityModel *model) const
#define AGX_FORCE_INLINE
Definition: Object.h:63
static GeometryParticleContactListModel * instance()
AGXPHYSICS_EXPORT agxData::Array< agx::Physics::ParticleGeometryContactPtr > & contacts()
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.Interaction entity.
AGXPHYSICS_EXPORT GeometryParticleContactListPtr & operator=(const agxData::EntityPtr &ptr)
Pointer to a entity instance of type Physics.RigidBody.
static agxData::ScalarAttributeT< agx::Physics::RigidBodyPtr > * bodyAttribute
Vector containing &#39;raw&#39; data.
Definition: Vector.h:245
EntityPtr & operator=(const EntityPtr &other)=default
Namespace agx contains the dynamics/math part of the AGX Dynamics API.
Pointer to a entity instance of type Physics.Geometry.
Contains classes for low level data storage for AGX.
Definition: Container.h:23
UInt32 Index
Definition: Integer.h:52
static agxData::ScalarAttributeT< agx::Vec3 > * bodyForceAttribute
static agxData::ArrayAttributeT< agx::Physics::ParticleGeometryContactPtr > * contactsAttribute
#define CALLABLE
Definition: Object.h:77
AGXPHYSICS_EXPORT agx::Physics::GeometryPtr & geometry()
AGXPHYSICS_EXPORT GeometryParticleContactListInstance instance()
bool isInstanceOf(agxData::EntityModel *model) const
Pointer to a entity instance of type Physics.GeometryParticleContactList.
static agxData::ScalarAttributeT< agx::Physics::GeometryPtr > * geometryAttribute
Abstract description of the data attributes for the Physics.GeometryParticleContactList entity...
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:102
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:101
AGXPHYSICS_EXPORT GeometryParticleContactListSemantics * operator->()