AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
CellEntity.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_HIERARCHICALGRID_CELL_H_PLUGIN
22#define GENERATED_AGX_PHYSICS_HIERARCHICALGRID_CELL_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>
47#include <agx/Integer.h>
48#include <agx/Vec3.h>
49#include <agx/Real.h>
50#include <agx/IndexRange.h>
52
53namespace agx { namespace Physics { namespace HierarchicalGrid { class ContactZonePtr; }}}
54
55namespace agx
56{
57 namespace Physics
58 {
59 namespace HierarchicalGrid
60 {
61
62 class CellModel;
63 class CellData;
64 class CellPtr;
65 class CellInstance;
66 class CellSemantics;
67
68
70
75 {
76 public:
77 typedef CellPtr PtrT;
78
79 CellModel(const agx::String& name = "Cell");
80
83
86
89
91 virtual void shutdownCleanup() override;
92
93
94
95 /* Attributes */
105 static const size_t childrenArraySize = 8;
108 static const size_t neighborsArraySize = 32;
117
118 protected:
119 virtual ~CellModel();
120 virtual agxData::EntityData* createData(agxData::EntityStorage* storage) override;
121 virtual void configure(agx::TiXmlElement* eEntity) override;
122 virtual void initAttributeAccessors() override;
123 virtual void construct(agxData::EntityPtr instance) override;
125 };
126
127
129 #ifndef AGX_PHYSICS_HIERARCHICALGRID_CELL_DATA_SET_OVERRIDE
130 #define AGX_PHYSICS_HIERARCHICALGRID_CELL_DATA_SET
131 class AGXPHYSICS_EXPORT CellData : public agxData::EntityData
132 {
133 public:
134 CellInstance operator[] (size_t index);
135
136 public:
147 static const size_t childrenArraySize = 8;
150 static const size_t neighborsArraySize = 32;
156 agx::Real32 emptyThreshold;
157 agx::Real reorderingFrequency;
158 agx::Real sizeAlignment;
159
160 public:
161 typedef agx::UInt8 tierType;
162 typedef agx::UInt8 invDepthType;
163 typedef agx::Vec3i idType;
164 typedef agx::Vec3 positionType;
165 typedef agx::UInt8 stateType;
166 typedef agx::Real32 emptyTimeType;
167 typedef agx::IndexRange32 collisionObjectsType;
168 typedef agx::UInt32 parentType;
169 typedef agx::UInt32 childrenType;
170 typedef agx::UInt8 numChildrenType;
171 typedef agx::UInt32 neighborsType;
172 typedef agx::UInt32 searchCostType;
173 typedef agx::UInt32 sortedIndexType;
174 typedef agx::Physics::HierarchicalGrid::ContactZonePtr internalZoneType;
175 typedef agx::UInt8 zoneTypeType;
176 typedef agx::AtomicValue* solveBodyOffsetsType;
177 typedef agx::Real32 emptyThresholdType;
178 typedef agx::Real reorderingFrequencyType;
179 typedef agx::Real sizeAlignmentType;
180
181 public:
182 CellData(agxData::EntityStorage* storage);
183 CellData();
184
185 protected:
186 virtual ~CellData() {}
187 virtual void setNumElements(agx::Index numElements) override;
188 virtual void synchronizeSharedAttribute(agxData::Value* value) override;
189
190 private:
191 CellData& operator= (const CellData&) { return *this; }
192
193 };
194 #endif
196
197
199 class AGXPHYSICS_EXPORT CellSemantics : protected agxData::EntityPtr
200 {
201 public:
202
203 // Automatic getters
204 agx::UInt8 const& getTier() const;
205 agx::UInt8 const& getInvDepth() const;
206 agx::Vec3i const& getId() const;
207 agx::Vec3 const& getPosition() const;
208 agx::UInt8 const& getState() const;
209 agx::Real32 const& getEmptyTime() const;
210 agx::IndexRange32 const& getCollisionObjects() const;
211 agx::UInt32 const& getParent() const;
212 agx::UInt8 const& getNumChildren() const;
213 agx::UInt32 const& getSearchCost() const;
214 agx::UInt32 const& getSortedIndex() const;
215 agx::Physics::HierarchicalGrid::ContactZonePtr const& getInternalZone() const;
216 agx::UInt8 const& getZoneType() const;
217 agx::AtomicValue* const& getSolveBodyOffsets() const;
218
219 // Semantics defined by explicit kernels
220
221 // Automatic setters
222 void setTier(agx::UInt8 const& value);
223 void setInvDepth(agx::UInt8 const& value);
224 void setId(agx::Vec3i const& value);
225 void setPosition(agx::Vec3 const& value);
226 void setState(agx::UInt8 const& value);
227 void setEmptyTime(agx::Real32 const& value);
228 void setCollisionObjects(agx::IndexRange32 const& value);
229 void setParent(agx::UInt32 const& value);
230 void setNumChildren(agx::UInt8 const& value);
231 void setSearchCost(agx::UInt32 const& value);
232 void setSortedIndex(agx::UInt32 const& value);
233 void setInternalZone(agx::Physics::HierarchicalGrid::ContactZonePtr const& value);
234 void setZoneType(agx::UInt8 const& value);
235 void setSolveBodyOffsets(agx::AtomicValue* const& value);
236
237
238 protected:
239 friend class CellPtr;
240 friend class CellInstance;
241 CellSemantics();
242 };
244
245
246
249 class CALLABLE CellPtr : public agxData::EntityPtr
250 {
251 public:
253 typedef CellData DataType;
254 typedef CellInstance InstanceType;
255
256 public:
264 AGXPHYSICS_EXPORT const CellInstance instance() const;
265
267 AGXPHYSICS_EXPORT const CellSemantics* operator->() const;
268
269 CellData* getData();
270 const CellData* getData() const;
271
272
277
282
287
292
297
302
307
312
316 AGXPHYSICS_EXPORT agx::UInt32 const& children(size_t index) const;
317
322
326 AGXPHYSICS_EXPORT agx::UInt32 const& neighbors(size_t index) const;
327
332
337
342
347
352
357
362
367
368 };
369
370
372 class AGXPHYSICS_EXPORT CellInstance : public agxData::EntityInstance
373 {
374 public:
375 CellInstance();
376 CellInstance(CellData* data, agx::Index index);
377 CellInstance(agxData::EntityStorage *storage, agx::Index index);
378 CellInstance(const agxData::EntityInstance& other);
379 CellInstance(const agxData::EntityPtr& ptr);
380
381 CellData* getData();
382 const CellData* getData() const;
383
384 public:
386 agx::UInt8& tier();
388 agx::UInt8 const& tier() const;
389
391 agx::UInt8& invDepth();
393 agx::UInt8 const& invDepth() const;
394
396 agx::Vec3i& id();
398 agx::Vec3i const& id() const;
399
401 agx::Vec3& position();
403 agx::Vec3 const& position() const;
404
406 agx::UInt8& state();
408 agx::UInt8 const& state() const;
409
411 agx::Real32& emptyTime();
413 agx::Real32 const& emptyTime() const;
414
416 agx::IndexRange32& collisionObjects();
418 agx::IndexRange32 const& collisionObjects() const;
419
421 agx::UInt32& parent();
423 agx::UInt32 const& parent() const;
424
426 agxData::Array< agx::UInt32 > const children() const;
427 agx::UInt32& children(size_t index);
428 agx::UInt32 const& children(size_t index) const;
429
431 agx::UInt8& numChildren();
433 agx::UInt8 const& numChildren() const;
434
436 agxData::Array< agx::UInt32 > const neighbors() const;
437 agx::UInt32& neighbors(size_t index);
438 agx::UInt32 const& neighbors(size_t index) const;
439
441 agx::UInt32& searchCost();
443 agx::UInt32 const& searchCost() const;
444
446 agx::UInt32& sortedIndex();
448 agx::UInt32 const& sortedIndex() const;
449
453 agx::Physics::HierarchicalGrid::ContactZonePtr const& internalZone() const;
454
456 agx::UInt8& zoneType();
458 agx::UInt8 const& zoneType() const;
459
461 agx::AtomicValue*& solveBodyOffsets();
463 agx::AtomicValue* const& solveBodyOffsets() const;
464
466 agx::Real32& emptyThreshold();
468 agx::Real32 const& emptyThreshold() const;
469
471 agx::Real& reorderingFrequency();
473 agx::Real const& reorderingFrequency() const;
474
476 agx::Real& sizeAlignment();
478 agx::Real const& sizeAlignment() const;
479
480 };
482
483
484
486 typedef agxData::Array<CellPtr> CellPtrArray;
487
488
489
491 /* Implementation */
492 //-----------------------------------------------------------------------------------------------------
493 //-----------------------------------------------------------------------------------------------------
494 inline CellInstance agx::Physics::HierarchicalGrid::CellData::operator[] (size_t index) { return CellInstance(this, (agx::Index)index); }
495 //-----------------------------------------------------------------------------------------------------
497 AGX_FORCE_INLINE CellPtr::CellPtr(agxData::EntityStorage* storage, agx::Index id) : agxData::EntityPtr(storage, id) {}
498 AGX_FORCE_INLINE CellPtr::CellPtr(const agxData::EntityPtr& ptr) : agxData::EntityPtr(ptr)
499 {
501 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
502 EntityPtr::getModel()->fullPath().c_str(), CellModel::instance()->fullPath().c_str());
503 }
504
505 AGX_FORCE_INLINE CellPtr::CellPtr(const agxData::EntityInstance& instance) : agxData::EntityPtr(instance)
506 {
507 agxAssertN(!instance || instance.isInstanceOf(CellModel::instance()),
508 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
509 EntityPtr::getModel()->fullPath().c_str(), CellModel::instance()->fullPath().c_str());
510 }
511
512 AGX_FORCE_INLINE CellPtr& CellPtr::operator= (const agxData::EntityPtr& ptr)
513 {
515 agxAssertN(!ptr || ptr.isInstanceOf(CellModel::instance()),
516 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
517 EntityPtr::getModel()->fullPath().c_str(), CellModel::instance()->fullPath().c_str());
518 return *this;
519 }
520
521 AGX_FORCE_INLINE CellPtr& CellPtr::operator= (const agxData::EntityInstance& instance)
522 {
524 agxAssertN(!instance || instance.isInstanceOf(CellModel::instance()),
525 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
526 EntityPtr::getModel()->fullPath().c_str(), CellModel::instance()->fullPath().c_str());
527 return *this;
528 }
529
530 inline CellInstance CellPtr::instance() { return agxData::EntityPtr::instance(); }
531 inline const CellInstance CellPtr::instance() const { return agxData::EntityPtr::instance(); }
532 AGX_FORCE_INLINE CellSemantics* CellPtr::operator->() { return (CellSemantics* )this; }
533 AGX_FORCE_INLINE const CellSemantics* CellPtr::operator->() const { return (const CellSemantics* )this; }
534 AGX_FORCE_INLINE CellData* CellPtr::getData() { return static_cast<CellData* >(agxData::EntityPtr::getData()); }
535 AGX_FORCE_INLINE const CellData* CellPtr::getData() const { return static_cast<const CellData* >(agxData::EntityPtr::getData()); }
536
537 AGX_FORCE_INLINE agx::UInt8& CellPtr::tier() { verifyIndex(); return getData()->tier[calculateIndex()]; }
538 AGX_FORCE_INLINE agx::UInt8 const& CellPtr::tier() const { verifyIndex(); return getData()->tier[calculateIndex()]; }
539
540 AGX_FORCE_INLINE agx::UInt8& CellPtr::invDepth() { verifyIndex(); return getData()->invDepth[calculateIndex()]; }
541 AGX_FORCE_INLINE agx::UInt8 const& CellPtr::invDepth() const { verifyIndex(); return getData()->invDepth[calculateIndex()]; }
542
543 AGX_FORCE_INLINE agx::Vec3i& CellPtr::id() { verifyIndex(); return getData()->id[calculateIndex()]; }
544 AGX_FORCE_INLINE agx::Vec3i const& CellPtr::id() const { verifyIndex(); return getData()->id[calculateIndex()]; }
545
546 AGX_FORCE_INLINE agx::Vec3& CellPtr::position() { verifyIndex(); return getData()->position[calculateIndex()]; }
547 AGX_FORCE_INLINE agx::Vec3 const& CellPtr::position() const { verifyIndex(); return getData()->position[calculateIndex()]; }
548
549 AGX_FORCE_INLINE agx::UInt8& CellPtr::state() { verifyIndex(); return getData()->state[calculateIndex()]; }
550 AGX_FORCE_INLINE agx::UInt8 const& CellPtr::state() const { verifyIndex(); return getData()->state[calculateIndex()]; }
551
552 AGX_FORCE_INLINE agx::Real32& CellPtr::emptyTime() { verifyIndex(); return getData()->emptyTime[calculateIndex()]; }
553 AGX_FORCE_INLINE agx::Real32 const& CellPtr::emptyTime() const { verifyIndex(); return getData()->emptyTime[calculateIndex()]; }
554
555 AGX_FORCE_INLINE agx::IndexRange32& CellPtr::collisionObjects() { verifyIndex(); return getData()->collisionObjects[calculateIndex()]; }
556 AGX_FORCE_INLINE agx::IndexRange32 const& CellPtr::collisionObjects() const { verifyIndex(); return getData()->collisionObjects[calculateIndex()]; }
557
558 AGX_FORCE_INLINE agx::UInt32& CellPtr::parent() { verifyIndex(); return getData()->parent[calculateIndex()]; }
559 AGX_FORCE_INLINE agx::UInt32 const& CellPtr::parent() const { verifyIndex(); return getData()->parent[calculateIndex()]; }
560
561 AGX_FORCE_INLINE agxData::Array< agx::UInt32 > CellPtr::children() { verifyIndex(); return getData()->children.slice(agx::IndexRange32(calculateIndex() * (agx::Index)CellData::childrenArraySize, (calculateIndex()+1) * (agx::Index)CellData::childrenArraySize)); }
562 AGX_FORCE_INLINE const agxData::Array< agx::UInt32 > CellPtr::children() const { verifyIndex(); return getData()->children.slice(agx::IndexRange32(calculateIndex() * (agx::Index)CellData::childrenArraySize, (calculateIndex()+1) * (agx::Index)CellData::childrenArraySize)); }
563 AGX_FORCE_INLINE agx::UInt32& CellPtr::children(size_t index) { return this->children()[index]; }
564 AGX_FORCE_INLINE agx::UInt32 const& CellPtr::children(size_t index) const { return this->children()[index]; }
565
566 AGX_FORCE_INLINE agx::UInt8& CellPtr::numChildren() { verifyIndex(); return getData()->numChildren[calculateIndex()]; }
567 AGX_FORCE_INLINE agx::UInt8 const& CellPtr::numChildren() const { verifyIndex(); return getData()->numChildren[calculateIndex()]; }
568
569 AGX_FORCE_INLINE agxData::Array< agx::UInt32 > CellPtr::neighbors() { verifyIndex(); return getData()->neighbors.slice(agx::IndexRange32(calculateIndex() * (agx::Index)CellData::neighborsArraySize, (calculateIndex()+1) * (agx::Index)CellData::neighborsArraySize)); }
570 AGX_FORCE_INLINE const agxData::Array< agx::UInt32 > CellPtr::neighbors() const { verifyIndex(); return getData()->neighbors.slice(agx::IndexRange32(calculateIndex() * (agx::Index)CellData::neighborsArraySize, (calculateIndex()+1) * (agx::Index)CellData::neighborsArraySize)); }
571 AGX_FORCE_INLINE agx::UInt32& CellPtr::neighbors(size_t index) { return this->neighbors()[index]; }
572 AGX_FORCE_INLINE agx::UInt32 const& CellPtr::neighbors(size_t index) const { return this->neighbors()[index]; }
573
574 AGX_FORCE_INLINE agx::UInt32& CellPtr::searchCost() { verifyIndex(); return getData()->searchCost[calculateIndex()]; }
575 AGX_FORCE_INLINE agx::UInt32 const& CellPtr::searchCost() const { verifyIndex(); return getData()->searchCost[calculateIndex()]; }
576
577 AGX_FORCE_INLINE agx::UInt32& CellPtr::sortedIndex() { verifyIndex(); return getData()->sortedIndex[calculateIndex()]; }
578 AGX_FORCE_INLINE agx::UInt32 const& CellPtr::sortedIndex() const { verifyIndex(); return getData()->sortedIndex[calculateIndex()]; }
579
580 AGX_FORCE_INLINE agx::Physics::HierarchicalGrid::ContactZonePtr& CellPtr::internalZone() { verifyIndex(); return getData()->internalZone[calculateIndex()]; }
581 AGX_FORCE_INLINE agx::Physics::HierarchicalGrid::ContactZonePtr const& CellPtr::internalZone() const { verifyIndex(); return getData()->internalZone[calculateIndex()]; }
582
583 AGX_FORCE_INLINE agx::UInt8& CellPtr::zoneType() { verifyIndex(); return getData()->zoneType[calculateIndex()]; }
584 AGX_FORCE_INLINE agx::UInt8 const& CellPtr::zoneType() const { verifyIndex(); return getData()->zoneType[calculateIndex()]; }
585
586 AGX_FORCE_INLINE agx::AtomicValue*& CellPtr::solveBodyOffsets() { verifyIndex(); return getData()->solveBodyOffsets[calculateIndex()]; }
587 AGX_FORCE_INLINE agx::AtomicValue* const& CellPtr::solveBodyOffsets() const { verifyIndex(); return getData()->solveBodyOffsets[calculateIndex()]; }
588
589 AGX_FORCE_INLINE agx::Real32& CellPtr::emptyThreshold() { verifyIndex(); return getData()->emptyThreshold; }
590 AGX_FORCE_INLINE agx::Real32 const& CellPtr::emptyThreshold() const { verifyIndex(); return getData()->emptyThreshold; }
591
592 AGX_FORCE_INLINE agx::Real& CellPtr::reorderingFrequency() { verifyIndex(); return getData()->reorderingFrequency; }
593 AGX_FORCE_INLINE agx::Real const& CellPtr::reorderingFrequency() const { verifyIndex(); return getData()->reorderingFrequency; }
594
595 AGX_FORCE_INLINE agx::Real& CellPtr::sizeAlignment() { verifyIndex(); return getData()->sizeAlignment; }
596 AGX_FORCE_INLINE agx::Real const& CellPtr::sizeAlignment() const { verifyIndex(); return getData()->sizeAlignment; }
597
598 //-----------------------------------------------------------------------------------------------------
599 AGX_FORCE_INLINE CellInstance::CellInstance() {}
600 AGX_FORCE_INLINE CellInstance::CellInstance(CellData* data, agx::Index index) : agxData::EntityInstance(data, index) {}
601 AGX_FORCE_INLINE CellInstance::CellInstance(agxData::EntityStorage* storage, agx::Index index) : agxData::EntityInstance(storage, index) {}
602 AGX_FORCE_INLINE CellInstance::CellInstance(const agxData::EntityInstance& other) : agxData::EntityInstance(other)
603 {
605 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
606 EntityInstance::getModel()->fullPath().c_str(), CellModel::instance()->fullPath().c_str());
607 }
608
609 AGX_FORCE_INLINE CellInstance::CellInstance(const agxData::EntityPtr& ptr) : agxData::EntityInstance(ptr)
610 {
612 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
613 EntityInstance::getModel()->fullPath().c_str(), CellModel::instance()->fullPath().c_str());
614 }
615
616
617 AGX_FORCE_INLINE CellData* CellInstance::getData() { return static_cast<CellData* >(agxData::EntityInstance::getData()); }
618 AGX_FORCE_INLINE const CellData* CellInstance::getData() const { return static_cast<const CellData* >(agxData::EntityInstance::getData()); }
619
620 AGX_FORCE_INLINE agx::UInt8& CellInstance::tier() { verifyIndex(); return getData()->tier[getIndex()]; }
621 AGX_FORCE_INLINE agx::UInt8 const& CellInstance::tier() const { verifyIndex(); return getData()->tier[getIndex()]; }
622
623 AGX_FORCE_INLINE agx::UInt8& CellInstance::invDepth() { verifyIndex(); return getData()->invDepth[getIndex()]; }
624 AGX_FORCE_INLINE agx::UInt8 const& CellInstance::invDepth() const { verifyIndex(); return getData()->invDepth[getIndex()]; }
625
626 AGX_FORCE_INLINE agx::Vec3i& CellInstance::id() { verifyIndex(); return getData()->id[getIndex()]; }
627 AGX_FORCE_INLINE agx::Vec3i const& CellInstance::id() const { verifyIndex(); return getData()->id[getIndex()]; }
628
629 AGX_FORCE_INLINE agx::Vec3& CellInstance::position() { verifyIndex(); return getData()->position[getIndex()]; }
630 AGX_FORCE_INLINE agx::Vec3 const& CellInstance::position() const { verifyIndex(); return getData()->position[getIndex()]; }
631
632 AGX_FORCE_INLINE agx::UInt8& CellInstance::state() { verifyIndex(); return getData()->state[getIndex()]; }
633 AGX_FORCE_INLINE agx::UInt8 const& CellInstance::state() const { verifyIndex(); return getData()->state[getIndex()]; }
634
635 AGX_FORCE_INLINE agx::Real32& CellInstance::emptyTime() { verifyIndex(); return getData()->emptyTime[getIndex()]; }
636 AGX_FORCE_INLINE agx::Real32 const& CellInstance::emptyTime() const { verifyIndex(); return getData()->emptyTime[getIndex()]; }
637
638 AGX_FORCE_INLINE agx::IndexRange32& CellInstance::collisionObjects() { verifyIndex(); return getData()->collisionObjects[getIndex()]; }
639 AGX_FORCE_INLINE agx::IndexRange32 const& CellInstance::collisionObjects() const { verifyIndex(); return getData()->collisionObjects[getIndex()]; }
640
641 AGX_FORCE_INLINE agx::UInt32& CellInstance::parent() { verifyIndex(); return getData()->parent[getIndex()]; }
642 AGX_FORCE_INLINE agx::UInt32 const& CellInstance::parent() const { verifyIndex(); return getData()->parent[getIndex()]; }
643
644 AGX_FORCE_INLINE agxData::Array< agx::UInt32 > CellInstance::children() { verifyIndex(); return getData()->children.slice(agx::IndexRange32(getIndex() * (agx::Index)CellData::childrenArraySize, (getIndex()+1) * (agx::Index)CellData::childrenArraySize)); }
645 AGX_FORCE_INLINE const agxData::Array< agx::UInt32 > CellInstance::children() const { verifyIndex(); return getData()->children.slice(agx::IndexRange32(getIndex() * (agx::Index)CellData::childrenArraySize, (getIndex()+1) * (agx::Index)CellData::childrenArraySize)); }
646 AGX_FORCE_INLINE agx::UInt32& CellInstance::children(size_t index) { return this->children()[index]; }
647 AGX_FORCE_INLINE agx::UInt32 const& CellInstance::children(size_t index) const { return this->children()[index]; }
648
649 AGX_FORCE_INLINE agx::UInt8& CellInstance::numChildren() { verifyIndex(); return getData()->numChildren[getIndex()]; }
650 AGX_FORCE_INLINE agx::UInt8 const& CellInstance::numChildren() const { verifyIndex(); return getData()->numChildren[getIndex()]; }
651
652 AGX_FORCE_INLINE agxData::Array< agx::UInt32 > CellInstance::neighbors() { verifyIndex(); return getData()->neighbors.slice(agx::IndexRange32(getIndex() * (agx::Index)CellData::neighborsArraySize, (getIndex()+1) * (agx::Index)CellData::neighborsArraySize)); }
653 AGX_FORCE_INLINE const agxData::Array< agx::UInt32 > CellInstance::neighbors() const { verifyIndex(); return getData()->neighbors.slice(agx::IndexRange32(getIndex() * (agx::Index)CellData::neighborsArraySize, (getIndex()+1) * (agx::Index)CellData::neighborsArraySize)); }
654 AGX_FORCE_INLINE agx::UInt32& CellInstance::neighbors(size_t index) { return this->neighbors()[index]; }
655 AGX_FORCE_INLINE agx::UInt32 const& CellInstance::neighbors(size_t index) const { return this->neighbors()[index]; }
656
657 AGX_FORCE_INLINE agx::UInt32& CellInstance::searchCost() { verifyIndex(); return getData()->searchCost[getIndex()]; }
658 AGX_FORCE_INLINE agx::UInt32 const& CellInstance::searchCost() const { verifyIndex(); return getData()->searchCost[getIndex()]; }
659
660 AGX_FORCE_INLINE agx::UInt32& CellInstance::sortedIndex() { verifyIndex(); return getData()->sortedIndex[getIndex()]; }
661 AGX_FORCE_INLINE agx::UInt32 const& CellInstance::sortedIndex() const { verifyIndex(); return getData()->sortedIndex[getIndex()]; }
662
663 AGX_FORCE_INLINE agx::Physics::HierarchicalGrid::ContactZonePtr& CellInstance::internalZone() { verifyIndex(); return getData()->internalZone[getIndex()]; }
664 AGX_FORCE_INLINE agx::Physics::HierarchicalGrid::ContactZonePtr const& CellInstance::internalZone() const { verifyIndex(); return getData()->internalZone[getIndex()]; }
665
666 AGX_FORCE_INLINE agx::UInt8& CellInstance::zoneType() { verifyIndex(); return getData()->zoneType[getIndex()]; }
667 AGX_FORCE_INLINE agx::UInt8 const& CellInstance::zoneType() const { verifyIndex(); return getData()->zoneType[getIndex()]; }
668
669 AGX_FORCE_INLINE agx::AtomicValue*& CellInstance::solveBodyOffsets() { verifyIndex(); return getData()->solveBodyOffsets[getIndex()]; }
670 AGX_FORCE_INLINE agx::AtomicValue* const& CellInstance::solveBodyOffsets() const { verifyIndex(); return getData()->solveBodyOffsets[getIndex()]; }
671
672 AGX_FORCE_INLINE agx::Real32& CellInstance::emptyThreshold() { verifyIndex(); return getData()->emptyThreshold; }
673 AGX_FORCE_INLINE agx::Real32 const& CellInstance::emptyThreshold() const { verifyIndex(); return getData()->emptyThreshold; }
674
675 AGX_FORCE_INLINE agx::Real& CellInstance::reorderingFrequency() { verifyIndex(); return getData()->reorderingFrequency; }
676 AGX_FORCE_INLINE agx::Real const& CellInstance::reorderingFrequency() const { verifyIndex(); return getData()->reorderingFrequency; }
677
678 AGX_FORCE_INLINE agx::Real& CellInstance::sizeAlignment() { verifyIndex(); return getData()->sizeAlignment; }
679 AGX_FORCE_INLINE agx::Real const& CellInstance::sizeAlignment() const { verifyIndex(); return getData()->sizeAlignment; }
680
681 //-----------------------------------------------------------------------------------------------------
682 AGX_FORCE_INLINE CellSemantics::CellSemantics() {}
683 //-----------------------------------------------------------------------------------------------------
685 }
686 }
687}
688
689AGX_TYPE_BINDING(agx::Physics::HierarchicalGrid::CellPtr, "Physics.HierarchicalGrid.CellPtr")
690AGX_TYPE_BINDING(agx::Physics::HierarchicalGrid::CellInstance, "Physics.HierarchicalGrid.CellInstance")
691
692#ifdef _MSC_VER
693# pragma warning(pop)
694#endif
695
696#undef AGX_ENTITY_WRAPPER
697#undef AGX_ENTITY_NAMESPACE
698#endif
699
#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()
An abstract description of a data entity stored using SOA (structure of arrays) pattern in a EntitySt...
Definition: EntityModel.h:64
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
Abstract representation of a value.
Definition: Value.h:49
A range of indices.
Definition: IndexRange.h:32
agx::String fullPath() const
Abstract description of the data attributes for the Physics.HierarchicalGrid.Cell entity.
Definition: CellEntity.h:75
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
static agxData::ScalarAttributeT< agx::UInt32 > * searchCostAttribute
Definition: CellEntity.h:109
static agxData::ScalarAttributeT< agx::Physics::HierarchicalGrid::ContactZonePtr > * internalZoneAttribute
Definition: CellEntity.h:111
static agxData::ScalarAttributeT< agx::UInt8 > * stateAttribute
Definition: CellEntity.h:100
virtual void initAttributeAccessors() override
static agxData::ScalarAttributeT< agx::IndexRange32 > * collisionObjectsAttribute
Definition: CellEntity.h:102
static agxData::EntityStorage * defaultStorage()
virtual void configure(agx::TiXmlElement *eEntity) override
static CellPtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
static agxData::ScalarAttributeT< agx::Vec3 > * positionAttribute
Definition: CellEntity.h:99
static agxData::SharedAttributeT< agx::Real32 > * emptyThresholdAttribute
Definition: CellEntity.h:114
static agxData::ScalarAttributeT< agx::Vec3i > * idAttribute
Definition: CellEntity.h:98
static agxData::ScalarAttributeT< agx::UInt8 > * zoneTypeAttribute
Definition: CellEntity.h:112
static agxData::ScalarAttributeT< agx::UInt32 > * sortedIndexAttribute
Definition: CellEntity.h:110
static agxData::ScalarAttributeT< agx::UInt32 > * parentAttribute
Definition: CellEntity.h:103
static agxData::SharedAttributeT< agx::Real > * sizeAlignmentAttribute
Definition: CellEntity.h:116
CellModel(const agx::String &name="Cell")
void construct(agx::Physics::HierarchicalGrid::CellPtr cell)
static agxData::SharedAttributeT< agx::Real > * reorderingFrequencyAttribute
Definition: CellEntity.h:115
static agxData::ScalarAttributeT< agx::UInt8 > * numChildrenAttribute
Definition: CellEntity.h:106
static agxData::ScalarAttributeT< agx::UInt32 > * childrenAttribute
Definition: CellEntity.h:104
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
static agxData::ScalarAttributeT< agx::UInt8 > * invDepthAttribute
Definition: CellEntity.h:97
static agxData::ScalarAttributeT< agx::Real32 > * emptyTimeAttribute
Definition: CellEntity.h:101
static agxData::PointerAttributeT< agx::AtomicValue * > * solveBodyOffsetsAttribute
Definition: CellEntity.h:113
static agxData::ScalarAttributeT< agx::UInt32 > * neighborsAttribute
Definition: CellEntity.h:107
static agxData::ScalarAttributeT< agx::UInt8 > * tierAttribute
Definition: CellEntity.h:96
virtual void construct(agxData::EntityPtr instance) override
Pointer to a entity instance of type Physics.HierarchicalGrid.Cell.
Definition: CellEntity.h:250
AGXPHYSICS_EXPORT agxData::Array< agx::UInt32 > const children() const
AGXPHYSICS_EXPORT agx::UInt32 & neighbors(size_t index)
AGXPHYSICS_EXPORT agxData::Array< agx::UInt32 > neighbors()
AGXPHYSICS_EXPORT agx::UInt8 const & invDepth() const
AGXPHYSICS_EXPORT agx::UInt32 & sortedIndex()
AGXPHYSICS_EXPORT agx::UInt32 & children(size_t index)
AGXPHYSICS_EXPORT agx::UInt8 & numChildren()
AGXPHYSICS_EXPORT const CellSemantics * operator->() const
AGXPHYSICS_EXPORT agx::IndexRange32 const & collisionObjects() const
AGXPHYSICS_EXPORT agx::UInt8 & state()
AGXPHYSICS_EXPORT agx::Real & reorderingFrequency()
AGXPHYSICS_EXPORT agx::UInt8 const & numChildren() const
AGXPHYSICS_EXPORT agx::UInt8 const & tier() const
AGXPHYSICS_EXPORT agxData::Array< agx::UInt32 > children()
AGXPHYSICS_EXPORT CellPtr(const agxData::EntityInstance &instance)
AGXPHYSICS_EXPORT agx::Real const & reorderingFrequency() const
AGXPHYSICS_EXPORT agx::Physics::HierarchicalGrid::ContactZonePtr const & internalZone() const
AGXPHYSICS_EXPORT CellSemantics * operator->()
AGXPHYSICS_EXPORT agx::IndexRange32 & collisionObjects()
AGXPHYSICS_EXPORT agx::Real32 const & emptyThreshold() const
AGXPHYSICS_EXPORT agx::Real const & sizeAlignment() const
AGXPHYSICS_EXPORT agx::AtomicValue *& solveBodyOffsets()
AGXPHYSICS_EXPORT agxData::Array< agx::UInt32 > const neighbors() const
AGXPHYSICS_EXPORT agx::UInt32 const & children(size_t index) const
AGXPHYSICS_EXPORT agx::UInt8 & invDepth()
AGXPHYSICS_EXPORT agx::UInt8 & tier()
const CellData * getData() const
AGXPHYSICS_EXPORT agx::UInt32 const & neighbors(size_t index) const
AGXPHYSICS_EXPORT agx::Real32 & emptyThreshold()
AGXPHYSICS_EXPORT CellPtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT agx::Vec3 const & position() const
AGXPHYSICS_EXPORT CellInstance instance()
AGXPHYSICS_EXPORT const CellInstance instance() const
AGXPHYSICS_EXPORT agx::Vec3 & position()
AGXPHYSICS_EXPORT agx::AtomicValue *const & solveBodyOffsets() const
AGXPHYSICS_EXPORT agx::Real32 const & emptyTime() const
AGXPHYSICS_EXPORT agx::UInt8 & zoneType()
AGXPHYSICS_EXPORT agx::UInt8 const & state() const
AGXPHYSICS_EXPORT agx::Real32 & emptyTime()
AGXPHYSICS_EXPORT agx::UInt32 const & sortedIndex() const
AGXPHYSICS_EXPORT agx::Vec3i const & id() const
AGXPHYSICS_EXPORT agx::Real & sizeAlignment()
AGXPHYSICS_EXPORT agx::UInt32 & searchCost()
AGXPHYSICS_EXPORT agx::Physics::HierarchicalGrid::ContactZonePtr & internalZone()
AGXPHYSICS_EXPORT agx::Vec3i & id()
AGXPHYSICS_EXPORT agx::UInt32 const & parent() const
AGXPHYSICS_EXPORT agx::UInt32 & parent()
AGXPHYSICS_EXPORT agx::UInt32 const & searchCost() const
AGXPHYSICS_EXPORT agx::UInt8 const & zoneType() const
AGXPHYSICS_EXPORT CellPtr(agxData::EntityStorage *storage, agx::Index id)
Pointer to a entity instance of type Physics.HierarchicalGrid.ContactZone.
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.
uint32_t UInt32
Definition: Integer.h:32
double Real
Definition: Real.h:41
uint8_t UInt8
Definition: Integer.h:30
float Real32
Definition: Real.h:43
UInt32 Index
Definition: Integer.h:44