AGX Dynamics  2.35.0.1
HollowConeEntity.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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_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>
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>
48 #include <agx/Real.h>
49 
50 
51 namespace 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:
98  virtual ~HollowConeModel();
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:
118  agxData::Array< agx::Real > topRadius;
119  agxData::Array< agx::Real > bottomRadius;
120  agxData::Array< agx::Real > thickness;
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 
220  // Only used by tolua!
221  #ifdef AGX_GENERATED_TOLUA_WRAPPER
222  inline agx::Real const& getHeight() const { return (*this)->getHeight(); }
223  inline agx::Real const& getTopRadius() const { return (*this)->getTopRadius(); }
224  inline agx::Real const& getBottomRadius() const { return (*this)->getBottomRadius(); }
225  inline agx::Real const& getThickness() const { return (*this)->getThickness(); }
226 
227 
228  inline void setHeight(agx::Real const& value) { (*this)->setHeight(value); }
229  inline void setTopRadius(agx::Real const& value) { (*this)->setTopRadius(value); }
230  inline void setBottomRadius(agx::Real const& value) { (*this)->setBottomRadius(value); }
231  inline void setThickness(agx::Real const& value) { (*this)->setThickness(value); }
232  #endif
234 
235  };
236 
237  // Entity is Referenced
239 
240 
242  class AGXPHYSICS_EXPORT HollowConeInstance : public agx::Physics::Geometry::ShapeInstance
243  {
244  public:
245  HollowConeInstance();
246  HollowConeInstance(HollowConeData* data, agx::Index index);
247  HollowConeInstance(agxData::EntityStorage *storage, agx::Index index);
248  HollowConeInstance(const agxData::EntityInstance& other);
249  HollowConeInstance(const agxData::EntityPtr& ptr);
250 
251  HollowConeData* getData();
252  const HollowConeData* getData() const;
253 
254  public:
256  agx::Real& height();
258  agx::Real const& height() const;
259 
261  agx::Real& topRadius();
263  agx::Real const& topRadius() const;
264 
266  agx::Real& bottomRadius();
268  agx::Real const& bottomRadius() const;
269 
271  agx::Real& thickness();
273  agx::Real const& thickness() const;
274 
275  };
277 
278 
279 
282 
283 
284 
286  /* Implementation */
287  //-----------------------------------------------------------------------------------------------------
288  //-----------------------------------------------------------------------------------------------------
289  inline HollowConeInstance agx::Physics::Geometry::HollowConeData::operator[] (size_t index) { return HollowConeInstance(this, (agx::Index)index); }
290  //-----------------------------------------------------------------------------------------------------
292  AGX_FORCE_INLINE HollowConePtr::HollowConePtr(agxData::EntityStorage* storage, agx::Index id) : agx::Physics::Geometry::ShapePtr(storage, id) {}
293  AGX_FORCE_INLINE HollowConePtr::HollowConePtr(const agxData::EntityPtr& ptr) : agx::Physics::Geometry::ShapePtr(ptr)
294  {
296  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
298  }
299 
300  AGX_FORCE_INLINE HollowConePtr::HollowConePtr(const agxData::EntityInstance& instance) : agx::Physics::Geometry::ShapePtr(instance)
301  {
302  agxAssertN(!instance || instance.isInstanceOf(HollowConeModel::instance()),
303  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
305  }
306 
307  AGX_FORCE_INLINE HollowConePtr& HollowConePtr::operator= (const agxData::EntityPtr& ptr)
308  {
310  agxAssertN(!ptr || ptr.isInstanceOf(HollowConeModel::instance()),
311  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
312  EntityPtr::getModel()->fullPath().c_str(), HollowConeModel::instance()->fullPath().c_str());
313  return *this;
314  }
315 
316  AGX_FORCE_INLINE HollowConePtr& HollowConePtr::operator= (const agxData::EntityInstance& instance)
317  {
319  agxAssertN(!instance || instance.isInstanceOf(HollowConeModel::instance()),
320  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
321  EntityPtr::getModel()->fullPath().c_str(), HollowConeModel::instance()->fullPath().c_str());
322  return *this;
323  }
324 
325  inline HollowConeInstance HollowConePtr::instance() { return agxData::EntityPtr::instance(); }
326  inline const HollowConeInstance HollowConePtr::instance() const { return agxData::EntityPtr::instance(); }
327  AGX_FORCE_INLINE HollowConeSemantics* HollowConePtr::operator->() { return (HollowConeSemantics* )this; }
328  AGX_FORCE_INLINE const HollowConeSemantics* HollowConePtr::operator->() const { return (const HollowConeSemantics* )this; }
329  AGX_FORCE_INLINE HollowConeData* HollowConePtr::getData() { return static_cast<HollowConeData* >(agxData::EntityPtr::getData()); }
330  AGX_FORCE_INLINE const HollowConeData* HollowConePtr::getData() const { return static_cast<const HollowConeData* >(agxData::EntityPtr::getData()); }
331 
332  AGX_FORCE_INLINE agx::Real& HollowConePtr::height() { verifyIndex(); return getData()->height[calculateIndex()]; }
333  AGX_FORCE_INLINE agx::Real const& HollowConePtr::height() const { verifyIndex(); return getData()->height[calculateIndex()]; }
334 
335  AGX_FORCE_INLINE agx::Real& HollowConePtr::topRadius() { verifyIndex(); return getData()->topRadius[calculateIndex()]; }
336  AGX_FORCE_INLINE agx::Real const& HollowConePtr::topRadius() const { verifyIndex(); return getData()->topRadius[calculateIndex()]; }
337 
338  AGX_FORCE_INLINE agx::Real& HollowConePtr::bottomRadius() { verifyIndex(); return getData()->bottomRadius[calculateIndex()]; }
339  AGX_FORCE_INLINE agx::Real const& HollowConePtr::bottomRadius() const { verifyIndex(); return getData()->bottomRadius[calculateIndex()]; }
340 
341  AGX_FORCE_INLINE agx::Real& HollowConePtr::thickness() { verifyIndex(); return getData()->thickness[calculateIndex()]; }
342  AGX_FORCE_INLINE agx::Real const& HollowConePtr::thickness() const { verifyIndex(); return getData()->thickness[calculateIndex()]; }
343 
344  //-----------------------------------------------------------------------------------------------------
345  AGX_FORCE_INLINE HollowConeInstance::HollowConeInstance() {}
346  AGX_FORCE_INLINE HollowConeInstance::HollowConeInstance(HollowConeData* data, agx::Index index) : agx::Physics::Geometry::ShapeInstance(data, index) {}
347  AGX_FORCE_INLINE HollowConeInstance::HollowConeInstance(agxData::EntityStorage* storage, agx::Index index) : agx::Physics::Geometry::ShapeInstance(storage, index) {}
348  AGX_FORCE_INLINE HollowConeInstance::HollowConeInstance(const agxData::EntityInstance& other) : agx::Physics::Geometry::ShapeInstance(other)
349  {
351  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
353  }
354 
355  AGX_FORCE_INLINE HollowConeInstance::HollowConeInstance(const agxData::EntityPtr& ptr) : agx::Physics::Geometry::ShapeInstance(ptr)
356  {
358  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
360  }
361 
362 
363  AGX_FORCE_INLINE HollowConeData* HollowConeInstance::getData() { return static_cast<HollowConeData* >(agxData::EntityInstance::getData()); }
364  AGX_FORCE_INLINE const HollowConeData* HollowConeInstance::getData() const { return static_cast<const HollowConeData* >(agxData::EntityInstance::getData()); }
365 
366  AGX_FORCE_INLINE agx::Real& HollowConeInstance::height() { verifyIndex(); return getData()->height[getIndex()]; }
367  AGX_FORCE_INLINE agx::Real const& HollowConeInstance::height() const { verifyIndex(); return getData()->height[getIndex()]; }
368 
369  AGX_FORCE_INLINE agx::Real& HollowConeInstance::topRadius() { verifyIndex(); return getData()->topRadius[getIndex()]; }
370  AGX_FORCE_INLINE agx::Real const& HollowConeInstance::topRadius() const { verifyIndex(); return getData()->topRadius[getIndex()]; }
371 
372  AGX_FORCE_INLINE agx::Real& HollowConeInstance::bottomRadius() { verifyIndex(); return getData()->bottomRadius[getIndex()]; }
373  AGX_FORCE_INLINE agx::Real const& HollowConeInstance::bottomRadius() const { verifyIndex(); return getData()->bottomRadius[getIndex()]; }
374 
375  AGX_FORCE_INLINE agx::Real& HollowConeInstance::thickness() { verifyIndex(); return getData()->thickness[getIndex()]; }
376  AGX_FORCE_INLINE agx::Real const& HollowConeInstance::thickness() const { verifyIndex(); return getData()->thickness[getIndex()]; }
377 
378  //-----------------------------------------------------------------------------------------------------
379  AGX_FORCE_INLINE HollowConeSemantics::HollowConeSemantics() {}
380  //-----------------------------------------------------------------------------------------------------
382  }
383  }
384 }
385 
386 AGX_TYPE_BINDING(agx::Physics::Geometry::HollowConePtr, "Physics.Geometry.HollowConePtr")
387 AGX_TYPE_BINDING(agx::Physics::Geometry::HollowConeInstance, "Physics.Geometry.HollowConeInstance")
388 
389 #ifdef _MSC_VER
390 # pragma warning(pop)
391 #endif
392 
393 #undef AGX_ENTITY_WRAPPER
394 #undef AGX_ENTITY_NAMESPACE
395 #endif
396 
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#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
bool isInstanceOf(agxData::EntityModel *model) const
agxData::EntityData * getData()
agxData::EntityInstance instance()
Definition: EntityPtr.h:269
EntityPtr & operator=(const EntityPtr &other)=default
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 agxData::EntityStorage * defaultStorage()
virtual void configure(agx::TiXmlElement *eEntity) override
static HollowConeModel * instance()
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
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
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
Pointer to a entity instance of type Physics.Geometry.HollowCone.
AGXPHYSICS_EXPORT agx::Real & topRadius()
AGXPHYSICS_EXPORT HollowConePtr(agxData::EntityStorage *storage, agx::Index id)
AGXPHYSICS_EXPORT HollowConePtr(const agxData::EntityInstance &instance)
AGXPHYSICS_EXPORT HollowConePtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT agx::Real & thickness()
AGXPHYSICS_EXPORT agx::Real const & thickness() const
AGXPHYSICS_EXPORT HollowConeSemantics * operator->()
AGXPHYSICS_EXPORT const HollowConeInstance instance() const
AGXPHYSICS_EXPORT agx::Real & bottomRadius()
AGXPHYSICS_EXPORT agx::Real const & topRadius() const
AGXPHYSICS_EXPORT HollowConeInstance instance()
AGXPHYSICS_EXPORT const HollowConeSemantics * operator->() const
AGXPHYSICS_EXPORT agx::Real const & bottomRadius() const
AGXPHYSICS_EXPORT agx::Real const & height() const
const HollowConeData * 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:97
#define CALLABLE
Definition: macros.h:72
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
#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:42
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())
Definition: Object.h:364
UInt32 Index
Definition: Integer.h:52