AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
WireMaterialEntity.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_WIREMATERIAL_H_PLUGIN
22#define GENERATED_AGX_PHYSICS_WIREMATERIAL_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#include <agx/Integer.h>
50
51
52namespace agx
53{
54 namespace Physics
55 {
56
57 class WireMaterialModel;
58 class WireMaterialData;
59 class WireMaterialPtr;
60 class WireMaterialInstance;
61 class WireMaterialSemantics;
62
63
65
70 {
71 public:
73
74 WireMaterialModel(const agx::String& name = "WireMaterial");
75
78
81
84
86 virtual void shutdownCleanup() override;
87
88
89
90 /* 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_WIREMATERIAL_DATA_SET_OVERRIDE
109 #define AGX_PHYSICS_WIREMATERIAL_DATA_SET
110 class AGXPHYSICS_EXPORT WireMaterialData : public agx::ReferencedData
111 {
112 public:
113 WireMaterialInstance operator[] (size_t index);
114
115 public:
117 agxData::Array< agx::Real > youngsModulusStretch;
118 agxData::Array< agx::Real > youngsModulusBend;
119 agxData::Array< agx::Real > dampingStretch;
120 agxData::Array< agx::Real > dampingBend;
122
123 public:
124 typedef agx::Real youngsModulusStretchType;
125 typedef agx::Real youngsModulusBendType;
126 typedef agx::Real dampingStretchType;
127 typedef agx::Real dampingBendType;
128 typedef agx::Bool dirtyType;
129
130 public:
131 WireMaterialData(agxData::EntityStorage* storage);
132 WireMaterialData();
133
134 protected:
135 virtual ~WireMaterialData() {}
136 virtual void setNumElements(agx::Index numElements) override;
137
138 private:
139 WireMaterialData& operator= (const WireMaterialData&) { return *this; }
140
141 };
142 #endif
144
145
147 class AGXPHYSICS_EXPORT WireMaterialSemantics : public agx::ReferencedSemantics
148 {
149 public:
150
151 // Automatic getters
152 agx::Real const& getYoungsModulusStretch() const;
153 agx::Real const& getYoungsModulusBend() const;
154 agx::Real const& getDampingStretch() const;
155 agx::Real const& getDampingBend() const;
156 agx::Bool const& getDirty() const;
157
158 // Semantics defined by explicit kernels
159
160 // Automatic setters
161 void setYoungsModulusStretch(agx::Real const& value);
162 void setYoungsModulusBend(agx::Real const& value);
163 void setDampingStretch(agx::Real const& value);
164 void setDampingBend(agx::Real const& value);
165 void setDirty(agx::Bool const& value);
166
167
168 protected:
169 friend class WireMaterialPtr;
170 friend class WireMaterialInstance;
171 WireMaterialSemantics();
172 };
174
175
176
180 {
181 public:
183 typedef WireMaterialData DataType;
184 typedef WireMaterialInstance InstanceType;
185
186 public:
193 AGXPHYSICS_EXPORT WireMaterialInstance instance();
194 AGXPHYSICS_EXPORT const WireMaterialInstance instance() const;
195
196 AGXPHYSICS_EXPORT WireMaterialSemantics* operator->();
197 AGXPHYSICS_EXPORT const WireMaterialSemantics* operator->() const;
198
199 WireMaterialData* getData();
200 const WireMaterialData* getData() const;
201
202
207
212
217
222
227
228 };
229
230 // Entity is Referenced
232
233
235 class AGXPHYSICS_EXPORT WireMaterialInstance : public agx::ReferencedInstance
236 {
237 public:
238 WireMaterialInstance();
239 WireMaterialInstance(WireMaterialData* data, agx::Index index);
240 WireMaterialInstance(agxData::EntityStorage *storage, agx::Index index);
241 WireMaterialInstance(const agxData::EntityInstance& other);
242 WireMaterialInstance(const agxData::EntityPtr& ptr);
243
244 WireMaterialData* getData();
245 const WireMaterialData* getData() const;
246
247 public:
249 agx::Real& youngsModulusStretch();
251 agx::Real const& youngsModulusStretch() const;
252
254 agx::Real& youngsModulusBend();
256 agx::Real const& youngsModulusBend() const;
257
259 agx::Real& dampingStretch();
261 agx::Real const& dampingStretch() const;
262
264 agx::Real& dampingBend();
266 agx::Real const& dampingBend() const;
267
269 agx::Bool& dirty();
271 agx::Bool const& dirty() const;
272
273 };
275
276
277
280
281
282
284 /* Implementation */
285 //-----------------------------------------------------------------------------------------------------
286 //-----------------------------------------------------------------------------------------------------
287 inline WireMaterialInstance agx::Physics::WireMaterialData::operator[] (size_t index) { return WireMaterialInstance(this, (agx::Index)index); }
288 //-----------------------------------------------------------------------------------------------------
290 AGX_FORCE_INLINE WireMaterialPtr::WireMaterialPtr(agxData::EntityStorage* storage, agx::Index id) : agx::ReferencedPtr(storage, id) {}
291 AGX_FORCE_INLINE WireMaterialPtr::WireMaterialPtr(const agxData::EntityPtr& ptr) : agx::ReferencedPtr(ptr)
292 {
294 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
295 EntityPtr::getModel()->fullPath().c_str(), WireMaterialModel::instance()->fullPath().c_str());
296 }
297
298 AGX_FORCE_INLINE WireMaterialPtr::WireMaterialPtr(const agxData::EntityInstance& instance) : agx::ReferencedPtr(instance)
299 {
300 agxAssertN(!instance || instance.isInstanceOf(WireMaterialModel::instance()),
301 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
302 EntityPtr::getModel()->fullPath().c_str(), WireMaterialModel::instance()->fullPath().c_str());
303 }
304
305 AGX_FORCE_INLINE WireMaterialPtr& WireMaterialPtr::operator= (const agxData::EntityPtr& ptr)
306 {
308 agxAssertN(!ptr || ptr.isInstanceOf(WireMaterialModel::instance()),
309 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
310 EntityPtr::getModel()->fullPath().c_str(), WireMaterialModel::instance()->fullPath().c_str());
311 return *this;
312 }
313
314 AGX_FORCE_INLINE WireMaterialPtr& WireMaterialPtr::operator= (const agxData::EntityInstance& instance)
315 {
317 agxAssertN(!instance || instance.isInstanceOf(WireMaterialModel::instance()),
318 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
319 EntityPtr::getModel()->fullPath().c_str(), WireMaterialModel::instance()->fullPath().c_str());
320 return *this;
321 }
322
323 inline WireMaterialInstance WireMaterialPtr::instance() { return agxData::EntityPtr::instance(); }
324 inline const WireMaterialInstance WireMaterialPtr::instance() const { return agxData::EntityPtr::instance(); }
325 AGX_FORCE_INLINE WireMaterialSemantics* WireMaterialPtr::operator->() { return (WireMaterialSemantics* )this; }
326 AGX_FORCE_INLINE const WireMaterialSemantics* WireMaterialPtr::operator->() const { return (const WireMaterialSemantics* )this; }
327 AGX_FORCE_INLINE WireMaterialData* WireMaterialPtr::getData() { return static_cast<WireMaterialData* >(agxData::EntityPtr::getData()); }
328 AGX_FORCE_INLINE const WireMaterialData* WireMaterialPtr::getData() const { return static_cast<const WireMaterialData* >(agxData::EntityPtr::getData()); }
329
330 AGX_FORCE_INLINE agx::Real& WireMaterialPtr::youngsModulusStretch() { verifyIndex(); return getData()->youngsModulusStretch[calculateIndex()]; }
331 AGX_FORCE_INLINE agx::Real const& WireMaterialPtr::youngsModulusStretch() const { verifyIndex(); return getData()->youngsModulusStretch[calculateIndex()]; }
332
333 AGX_FORCE_INLINE agx::Real& WireMaterialPtr::youngsModulusBend() { verifyIndex(); return getData()->youngsModulusBend[calculateIndex()]; }
334 AGX_FORCE_INLINE agx::Real const& WireMaterialPtr::youngsModulusBend() const { verifyIndex(); return getData()->youngsModulusBend[calculateIndex()]; }
335
336 AGX_FORCE_INLINE agx::Real& WireMaterialPtr::dampingStretch() { verifyIndex(); return getData()->dampingStretch[calculateIndex()]; }
337 AGX_FORCE_INLINE agx::Real const& WireMaterialPtr::dampingStretch() const { verifyIndex(); return getData()->dampingStretch[calculateIndex()]; }
338
339 AGX_FORCE_INLINE agx::Real& WireMaterialPtr::dampingBend() { verifyIndex(); return getData()->dampingBend[calculateIndex()]; }
340 AGX_FORCE_INLINE agx::Real const& WireMaterialPtr::dampingBend() const { verifyIndex(); return getData()->dampingBend[calculateIndex()]; }
341
342 AGX_FORCE_INLINE agx::Bool& WireMaterialPtr::dirty() { verifyIndex(); return getData()->dirty[calculateIndex()]; }
343 AGX_FORCE_INLINE agx::Bool const& WireMaterialPtr::dirty() const { verifyIndex(); return getData()->dirty[calculateIndex()]; }
344
345 //-----------------------------------------------------------------------------------------------------
346 AGX_FORCE_INLINE WireMaterialInstance::WireMaterialInstance() {}
347 AGX_FORCE_INLINE WireMaterialInstance::WireMaterialInstance(WireMaterialData* data, agx::Index index) : agx::ReferencedInstance(data, index) {}
348 AGX_FORCE_INLINE WireMaterialInstance::WireMaterialInstance(agxData::EntityStorage* storage, agx::Index index) : agx::ReferencedInstance(storage, index) {}
349 AGX_FORCE_INLINE WireMaterialInstance::WireMaterialInstance(const agxData::EntityInstance& other) : agx::ReferencedInstance(other)
350 {
352 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
353 EntityInstance::getModel()->fullPath().c_str(), WireMaterialModel::instance()->fullPath().c_str());
354 }
355
356 AGX_FORCE_INLINE WireMaterialInstance::WireMaterialInstance(const agxData::EntityPtr& ptr) : agx::ReferencedInstance(ptr)
357 {
359 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
360 EntityInstance::getModel()->fullPath().c_str(), WireMaterialModel::instance()->fullPath().c_str());
361 }
362
363
364 AGX_FORCE_INLINE WireMaterialData* WireMaterialInstance::getData() { return static_cast<WireMaterialData* >(agxData::EntityInstance::getData()); }
365 AGX_FORCE_INLINE const WireMaterialData* WireMaterialInstance::getData() const { return static_cast<const WireMaterialData* >(agxData::EntityInstance::getData()); }
366
367 AGX_FORCE_INLINE agx::Real& WireMaterialInstance::youngsModulusStretch() { verifyIndex(); return getData()->youngsModulusStretch[getIndex()]; }
368 AGX_FORCE_INLINE agx::Real const& WireMaterialInstance::youngsModulusStretch() const { verifyIndex(); return getData()->youngsModulusStretch[getIndex()]; }
369
370 AGX_FORCE_INLINE agx::Real& WireMaterialInstance::youngsModulusBend() { verifyIndex(); return getData()->youngsModulusBend[getIndex()]; }
371 AGX_FORCE_INLINE agx::Real const& WireMaterialInstance::youngsModulusBend() const { verifyIndex(); return getData()->youngsModulusBend[getIndex()]; }
372
373 AGX_FORCE_INLINE agx::Real& WireMaterialInstance::dampingStretch() { verifyIndex(); return getData()->dampingStretch[getIndex()]; }
374 AGX_FORCE_INLINE agx::Real const& WireMaterialInstance::dampingStretch() const { verifyIndex(); return getData()->dampingStretch[getIndex()]; }
375
376 AGX_FORCE_INLINE agx::Real& WireMaterialInstance::dampingBend() { verifyIndex(); return getData()->dampingBend[getIndex()]; }
377 AGX_FORCE_INLINE agx::Real const& WireMaterialInstance::dampingBend() const { verifyIndex(); return getData()->dampingBend[getIndex()]; }
378
379 AGX_FORCE_INLINE agx::Bool& WireMaterialInstance::dirty() { verifyIndex(); return getData()->dirty[getIndex()]; }
380 AGX_FORCE_INLINE agx::Bool const& WireMaterialInstance::dirty() const { verifyIndex(); return getData()->dirty[getIndex()]; }
381
382 //-----------------------------------------------------------------------------------------------------
383 AGX_FORCE_INLINE WireMaterialSemantics::WireMaterialSemantics() {}
384 //-----------------------------------------------------------------------------------------------------
386 }
387}
388
389AGX_TYPE_BINDING(agx::Physics::WireMaterialPtr, "Physics.WireMaterialPtr")
390AGX_TYPE_BINDING(agx::Physics::WireMaterialInstance, "Physics.WireMaterialInstance")
391
392#ifdef _MSC_VER
393# pragma warning(pop)
394#endif
395
396#undef AGX_ENTITY_WRAPPER
397#undef AGX_ENTITY_NAMESPACE
398#endif
399
#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
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.WireMaterial entity.
void construct(agx::Physics::WireMaterialPtr wireMaterial)
static agxData::ScalarAttributeT< agx::Bool > * dirtyAttribute
WireMaterialModel(const agx::String &name="WireMaterial")
static WireMaterialModel * instance()
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
static agxData::ScalarAttributeT< agx::Real > * dampingBendAttribute
static agxData::ScalarAttributeT< agx::Real > * youngsModulusBendAttribute
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
virtual void initAttributeAccessors() override
virtual void configure(agx::TiXmlElement *eEntity) override
static WireMaterialPtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
static agxData::EntityStorage * defaultStorage()
virtual void construct(agxData::EntityPtr instance) override
static agxData::ScalarAttributeT< agx::Real > * dampingStretchAttribute
static agxData::ScalarAttributeT< agx::Real > * youngsModulusStretchAttribute
Pointer to a entity instance of type Physics.WireMaterial.
const WireMaterialData * getData() const
AGXPHYSICS_EXPORT agx::Real & youngsModulusBend()
AGXPHYSICS_EXPORT agx::Bool & dirty()
AGXPHYSICS_EXPORT agx::Real & dampingStretch()
AGXPHYSICS_EXPORT agx::Real const & dampingBend() const
WireMaterialData * getData()
AGXPHYSICS_EXPORT WireMaterialSemantics * operator->()
AGXPHYSICS_EXPORT WireMaterialPtr(const agxData::EntityInstance &instance)
AGXPHYSICS_EXPORT WireMaterialPtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT agx::Real & dampingBend()
AGXPHYSICS_EXPORT agx::Real const & dampingStretch() const
AGXPHYSICS_EXPORT agx::Real & youngsModulusStretch()
AGXPHYSICS_EXPORT const WireMaterialInstance instance() const
AGXPHYSICS_EXPORT WireMaterialInstance instance()
AGXPHYSICS_EXPORT agx::Bool const & dirty() const
AGXPHYSICS_EXPORT agx::Real const & youngsModulusBend() const
AGXPHYSICS_EXPORT WireMaterialPtr()
AGXPHYSICS_EXPORT agx::Real const & youngsModulusStretch() const
WireMaterialInstance InstanceType
AGXPHYSICS_EXPORT const WireMaterialSemantics * operator->() const
AGXPHYSICS_EXPORT WireMaterialPtr(agxData::EntityStorage *storage, agx::Index id)
Abstract description of the data attributes for the Referenced entity.
Pointer to a entity instance of type Referenced.
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< WireMaterialPtr > WireMaterialRef
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool Bool
Definition: Integer.h:40
double Real
Definition: Real.h:41
UInt32 Index
Definition: Integer.h:44