AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
ConeEntity.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_GEOMETRY_CONE_H_PLUGIN
22#define GENERATED_AGX_PHYSICS_GEOMETRY_CONE_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/Real.h>
49
50
51namespace agx
52{
53 namespace Physics
54 {
55 namespace Geometry
56 {
57
58 class ConeModel;
59 class ConeData;
60 class ConePtr;
61 class ConeInstance;
62 class ConeSemantics;
63
64
66
71 {
72 public:
73 typedef ConePtr PtrT;
74
75 ConeModel(const agx::String& name = "Cone");
76
79
82
85
87 virtual void shutdownCleanup() override;
88
89
90
91 /* Attributes */
95
96 protected:
97 virtual ~ConeModel();
98 virtual agxData::EntityData* createData(agxData::EntityStorage* storage) override;
99 virtual void configure(agx::TiXmlElement* eEntity) override;
100 virtual void initAttributeAccessors() override;
101 virtual void construct(agxData::EntityPtr instance) override;
103 };
104
105
107 #ifndef AGX_PHYSICS_GEOMETRY_CONE_DATA_SET_OVERRIDE
108 #define AGX_PHYSICS_GEOMETRY_CONE_DATA_SET
109 class AGXPHYSICS_EXPORT ConeData : public agx::Physics::Geometry::ShapeData
110 {
111 public:
112 ConeInstance operator[] (size_t index);
113
114 public:
118 agxData::Array< agx::Real > bottomRadius;
119
120 public:
121 typedef agx::Real heightType;
122 typedef agx::Real topRadiusType;
123 typedef agx::Real bottomRadiusType;
124
125 public:
126 ConeData(agxData::EntityStorage* storage);
127 ConeData();
128
129 protected:
130 virtual ~ConeData() {}
131 virtual void setNumElements(agx::Index numElements) override;
132
133 private:
134 ConeData& operator= (const ConeData&) { return *this; }
135
136 };
137 #endif
139
140
142 class AGXPHYSICS_EXPORT ConeSemantics : public agx::Physics::Geometry::ShapeSemantics
143 {
144 public:
145
146 // Automatic getters
147 agx::Real const& getHeight() const;
148 agx::Real const& getTopRadius() const;
149 agx::Real const& getBottomRadius() const;
150
151 // Semantics defined by explicit kernels
152
153 // Automatic setters
154 void setHeight(agx::Real const& value);
155 void setTopRadius(agx::Real const& value);
156 void setBottomRadius(agx::Real const& value);
157
158
159 protected:
160 friend class ConePtr;
161 friend class ConeInstance;
162 ConeSemantics();
163 };
165
166
167
170 class CALLABLE ConePtr : public agx::Physics::Geometry::ShapePtr
171 {
172 public:
174 typedef ConeData DataType;
175 typedef ConeInstance InstanceType;
176
177 public:
185 AGXPHYSICS_EXPORT const ConeInstance instance() const;
186
188 AGXPHYSICS_EXPORT const ConeSemantics* operator->() const;
189
190 ConeData* getData();
191 const ConeData* getData() const;
192
193
198
203
208
209 };
210
211 // Entity is Referenced
213
214
216 class AGXPHYSICS_EXPORT ConeInstance : public agx::Physics::Geometry::ShapeInstance
217 {
218 public:
219 ConeInstance();
220 ConeInstance(ConeData* data, agx::Index index);
221 ConeInstance(agxData::EntityStorage *storage, agx::Index index);
222 ConeInstance(const agxData::EntityInstance& other);
223 ConeInstance(const agxData::EntityPtr& ptr);
224
225 ConeData* getData();
226 const ConeData* getData() const;
227
228 public:
230 agx::Real& height();
232 agx::Real const& height() const;
233
235 agx::Real& topRadius();
237 agx::Real const& topRadius() const;
238
240 agx::Real& bottomRadius();
242 agx::Real const& bottomRadius() const;
243
244 };
246
247
248
250 typedef agxData::Array<ConePtr> ConePtrArray;
251
252
253
255 /* Implementation */
256 //-----------------------------------------------------------------------------------------------------
257 //-----------------------------------------------------------------------------------------------------
258 inline ConeInstance agx::Physics::Geometry::ConeData::operator[] (size_t index) { return ConeInstance(this, (agx::Index)index); }
259 //-----------------------------------------------------------------------------------------------------
261 AGX_FORCE_INLINE ConePtr::ConePtr(agxData::EntityStorage* storage, agx::Index id) : agx::Physics::Geometry::ShapePtr(storage, id) {}
262 AGX_FORCE_INLINE ConePtr::ConePtr(const agxData::EntityPtr& ptr) : agx::Physics::Geometry::ShapePtr(ptr)
263 {
265 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
266 EntityPtr::getModel()->fullPath().c_str(), ConeModel::instance()->fullPath().c_str());
267 }
268
269 AGX_FORCE_INLINE ConePtr::ConePtr(const agxData::EntityInstance& instance) : agx::Physics::Geometry::ShapePtr(instance)
270 {
271 agxAssertN(!instance || instance.isInstanceOf(ConeModel::instance()),
272 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
273 EntityPtr::getModel()->fullPath().c_str(), ConeModel::instance()->fullPath().c_str());
274 }
275
276 AGX_FORCE_INLINE ConePtr& ConePtr::operator= (const agxData::EntityPtr& ptr)
277 {
279 agxAssertN(!ptr || ptr.isInstanceOf(ConeModel::instance()),
280 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
281 EntityPtr::getModel()->fullPath().c_str(), ConeModel::instance()->fullPath().c_str());
282 return *this;
283 }
284
285 AGX_FORCE_INLINE ConePtr& ConePtr::operator= (const agxData::EntityInstance& instance)
286 {
288 agxAssertN(!instance || instance.isInstanceOf(ConeModel::instance()),
289 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
290 EntityPtr::getModel()->fullPath().c_str(), ConeModel::instance()->fullPath().c_str());
291 return *this;
292 }
293
294 inline ConeInstance ConePtr::instance() { return agxData::EntityPtr::instance(); }
295 inline const ConeInstance ConePtr::instance() const { return agxData::EntityPtr::instance(); }
296 AGX_FORCE_INLINE ConeSemantics* ConePtr::operator->() { return (ConeSemantics* )this; }
297 AGX_FORCE_INLINE const ConeSemantics* ConePtr::operator->() const { return (const ConeSemantics* )this; }
298 AGX_FORCE_INLINE ConeData* ConePtr::getData() { return static_cast<ConeData* >(agxData::EntityPtr::getData()); }
299 AGX_FORCE_INLINE const ConeData* ConePtr::getData() const { return static_cast<const ConeData* >(agxData::EntityPtr::getData()); }
300
301 AGX_FORCE_INLINE agx::Real& ConePtr::height() { verifyIndex(); return getData()->height[calculateIndex()]; }
302 AGX_FORCE_INLINE agx::Real const& ConePtr::height() const { verifyIndex(); return getData()->height[calculateIndex()]; }
303
304 AGX_FORCE_INLINE agx::Real& ConePtr::topRadius() { verifyIndex(); return getData()->topRadius[calculateIndex()]; }
305 AGX_FORCE_INLINE agx::Real const& ConePtr::topRadius() const { verifyIndex(); return getData()->topRadius[calculateIndex()]; }
306
307 AGX_FORCE_INLINE agx::Real& ConePtr::bottomRadius() { verifyIndex(); return getData()->bottomRadius[calculateIndex()]; }
308 AGX_FORCE_INLINE agx::Real const& ConePtr::bottomRadius() const { verifyIndex(); return getData()->bottomRadius[calculateIndex()]; }
309
310 //-----------------------------------------------------------------------------------------------------
311 AGX_FORCE_INLINE ConeInstance::ConeInstance() {}
312 AGX_FORCE_INLINE ConeInstance::ConeInstance(ConeData* data, agx::Index index) : agx::Physics::Geometry::ShapeInstance(data, index) {}
313 AGX_FORCE_INLINE ConeInstance::ConeInstance(agxData::EntityStorage* storage, agx::Index index) : agx::Physics::Geometry::ShapeInstance(storage, index) {}
314 AGX_FORCE_INLINE ConeInstance::ConeInstance(const agxData::EntityInstance& other) : agx::Physics::Geometry::ShapeInstance(other)
315 {
317 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
318 EntityInstance::getModel()->fullPath().c_str(), ConeModel::instance()->fullPath().c_str());
319 }
320
321 AGX_FORCE_INLINE ConeInstance::ConeInstance(const agxData::EntityPtr& ptr) : agx::Physics::Geometry::ShapeInstance(ptr)
322 {
324 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
325 EntityInstance::getModel()->fullPath().c_str(), ConeModel::instance()->fullPath().c_str());
326 }
327
328
329 AGX_FORCE_INLINE ConeData* ConeInstance::getData() { return static_cast<ConeData* >(agxData::EntityInstance::getData()); }
330 AGX_FORCE_INLINE const ConeData* ConeInstance::getData() const { return static_cast<const ConeData* >(agxData::EntityInstance::getData()); }
331
332 AGX_FORCE_INLINE agx::Real& ConeInstance::height() { verifyIndex(); return getData()->height[getIndex()]; }
333 AGX_FORCE_INLINE agx::Real const& ConeInstance::height() const { verifyIndex(); return getData()->height[getIndex()]; }
334
335 AGX_FORCE_INLINE agx::Real& ConeInstance::topRadius() { verifyIndex(); return getData()->topRadius[getIndex()]; }
336 AGX_FORCE_INLINE agx::Real const& ConeInstance::topRadius() const { verifyIndex(); return getData()->topRadius[getIndex()]; }
337
338 AGX_FORCE_INLINE agx::Real& ConeInstance::bottomRadius() { verifyIndex(); return getData()->bottomRadius[getIndex()]; }
339 AGX_FORCE_INLINE agx::Real const& ConeInstance::bottomRadius() const { verifyIndex(); return getData()->bottomRadius[getIndex()]; }
340
341 //-----------------------------------------------------------------------------------------------------
342 AGX_FORCE_INLINE ConeSemantics::ConeSemantics() {}
343 //-----------------------------------------------------------------------------------------------------
345 }
346 }
347}
348
349AGX_TYPE_BINDING(agx::Physics::Geometry::ConePtr, "Physics.Geometry.ConePtr")
350AGX_TYPE_BINDING(agx::Physics::Geometry::ConeInstance, "Physics.Geometry.ConeInstance")
351
352#ifdef _MSC_VER
353# pragma warning(pop)
354#endif
355
356#undef AGX_ENTITY_WRAPPER
357#undef AGX_ENTITY_NAMESPACE
358#endif
359
#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
An entity reference is a safe/referencing handle to an entity instance whose model is descendant from...
Definition: EntityRef.h:35
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.Geometry.Cone entity.
Definition: ConeEntity.h:71
static agxData::ScalarAttributeT< agx::Real > * heightAttribute
Definition: ConeEntity.h:92
ConeModel(const agx::String &name="Cone")
static agxData::ScalarAttributeT< agx::Real > * bottomRadiusAttribute
Definition: ConeEntity.h:94
static agxData::ScalarAttributeT< agx::Real > * topRadiusAttribute
Definition: ConeEntity.h:93
void construct(agx::Physics::Geometry::ConePtr cone)
static ConePtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
virtual void configure(agx::TiXmlElement *eEntity) override
static ConeModel * instance()
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
virtual void initAttributeAccessors() override
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
virtual void construct(agxData::EntityPtr instance) override
static agxData::EntityStorage * defaultStorage()
Pointer to a entity instance of type Physics.Geometry.Cone.
Definition: ConeEntity.h:171
AGXPHYSICS_EXPORT ConePtr(agxData::EntityStorage *storage, agx::Index id)
AGXPHYSICS_EXPORT agx::Real const & height() const
AGXPHYSICS_EXPORT ConePtr(const agxData::EntityInstance &instance)
AGXPHYSICS_EXPORT const ConeSemantics * operator->() const
AGXPHYSICS_EXPORT agx::Real & topRadius()
AGXPHYSICS_EXPORT agx::Real const & bottomRadius() const
AGXPHYSICS_EXPORT agx::Real const & topRadius() const
AGXPHYSICS_EXPORT ConePtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT ConeInstance instance()
AGXPHYSICS_EXPORT ConeSemantics * operator->()
AGXPHYSICS_EXPORT ConePtr()
AGXPHYSICS_EXPORT agx::Real & bottomRadius()
AGXPHYSICS_EXPORT const ConeInstance instance() const
const ConeData * getData() const
AGXPHYSICS_EXPORT agx::Real & height()
Abstract description of the data attributes for the Physics.Geometry.Shape entity.
Definition: ShapeEntity.h:76
Pointer to a entity instance of type Physics.Geometry.Shape.
Definition: ShapeEntity.h:196
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
agxData::EntityRef< ConePtr > ConeRef
Definition: ConeEntity.h:212
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition: Real.h:41
UInt32 Index
Definition: Integer.h:44