AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
HollowConeEntity.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_HOLLOWCONE_H_PLUGIN
22#define GENERATED_AGX_PHYSICS_GEOMETRY_HOLLOWCONE_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 HollowConeModel;
59 class HollowConeData;
60 class HollowConePtr;
61 class HollowConeInstance;
62 class HollowConeSemantics;
63
64
66
71 {
72 public:
74
75 HollowConeModel(const agx::String& name = "HollowCone");
76
79
82
85
87 virtual void shutdownCleanup() override;
88
89
90
91 /* Attributes */
96
97 protected:
99 virtual agxData::EntityData* createData(agxData::EntityStorage* storage) override;
100 virtual void configure(agx::TiXmlElement* eEntity) override;
101 virtual void initAttributeAccessors() override;
102 virtual void construct(agxData::EntityPtr instance) override;
104 };
105
106
108 #ifndef AGX_PHYSICS_GEOMETRY_HOLLOWCONE_DATA_SET_OVERRIDE
109 #define AGX_PHYSICS_GEOMETRY_HOLLOWCONE_DATA_SET
110 class AGXPHYSICS_EXPORT HollowConeData : public agx::Physics::Geometry::ShapeData
111 {
112 public:
113 HollowConeInstance operator[] (size_t index);
114
115 public:
119 agxData::Array< agx::Real > bottomRadius;
121
122 public:
123 typedef agx::Real heightType;
124 typedef agx::Real topRadiusType;
125 typedef agx::Real bottomRadiusType;
126 typedef agx::Real thicknessType;
127
128 public:
129 HollowConeData(agxData::EntityStorage* storage);
130 HollowConeData();
131
132 protected:
133 virtual ~HollowConeData() {}
134 virtual void setNumElements(agx::Index numElements) override;
135
136 private:
137 HollowConeData& operator= (const HollowConeData&) { return *this; }
138
139 };
140 #endif
142
143
145 class AGXPHYSICS_EXPORT HollowConeSemantics : public agx::Physics::Geometry::ShapeSemantics
146 {
147 public:
148
149 // Automatic getters
150 agx::Real const& getHeight() const;
151 agx::Real const& getTopRadius() const;
152 agx::Real const& getBottomRadius() const;
153 agx::Real const& getThickness() const;
154
155 // Semantics defined by explicit kernels
156
157 // Automatic setters
158 void setHeight(agx::Real const& value);
159 void setTopRadius(agx::Real const& value);
160 void setBottomRadius(agx::Real const& value);
161 void setThickness(agx::Real const& value);
162
163
164 protected:
165 friend class HollowConePtr;
166 friend class HollowConeInstance;
167 HollowConeSemantics();
168 };
170
171
172
175 class CALLABLE HollowConePtr : public agx::Physics::Geometry::ShapePtr
176 {
177 public:
179 typedef HollowConeData DataType;
180 typedef HollowConeInstance InstanceType;
181
182 public:
189 AGXPHYSICS_EXPORT HollowConeInstance instance();
190 AGXPHYSICS_EXPORT const HollowConeInstance instance() const;
191
192 AGXPHYSICS_EXPORT HollowConeSemantics* operator->();
193 AGXPHYSICS_EXPORT const HollowConeSemantics* operator->() const;
194
195 HollowConeData* getData();
196 const HollowConeData* getData() const;
197
198
203
208
213
218
219 };
220
221 // Entity is Referenced
223
224
226 class AGXPHYSICS_EXPORT HollowConeInstance : public agx::Physics::Geometry::ShapeInstance
227 {
228 public:
229 HollowConeInstance();
230 HollowConeInstance(HollowConeData* data, agx::Index index);
231 HollowConeInstance(agxData::EntityStorage *storage, agx::Index index);
232 HollowConeInstance(const agxData::EntityInstance& other);
233 HollowConeInstance(const agxData::EntityPtr& ptr);
234
235 HollowConeData* getData();
236 const HollowConeData* getData() const;
237
238 public:
240 agx::Real& height();
242 agx::Real const& height() const;
243
245 agx::Real& topRadius();
247 agx::Real const& topRadius() const;
248
250 agx::Real& bottomRadius();
252 agx::Real const& bottomRadius() const;
253
255 agx::Real& thickness();
257 agx::Real const& thickness() const;
258
259 };
261
262
263
266
267
268
270 /* Implementation */
271 //-----------------------------------------------------------------------------------------------------
272 //-----------------------------------------------------------------------------------------------------
273 inline HollowConeInstance agx::Physics::Geometry::HollowConeData::operator[] (size_t index) { return HollowConeInstance(this, (agx::Index)index); }
274 //-----------------------------------------------------------------------------------------------------
276 AGX_FORCE_INLINE HollowConePtr::HollowConePtr(agxData::EntityStorage* storage, agx::Index id) : agx::Physics::Geometry::ShapePtr(storage, id) {}
277 AGX_FORCE_INLINE HollowConePtr::HollowConePtr(const agxData::EntityPtr& ptr) : agx::Physics::Geometry::ShapePtr(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(), HollowConeModel::instance()->fullPath().c_str());
282 }
283
284 AGX_FORCE_INLINE HollowConePtr::HollowConePtr(const agxData::EntityInstance& instance) : agx::Physics::Geometry::ShapePtr(instance)
285 {
286 agxAssertN(!instance || instance.isInstanceOf(HollowConeModel::instance()),
287 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
288 EntityPtr::getModel()->fullPath().c_str(), HollowConeModel::instance()->fullPath().c_str());
289 }
290
291 AGX_FORCE_INLINE HollowConePtr& HollowConePtr::operator= (const agxData::EntityPtr& ptr)
292 {
294 agxAssertN(!ptr || ptr.isInstanceOf(HollowConeModel::instance()),
295 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
296 EntityPtr::getModel()->fullPath().c_str(), HollowConeModel::instance()->fullPath().c_str());
297 return *this;
298 }
299
300 AGX_FORCE_INLINE HollowConePtr& HollowConePtr::operator= (const agxData::EntityInstance& instance)
301 {
303 agxAssertN(!instance || instance.isInstanceOf(HollowConeModel::instance()),
304 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
305 EntityPtr::getModel()->fullPath().c_str(), HollowConeModel::instance()->fullPath().c_str());
306 return *this;
307 }
308
309 inline HollowConeInstance HollowConePtr::instance() { return agxData::EntityPtr::instance(); }
310 inline const HollowConeInstance HollowConePtr::instance() const { return agxData::EntityPtr::instance(); }
311 AGX_FORCE_INLINE HollowConeSemantics* HollowConePtr::operator->() { return (HollowConeSemantics* )this; }
312 AGX_FORCE_INLINE const HollowConeSemantics* HollowConePtr::operator->() const { return (const HollowConeSemantics* )this; }
313 AGX_FORCE_INLINE HollowConeData* HollowConePtr::getData() { return static_cast<HollowConeData* >(agxData::EntityPtr::getData()); }
314 AGX_FORCE_INLINE const HollowConeData* HollowConePtr::getData() const { return static_cast<const HollowConeData* >(agxData::EntityPtr::getData()); }
315
316 AGX_FORCE_INLINE agx::Real& HollowConePtr::height() { verifyIndex(); return getData()->height[calculateIndex()]; }
317 AGX_FORCE_INLINE agx::Real const& HollowConePtr::height() const { verifyIndex(); return getData()->height[calculateIndex()]; }
318
319 AGX_FORCE_INLINE agx::Real& HollowConePtr::topRadius() { verifyIndex(); return getData()->topRadius[calculateIndex()]; }
320 AGX_FORCE_INLINE agx::Real const& HollowConePtr::topRadius() const { verifyIndex(); return getData()->topRadius[calculateIndex()]; }
321
322 AGX_FORCE_INLINE agx::Real& HollowConePtr::bottomRadius() { verifyIndex(); return getData()->bottomRadius[calculateIndex()]; }
323 AGX_FORCE_INLINE agx::Real const& HollowConePtr::bottomRadius() const { verifyIndex(); return getData()->bottomRadius[calculateIndex()]; }
324
325 AGX_FORCE_INLINE agx::Real& HollowConePtr::thickness() { verifyIndex(); return getData()->thickness[calculateIndex()]; }
326 AGX_FORCE_INLINE agx::Real const& HollowConePtr::thickness() const { verifyIndex(); return getData()->thickness[calculateIndex()]; }
327
328 //-----------------------------------------------------------------------------------------------------
329 AGX_FORCE_INLINE HollowConeInstance::HollowConeInstance() {}
330 AGX_FORCE_INLINE HollowConeInstance::HollowConeInstance(HollowConeData* data, agx::Index index) : agx::Physics::Geometry::ShapeInstance(data, index) {}
331 AGX_FORCE_INLINE HollowConeInstance::HollowConeInstance(agxData::EntityStorage* storage, agx::Index index) : agx::Physics::Geometry::ShapeInstance(storage, index) {}
332 AGX_FORCE_INLINE HollowConeInstance::HollowConeInstance(const agxData::EntityInstance& other) : agx::Physics::Geometry::ShapeInstance(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(), HollowConeModel::instance()->fullPath().c_str());
337 }
338
339 AGX_FORCE_INLINE HollowConeInstance::HollowConeInstance(const agxData::EntityPtr& ptr) : agx::Physics::Geometry::ShapeInstance(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(), HollowConeModel::instance()->fullPath().c_str());
344 }
345
346
347 AGX_FORCE_INLINE HollowConeData* HollowConeInstance::getData() { return static_cast<HollowConeData* >(agxData::EntityInstance::getData()); }
348 AGX_FORCE_INLINE const HollowConeData* HollowConeInstance::getData() const { return static_cast<const HollowConeData* >(agxData::EntityInstance::getData()); }
349
350 AGX_FORCE_INLINE agx::Real& HollowConeInstance::height() { verifyIndex(); return getData()->height[getIndex()]; }
351 AGX_FORCE_INLINE agx::Real const& HollowConeInstance::height() const { verifyIndex(); return getData()->height[getIndex()]; }
352
353 AGX_FORCE_INLINE agx::Real& HollowConeInstance::topRadius() { verifyIndex(); return getData()->topRadius[getIndex()]; }
354 AGX_FORCE_INLINE agx::Real const& HollowConeInstance::topRadius() const { verifyIndex(); return getData()->topRadius[getIndex()]; }
355
356 AGX_FORCE_INLINE agx::Real& HollowConeInstance::bottomRadius() { verifyIndex(); return getData()->bottomRadius[getIndex()]; }
357 AGX_FORCE_INLINE agx::Real const& HollowConeInstance::bottomRadius() const { verifyIndex(); return getData()->bottomRadius[getIndex()]; }
358
359 AGX_FORCE_INLINE agx::Real& HollowConeInstance::thickness() { verifyIndex(); return getData()->thickness[getIndex()]; }
360 AGX_FORCE_INLINE agx::Real const& HollowConeInstance::thickness() const { verifyIndex(); return getData()->thickness[getIndex()]; }
361
362 //-----------------------------------------------------------------------------------------------------
363 AGX_FORCE_INLINE HollowConeSemantics::HollowConeSemantics() {}
364 //-----------------------------------------------------------------------------------------------------
366 }
367 }
368}
369
370AGX_TYPE_BINDING(agx::Physics::Geometry::HollowConePtr, "Physics.Geometry.HollowConePtr")
371AGX_TYPE_BINDING(agx::Physics::Geometry::HollowConeInstance, "Physics.Geometry.HollowConeInstance")
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()
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.HollowCone entity.
static agxData::ScalarAttributeT< agx::Real > * topRadiusAttribute
static HollowConeModel * instance()
virtual void configure(agx::TiXmlElement *eEntity) override
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
virtual void construct(agxData::EntityPtr instance) override
HollowConeModel(const agx::String &name="HollowCone")
void construct(agx::Physics::Geometry::HollowConePtr hollowCone)
static agxData::ScalarAttributeT< agx::Real > * bottomRadiusAttribute
static agxData::EntityStorage * defaultStorage()
virtual void initAttributeAccessors() override
static HollowConePtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
static agxData::ScalarAttributeT< agx::Real > * heightAttribute
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
static agxData::ScalarAttributeT< agx::Real > * thicknessAttribute
Pointer to a entity instance of type Physics.Geometry.HollowCone.
AGXPHYSICS_EXPORT agx::Real const & thickness() const
AGXPHYSICS_EXPORT HollowConePtr(agxData::EntityStorage *storage, agx::Index id)
AGXPHYSICS_EXPORT HollowConePtr(const agxData::EntityInstance &instance)
const HollowConeData * getData() const
AGXPHYSICS_EXPORT const HollowConeSemantics * operator->() const
AGXPHYSICS_EXPORT HollowConePtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT agx::Real const & topRadius() const
AGXPHYSICS_EXPORT agx::Real & bottomRadius()
AGXPHYSICS_EXPORT agx::Real const & height() const
AGXPHYSICS_EXPORT agx::Real const & bottomRadius() const
AGXPHYSICS_EXPORT const HollowConeInstance instance() const
AGXPHYSICS_EXPORT HollowConeInstance instance()
AGXPHYSICS_EXPORT HollowConeSemantics * operator->()
AGXPHYSICS_EXPORT agx::Real & thickness()
AGXPHYSICS_EXPORT agx::Real & topRadius()
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< HollowConePtr > HollowConeRef
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