AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
GeometryParticleContactListEntity.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or
9having been advised so by Algoryx Simulation AB for a time limited evaluation,
10or having purchased a valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx 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>
41#include <agxData/EntityRef.h>
42#include <agxData/EntityPtr.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
54namespace agx { namespace Physics { class GeometryPtr; }}
55namespace agx { namespace Physics { class RigidBodyPtr; }}
56namespace agx { namespace Physics { class ParticleGeometryContactPtr; }}
57
58namespace 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
84
87
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;
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:
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);
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
218
223
228
233
238
243
244 };
245
246
248 class AGXPHYSICS_EXPORT GeometryParticleContactListInstance : public agx::Physics::InteractionInstance
249 {
250 public:
251 GeometryParticleContactListInstance();
252 GeometryParticleContactListInstance(GeometryParticleContactListData* data, agx::Index index);
253 GeometryParticleContactListInstance(agxData::EntityStorage *storage, agx::Index index);
254 GeometryParticleContactListInstance(const agxData::EntityInstance& other);
255 GeometryParticleContactListInstance(const agxData::EntityPtr& ptr);
256
257 GeometryParticleContactListData* getData();
258 const GeometryParticleContactListData* getData() const;
259
260 public:
262 agx::Physics::GeometryPtr& geometry();
264 agx::Physics::GeometryPtr const& geometry() const;
265
269 agx::Physics::RigidBodyPtr const& body() const;
270
272 agx::Vec3& bodyForce();
274 agx::Vec3 const& bodyForce() const;
275
277 agx::Vec3& bodyTorque();
279 agx::Vec3 const& bodyTorque() const;
280
282 agx::Bool& isImpacting();
284 agx::Bool const& isImpacting() const;
285
290
291 };
293
294
295
298
299
300
302 /* Implementation */
303 //-----------------------------------------------------------------------------------------------------
304 //-----------------------------------------------------------------------------------------------------
305 inline GeometryParticleContactListInstance agx::Physics::GeometryParticleContactListData::operator[] (size_t index) { return GeometryParticleContactListInstance(this, (agx::Index)index); }
306 //-----------------------------------------------------------------------------------------------------
309 AGX_FORCE_INLINE GeometryParticleContactListPtr::GeometryParticleContactListPtr(const agxData::EntityPtr& ptr) : agx::Physics::InteractionPtr(ptr)
310 {
312 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
313 EntityPtr::getModel()->fullPath().c_str(), GeometryParticleContactListModel::instance()->fullPath().c_str());
314 }
315
316 AGX_FORCE_INLINE GeometryParticleContactListPtr::GeometryParticleContactListPtr(const agxData::EntityInstance& instance) : agx::Physics::InteractionPtr(instance)
317 {
319 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
320 EntityPtr::getModel()->fullPath().c_str(), GeometryParticleContactListModel::instance()->fullPath().c_str());
321 }
322
323 AGX_FORCE_INLINE GeometryParticleContactListPtr& GeometryParticleContactListPtr::operator= (const agxData::EntityPtr& ptr)
324 {
326 agxAssertN(!ptr || ptr.isInstanceOf(GeometryParticleContactListModel::instance()),
327 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
328 EntityPtr::getModel()->fullPath().c_str(), GeometryParticleContactListModel::instance()->fullPath().c_str());
329 return *this;
330 }
331
332 AGX_FORCE_INLINE GeometryParticleContactListPtr& GeometryParticleContactListPtr::operator= (const agxData::EntityInstance& instance)
333 {
335 agxAssertN(!instance || instance.isInstanceOf(GeometryParticleContactListModel::instance()),
336 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
337 EntityPtr::getModel()->fullPath().c_str(), GeometryParticleContactListModel::instance()->fullPath().c_str());
338 return *this;
339 }
340
341 inline GeometryParticleContactListInstance GeometryParticleContactListPtr::instance() { return agxData::EntityPtr::instance(); }
342 inline const GeometryParticleContactListInstance GeometryParticleContactListPtr::instance() const { return agxData::EntityPtr::instance(); }
343 AGX_FORCE_INLINE GeometryParticleContactListSemantics* GeometryParticleContactListPtr::operator->() { return (GeometryParticleContactListSemantics* )this; }
344 AGX_FORCE_INLINE const GeometryParticleContactListSemantics* GeometryParticleContactListPtr::operator->() const { return (const GeometryParticleContactListSemantics* )this; }
345 AGX_FORCE_INLINE GeometryParticleContactListData* GeometryParticleContactListPtr::getData() { return static_cast<GeometryParticleContactListData* >(agxData::EntityPtr::getData()); }
346 AGX_FORCE_INLINE const GeometryParticleContactListData* GeometryParticleContactListPtr::getData() const { return static_cast<const GeometryParticleContactListData* >(agxData::EntityPtr::getData()); }
347
348 AGX_FORCE_INLINE agx::Physics::GeometryPtr& GeometryParticleContactListPtr::geometry() { verifyIndex(); return getData()->geometry[calculateIndex()]; }
349 AGX_FORCE_INLINE agx::Physics::GeometryPtr const& GeometryParticleContactListPtr::geometry() const { verifyIndex(); return getData()->geometry[calculateIndex()]; }
350
351 AGX_FORCE_INLINE agx::Physics::RigidBodyPtr& GeometryParticleContactListPtr::body() { verifyIndex(); return getData()->body[calculateIndex()]; }
352 AGX_FORCE_INLINE agx::Physics::RigidBodyPtr const& GeometryParticleContactListPtr::body() const { verifyIndex(); return getData()->body[calculateIndex()]; }
353
354 AGX_FORCE_INLINE agx::Vec3& GeometryParticleContactListPtr::bodyForce() { verifyIndex(); return getData()->bodyForce[calculateIndex()]; }
355 AGX_FORCE_INLINE agx::Vec3 const& GeometryParticleContactListPtr::bodyForce() const { verifyIndex(); return getData()->bodyForce[calculateIndex()]; }
356
357 AGX_FORCE_INLINE agx::Vec3& GeometryParticleContactListPtr::bodyTorque() { verifyIndex(); return getData()->bodyTorque[calculateIndex()]; }
358 AGX_FORCE_INLINE agx::Vec3 const& GeometryParticleContactListPtr::bodyTorque() const { verifyIndex(); return getData()->bodyTorque[calculateIndex()]; }
359
360 AGX_FORCE_INLINE agx::Bool& GeometryParticleContactListPtr::isImpacting() { verifyIndex(); return getData()->isImpacting[calculateIndex()]; }
361 AGX_FORCE_INLINE agx::Bool const& GeometryParticleContactListPtr::isImpacting() const { verifyIndex(); return getData()->isImpacting[calculateIndex()]; }
362
363 AGX_FORCE_INLINE agxData::Array< agx::Physics::ParticleGeometryContactPtr >& GeometryParticleContactListPtr::contacts() { verifyIndex(); return getData()->contacts[calculateIndex()]; }
364 AGX_FORCE_INLINE agxData::Array< agx::Physics::ParticleGeometryContactPtr > const& GeometryParticleContactListPtr::contacts() const { verifyIndex(); return getData()->contacts[calculateIndex()]; }
365
366 //-----------------------------------------------------------------------------------------------------
367 AGX_FORCE_INLINE GeometryParticleContactListInstance::GeometryParticleContactListInstance() {}
368 AGX_FORCE_INLINE GeometryParticleContactListInstance::GeometryParticleContactListInstance(GeometryParticleContactListData* data, agx::Index index) : agx::Physics::InteractionInstance(data, index) {}
369 AGX_FORCE_INLINE GeometryParticleContactListInstance::GeometryParticleContactListInstance(agxData::EntityStorage* storage, agx::Index index) : agx::Physics::InteractionInstance(storage, index) {}
370 AGX_FORCE_INLINE GeometryParticleContactListInstance::GeometryParticleContactListInstance(const agxData::EntityInstance& other) : agx::Physics::InteractionInstance(other)
371 {
373 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
374 EntityInstance::getModel()->fullPath().c_str(), GeometryParticleContactListModel::instance()->fullPath().c_str());
375 }
376
377 AGX_FORCE_INLINE GeometryParticleContactListInstance::GeometryParticleContactListInstance(const agxData::EntityPtr& ptr) : agx::Physics::InteractionInstance(ptr)
378 {
380 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
381 EntityInstance::getModel()->fullPath().c_str(), GeometryParticleContactListModel::instance()->fullPath().c_str());
382 }
383
384
385 AGX_FORCE_INLINE GeometryParticleContactListData* GeometryParticleContactListInstance::getData() { return static_cast<GeometryParticleContactListData* >(agxData::EntityInstance::getData()); }
386 AGX_FORCE_INLINE const GeometryParticleContactListData* GeometryParticleContactListInstance::getData() const { return static_cast<const GeometryParticleContactListData* >(agxData::EntityInstance::getData()); }
387
388 AGX_FORCE_INLINE agx::Physics::GeometryPtr& GeometryParticleContactListInstance::geometry() { verifyIndex(); return getData()->geometry[getIndex()]; }
389 AGX_FORCE_INLINE agx::Physics::GeometryPtr const& GeometryParticleContactListInstance::geometry() const { verifyIndex(); return getData()->geometry[getIndex()]; }
390
391 AGX_FORCE_INLINE agx::Physics::RigidBodyPtr& GeometryParticleContactListInstance::body() { verifyIndex(); return getData()->body[getIndex()]; }
392 AGX_FORCE_INLINE agx::Physics::RigidBodyPtr const& GeometryParticleContactListInstance::body() const { verifyIndex(); return getData()->body[getIndex()]; }
393
394 AGX_FORCE_INLINE agx::Vec3& GeometryParticleContactListInstance::bodyForce() { verifyIndex(); return getData()->bodyForce[getIndex()]; }
395 AGX_FORCE_INLINE agx::Vec3 const& GeometryParticleContactListInstance::bodyForce() const { verifyIndex(); return getData()->bodyForce[getIndex()]; }
396
397 AGX_FORCE_INLINE agx::Vec3& GeometryParticleContactListInstance::bodyTorque() { verifyIndex(); return getData()->bodyTorque[getIndex()]; }
398 AGX_FORCE_INLINE agx::Vec3 const& GeometryParticleContactListInstance::bodyTorque() const { verifyIndex(); return getData()->bodyTorque[getIndex()]; }
399
400 AGX_FORCE_INLINE agx::Bool& GeometryParticleContactListInstance::isImpacting() { verifyIndex(); return getData()->isImpacting[getIndex()]; }
401 AGX_FORCE_INLINE agx::Bool const& GeometryParticleContactListInstance::isImpacting() const { verifyIndex(); return getData()->isImpacting[getIndex()]; }
402
403 AGX_FORCE_INLINE agxData::Array< agx::Physics::ParticleGeometryContactPtr >& GeometryParticleContactListInstance::contacts() { verifyIndex(); return getData()->contacts[getIndex()]; }
404 AGX_FORCE_INLINE agxData::Array< agx::Physics::ParticleGeometryContactPtr > const& GeometryParticleContactListInstance::contacts() const { verifyIndex(); return getData()->contacts[getIndex()]; }
405
406 //-----------------------------------------------------------------------------------------------------
407 AGX_FORCE_INLINE GeometryParticleContactListSemantics::GeometryParticleContactListSemantics() {}
408 //-----------------------------------------------------------------------------------------------------
410 }
411}
412
413AGX_TYPE_BINDING(agx::Physics::GeometryParticleContactListPtr, "Physics.GeometryParticleContactListPtr")
414AGX_TYPE_BINDING(agx::Physics::GeometryParticleContactListInstance, "Physics.GeometryParticleContactListInstance")
415
416#ifdef _MSC_VER
417# pragma warning(pop)
418#endif
419
420#undef AGX_ENTITY_WRAPPER
421#undef AGX_ENTITY_NAMESPACE
422#endif
423
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGX_TYPE_BINDING(_Type, _Name)
Definition: Type.h:179
#define AGXPHYSICS_EXPORT
Type-specific Array used for fast access into the data held by a Buffer.
Definition: Array.h:107
Entity instance provides access to a single instance in an EntityStorage.
bool isInstanceOf(agxData::EntityModel *model) const
agxData::EntityData * getData()
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
Definition: EntityPtr.h:52
EntityPtr & operator=(const EntityPtr &other)=default
bool isInstanceOf(agxData::EntityModel *model) const
agxData::EntityData * getData()
agxData::EntityInstance instance()
Definition: EntityPtr.h:269
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:73
agx::String fullPath() const
Abstract description of the data attributes for the Physics.GeometryParticleContactList entity.
static agxData::ArrayAttributeT< agx::Physics::ParticleGeometryContactPtr > * contactsAttribute
static agxData::ScalarAttributeT< agx::Physics::GeometryPtr > * geometryAttribute
virtual void configure(agx::TiXmlElement *eEntity) override
virtual void construct(agxData::EntityPtr instance) override
void construct(agx::Physics::GeometryParticleContactListPtr geometryParticleContactList)
static GeometryParticleContactListPtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
static agxData::ScalarAttributeT< agx::Physics::RigidBodyPtr > * bodyAttribute
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
static agxData::ScalarAttributeT< agx::Bool > * isImpactingAttribute
static agxData::EntityStorage * defaultStorage()
static agxData::ScalarAttributeT< agx::Vec3 > * bodyTorqueAttribute
GeometryParticleContactListModel(const agx::String &name="GeometryParticleContactList")
static GeometryParticleContactListModel * instance()
static agxData::ScalarAttributeT< agx::Vec3 > * bodyForceAttribute
Pointer to a entity instance of type Physics.GeometryParticleContactList.
AGXPHYSICS_EXPORT agx::Physics::RigidBodyPtr const & body() const
AGXPHYSICS_EXPORT GeometryParticleContactListPtr(const agxData::EntityInstance &instance)
GeometryParticleContactListData * getData()
AGXPHYSICS_EXPORT agx::Vec3 & bodyForce()
AGXPHYSICS_EXPORT const GeometryParticleContactListInstance instance() const
AGXPHYSICS_EXPORT GeometryParticleContactListSemantics * operator->()
AGXPHYSICS_EXPORT agxData::Array< agx::Physics::ParticleGeometryContactPtr > & contacts()
AGXPHYSICS_EXPORT agx::Physics::RigidBodyPtr & body()
AGXPHYSICS_EXPORT agx::Bool & isImpacting()
AGXPHYSICS_EXPORT agx::Vec3 & bodyTorque()
AGXPHYSICS_EXPORT GeometryParticleContactListPtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT agxData::Array< agx::Physics::ParticleGeometryContactPtr > const & contacts() const
AGXPHYSICS_EXPORT agx::Physics::GeometryPtr const & geometry() const
AGXPHYSICS_EXPORT GeometryParticleContactListInstance instance()
AGXPHYSICS_EXPORT const GeometryParticleContactListSemantics * operator->() const
AGXPHYSICS_EXPORT agx::Vec3 const & bodyForce() const
const GeometryParticleContactListData * getData() const
AGXPHYSICS_EXPORT agx::Bool const & isImpacting() const
AGXPHYSICS_EXPORT agx::Physics::GeometryPtr & geometry()
AGXPHYSICS_EXPORT GeometryParticleContactListPtr(agxData::EntityStorage *storage, agx::Index id)
AGXPHYSICS_EXPORT agx::Vec3 const & bodyTorque() const
Pointer to a entity instance of type Physics.Geometry.
Abstract description of the data attributes for the Physics.Interaction entity.
Pointer to a entity instance of type Physics.Interaction.
Pointer to a entity instance of type Physics.RigidBody.
Vector containing 'raw' data.
Definition: agx/Vector.h:246
#define agxAssertN(expr, format,...)
Definition: debug.h:145
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define CALLABLE
Definition: macros.h:72
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
#define AGX_FORCE_INLINE
Definition: macros.h:58
Contains classes for low level data storage for AGX.
Definition: Container.h:23
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool Bool
Definition: Integer.h:40
UInt32 Index
Definition: Integer.h:44