AGXDynamics  2.35.0.3
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 
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 
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 
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:52
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:248
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:238
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:364