AGX Dynamics  2.37.2.0
Cell2DEntity.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_HIERARCHICALGRID_CELL2D_H_PLUGIN
22 #define GENERATED_AGX_PHYSICS_HIERARCHICALGRID_CELL2D_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/Integer.h>
48 #include <agx/Vec2.h>
49 #include <agx/Real.h>
50 #include <agx/IndexRange.h>
51 
52 
53 namespace agx
54 {
55  namespace Physics
56  {
57  namespace HierarchicalGrid
58  {
59 
60  class Cell2DModel;
61  class Cell2DData;
62  class Cell2DPtr;
63  class Cell2DInstance;
64  class Cell2DSemantics;
65 
66 
68 
73  {
74  public:
75  typedef Cell2DPtr PtrT;
76 
77  Cell2DModel(const agx::String& name = "Cell2D");
78 
80  static Cell2DModel* instance();
81 
83  static Cell2DPtr createInstance();
84 
86  static agxData::EntityStorage* defaultStorage();
87 
89  virtual void shutdownCleanup() override;
90 
91 
92 
93  /* Attributes */
104  static const size_t childrenArraySize = 4;
107  static const size_t neighborsArraySize = 12;
111 
112  protected:
113  virtual ~Cell2DModel();
114  virtual agxData::EntityData* createData(agxData::EntityStorage* storage) override;
115  virtual void configure(agx::TiXmlElement* eEntity) override;
116  virtual void initAttributeAccessors() override;
117  virtual void construct(agxData::EntityPtr instance) override;
118  void construct(agx::Physics::HierarchicalGrid::Cell2DPtr cell2D);
119  };
120 
121 
123  #ifndef AGX_PHYSICS_HIERARCHICALGRID_CELL2D_DATA_SET_OVERRIDE
124  #define AGX_PHYSICS_HIERARCHICALGRID_CELL2D_DATA_SET
125  class AGXPHYSICS_EXPORT Cell2DData : public agxData::EntityData
126  {
127  public:
128  Cell2DInstance operator[] (size_t index);
129 
130  public:
131  agxData::Array< Cell2DPtr >& instance;
138  agxData::Array< agx::IndexRange32 > collisionObjects;
142  static const size_t childrenArraySize = 4;
143  agxData::Array< agx::UInt8 > numChildren;
145  static const size_t neighborsArraySize = 12;
147  agx::Real32 emptyThreshold;
148  agx::Real sizeAlignment;
149 
150  public:
151  typedef agx::UInt8 tierType;
152  typedef agx::Vec2i idType;
153  typedef agx::Vec2f positionType;
154  typedef agx::UInt64 linearIdType;
155  typedef agx::UInt8 stateType;
156  typedef agx::Real32 emptyTimeType;
157  typedef agx::IndexRange32 collisionObjectsType;
158  typedef agx::UInt8 zoneTypeType;
159  typedef agx::UInt32 parentType;
160  typedef agx::UInt32 childrenType;
161  typedef agx::UInt8 numChildrenType;
162  typedef agx::UInt32 neighborsType;
163  typedef agx::UInt32 searchCostType;
164  typedef agx::Real32 emptyThresholdType;
165  typedef agx::Real sizeAlignmentType;
166 
167  public:
168  Cell2DData(agxData::EntityStorage* storage);
169  Cell2DData();
170 
171  protected:
172  virtual ~Cell2DData() {}
173  virtual void setNumElements(agx::Index numElements) override;
174  virtual void synchronizeSharedAttribute(agxData::Value* value) override;
175 
176  private:
177  Cell2DData& operator= (const Cell2DData&) { return *this; }
178 
179  };
180  #endif
182 
183 
185  class AGXPHYSICS_EXPORT Cell2DSemantics : protected agxData::EntityPtr
186  {
187  public:
188 
189  // Automatic getters
190  agx::UInt8 const& getTier() const;
191  agx::Vec2i const& getId() const;
192  agx::Vec2f const& getPosition() const;
193  agx::UInt64 const& getLinearId() const;
194  agx::UInt8 const& getState() const;
195  agx::Real32 const& getEmptyTime() const;
196  agx::IndexRange32 const& getCollisionObjects() const;
197  agx::UInt8 const& getZoneType() const;
198  agx::UInt32 const& getParent() const;
199  agx::UInt8 const& getNumChildren() const;
200  agx::UInt32 const& getSearchCost() const;
201 
202  // Semantics defined by explicit kernels
203 
204  // Automatic setters
205  void setTier(agx::UInt8 const& value);
206  void setId(agx::Vec2i const& value);
207  void setPosition(agx::Vec2f const& value);
208  void setLinearId(agx::UInt64 const& value);
209  void setState(agx::UInt8 const& value);
210  void setEmptyTime(agx::Real32 const& value);
211  void setCollisionObjects(agx::IndexRange32 const& value);
212  void setZoneType(agx::UInt8 const& value);
213  void setParent(agx::UInt32 const& value);
214  void setNumChildren(agx::UInt8 const& value);
215  void setSearchCost(agx::UInt32 const& value);
216 
217 
218  protected:
219  friend class Cell2DPtr;
220  friend class Cell2DInstance;
221  Cell2DSemantics();
222  };
224 
225 
226 
229  class CALLABLE Cell2DPtr : public agxData::EntityPtr
230  {
231  public:
233  typedef Cell2DData DataType;
234  typedef Cell2DInstance InstanceType;
235 
236  public:
241  AGXPHYSICS_EXPORT Cell2DPtr& operator= (const agxData::EntityPtr& ptr);
242  AGXPHYSICS_EXPORT Cell2DPtr& operator= (const agxData::EntityInstance& instance);
243  AGXPHYSICS_EXPORT Cell2DInstance instance();
244  AGXPHYSICS_EXPORT const Cell2DInstance instance() const;
245 
246  AGXPHYSICS_EXPORT Cell2DSemantics* operator->();
247  AGXPHYSICS_EXPORT const Cell2DSemantics* operator->() const;
248 
249  Cell2DData* getData();
250  const Cell2DData* getData() const;
251 
252 
256  AGXPHYSICS_EXPORT agx::UInt8 const& tier() const;
257 
261  AGXPHYSICS_EXPORT agx::Vec2i const& id() const;
262 
264  AGXPHYSICS_EXPORT agx::Vec2f& position();
266  AGXPHYSICS_EXPORT agx::Vec2f const& position() const;
267 
269  AGXPHYSICS_EXPORT agx::UInt64& linearId();
271  AGXPHYSICS_EXPORT agx::UInt64 const& linearId() const;
272 
274  AGXPHYSICS_EXPORT agx::UInt8& state();
276  AGXPHYSICS_EXPORT agx::UInt8 const& state() const;
277 
279  AGXPHYSICS_EXPORT agx::Real32& emptyTime();
281  AGXPHYSICS_EXPORT agx::Real32 const& emptyTime() const;
282 
284  AGXPHYSICS_EXPORT agx::IndexRange32& collisionObjects();
286  AGXPHYSICS_EXPORT agx::IndexRange32 const& collisionObjects() const;
287 
289  AGXPHYSICS_EXPORT agx::UInt8& zoneType();
291  AGXPHYSICS_EXPORT agx::UInt8 const& zoneType() const;
292 
294  AGXPHYSICS_EXPORT agx::UInt32& parent();
296  AGXPHYSICS_EXPORT agx::UInt32 const& parent() const;
297 
299  AGXPHYSICS_EXPORT agxData::Array< agx::UInt32 > const children() const;
300  AGXPHYSICS_EXPORT agx::UInt32& children(size_t index);
301  AGXPHYSICS_EXPORT agx::UInt32 const& children(size_t index) const;
302 
304  AGXPHYSICS_EXPORT agx::UInt8& numChildren();
306  AGXPHYSICS_EXPORT agx::UInt8 const& numChildren() const;
307 
309  AGXPHYSICS_EXPORT agxData::Array< agx::UInt32 > const neighbors() const;
310  AGXPHYSICS_EXPORT agx::UInt32& neighbors(size_t index);
311  AGXPHYSICS_EXPORT agx::UInt32 const& neighbors(size_t index) const;
312 
314  AGXPHYSICS_EXPORT agx::UInt32& searchCost();
316  AGXPHYSICS_EXPORT agx::UInt32 const& searchCost() const;
317 
319  AGXPHYSICS_EXPORT agx::Real32& emptyThreshold();
321  AGXPHYSICS_EXPORT agx::Real32 const& emptyThreshold() const;
322 
324  AGXPHYSICS_EXPORT agx::Real& sizeAlignment();
326  AGXPHYSICS_EXPORT agx::Real const& sizeAlignment() const;
327 
328  };
329 
330 
332  class AGXPHYSICS_EXPORT Cell2DInstance : public agxData::EntityInstance
333  {
334  public:
335  Cell2DInstance();
336  Cell2DInstance(Cell2DData* data, agx::Index index);
337  Cell2DInstance(agxData::EntityStorage *storage, agx::Index index);
338  Cell2DInstance(const agxData::EntityInstance& other);
339  Cell2DInstance(const agxData::EntityPtr& ptr);
340 
341  Cell2DData* getData();
342  const Cell2DData* getData() const;
343 
344  public:
346  agx::UInt8& tier();
348  agx::UInt8 const& tier() const;
349 
351  agx::Vec2i& id();
353  agx::Vec2i const& id() const;
354 
356  agx::Vec2f& position();
358  agx::Vec2f const& position() const;
359 
361  agx::UInt64& linearId();
363  agx::UInt64 const& linearId() const;
364 
366  agx::UInt8& state();
368  agx::UInt8 const& state() const;
369 
371  agx::Real32& emptyTime();
373  agx::Real32 const& emptyTime() const;
374 
376  agx::IndexRange32& collisionObjects();
378  agx::IndexRange32 const& collisionObjects() const;
379 
381  agx::UInt8& zoneType();
383  agx::UInt8 const& zoneType() const;
384 
386  agx::UInt32& parent();
388  agx::UInt32 const& parent() const;
389 
391  agxData::Array< agx::UInt32 > const children() const;
392  agx::UInt32& children(size_t index);
393  agx::UInt32 const& children(size_t index) const;
394 
396  agx::UInt8& numChildren();
398  agx::UInt8 const& numChildren() const;
399 
400  agxData::Array< agx::UInt32 > neighbors();
401  agxData::Array< agx::UInt32 > const neighbors() const;
402  agx::UInt32& neighbors(size_t index);
403  agx::UInt32 const& neighbors(size_t index) const;
404 
406  agx::UInt32& searchCost();
408  agx::UInt32 const& searchCost() const;
409 
411  agx::Real32& emptyThreshold();
413  agx::Real32 const& emptyThreshold() const;
414 
416  agx::Real& sizeAlignment();
418  agx::Real const& sizeAlignment() const;
419 
420  };
422 
423 
424 
427 
428 
429 
431  /* Implementation */
432  //-----------------------------------------------------------------------------------------------------
433  //-----------------------------------------------------------------------------------------------------
434  inline Cell2DInstance agx::Physics::HierarchicalGrid::Cell2DData::operator[] (size_t index) { return Cell2DInstance(this, (agx::Index)index); }
435  //-----------------------------------------------------------------------------------------------------
439  {
441  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
442  EntityPtr::getModel()->fullPath().c_str(), Cell2DModel::instance()->fullPath().c_str());
443  }
444 
446  {
447  agxAssertN(!instance || instance.isInstanceOf(Cell2DModel::instance()),
448  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
449  EntityPtr::getModel()->fullPath().c_str(), Cell2DModel::instance()->fullPath().c_str());
450  }
451 
453  {
456  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
457  EntityPtr::getModel()->fullPath().c_str(), Cell2DModel::instance()->fullPath().c_str());
458  return *this;
459  }
460 
462  {
464  agxAssertN(!instance || instance.isInstanceOf(Cell2DModel::instance()),
465  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
466  EntityPtr::getModel()->fullPath().c_str(), Cell2DModel::instance()->fullPath().c_str());
467  return *this;
468  }
469 
470  inline Cell2DInstance Cell2DPtr::instance() { return agxData::EntityPtr::instance(); }
471  inline const Cell2DInstance Cell2DPtr::instance() const { return agxData::EntityPtr::instance(); }
472  AGX_FORCE_INLINE Cell2DSemantics* Cell2DPtr::operator->() { return (Cell2DSemantics* )this; }
473  AGX_FORCE_INLINE const Cell2DSemantics* Cell2DPtr::operator->() const { return (const Cell2DSemantics* )this; }
474  AGX_FORCE_INLINE Cell2DData* Cell2DPtr::getData() { return static_cast<Cell2DData* >(agxData::EntityPtr::getData()); }
475  AGX_FORCE_INLINE const Cell2DData* Cell2DPtr::getData() const { return static_cast<const Cell2DData* >(agxData::EntityPtr::getData()); }
476 
477  AGX_FORCE_INLINE agx::UInt8& Cell2DPtr::tier() { verifyIndex(); return getData()->tier[calculateIndex()]; }
478  AGX_FORCE_INLINE agx::UInt8 const& Cell2DPtr::tier() const { verifyIndex(); return getData()->tier[calculateIndex()]; }
479 
480  AGX_FORCE_INLINE agx::Vec2i& Cell2DPtr::id() { verifyIndex(); return getData()->id[calculateIndex()]; }
481  AGX_FORCE_INLINE agx::Vec2i const& Cell2DPtr::id() const { verifyIndex(); return getData()->id[calculateIndex()]; }
482 
483  AGX_FORCE_INLINE agx::Vec2f& Cell2DPtr::position() { verifyIndex(); return getData()->position[calculateIndex()]; }
484  AGX_FORCE_INLINE agx::Vec2f const& Cell2DPtr::position() const { verifyIndex(); return getData()->position[calculateIndex()]; }
485 
486  AGX_FORCE_INLINE agx::UInt64& Cell2DPtr::linearId() { verifyIndex(); return getData()->linearId[calculateIndex()]; }
487  AGX_FORCE_INLINE agx::UInt64 const& Cell2DPtr::linearId() const { verifyIndex(); return getData()->linearId[calculateIndex()]; }
488 
489  AGX_FORCE_INLINE agx::UInt8& Cell2DPtr::state() { verifyIndex(); return getData()->state[calculateIndex()]; }
490  AGX_FORCE_INLINE agx::UInt8 const& Cell2DPtr::state() const { verifyIndex(); return getData()->state[calculateIndex()]; }
491 
492  AGX_FORCE_INLINE agx::Real32& Cell2DPtr::emptyTime() { verifyIndex(); return getData()->emptyTime[calculateIndex()]; }
493  AGX_FORCE_INLINE agx::Real32 const& Cell2DPtr::emptyTime() const { verifyIndex(); return getData()->emptyTime[calculateIndex()]; }
494 
495  AGX_FORCE_INLINE agx::IndexRange32& Cell2DPtr::collisionObjects() { verifyIndex(); return getData()->collisionObjects[calculateIndex()]; }
496  AGX_FORCE_INLINE agx::IndexRange32 const& Cell2DPtr::collisionObjects() const { verifyIndex(); return getData()->collisionObjects[calculateIndex()]; }
497 
498  AGX_FORCE_INLINE agx::UInt8& Cell2DPtr::zoneType() { verifyIndex(); return getData()->zoneType[calculateIndex()]; }
499  AGX_FORCE_INLINE agx::UInt8 const& Cell2DPtr::zoneType() const { verifyIndex(); return getData()->zoneType[calculateIndex()]; }
500 
501  AGX_FORCE_INLINE agx::UInt32& Cell2DPtr::parent() { verifyIndex(); return getData()->parent[calculateIndex()]; }
502  AGX_FORCE_INLINE agx::UInt32 const& Cell2DPtr::parent() const { verifyIndex(); return getData()->parent[calculateIndex()]; }
503 
504  AGX_FORCE_INLINE agxData::Array< agx::UInt32 > Cell2DPtr::children() { verifyIndex(); return getData()->children.slice(agx::IndexRange32(calculateIndex() * (agx::Index)Cell2DData::childrenArraySize, (calculateIndex()+1) * (agx::Index)Cell2DData::childrenArraySize)); }
505  AGX_FORCE_INLINE const agxData::Array< agx::UInt32 > Cell2DPtr::children() const { verifyIndex(); return getData()->children.slice(agx::IndexRange32(calculateIndex() * (agx::Index)Cell2DData::childrenArraySize, (calculateIndex()+1) * (agx::Index)Cell2DData::childrenArraySize)); }
506  AGX_FORCE_INLINE agx::UInt32& Cell2DPtr::children(size_t index) { return this->children()[index]; }
507  AGX_FORCE_INLINE agx::UInt32 const& Cell2DPtr::children(size_t index) const { return this->children()[index]; }
508 
509  AGX_FORCE_INLINE agx::UInt8& Cell2DPtr::numChildren() { verifyIndex(); return getData()->numChildren[calculateIndex()]; }
510  AGX_FORCE_INLINE agx::UInt8 const& Cell2DPtr::numChildren() const { verifyIndex(); return getData()->numChildren[calculateIndex()]; }
511 
512  AGX_FORCE_INLINE agxData::Array< agx::UInt32 > Cell2DPtr::neighbors() { verifyIndex(); return getData()->neighbors.slice(agx::IndexRange32(calculateIndex() * (agx::Index)Cell2DData::neighborsArraySize, (calculateIndex()+1) * (agx::Index)Cell2DData::neighborsArraySize)); }
513  AGX_FORCE_INLINE const agxData::Array< agx::UInt32 > Cell2DPtr::neighbors() const { verifyIndex(); return getData()->neighbors.slice(agx::IndexRange32(calculateIndex() * (agx::Index)Cell2DData::neighborsArraySize, (calculateIndex()+1) * (agx::Index)Cell2DData::neighborsArraySize)); }
514  AGX_FORCE_INLINE agx::UInt32& Cell2DPtr::neighbors(size_t index) { return this->neighbors()[index]; }
515  AGX_FORCE_INLINE agx::UInt32 const& Cell2DPtr::neighbors(size_t index) const { return this->neighbors()[index]; }
516 
517  AGX_FORCE_INLINE agx::UInt32& Cell2DPtr::searchCost() { verifyIndex(); return getData()->searchCost[calculateIndex()]; }
518  AGX_FORCE_INLINE agx::UInt32 const& Cell2DPtr::searchCost() const { verifyIndex(); return getData()->searchCost[calculateIndex()]; }
519 
520  AGX_FORCE_INLINE agx::Real32& Cell2DPtr::emptyThreshold() { verifyIndex(); return getData()->emptyThreshold; }
521  AGX_FORCE_INLINE agx::Real32 const& Cell2DPtr::emptyThreshold() const { verifyIndex(); return getData()->emptyThreshold; }
522 
523  AGX_FORCE_INLINE agx::Real& Cell2DPtr::sizeAlignment() { verifyIndex(); return getData()->sizeAlignment; }
524  AGX_FORCE_INLINE agx::Real const& Cell2DPtr::sizeAlignment() const { verifyIndex(); return getData()->sizeAlignment; }
525 
526  //-----------------------------------------------------------------------------------------------------
527  AGX_FORCE_INLINE Cell2DInstance::Cell2DInstance() {}
528  AGX_FORCE_INLINE Cell2DInstance::Cell2DInstance(Cell2DData* data, agx::Index index) : agxData::EntityInstance(data, index) {}
529  AGX_FORCE_INLINE Cell2DInstance::Cell2DInstance(agxData::EntityStorage* storage, agx::Index index) : agxData::EntityInstance(storage, index) {}
530  AGX_FORCE_INLINE Cell2DInstance::Cell2DInstance(const agxData::EntityInstance& other) : agxData::EntityInstance(other)
531  {
532  agxAssertN(!other || other.isInstanceOf(Cell2DModel::instance()),
533  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
535  }
536 
537  AGX_FORCE_INLINE Cell2DInstance::Cell2DInstance(const agxData::EntityPtr& ptr) : agxData::EntityInstance(ptr)
538  {
540  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
542  }
543 
544 
545  AGX_FORCE_INLINE Cell2DData* Cell2DInstance::getData() { return static_cast<Cell2DData* >(agxData::EntityInstance::getData()); }
546  AGX_FORCE_INLINE const Cell2DData* Cell2DInstance::getData() const { return static_cast<const Cell2DData* >(agxData::EntityInstance::getData()); }
547 
548  AGX_FORCE_INLINE agx::UInt8& Cell2DInstance::tier() { verifyIndex(); return getData()->tier[getIndex()]; }
549  AGX_FORCE_INLINE agx::UInt8 const& Cell2DInstance::tier() const { verifyIndex(); return getData()->tier[getIndex()]; }
550 
551  AGX_FORCE_INLINE agx::Vec2i& Cell2DInstance::id() { verifyIndex(); return getData()->id[getIndex()]; }
552  AGX_FORCE_INLINE agx::Vec2i const& Cell2DInstance::id() const { verifyIndex(); return getData()->id[getIndex()]; }
553 
554  AGX_FORCE_INLINE agx::Vec2f& Cell2DInstance::position() { verifyIndex(); return getData()->position[getIndex()]; }
555  AGX_FORCE_INLINE agx::Vec2f const& Cell2DInstance::position() const { verifyIndex(); return getData()->position[getIndex()]; }
556 
557  AGX_FORCE_INLINE agx::UInt64& Cell2DInstance::linearId() { verifyIndex(); return getData()->linearId[getIndex()]; }
558  AGX_FORCE_INLINE agx::UInt64 const& Cell2DInstance::linearId() const { verifyIndex(); return getData()->linearId[getIndex()]; }
559 
560  AGX_FORCE_INLINE agx::UInt8& Cell2DInstance::state() { verifyIndex(); return getData()->state[getIndex()]; }
561  AGX_FORCE_INLINE agx::UInt8 const& Cell2DInstance::state() const { verifyIndex(); return getData()->state[getIndex()]; }
562 
563  AGX_FORCE_INLINE agx::Real32& Cell2DInstance::emptyTime() { verifyIndex(); return getData()->emptyTime[getIndex()]; }
564  AGX_FORCE_INLINE agx::Real32 const& Cell2DInstance::emptyTime() const { verifyIndex(); return getData()->emptyTime[getIndex()]; }
565 
566  AGX_FORCE_INLINE agx::IndexRange32& Cell2DInstance::collisionObjects() { verifyIndex(); return getData()->collisionObjects[getIndex()]; }
567  AGX_FORCE_INLINE agx::IndexRange32 const& Cell2DInstance::collisionObjects() const { verifyIndex(); return getData()->collisionObjects[getIndex()]; }
568 
569  AGX_FORCE_INLINE agx::UInt8& Cell2DInstance::zoneType() { verifyIndex(); return getData()->zoneType[getIndex()]; }
570  AGX_FORCE_INLINE agx::UInt8 const& Cell2DInstance::zoneType() const { verifyIndex(); return getData()->zoneType[getIndex()]; }
571 
572  AGX_FORCE_INLINE agx::UInt32& Cell2DInstance::parent() { verifyIndex(); return getData()->parent[getIndex()]; }
573  AGX_FORCE_INLINE agx::UInt32 const& Cell2DInstance::parent() const { verifyIndex(); return getData()->parent[getIndex()]; }
574 
575  AGX_FORCE_INLINE agxData::Array< agx::UInt32 > Cell2DInstance::children() { verifyIndex(); return getData()->children.slice(agx::IndexRange32(getIndex() * (agx::Index)Cell2DData::childrenArraySize, (getIndex()+1) * (agx::Index)Cell2DData::childrenArraySize)); }
576  AGX_FORCE_INLINE const agxData::Array< agx::UInt32 > Cell2DInstance::children() const { verifyIndex(); return getData()->children.slice(agx::IndexRange32(getIndex() * (agx::Index)Cell2DData::childrenArraySize, (getIndex()+1) * (agx::Index)Cell2DData::childrenArraySize)); }
577  AGX_FORCE_INLINE agx::UInt32& Cell2DInstance::children(size_t index) { return this->children()[index]; }
578  AGX_FORCE_INLINE agx::UInt32 const& Cell2DInstance::children(size_t index) const { return this->children()[index]; }
579 
580  AGX_FORCE_INLINE agx::UInt8& Cell2DInstance::numChildren() { verifyIndex(); return getData()->numChildren[getIndex()]; }
581  AGX_FORCE_INLINE agx::UInt8 const& Cell2DInstance::numChildren() const { verifyIndex(); return getData()->numChildren[getIndex()]; }
582 
583  AGX_FORCE_INLINE agxData::Array< agx::UInt32 > Cell2DInstance::neighbors() { verifyIndex(); return getData()->neighbors.slice(agx::IndexRange32(getIndex() * (agx::Index)Cell2DData::neighborsArraySize, (getIndex()+1) * (agx::Index)Cell2DData::neighborsArraySize)); }
584  AGX_FORCE_INLINE const agxData::Array< agx::UInt32 > Cell2DInstance::neighbors() const { verifyIndex(); return getData()->neighbors.slice(agx::IndexRange32(getIndex() * (agx::Index)Cell2DData::neighborsArraySize, (getIndex()+1) * (agx::Index)Cell2DData::neighborsArraySize)); }
585  AGX_FORCE_INLINE agx::UInt32& Cell2DInstance::neighbors(size_t index) { return this->neighbors()[index]; }
586  AGX_FORCE_INLINE agx::UInt32 const& Cell2DInstance::neighbors(size_t index) const { return this->neighbors()[index]; }
587 
588  AGX_FORCE_INLINE agx::UInt32& Cell2DInstance::searchCost() { verifyIndex(); return getData()->searchCost[getIndex()]; }
589  AGX_FORCE_INLINE agx::UInt32 const& Cell2DInstance::searchCost() const { verifyIndex(); return getData()->searchCost[getIndex()]; }
590 
591  AGX_FORCE_INLINE agx::Real32& Cell2DInstance::emptyThreshold() { verifyIndex(); return getData()->emptyThreshold; }
592  AGX_FORCE_INLINE agx::Real32 const& Cell2DInstance::emptyThreshold() const { verifyIndex(); return getData()->emptyThreshold; }
593 
594  AGX_FORCE_INLINE agx::Real& Cell2DInstance::sizeAlignment() { verifyIndex(); return getData()->sizeAlignment; }
595  AGX_FORCE_INLINE agx::Real const& Cell2DInstance::sizeAlignment() const { verifyIndex(); return getData()->sizeAlignment; }
596 
597  //-----------------------------------------------------------------------------------------------------
598  AGX_FORCE_INLINE Cell2DSemantics::Cell2DSemantics() {}
599  //-----------------------------------------------------------------------------------------------------
601  }
602  }
603 }
604 
605 AGX_TYPE_BINDING(agx::Physics::HierarchicalGrid::Cell2DPtr, "Physics.HierarchicalGrid.Cell2DPtr")
606 AGX_TYPE_BINDING(agx::Physics::HierarchicalGrid::Cell2DInstance, "Physics.HierarchicalGrid.Cell2DInstance")
607 
608 #ifdef _MSC_VER
609 # pragma warning(pop)
610 #endif
611 
612 #undef AGX_ENTITY_WRAPPER
613 #undef AGX_ENTITY_NAMESPACE
614 #endif
615 
AGXPHYSICS_EXPORT agx::UInt8 & tier()
AGXPHYSICS_EXPORT agx::UInt32 & searchCost()
float Real32
Definition: Real.h:44
static agxData::ScalarAttributeT< agx::Vec2f > * positionAttribute
Definition: Cell2DEntity.h:96
AGXPHYSICS_EXPORT agx::Real & sizeAlignment()
static agxData::SharedAttributeT< agx::Real32 > * emptyThresholdAttribute
Definition: Cell2DEntity.h:109
static agxData::ScalarAttributeT< agx::IndexRange32 > * collisionObjectsAttribute
Definition: Cell2DEntity.h:100
agxData::EntityData * getData()
AGXPHYSICS_EXPORT agx::Vec2f & position()
static agxData::ScalarAttributeT< agx::UInt32 > * neighborsAttribute
Definition: Cell2DEntity.h:106
AGXPHYSICS_EXPORT agxData::Array< agx::UInt32 > children()
agxData::EntityInstance instance()
Definition: EntityPtr.h:269
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:72
Abstract representation of a value.
Definition: Value.h:48
static agxData::ScalarAttributeT< agx::UInt64 > * linearIdAttribute
Definition: Cell2DEntity.h:97
#define agxAssertN(expr, format,...)
Definition: debug.h:145
agxData::EntityData * getData()
agx::String fullPath() const
AGXPHYSICS_EXPORT agx::UInt8 & zoneType()
AGXPHYSICS_EXPORT agx::IndexRange32 & collisionObjects()
#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
uint8_t UInt8
Definition: Integer.h:38
#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
#define AGX_FORCE_INLINE
Definition: Object.h:59
AGXPHYSICS_EXPORT Cell2DInstance instance()
static agxData::ScalarAttributeT< agx::Vec2i > * idAttribute
Definition: Cell2DEntity.h:95
AGXPHYSICS_EXPORT agx::UInt32 & parent()
static agxData::ScalarAttributeT< agx::UInt32 > * parentAttribute
Definition: Cell2DEntity.h:102
Type-specific Array used for fast access into the data held by a Buffer.
Definition: agxData.h:30
static agxData::ScalarAttributeT< agx::UInt8 > * zoneTypeAttribute
Definition: Cell2DEntity.h:101
static agxData::ScalarAttributeT< agx::UInt8 > * tierAttribute
Definition: Cell2DEntity.h:94
AGXPHYSICS_EXPORT agx::Real32 & emptyTime()
Vector containing &#39;raw&#39; data.
Definition: Vector.h:245
EntityPtr & operator=(const EntityPtr &other)=default
AGXPHYSICS_EXPORT Cell2DPtr & operator=(const agxData::EntityPtr &ptr)
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
AGXPHYSICS_EXPORT agx::Vec2i & id()
AGXPHYSICS_EXPORT agx::Real32 & emptyThreshold()
Contains classes for low level data storage for AGX.
Definition: Container.h:23
UInt32 Index
Definition: Integer.h:52
AGXPHYSICS_EXPORT Cell2DSemantics * operator->()
static agxData::ScalarAttributeT< agx::UInt32 > * childrenAttribute
Definition: Cell2DEntity.h:103
static agxData::ScalarAttributeT< agx::UInt8 > * numChildrenAttribute
Definition: Cell2DEntity.h:105
A range of indices.
Definition: IndexRange.h:32
Pointer to a entity instance of type Physics.HierarchicalGrid.Cell2D.
Definition: Cell2DEntity.h:229
static agxData::ScalarAttributeT< agx::UInt32 > * searchCostAttribute
Definition: Cell2DEntity.h:108
An abstract description of a data entity stored using SOA (structure of arrays) pattern in a EntitySt...
Definition: EntityModel.h:63
Abstract description of the data attributes for the Physics.HierarchicalGrid.Cell2D entity...
Definition: Cell2DEntity.h:72
#define CALLABLE
Definition: Object.h:73
AGXPHYSICS_EXPORT agx::UInt8 & numChildren()
AGXPHYSICS_EXPORT agx::UInt8 & state()
bool isInstanceOf(agxData::EntityModel *model) const
uint64_t UInt64
Definition: Integer.h:41
static agxData::SharedAttributeT< agx::Real > * sizeAlignmentAttribute
Definition: Cell2DEntity.h:110
double Real
Definition: Real.h:42
AGXPHYSICS_EXPORT agxData::Array< agx::UInt32 > neighbors()
static agxData::ScalarAttributeT< agx::Real32 > * emptyTimeAttribute
Definition: Cell2DEntity.h:99
uint32_t UInt32
Definition: Integer.h:40
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
AGXPHYSICS_EXPORT agx::UInt64 & linearId()
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97
static agxData::ScalarAttributeT< agx::UInt8 > * stateAttribute
Definition: Cell2DEntity.h:98