AGX Dynamics  2.38.0.2
HollowConeEntity.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_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 
78  static HollowConeModel* instance();
79 
81  static HollowConePtr createInstance();
82 
84  static agxData::EntityStorage* defaultStorage();
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;
103  void construct(agx::Physics::Geometry::HollowConePtr hollowCone);
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:
187  AGXPHYSICS_EXPORT HollowConePtr& operator= (const agxData::EntityPtr& ptr);
188  AGXPHYSICS_EXPORT HollowConePtr& operator= (const agxData::EntityInstance& instance);
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 
200  AGXPHYSICS_EXPORT agx::Real& height();
202  AGXPHYSICS_EXPORT agx::Real const& height() const;
203 
205  AGXPHYSICS_EXPORT agx::Real& topRadius();
207  AGXPHYSICS_EXPORT agx::Real const& topRadius() const;
208 
210  AGXPHYSICS_EXPORT agx::Real& bottomRadius();
212  AGXPHYSICS_EXPORT agx::Real const& bottomRadius() const;
213 
215  AGXPHYSICS_EXPORT agx::Real& thickness();
217  AGXPHYSICS_EXPORT agx::Real const& thickness() const;
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\'",
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\'",
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\'",
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\'",
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 
370 AGX_TYPE_BINDING(agx::Physics::Geometry::HollowConePtr, "Physics.Geometry.HollowConePtr")
371 AGX_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 
agx::Real
double Real
Definition: Real.h:42
agxData::ScalarAttributeT< agx::Real >
agx::Physics::Geometry::HollowConePtr::DataType
HollowConeData DataType
Definition: HollowConeEntity.h:179
agx::Physics::Geometry::HollowConeModel::instance
static HollowConeModel * instance()
CALLABLE
#define CALLABLE
Definition: macros.h:72
agx::Physics::Geometry::HollowConeModel::heightAttribute
static agxData::ScalarAttributeT< agx::Real > * heightAttribute
Definition: HollowConeEntity.h:92
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::HollowConePtr::InstanceType
HollowConeInstance InstanceType
Definition: HollowConeEntity.h:180
agx::Physics::Geometry::HollowConeModel::topRadiusAttribute
static agxData::ScalarAttributeT< agx::Real > * topRadiusAttribute
Definition: HollowConeEntity.h:93
agxData::EntityPtr::isInstanceOf
bool isInstanceOf(agxData::EntityModel *model) const
Definition: EntityStorage.h:784
agx::Model::fullPath
agx::String fullPath() const
agx::Physics::Geometry::HollowConePtr::HollowConePtr
AGXPHYSICS_EXPORT HollowConePtr()
agxData::EntityStorage
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:72
EntityModel.h
agx::Physics::Geometry::HollowConeModel
Abstract description of the data attributes for the Physics.Geometry.HollowCone entity.
Definition: HollowConeEntity.h:70
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
agx::Physics::Geometry::HollowConeModel::bottomRadiusAttribute
static agxData::ScalarAttributeT< agx::Real > * bottomRadiusAttribute
Definition: HollowConeEntity.h:94
EntityPtr.h
agx::Physics::Geometry::HollowConePtr
Pointer to a entity instance of type Physics.Geometry.HollowCone.
Definition: HollowConeEntity.h:175
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
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::Physics::Geometry::HollowConeModel::PtrT
HollowConePtr PtrT
Definition: HollowConeEntity.h:73
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agx::Physics::Geometry::ShapePtr
Pointer to a entity instance of type Physics.Geometry.Shape.
Definition: ShapeEntity.h:195
agx::Physics::Geometry::HollowConePtr::ModelType
HollowConeModel ModelType
Definition: HollowConeEntity.h:178
agxData::EntityRef
An entity reference is a safe/referencing handle to an entity instance whose model is descendant from...
Definition: EntityRef.h:34
agx::Physics::Geometry::HollowConeModel::thicknessAttribute
static agxData::ScalarAttributeT< agx::Real > * thicknessAttribute
Definition: HollowConeEntity.h:95
agx::Physics::Geometry::HollowConeRef
agxData::EntityRef< HollowConePtr > HollowConeRef
Definition: HollowConeEntity.h:222
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
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_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