AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
BroadPhasePairEntity.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_BROADPHASEPAIR_H_PLUGIN
22#define GENERATED_AGX_PHYSICS_BROADPHASEPAIR_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>
48#include <agx/Integer.h>
51
52namespace agx { namespace Physics { class GeometryContactPtr; }}
53namespace agx { namespace Physics { class WarmStartingDataPtr; }}
54
55namespace agx
56{
57 namespace Physics
58 {
59
60 class BroadPhasePairModel;
61 class BroadPhasePairData;
62 class BroadPhasePairPtr;
63 class BroadPhasePairInstance;
64 class BroadPhasePairSemantics;
65
66
68
73 {
74 public:
76
77 BroadPhasePairModel(const agx::String& name = "BroadPhasePair");
78
81
84
87
89 virtual void shutdownCleanup() override;
90
91
92
93 /* Attributes */
97
98 protected:
100 virtual agxData::EntityData* createData(agxData::EntityStorage* storage) override;
101 virtual void configure(agx::TiXmlElement* eEntity) override;
102 virtual void initAttributeAccessors() override;
103 virtual void construct(agxData::EntityPtr instance) override;
105 };
106
107
109 #ifndef AGX_PHYSICS_BROADPHASEPAIR_DATA_SET_OVERRIDE
110 #define AGX_PHYSICS_BROADPHASEPAIR_DATA_SET
111 class AGXPHYSICS_EXPORT BroadPhasePairData : public agx::Physics::GeometryPairData
112 {
113 public:
114 BroadPhasePairInstance operator[] (size_t index);
115
116 public:
121
122 public:
123 typedef agx::UInt8 stateType;
124 typedef agx::Physics::GeometryContactPtr contactType;
125 typedef agxData::Array< agx::Physics::WarmStartingDataPtr > warmStartingDataType;
126
127 public:
128 BroadPhasePairData(agxData::EntityStorage* storage);
129 BroadPhasePairData();
130
131 protected:
132 virtual ~BroadPhasePairData() {}
133 virtual void setNumElements(agx::Index numElements) override;
134
135 private:
136 BroadPhasePairData& operator= (const BroadPhasePairData&) { return *this; }
137
138 };
139 #endif
141
142
144 class AGXPHYSICS_EXPORT BroadPhasePairSemantics : public agx::Physics::GeometryPairSemantics
145 {
146 public:
147
148 // Automatic getters
149 agx::UInt8 const& getState() const;
150 agx::Physics::GeometryContactPtr const& getContact() const;
151 agxData::Array< agx::Physics::WarmStartingDataPtr > const& getWarmStartingData() const;
152
153 // Semantics defined by explicit kernels
154
155 // Automatic setters
156 void setState(agx::UInt8 const& value);
157 void setContact(agx::Physics::GeometryContactPtr const& value);
158 void setWarmStartingData(agxData::Array< agx::Physics::WarmStartingDataPtr > const& value);
159
160
161 protected:
162 friend class BroadPhasePairPtr;
163 friend class BroadPhasePairInstance;
164 BroadPhasePairSemantics();
165 };
167
168
169
173 {
174 public:
176 typedef BroadPhasePairData DataType;
177 typedef BroadPhasePairInstance InstanceType;
178
179 public:
186 AGXPHYSICS_EXPORT BroadPhasePairInstance instance();
187 AGXPHYSICS_EXPORT const BroadPhasePairInstance instance() const;
188
189 AGXPHYSICS_EXPORT BroadPhasePairSemantics* operator->();
190 AGXPHYSICS_EXPORT const BroadPhasePairSemantics* operator->() const;
191
192 BroadPhasePairData* getData();
193 const BroadPhasePairData* getData() const;
194
195
200
205
210
211 };
212
213
215 class AGXPHYSICS_EXPORT BroadPhasePairInstance : public agx::Physics::GeometryPairInstance
216 {
217 public:
218 BroadPhasePairInstance();
219 BroadPhasePairInstance(BroadPhasePairData* data, agx::Index index);
220 BroadPhasePairInstance(agxData::EntityStorage *storage, agx::Index index);
221 BroadPhasePairInstance(const agxData::EntityInstance& other);
222 BroadPhasePairInstance(const agxData::EntityPtr& ptr);
223
224 BroadPhasePairData* getData();
225 const BroadPhasePairData* getData() const;
226
227 public:
229 agx::UInt8& state();
231 agx::UInt8 const& state() const;
232
236 agx::Physics::GeometryContactPtr const& contact() const;
237
241 agxData::Array< agx::Physics::WarmStartingDataPtr > const& warmStartingData() const;
242
243 };
245
246
247
250
251
252
254 /* Implementation */
255 //-----------------------------------------------------------------------------------------------------
256 //-----------------------------------------------------------------------------------------------------
257 inline BroadPhasePairInstance agx::Physics::BroadPhasePairData::operator[] (size_t index) { return BroadPhasePairInstance(this, (agx::Index)index); }
258 //-----------------------------------------------------------------------------------------------------
260 AGX_FORCE_INLINE BroadPhasePairPtr::BroadPhasePairPtr(agxData::EntityStorage* storage, agx::Index id) : agx::Physics::GeometryPairPtr(storage, id) {}
261 AGX_FORCE_INLINE BroadPhasePairPtr::BroadPhasePairPtr(const agxData::EntityPtr& ptr) : agx::Physics::GeometryPairPtr(ptr)
262 {
264 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
265 EntityPtr::getModel()->fullPath().c_str(), BroadPhasePairModel::instance()->fullPath().c_str());
266 }
267
268 AGX_FORCE_INLINE BroadPhasePairPtr::BroadPhasePairPtr(const agxData::EntityInstance& instance) : agx::Physics::GeometryPairPtr(instance)
269 {
271 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
272 EntityPtr::getModel()->fullPath().c_str(), BroadPhasePairModel::instance()->fullPath().c_str());
273 }
274
275 AGX_FORCE_INLINE BroadPhasePairPtr& BroadPhasePairPtr::operator= (const agxData::EntityPtr& ptr)
276 {
278 agxAssertN(!ptr || ptr.isInstanceOf(BroadPhasePairModel::instance()),
279 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
280 EntityPtr::getModel()->fullPath().c_str(), BroadPhasePairModel::instance()->fullPath().c_str());
281 return *this;
282 }
283
284 AGX_FORCE_INLINE BroadPhasePairPtr& BroadPhasePairPtr::operator= (const agxData::EntityInstance& instance)
285 {
287 agxAssertN(!instance || instance.isInstanceOf(BroadPhasePairModel::instance()),
288 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
289 EntityPtr::getModel()->fullPath().c_str(), BroadPhasePairModel::instance()->fullPath().c_str());
290 return *this;
291 }
292
293 inline BroadPhasePairInstance BroadPhasePairPtr::instance() { return agxData::EntityPtr::instance(); }
294 inline const BroadPhasePairInstance BroadPhasePairPtr::instance() const { return agxData::EntityPtr::instance(); }
295 AGX_FORCE_INLINE BroadPhasePairSemantics* BroadPhasePairPtr::operator->() { return (BroadPhasePairSemantics* )this; }
296 AGX_FORCE_INLINE const BroadPhasePairSemantics* BroadPhasePairPtr::operator->() const { return (const BroadPhasePairSemantics* )this; }
297 AGX_FORCE_INLINE BroadPhasePairData* BroadPhasePairPtr::getData() { return static_cast<BroadPhasePairData* >(agxData::EntityPtr::getData()); }
298 AGX_FORCE_INLINE const BroadPhasePairData* BroadPhasePairPtr::getData() const { return static_cast<const BroadPhasePairData* >(agxData::EntityPtr::getData()); }
299
300 AGX_FORCE_INLINE agx::UInt8& BroadPhasePairPtr::state() { verifyIndex(); return getData()->state[calculateIndex()]; }
301 AGX_FORCE_INLINE agx::UInt8 const& BroadPhasePairPtr::state() const { verifyIndex(); return getData()->state[calculateIndex()]; }
302
303 AGX_FORCE_INLINE agx::Physics::GeometryContactPtr& BroadPhasePairPtr::contact() { verifyIndex(); return getData()->contact[calculateIndex()]; }
304 AGX_FORCE_INLINE agx::Physics::GeometryContactPtr const& BroadPhasePairPtr::contact() const { verifyIndex(); return getData()->contact[calculateIndex()]; }
305
306 AGX_FORCE_INLINE agxData::Array< agx::Physics::WarmStartingDataPtr >& BroadPhasePairPtr::warmStartingData() { verifyIndex(); return getData()->warmStartingData[calculateIndex()]; }
307 AGX_FORCE_INLINE agxData::Array< agx::Physics::WarmStartingDataPtr > const& BroadPhasePairPtr::warmStartingData() const { verifyIndex(); return getData()->warmStartingData[calculateIndex()]; }
308
309 //-----------------------------------------------------------------------------------------------------
310 AGX_FORCE_INLINE BroadPhasePairInstance::BroadPhasePairInstance() {}
311 AGX_FORCE_INLINE BroadPhasePairInstance::BroadPhasePairInstance(BroadPhasePairData* data, agx::Index index) : agx::Physics::GeometryPairInstance(data, index) {}
312 AGX_FORCE_INLINE BroadPhasePairInstance::BroadPhasePairInstance(agxData::EntityStorage* storage, agx::Index index) : agx::Physics::GeometryPairInstance(storage, index) {}
313 AGX_FORCE_INLINE BroadPhasePairInstance::BroadPhasePairInstance(const agxData::EntityInstance& other) : agx::Physics::GeometryPairInstance(other)
314 {
316 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
317 EntityInstance::getModel()->fullPath().c_str(), BroadPhasePairModel::instance()->fullPath().c_str());
318 }
319
320 AGX_FORCE_INLINE BroadPhasePairInstance::BroadPhasePairInstance(const agxData::EntityPtr& ptr) : agx::Physics::GeometryPairInstance(ptr)
321 {
323 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
324 EntityInstance::getModel()->fullPath().c_str(), BroadPhasePairModel::instance()->fullPath().c_str());
325 }
326
327
328 AGX_FORCE_INLINE BroadPhasePairData* BroadPhasePairInstance::getData() { return static_cast<BroadPhasePairData* >(agxData::EntityInstance::getData()); }
329 AGX_FORCE_INLINE const BroadPhasePairData* BroadPhasePairInstance::getData() const { return static_cast<const BroadPhasePairData* >(agxData::EntityInstance::getData()); }
330
331 AGX_FORCE_INLINE agx::UInt8& BroadPhasePairInstance::state() { verifyIndex(); return getData()->state[getIndex()]; }
332 AGX_FORCE_INLINE agx::UInt8 const& BroadPhasePairInstance::state() const { verifyIndex(); return getData()->state[getIndex()]; }
333
334 AGX_FORCE_INLINE agx::Physics::GeometryContactPtr& BroadPhasePairInstance::contact() { verifyIndex(); return getData()->contact[getIndex()]; }
335 AGX_FORCE_INLINE agx::Physics::GeometryContactPtr const& BroadPhasePairInstance::contact() const { verifyIndex(); return getData()->contact[getIndex()]; }
336
337 AGX_FORCE_INLINE agxData::Array< agx::Physics::WarmStartingDataPtr >& BroadPhasePairInstance::warmStartingData() { verifyIndex(); return getData()->warmStartingData[getIndex()]; }
338 AGX_FORCE_INLINE agxData::Array< agx::Physics::WarmStartingDataPtr > const& BroadPhasePairInstance::warmStartingData() const { verifyIndex(); return getData()->warmStartingData[getIndex()]; }
339
340 //-----------------------------------------------------------------------------------------------------
341 AGX_FORCE_INLINE BroadPhasePairSemantics::BroadPhasePairSemantics() {}
342 //-----------------------------------------------------------------------------------------------------
344 }
345}
346
347AGX_TYPE_BINDING(agx::Physics::BroadPhasePairPtr, "Physics.BroadPhasePairPtr")
348AGX_TYPE_BINDING(agx::Physics::BroadPhasePairInstance, "Physics.BroadPhasePairInstance")
349
350#ifdef _MSC_VER
351# pragma warning(pop)
352#endif
353
354#undef AGX_ENTITY_WRAPPER
355#undef AGX_ENTITY_NAMESPACE
356#endif
357
#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.BroadPhasePair entity.
void construct(agx::Physics::BroadPhasePairPtr broadPhasePair)
BroadPhasePairModel(const agx::String &name="BroadPhasePair")
virtual void construct(agxData::EntityPtr instance) override
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
static agxData::EntityStorage * defaultStorage()
static agxData::ScalarAttributeT< agx::Physics::GeometryContactPtr > * contactAttribute
virtual void configure(agx::TiXmlElement *eEntity) override
static agxData::ScalarAttributeT< agx::UInt8 > * stateAttribute
static BroadPhasePairPtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
static BroadPhasePairModel * instance()
static agxData::ArrayAttributeT< agx::Physics::WarmStartingDataPtr > * warmStartingDataAttribute
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
virtual void initAttributeAccessors() override
Pointer to a entity instance of type Physics.BroadPhasePair.
AGXPHYSICS_EXPORT BroadPhasePairPtr(const agxData::EntityInstance &instance)
const BroadPhasePairData * getData() const
AGXPHYSICS_EXPORT BroadPhasePairPtr(agxData::EntityStorage *storage, agx::Index id)
AGXPHYSICS_EXPORT agx::UInt8 & state()
AGXPHYSICS_EXPORT agxData::Array< agx::Physics::WarmStartingDataPtr > & warmStartingData()
AGXPHYSICS_EXPORT agx::Physics::GeometryContactPtr & contact()
AGXPHYSICS_EXPORT BroadPhasePairInstance instance()
AGXPHYSICS_EXPORT const BroadPhasePairSemantics * operator->() const
AGXPHYSICS_EXPORT const BroadPhasePairInstance instance() const
BroadPhasePairData * getData()
AGXPHYSICS_EXPORT BroadPhasePairPtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT agx::Physics::GeometryContactPtr const & contact() const
AGXPHYSICS_EXPORT BroadPhasePairPtr()
AGXPHYSICS_EXPORT agx::UInt8 const & state() const
AGXPHYSICS_EXPORT BroadPhasePairSemantics * operator->()
AGXPHYSICS_EXPORT agxData::Array< agx::Physics::WarmStartingDataPtr > const & warmStartingData() const
A geometry contact hold contact information between two geometries.
Abstract description of the data attributes for the Physics.GeometryPair entity.
Pointer to a entity instance of type Physics.GeometryPair.
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.
uint8_t UInt8
Definition: Integer.h:30
UInt32 Index
Definition: Integer.h:44