AGX Dynamics  2.38.0.2
HollowCylinderEntity.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_GEOMETRY_HOLLOWCYLINDER_H_PLUGIN
22 #define GENERATED_AGX_PHYSICS_GEOMETRY_HOLLOWCYLINDER_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 HollowCylinderModel;
59  class HollowCylinderData;
60  class HollowCylinderPtr;
61  class HollowCylinderInstance;
62  class HollowCylinderSemantics;
63 
64 
66 
71  {
72  public:
74 
75  HollowCylinderModel(const agx::String& name = "HollowCylinder");
76 
78  static HollowCylinderModel* instance();
79 
81  static HollowCylinderPtr createInstance();
82 
84  static agxData::EntityStorage* defaultStorage();
85 
87  virtual void shutdownCleanup() override;
88 
89 
90 
91  /* Attributes */
95 
96  protected:
97  virtual ~HollowCylinderModel();
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;
102  void construct(agx::Physics::Geometry::HollowCylinderPtr hollowCylinder);
103  };
104 
105 
107  #ifndef AGX_PHYSICS_GEOMETRY_HOLLOWCYLINDER_DATA_SET_OVERRIDE
108  #define AGX_PHYSICS_GEOMETRY_HOLLOWCYLINDER_DATA_SET
109  class AGXPHYSICS_EXPORT HollowCylinderData : public agx::Physics::Geometry::ShapeData
110  {
111  public:
112  HollowCylinderInstance operator[] (size_t index);
113 
114  public:
118  agxData::Array< agx::Real > thickness;
119 
120  public:
121  typedef agx::Real heightType;
122  typedef agx::Real radiusType;
123  typedef agx::Real thicknessType;
124 
125  public:
126  HollowCylinderData(agxData::EntityStorage* storage);
127  HollowCylinderData();
128 
129  protected:
130  virtual ~HollowCylinderData() {}
131  virtual void setNumElements(agx::Index numElements) override;
132 
133  private:
134  HollowCylinderData& operator= (const HollowCylinderData&) { return *this; }
135 
136  };
137  #endif
139 
140 
142  class AGXPHYSICS_EXPORT HollowCylinderSemantics : public agx::Physics::Geometry::ShapeSemantics
143  {
144  public:
145 
146  // Automatic getters
147  agx::Real const& getHeight() const;
148  agx::Real const& getRadius() const;
149  agx::Real const& getThickness() const;
150 
151  // Semantics defined by explicit kernels
152 
153  // Automatic setters
154  void setHeight(agx::Real const& value);
155  void setRadius(agx::Real const& value);
156  void setThickness(agx::Real const& value);
157 
158 
159  protected:
160  friend class HollowCylinderPtr;
161  friend class HollowCylinderInstance;
162  HollowCylinderSemantics();
163  };
165 
166 
167 
170  class CALLABLE HollowCylinderPtr : public agx::Physics::Geometry::ShapePtr
171  {
172  public:
174  typedef HollowCylinderData DataType;
175  typedef HollowCylinderInstance InstanceType;
176 
177  public:
183  AGXPHYSICS_EXPORT HollowCylinderPtr& operator= (const agxData::EntityInstance& instance);
184  AGXPHYSICS_EXPORT HollowCylinderInstance instance();
185  AGXPHYSICS_EXPORT const HollowCylinderInstance instance() const;
186 
187  AGXPHYSICS_EXPORT HollowCylinderSemantics* operator->();
188  AGXPHYSICS_EXPORT const HollowCylinderSemantics* operator->() const;
189 
190  HollowCylinderData* getData();
191  const HollowCylinderData* getData() const;
192 
193 
195  AGXPHYSICS_EXPORT agx::Real& height();
197  AGXPHYSICS_EXPORT agx::Real const& height() const;
198 
200  AGXPHYSICS_EXPORT agx::Real& radius();
202  AGXPHYSICS_EXPORT agx::Real const& radius() const;
203 
205  AGXPHYSICS_EXPORT agx::Real& thickness();
207  AGXPHYSICS_EXPORT agx::Real const& thickness() const;
208 
209  };
210 
211  // Entity is Referenced
213 
214 
216  class AGXPHYSICS_EXPORT HollowCylinderInstance : public agx::Physics::Geometry::ShapeInstance
217  {
218  public:
219  HollowCylinderInstance();
220  HollowCylinderInstance(HollowCylinderData* data, agx::Index index);
221  HollowCylinderInstance(agxData::EntityStorage *storage, agx::Index index);
222  HollowCylinderInstance(const agxData::EntityInstance& other);
223  HollowCylinderInstance(const agxData::EntityPtr& ptr);
224 
225  HollowCylinderData* getData();
226  const HollowCylinderData* getData() const;
227 
228  public:
230  agx::Real& height();
232  agx::Real const& height() const;
233 
235  agx::Real& radius();
237  agx::Real const& radius() const;
238 
240  agx::Real& thickness();
242  agx::Real const& thickness() const;
243 
244  };
246 
247 
248 
251 
252 
253 
255  /* Implementation */
256  //-----------------------------------------------------------------------------------------------------
257  //-----------------------------------------------------------------------------------------------------
258  inline HollowCylinderInstance agx::Physics::Geometry::HollowCylinderData::operator[] (size_t index) { return HollowCylinderInstance(this, (agx::Index)index); }
259  //-----------------------------------------------------------------------------------------------------
261  AGX_FORCE_INLINE HollowCylinderPtr::HollowCylinderPtr(agxData::EntityStorage* storage, agx::Index id) : agx::Physics::Geometry::ShapePtr(storage, id) {}
262  AGX_FORCE_INLINE HollowCylinderPtr::HollowCylinderPtr(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\'",
267  }
268 
269  AGX_FORCE_INLINE HollowCylinderPtr::HollowCylinderPtr(const agxData::EntityInstance& instance) : agx::Physics::Geometry::ShapePtr(instance)
270  {
271  agxAssertN(!instance || instance.isInstanceOf(HollowCylinderModel::instance()),
272  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
274  }
275 
276  AGX_FORCE_INLINE HollowCylinderPtr& HollowCylinderPtr::operator= (const agxData::EntityPtr& ptr)
277  {
279  agxAssertN(!ptr || ptr.isInstanceOf(HollowCylinderModel::instance()),
280  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
281  EntityPtr::getModel()->fullPath().c_str(), HollowCylinderModel::instance()->fullPath().c_str());
282  return *this;
283  }
284 
285  AGX_FORCE_INLINE HollowCylinderPtr& HollowCylinderPtr::operator= (const agxData::EntityInstance& instance)
286  {
288  agxAssertN(!instance || instance.isInstanceOf(HollowCylinderModel::instance()),
289  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
290  EntityPtr::getModel()->fullPath().c_str(), HollowCylinderModel::instance()->fullPath().c_str());
291  return *this;
292  }
293 
294  inline HollowCylinderInstance HollowCylinderPtr::instance() { return agxData::EntityPtr::instance(); }
295  inline const HollowCylinderInstance HollowCylinderPtr::instance() const { return agxData::EntityPtr::instance(); }
296  AGX_FORCE_INLINE HollowCylinderSemantics* HollowCylinderPtr::operator->() { return (HollowCylinderSemantics* )this; }
297  AGX_FORCE_INLINE const HollowCylinderSemantics* HollowCylinderPtr::operator->() const { return (const HollowCylinderSemantics* )this; }
298  AGX_FORCE_INLINE HollowCylinderData* HollowCylinderPtr::getData() { return static_cast<HollowCylinderData* >(agxData::EntityPtr::getData()); }
299  AGX_FORCE_INLINE const HollowCylinderData* HollowCylinderPtr::getData() const { return static_cast<const HollowCylinderData* >(agxData::EntityPtr::getData()); }
300 
301  AGX_FORCE_INLINE agx::Real& HollowCylinderPtr::height() { verifyIndex(); return getData()->height[calculateIndex()]; }
302  AGX_FORCE_INLINE agx::Real const& HollowCylinderPtr::height() const { verifyIndex(); return getData()->height[calculateIndex()]; }
303 
304  AGX_FORCE_INLINE agx::Real& HollowCylinderPtr::radius() { verifyIndex(); return getData()->radius[calculateIndex()]; }
305  AGX_FORCE_INLINE agx::Real const& HollowCylinderPtr::radius() const { verifyIndex(); return getData()->radius[calculateIndex()]; }
306 
307  AGX_FORCE_INLINE agx::Real& HollowCylinderPtr::thickness() { verifyIndex(); return getData()->thickness[calculateIndex()]; }
308  AGX_FORCE_INLINE agx::Real const& HollowCylinderPtr::thickness() const { verifyIndex(); return getData()->thickness[calculateIndex()]; }
309 
310  //-----------------------------------------------------------------------------------------------------
311  AGX_FORCE_INLINE HollowCylinderInstance::HollowCylinderInstance() {}
312  AGX_FORCE_INLINE HollowCylinderInstance::HollowCylinderInstance(HollowCylinderData* data, agx::Index index) : agx::Physics::Geometry::ShapeInstance(data, index) {}
313  AGX_FORCE_INLINE HollowCylinderInstance::HollowCylinderInstance(agxData::EntityStorage* storage, agx::Index index) : agx::Physics::Geometry::ShapeInstance(storage, index) {}
314  AGX_FORCE_INLINE HollowCylinderInstance::HollowCylinderInstance(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\'",
319  }
320 
321  AGX_FORCE_INLINE HollowCylinderInstance::HollowCylinderInstance(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\'",
326  }
327 
328 
329  AGX_FORCE_INLINE HollowCylinderData* HollowCylinderInstance::getData() { return static_cast<HollowCylinderData* >(agxData::EntityInstance::getData()); }
330  AGX_FORCE_INLINE const HollowCylinderData* HollowCylinderInstance::getData() const { return static_cast<const HollowCylinderData* >(agxData::EntityInstance::getData()); }
331 
332  AGX_FORCE_INLINE agx::Real& HollowCylinderInstance::height() { verifyIndex(); return getData()->height[getIndex()]; }
333  AGX_FORCE_INLINE agx::Real const& HollowCylinderInstance::height() const { verifyIndex(); return getData()->height[getIndex()]; }
334 
335  AGX_FORCE_INLINE agx::Real& HollowCylinderInstance::radius() { verifyIndex(); return getData()->radius[getIndex()]; }
336  AGX_FORCE_INLINE agx::Real const& HollowCylinderInstance::radius() const { verifyIndex(); return getData()->radius[getIndex()]; }
337 
338  AGX_FORCE_INLINE agx::Real& HollowCylinderInstance::thickness() { verifyIndex(); return getData()->thickness[getIndex()]; }
339  AGX_FORCE_INLINE agx::Real const& HollowCylinderInstance::thickness() const { verifyIndex(); return getData()->thickness[getIndex()]; }
340 
341  //-----------------------------------------------------------------------------------------------------
342  AGX_FORCE_INLINE HollowCylinderSemantics::HollowCylinderSemantics() {}
343  //-----------------------------------------------------------------------------------------------------
345  }
346  }
347 }
348 
349 AGX_TYPE_BINDING(agx::Physics::Geometry::HollowCylinderPtr, "Physics.Geometry.HollowCylinderPtr")
350 AGX_TYPE_BINDING(agx::Physics::Geometry::HollowCylinderInstance, "Physics.Geometry.HollowCylinderInstance")
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 
agx::Physics::Geometry::HollowCylinderModel::radiusAttribute
static agxData::ScalarAttributeT< agx::Real > * radiusAttribute
Definition: HollowCylinderEntity.h:93
agx::Physics::Geometry::HollowCylinderRef
agxData::EntityRef< HollowCylinderPtr > HollowCylinderRef
Definition: HollowCylinderEntity.h:212
agx::Real
double Real
Definition: Real.h:42
agxData::ScalarAttributeT< agx::Real >
CALLABLE
#define CALLABLE
Definition: macros.h:72
agx::Physics::Geometry::HollowCylinderPtr::ModelType
HollowCylinderModel ModelType
Definition: HollowCylinderEntity.h:173
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
agxData::EntityPtr::getData
agxData::EntityData * getData()
Definition: EntityStorage.h:594
DOXYGEN_START_INTERNAL_BLOCK
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
macros.h
agx::Physics::Geometry::HollowCylinderPtr::DataType
HollowCylinderData DataType
Definition: HollowCylinderEntity.h:174
agxData::EntityPtr::isInstanceOf
bool isInstanceOf(agxData::EntityModel *model) const
Definition: EntityStorage.h:784
agx::Model::fullPath
agx::String fullPath() const
agxData::EntityStorage
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:72
EntityModel.h
agx::VectorPOD
Vector containing 'raw' data.
Definition: Vector.h:245
agxData::EntityPtr::instance
agxData::EntityInstance instance()
Definition: EntityPtr.h:269
agxData::EntityInstance::isInstanceOf
bool isInstanceOf(agxData::EntityModel *model) const
Definition: EntityStorage.h:829
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agxData
Contains classes for low level data storage for AGX.
Definition: Container.h:23
ShapeEntity.h
agxData::Array
Type-specific Array used for fast access into the data held by a Buffer.
Definition: agxData.h:30
EntityStorage.h
EntityRef.h
EntityPtr.h
EntityInstance.h
Integer.h
agxData::EntityPtr::operator=
EntityPtr & operator=(const EntityPtr &other)=default
agx::Index
UInt32 Index
Definition: Integer.h:44
agx::Physics::Geometry::ShapeModel
Abstract description of the data attributes for the Physics.Geometry.Shape entity.
Definition: ShapeEntity.h:75
agx::Physics::Geometry::HollowCylinderModel::thicknessAttribute
static agxData::ScalarAttributeT< agx::Real > * thicknessAttribute
Definition: HollowCylinderEntity.h:94
agx::Physics::Geometry::HollowCylinderModel::instance
static HollowCylinderModel * instance()
agxData::EntityInstance
Entity instance provides access to a single instance in an EntityStorage.
Definition: EntityInstance.h:43
agxData::EntityInstance::getData
agxData::EntityData * getData()
Definition: EntityInstance.h:149
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agx::Physics::Geometry::HollowCylinderModel::heightAttribute
static agxData::ScalarAttributeT< agx::Real > * heightAttribute
Definition: HollowCylinderEntity.h:92
agx::Physics::Geometry::ShapePtr
Pointer to a entity instance of type Physics.Geometry.Shape.
Definition: ShapeEntity.h:195
agx::Physics::Geometry::HollowCylinderPtr
Pointer to a entity instance of type Physics.Geometry.HollowCylinder.
Definition: HollowCylinderEntity.h:170
agxData::EntityRef
An entity reference is a safe/referencing handle to an entity instance whose model is descendant from...
Definition: EntityRef.h:34
agx::AgXString< std::string >
agxAssertN
#define agxAssertN(expr, format,...)
Definition: debug.h:145
AGX_TYPE_BINDING
#define AGX_TYPE_BINDING(_Type, _Name)
Definition: Type.h:179
agx::Physics::Geometry::HollowCylinderModel
Abstract description of the data attributes for the Physics.Geometry.HollowCylinder entity.
Definition: HollowCylinderEntity.h:70
agx::Physics::Geometry::HollowCylinderPtr::HollowCylinderPtr
AGXPHYSICS_EXPORT HollowCylinderPtr()
agx::Physics::Geometry::HollowCylinderPtr::InstanceType
HollowCylinderInstance InstanceType
Definition: HollowCylinderEntity.h:175
Real.h
agxData::EntityPtr
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
Definition: EntityPtr.h:51
agx::Physics::Geometry::HollowCylinderModel::PtrT
HollowCylinderPtr PtrT
Definition: HollowCylinderEntity.h:73
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition: macros.h:58
agx::getModel
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())
Definition: Object.h:363