AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
OrientedGeometryBoundEntity.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_ORIENTEDGEOMETRYBOUND_H_PLUGIN
22#define GENERATED_AGX_PHYSICS_HIERARCHICALGRID_ORIENTEDGEOMETRYBOUND_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/Bound.h>
49#include <agx/Vec3.h>
50#include <agx/AffineMatrix4x4.h>
51
52namespace agx { namespace Physics { class GeometryPtr; }}
53
54namespace agx
55{
56 namespace Physics
57 {
58 namespace HierarchicalGrid
59 {
60
61 class OrientedGeometryBoundModel;
62 class OrientedGeometryBoundData;
63 class OrientedGeometryBoundPtr;
64 class OrientedGeometryBoundInstance;
65 class OrientedGeometryBoundSemantics;
66
67
69
74 {
75 public:
77
78 OrientedGeometryBoundModel(const agx::String& name = "OrientedGeometryBound");
79
82
85
88
90 virtual void shutdownCleanup() override;
91
92
93
94 /* Attributes */
99
100 protected:
102 virtual agxData::EntityData* createData(agxData::EntityStorage* storage) override;
103 virtual void configure(agx::TiXmlElement* eEntity) override;
104 virtual void initAttributeAccessors() override;
105 virtual void construct(agxData::EntityPtr instance) override;
107 };
108
109
111 #ifndef AGX_PHYSICS_HIERARCHICALGRID_ORIENTEDGEOMETRYBOUND_DATA_SET_OVERRIDE
112 #define AGX_PHYSICS_HIERARCHICALGRID_ORIENTEDGEOMETRYBOUND_DATA_SET
113 class AGXPHYSICS_EXPORT OrientedGeometryBoundData : public agxData::EntityData
114 {
115 public:
116 OrientedGeometryBoundInstance operator[] (size_t index);
117
118 public:
122 agxData::Array< agx::Vec3 > halfExtents;
124
125 public:
126 typedef agx::Physics::GeometryPtr geometryType;
127 typedef agx::Bound3 localBoundType;
128 typedef agx::Vec3 halfExtentsType;
129 typedef agx::AffineMatrix4x4 invTransformType;
130
131 public:
132 OrientedGeometryBoundData(agxData::EntityStorage* storage);
133 OrientedGeometryBoundData();
134
135 protected:
136 virtual ~OrientedGeometryBoundData() {}
137 virtual void setNumElements(agx::Index numElements) override;
138
139 private:
140 OrientedGeometryBoundData& operator= (const OrientedGeometryBoundData&) { return *this; }
141
142 };
143 #endif
145
146
148 class AGXPHYSICS_EXPORT OrientedGeometryBoundSemantics : protected agxData::EntityPtr
149 {
150 public:
151
152 // Automatic getters
153 agx::Physics::GeometryPtr const& getGeometry() const;
154 agx::Bound3 const& getLocalBound() const;
155 agx::Vec3 const& getHalfExtents() const;
156 agx::AffineMatrix4x4 const& getInvTransform() const;
157
158 // Semantics defined by explicit kernels
159
160 // Automatic setters
161 void setGeometry(agx::Physics::GeometryPtr const& value);
162 void setLocalBound(agx::Bound3 const& value);
163 void setHalfExtents(agx::Vec3 const& value);
164 void setInvTransform(agx::AffineMatrix4x4 const& value);
165
166
167 protected:
168 friend class OrientedGeometryBoundPtr;
169 friend class OrientedGeometryBoundInstance;
170 OrientedGeometryBoundSemantics();
171 };
173
174
175
178 class CALLABLE OrientedGeometryBoundPtr : public agxData::EntityPtr
179 {
180 public:
182 typedef OrientedGeometryBoundData DataType;
183 typedef OrientedGeometryBoundInstance InstanceType;
184
185 public:
192 AGXPHYSICS_EXPORT OrientedGeometryBoundInstance instance();
193 AGXPHYSICS_EXPORT const OrientedGeometryBoundInstance instance() const;
194
195 AGXPHYSICS_EXPORT OrientedGeometryBoundSemantics* operator->();
196 AGXPHYSICS_EXPORT const OrientedGeometryBoundSemantics* operator->() const;
197
198 OrientedGeometryBoundData* getData();
199 const OrientedGeometryBoundData* getData() const;
200
201
206
211
216
221
222 };
223
224
226 class AGXPHYSICS_EXPORT OrientedGeometryBoundInstance : public agxData::EntityInstance
227 {
228 public:
229 OrientedGeometryBoundInstance();
230 OrientedGeometryBoundInstance(OrientedGeometryBoundData* data, agx::Index index);
231 OrientedGeometryBoundInstance(agxData::EntityStorage *storage, agx::Index index);
232 OrientedGeometryBoundInstance(const agxData::EntityInstance& other);
233 OrientedGeometryBoundInstance(const agxData::EntityPtr& ptr);
234
235 OrientedGeometryBoundData* getData();
236 const OrientedGeometryBoundData* getData() const;
237
238 public:
240 agx::Physics::GeometryPtr& geometry();
242 agx::Physics::GeometryPtr const& geometry() const;
243
245 agx::Bound3& localBound();
247 agx::Bound3 const& localBound() const;
248
250 agx::Vec3& halfExtents();
252 agx::Vec3 const& halfExtents() const;
253
255 agx::AffineMatrix4x4& invTransform();
257 agx::AffineMatrix4x4 const& invTransform() const;
258
259 };
261
262
263
266
267
268
270 /* Implementation */
271 //-----------------------------------------------------------------------------------------------------
272 //-----------------------------------------------------------------------------------------------------
273 inline OrientedGeometryBoundInstance agx::Physics::HierarchicalGrid::OrientedGeometryBoundData::operator[] (size_t index) { return OrientedGeometryBoundInstance(this, (agx::Index)index); }
274 //-----------------------------------------------------------------------------------------------------
277 AGX_FORCE_INLINE OrientedGeometryBoundPtr::OrientedGeometryBoundPtr(const agxData::EntityPtr& ptr) : agxData::EntityPtr(ptr)
278 {
280 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
281 EntityPtr::getModel()->fullPath().c_str(), OrientedGeometryBoundModel::instance()->fullPath().c_str());
282 }
283
284 AGX_FORCE_INLINE OrientedGeometryBoundPtr::OrientedGeometryBoundPtr(const agxData::EntityInstance& instance) : agxData::EntityPtr(instance)
285 {
287 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
288 EntityPtr::getModel()->fullPath().c_str(), OrientedGeometryBoundModel::instance()->fullPath().c_str());
289 }
290
291 AGX_FORCE_INLINE OrientedGeometryBoundPtr& OrientedGeometryBoundPtr::operator= (const agxData::EntityPtr& ptr)
292 {
294 agxAssertN(!ptr || ptr.isInstanceOf(OrientedGeometryBoundModel::instance()),
295 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
296 EntityPtr::getModel()->fullPath().c_str(), OrientedGeometryBoundModel::instance()->fullPath().c_str());
297 return *this;
298 }
299
300 AGX_FORCE_INLINE OrientedGeometryBoundPtr& OrientedGeometryBoundPtr::operator= (const agxData::EntityInstance& instance)
301 {
303 agxAssertN(!instance || instance.isInstanceOf(OrientedGeometryBoundModel::instance()),
304 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
305 EntityPtr::getModel()->fullPath().c_str(), OrientedGeometryBoundModel::instance()->fullPath().c_str());
306 return *this;
307 }
308
309 inline OrientedGeometryBoundInstance OrientedGeometryBoundPtr::instance() { return agxData::EntityPtr::instance(); }
310 inline const OrientedGeometryBoundInstance OrientedGeometryBoundPtr::instance() const { return agxData::EntityPtr::instance(); }
311 AGX_FORCE_INLINE OrientedGeometryBoundSemantics* OrientedGeometryBoundPtr::operator->() { return (OrientedGeometryBoundSemantics* )this; }
312 AGX_FORCE_INLINE const OrientedGeometryBoundSemantics* OrientedGeometryBoundPtr::operator->() const { return (const OrientedGeometryBoundSemantics* )this; }
313 AGX_FORCE_INLINE OrientedGeometryBoundData* OrientedGeometryBoundPtr::getData() { return static_cast<OrientedGeometryBoundData* >(agxData::EntityPtr::getData()); }
314 AGX_FORCE_INLINE const OrientedGeometryBoundData* OrientedGeometryBoundPtr::getData() const { return static_cast<const OrientedGeometryBoundData* >(agxData::EntityPtr::getData()); }
315
316 AGX_FORCE_INLINE agx::Physics::GeometryPtr& OrientedGeometryBoundPtr::geometry() { verifyIndex(); return getData()->geometry[calculateIndex()]; }
317 AGX_FORCE_INLINE agx::Physics::GeometryPtr const& OrientedGeometryBoundPtr::geometry() const { verifyIndex(); return getData()->geometry[calculateIndex()]; }
318
319 AGX_FORCE_INLINE agx::Bound3& OrientedGeometryBoundPtr::localBound() { verifyIndex(); return getData()->localBound[calculateIndex()]; }
320 AGX_FORCE_INLINE agx::Bound3 const& OrientedGeometryBoundPtr::localBound() const { verifyIndex(); return getData()->localBound[calculateIndex()]; }
321
322 AGX_FORCE_INLINE agx::Vec3& OrientedGeometryBoundPtr::halfExtents() { verifyIndex(); return getData()->halfExtents[calculateIndex()]; }
323 AGX_FORCE_INLINE agx::Vec3 const& OrientedGeometryBoundPtr::halfExtents() const { verifyIndex(); return getData()->halfExtents[calculateIndex()]; }
324
325 AGX_FORCE_INLINE agx::AffineMatrix4x4& OrientedGeometryBoundPtr::invTransform() { verifyIndex(); return getData()->invTransform[calculateIndex()]; }
326 AGX_FORCE_INLINE agx::AffineMatrix4x4 const& OrientedGeometryBoundPtr::invTransform() const { verifyIndex(); return getData()->invTransform[calculateIndex()]; }
327
328 //-----------------------------------------------------------------------------------------------------
329 AGX_FORCE_INLINE OrientedGeometryBoundInstance::OrientedGeometryBoundInstance() {}
330 AGX_FORCE_INLINE OrientedGeometryBoundInstance::OrientedGeometryBoundInstance(OrientedGeometryBoundData* data, agx::Index index) : agxData::EntityInstance(data, index) {}
331 AGX_FORCE_INLINE OrientedGeometryBoundInstance::OrientedGeometryBoundInstance(agxData::EntityStorage* storage, agx::Index index) : agxData::EntityInstance(storage, index) {}
332 AGX_FORCE_INLINE OrientedGeometryBoundInstance::OrientedGeometryBoundInstance(const agxData::EntityInstance& other) : agxData::EntityInstance(other)
333 {
335 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
336 EntityInstance::getModel()->fullPath().c_str(), OrientedGeometryBoundModel::instance()->fullPath().c_str());
337 }
338
339 AGX_FORCE_INLINE OrientedGeometryBoundInstance::OrientedGeometryBoundInstance(const agxData::EntityPtr& ptr) : agxData::EntityInstance(ptr)
340 {
342 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
343 EntityInstance::getModel()->fullPath().c_str(), OrientedGeometryBoundModel::instance()->fullPath().c_str());
344 }
345
346
347 AGX_FORCE_INLINE OrientedGeometryBoundData* OrientedGeometryBoundInstance::getData() { return static_cast<OrientedGeometryBoundData* >(agxData::EntityInstance::getData()); }
348 AGX_FORCE_INLINE const OrientedGeometryBoundData* OrientedGeometryBoundInstance::getData() const { return static_cast<const OrientedGeometryBoundData* >(agxData::EntityInstance::getData()); }
349
350 AGX_FORCE_INLINE agx::Physics::GeometryPtr& OrientedGeometryBoundInstance::geometry() { verifyIndex(); return getData()->geometry[getIndex()]; }
351 AGX_FORCE_INLINE agx::Physics::GeometryPtr const& OrientedGeometryBoundInstance::geometry() const { verifyIndex(); return getData()->geometry[getIndex()]; }
352
353 AGX_FORCE_INLINE agx::Bound3& OrientedGeometryBoundInstance::localBound() { verifyIndex(); return getData()->localBound[getIndex()]; }
354 AGX_FORCE_INLINE agx::Bound3 const& OrientedGeometryBoundInstance::localBound() const { verifyIndex(); return getData()->localBound[getIndex()]; }
355
356 AGX_FORCE_INLINE agx::Vec3& OrientedGeometryBoundInstance::halfExtents() { verifyIndex(); return getData()->halfExtents[getIndex()]; }
357 AGX_FORCE_INLINE agx::Vec3 const& OrientedGeometryBoundInstance::halfExtents() const { verifyIndex(); return getData()->halfExtents[getIndex()]; }
358
359 AGX_FORCE_INLINE agx::AffineMatrix4x4& OrientedGeometryBoundInstance::invTransform() { verifyIndex(); return getData()->invTransform[getIndex()]; }
360 AGX_FORCE_INLINE agx::AffineMatrix4x4 const& OrientedGeometryBoundInstance::invTransform() const { verifyIndex(); return getData()->invTransform[getIndex()]; }
361
362 //-----------------------------------------------------------------------------------------------------
363 AGX_FORCE_INLINE OrientedGeometryBoundSemantics::OrientedGeometryBoundSemantics() {}
364 //-----------------------------------------------------------------------------------------------------
366 }
367 }
368}
369
370AGX_TYPE_BINDING(agx::Physics::HierarchicalGrid::OrientedGeometryBoundPtr, "Physics.HierarchicalGrid.OrientedGeometryBoundPtr")
371AGX_TYPE_BINDING(agx::Physics::HierarchicalGrid::OrientedGeometryBoundInstance, "Physics.HierarchicalGrid.OrientedGeometryBoundInstance")
372
373#ifdef _MSC_VER
374# pragma warning(pop)
375#endif
376
377#undef AGX_ENTITY_WRAPPER
378#undef AGX_ENTITY_NAMESPACE
379#endif
380
#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
agx::String fullPath() const
Pointer to a entity instance of type Physics.Geometry.
Abstract description of the data attributes for the Physics.HierarchicalGrid.OrientedGeometryBound en...
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
void construct(agx::Physics::HierarchicalGrid::OrientedGeometryBoundPtr orientedGeometryBound)
static agxData::ScalarAttributeT< agx::Physics::GeometryPtr > * geometryAttribute
virtual void construct(agxData::EntityPtr instance) override
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
static agxData::ScalarAttributeT< agx::Vec3 > * halfExtentsAttribute
virtual void configure(agx::TiXmlElement *eEntity) override
OrientedGeometryBoundModel(const agx::String &name="OrientedGeometryBound")
static OrientedGeometryBoundPtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
static agxData::ScalarAttributeT< agx::Bound3 > * localBoundAttribute
static OrientedGeometryBoundModel * instance()
static agxData::ScalarAttributeT< agx::AffineMatrix4x4 > * invTransformAttribute
Pointer to a entity instance of type Physics.HierarchicalGrid.OrientedGeometryBound.
AGXPHYSICS_EXPORT agx::Vec3 const & halfExtents() const
AGXPHYSICS_EXPORT OrientedGeometryBoundPtr(const agxData::EntityInstance &instance)
AGXPHYSICS_EXPORT agx::Physics::GeometryPtr const & geometry() const
AGXPHYSICS_EXPORT const OrientedGeometryBoundSemantics * operator->() const
AGXPHYSICS_EXPORT const OrientedGeometryBoundInstance instance() const
AGXPHYSICS_EXPORT agx::Bound3 const & localBound() const
AGXPHYSICS_EXPORT OrientedGeometryBoundInstance instance()
AGXPHYSICS_EXPORT agx::AffineMatrix4x4 & invTransform()
AGXPHYSICS_EXPORT OrientedGeometryBoundSemantics * operator->()
const OrientedGeometryBoundData * getData() const
AGXPHYSICS_EXPORT agx::AffineMatrix4x4 const & invTransform() const
AGXPHYSICS_EXPORT agx::Physics::GeometryPtr & geometry()
AGXPHYSICS_EXPORT OrientedGeometryBoundPtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT OrientedGeometryBoundPtr(agxData::EntityStorage *storage, agx::Index id)
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 Index
Definition: Integer.h:44