AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
WarmStartingDataEntity.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_WARMSTARTINGDATA_H_PLUGIN
22#define GENERATED_AGX_PHYSICS_WARMSTARTINGDATA_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>
47#include <agx/Vec3.h>
48#include <agx/Vec4.h>
49
50
51namespace agx
52{
53 namespace Physics
54 {
55
56 class WarmStartingDataModel;
57 class WarmStartingDataData;
58 class WarmStartingDataPtr;
59 class WarmStartingDataInstance;
60 class WarmStartingDataSemantics;
61
62
64
69 {
70 public:
72
73 WarmStartingDataModel(const agx::String& name = "WarmStartingData");
74
77
80
83
85 virtual void shutdownCleanup() override;
86
87
88
89 /* Attributes */
95
96 protected:
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;
103 };
104
105
107 #ifndef AGX_PHYSICS_WARMSTARTINGDATA_DATA_SET_OVERRIDE
108 #define AGX_PHYSICS_WARMSTARTINGDATA_DATA_SET
109 class AGXPHYSICS_EXPORT WarmStartingDataData : public agxData::EntityData
110 {
111 public:
112 WarmStartingDataInstance operator[] (size_t index);
113
114 public:
120 agxData::Array< agx::Vec3 > shape1normal;
121
122 public:
123 typedef agx::Vec3 localForceType;
124 typedef agx::Vec4i8 indexSetType;
125 typedef agx::Vec3 shape1posType;
126 typedef agx::Vec3 shape2posType;
127 typedef agx::Vec3 shape1normalType;
128
129 public:
130 WarmStartingDataData(agxData::EntityStorage* storage);
131 WarmStartingDataData();
132
133 protected:
134 virtual ~WarmStartingDataData() {}
135 virtual void setNumElements(agx::Index numElements) override;
136
137 private:
138 WarmStartingDataData& operator= (const WarmStartingDataData&) { return *this; }
139
140 };
141 #endif
143
144
146 class AGXPHYSICS_EXPORT WarmStartingDataSemantics : protected agxData::EntityPtr
147 {
148 public:
149
150 // Automatic getters
151 agx::Vec3 const& getLocalForce() const;
152 agx::Vec4i8 const& getIndexSet() const;
153 agx::Vec3 const& getShape1pos() const;
154 agx::Vec3 const& getShape2pos() const;
155 agx::Vec3 const& getShape1normal() const;
156
157 // Semantics defined by explicit kernels
158
159 // Automatic setters
160 void setLocalForce(agx::Vec3 const& value);
161 void setIndexSet(agx::Vec4i8 const& value);
162 void setShape1pos(agx::Vec3 const& value);
163 void setShape2pos(agx::Vec3 const& value);
164 void setShape1normal(agx::Vec3 const& value);
165
166
167 protected:
168 friend class WarmStartingDataPtr;
169 friend class WarmStartingDataInstance;
170 WarmStartingDataSemantics();
171 };
173
174
175
178 class CALLABLE WarmStartingDataPtr : public agxData::EntityPtr
179 {
180 public:
182 typedef WarmStartingDataData DataType;
183 typedef WarmStartingDataInstance InstanceType;
184
185 public:
192 AGXPHYSICS_EXPORT WarmStartingDataInstance instance();
193 AGXPHYSICS_EXPORT const WarmStartingDataInstance instance() const;
194
195 AGXPHYSICS_EXPORT WarmStartingDataSemantics* operator->();
196 AGXPHYSICS_EXPORT const WarmStartingDataSemantics* operator->() const;
197
198 WarmStartingDataData* getData();
199 const WarmStartingDataData* getData() const;
200
201
206
211
216
221
226
227 };
228
229
231 class AGXPHYSICS_EXPORT WarmStartingDataInstance : public agxData::EntityInstance
232 {
233 public:
234 WarmStartingDataInstance();
235 WarmStartingDataInstance(WarmStartingDataData* data, agx::Index index);
236 WarmStartingDataInstance(agxData::EntityStorage *storage, agx::Index index);
237 WarmStartingDataInstance(const agxData::EntityInstance& other);
238 WarmStartingDataInstance(const agxData::EntityPtr& ptr);
239
240 WarmStartingDataData* getData();
241 const WarmStartingDataData* getData() const;
242
243 public:
245 agx::Vec3& localForce();
247 agx::Vec3 const& localForce() const;
248
250 agx::Vec4i8& indexSet();
252 agx::Vec4i8 const& indexSet() const;
253
255 agx::Vec3& shape1pos();
257 agx::Vec3 const& shape1pos() const;
258
260 agx::Vec3& shape2pos();
262 agx::Vec3 const& shape2pos() const;
263
265 agx::Vec3& shape1normal();
267 agx::Vec3 const& shape1normal() const;
268
269 };
271
272
273
276
277
278
280 /* Implementation */
281 //-----------------------------------------------------------------------------------------------------
282 //-----------------------------------------------------------------------------------------------------
283 inline WarmStartingDataInstance agx::Physics::WarmStartingDataData::operator[] (size_t index) { return WarmStartingDataInstance(this, (agx::Index)index); }
284 //-----------------------------------------------------------------------------------------------------
287 AGX_FORCE_INLINE WarmStartingDataPtr::WarmStartingDataPtr(const agxData::EntityPtr& ptr) : agxData::EntityPtr(ptr)
288 {
290 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
291 EntityPtr::getModel()->fullPath().c_str(), WarmStartingDataModel::instance()->fullPath().c_str());
292 }
293
294 AGX_FORCE_INLINE WarmStartingDataPtr::WarmStartingDataPtr(const agxData::EntityInstance& instance) : agxData::EntityPtr(instance)
295 {
297 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
298 EntityPtr::getModel()->fullPath().c_str(), WarmStartingDataModel::instance()->fullPath().c_str());
299 }
300
301 AGX_FORCE_INLINE WarmStartingDataPtr& WarmStartingDataPtr::operator= (const agxData::EntityPtr& ptr)
302 {
304 agxAssertN(!ptr || ptr.isInstanceOf(WarmStartingDataModel::instance()),
305 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
306 EntityPtr::getModel()->fullPath().c_str(), WarmStartingDataModel::instance()->fullPath().c_str());
307 return *this;
308 }
309
310 AGX_FORCE_INLINE WarmStartingDataPtr& WarmStartingDataPtr::operator= (const agxData::EntityInstance& instance)
311 {
313 agxAssertN(!instance || instance.isInstanceOf(WarmStartingDataModel::instance()),
314 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
315 EntityPtr::getModel()->fullPath().c_str(), WarmStartingDataModel::instance()->fullPath().c_str());
316 return *this;
317 }
318
319 inline WarmStartingDataInstance WarmStartingDataPtr::instance() { return agxData::EntityPtr::instance(); }
320 inline const WarmStartingDataInstance WarmStartingDataPtr::instance() const { return agxData::EntityPtr::instance(); }
321 AGX_FORCE_INLINE WarmStartingDataSemantics* WarmStartingDataPtr::operator->() { return (WarmStartingDataSemantics* )this; }
322 AGX_FORCE_INLINE const WarmStartingDataSemantics* WarmStartingDataPtr::operator->() const { return (const WarmStartingDataSemantics* )this; }
323 AGX_FORCE_INLINE WarmStartingDataData* WarmStartingDataPtr::getData() { return static_cast<WarmStartingDataData* >(agxData::EntityPtr::getData()); }
324 AGX_FORCE_INLINE const WarmStartingDataData* WarmStartingDataPtr::getData() const { return static_cast<const WarmStartingDataData* >(agxData::EntityPtr::getData()); }
325
326 AGX_FORCE_INLINE agx::Vec3& WarmStartingDataPtr::localForce() { verifyIndex(); return getData()->localForce[calculateIndex()]; }
327 AGX_FORCE_INLINE agx::Vec3 const& WarmStartingDataPtr::localForce() const { verifyIndex(); return getData()->localForce[calculateIndex()]; }
328
329 AGX_FORCE_INLINE agx::Vec4i8& WarmStartingDataPtr::indexSet() { verifyIndex(); return getData()->indexSet[calculateIndex()]; }
330 AGX_FORCE_INLINE agx::Vec4i8 const& WarmStartingDataPtr::indexSet() const { verifyIndex(); return getData()->indexSet[calculateIndex()]; }
331
332 AGX_FORCE_INLINE agx::Vec3& WarmStartingDataPtr::shape1pos() { verifyIndex(); return getData()->shape1pos[calculateIndex()]; }
333 AGX_FORCE_INLINE agx::Vec3 const& WarmStartingDataPtr::shape1pos() const { verifyIndex(); return getData()->shape1pos[calculateIndex()]; }
334
335 AGX_FORCE_INLINE agx::Vec3& WarmStartingDataPtr::shape2pos() { verifyIndex(); return getData()->shape2pos[calculateIndex()]; }
336 AGX_FORCE_INLINE agx::Vec3 const& WarmStartingDataPtr::shape2pos() const { verifyIndex(); return getData()->shape2pos[calculateIndex()]; }
337
338 AGX_FORCE_INLINE agx::Vec3& WarmStartingDataPtr::shape1normal() { verifyIndex(); return getData()->shape1normal[calculateIndex()]; }
339 AGX_FORCE_INLINE agx::Vec3 const& WarmStartingDataPtr::shape1normal() const { verifyIndex(); return getData()->shape1normal[calculateIndex()]; }
340
341 //-----------------------------------------------------------------------------------------------------
342 AGX_FORCE_INLINE WarmStartingDataInstance::WarmStartingDataInstance() {}
343 AGX_FORCE_INLINE WarmStartingDataInstance::WarmStartingDataInstance(WarmStartingDataData* data, agx::Index index) : agxData::EntityInstance(data, index) {}
344 AGX_FORCE_INLINE WarmStartingDataInstance::WarmStartingDataInstance(agxData::EntityStorage* storage, agx::Index index) : agxData::EntityInstance(storage, index) {}
345 AGX_FORCE_INLINE WarmStartingDataInstance::WarmStartingDataInstance(const agxData::EntityInstance& other) : agxData::EntityInstance(other)
346 {
348 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
349 EntityInstance::getModel()->fullPath().c_str(), WarmStartingDataModel::instance()->fullPath().c_str());
350 }
351
352 AGX_FORCE_INLINE WarmStartingDataInstance::WarmStartingDataInstance(const agxData::EntityPtr& ptr) : agxData::EntityInstance(ptr)
353 {
355 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
356 EntityInstance::getModel()->fullPath().c_str(), WarmStartingDataModel::instance()->fullPath().c_str());
357 }
358
359
360 AGX_FORCE_INLINE WarmStartingDataData* WarmStartingDataInstance::getData() { return static_cast<WarmStartingDataData* >(agxData::EntityInstance::getData()); }
361 AGX_FORCE_INLINE const WarmStartingDataData* WarmStartingDataInstance::getData() const { return static_cast<const WarmStartingDataData* >(agxData::EntityInstance::getData()); }
362
363 AGX_FORCE_INLINE agx::Vec3& WarmStartingDataInstance::localForce() { verifyIndex(); return getData()->localForce[getIndex()]; }
364 AGX_FORCE_INLINE agx::Vec3 const& WarmStartingDataInstance::localForce() const { verifyIndex(); return getData()->localForce[getIndex()]; }
365
366 AGX_FORCE_INLINE agx::Vec4i8& WarmStartingDataInstance::indexSet() { verifyIndex(); return getData()->indexSet[getIndex()]; }
367 AGX_FORCE_INLINE agx::Vec4i8 const& WarmStartingDataInstance::indexSet() const { verifyIndex(); return getData()->indexSet[getIndex()]; }
368
369 AGX_FORCE_INLINE agx::Vec3& WarmStartingDataInstance::shape1pos() { verifyIndex(); return getData()->shape1pos[getIndex()]; }
370 AGX_FORCE_INLINE agx::Vec3 const& WarmStartingDataInstance::shape1pos() const { verifyIndex(); return getData()->shape1pos[getIndex()]; }
371
372 AGX_FORCE_INLINE agx::Vec3& WarmStartingDataInstance::shape2pos() { verifyIndex(); return getData()->shape2pos[getIndex()]; }
373 AGX_FORCE_INLINE agx::Vec3 const& WarmStartingDataInstance::shape2pos() const { verifyIndex(); return getData()->shape2pos[getIndex()]; }
374
375 AGX_FORCE_INLINE agx::Vec3& WarmStartingDataInstance::shape1normal() { verifyIndex(); return getData()->shape1normal[getIndex()]; }
376 AGX_FORCE_INLINE agx::Vec3 const& WarmStartingDataInstance::shape1normal() const { verifyIndex(); return getData()->shape1normal[getIndex()]; }
377
378 //-----------------------------------------------------------------------------------------------------
379 AGX_FORCE_INLINE WarmStartingDataSemantics::WarmStartingDataSemantics() {}
380 //-----------------------------------------------------------------------------------------------------
382 }
383}
384
385AGX_TYPE_BINDING(agx::Physics::WarmStartingDataPtr, "Physics.WarmStartingDataPtr")
386AGX_TYPE_BINDING(agx::Physics::WarmStartingDataInstance, "Physics.WarmStartingDataInstance")
387
388#ifdef _MSC_VER
389# pragma warning(pop)
390#endif
391
392#undef AGX_ENTITY_WRAPPER
393#undef AGX_ENTITY_NAMESPACE
394#endif
395
#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()
An abstract description of a data entity stored using SOA (structure of arrays) pattern in a EntitySt...
Definition: EntityModel.h:64
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.WarmStartingData entity.
static agxData::EntityStorage * defaultStorage()
static WarmStartingDataModel * instance()
static agxData::ScalarAttributeT< agx::Vec3 > * shape2posAttribute
void construct(agx::Physics::WarmStartingDataPtr warmStartingData)
WarmStartingDataModel(const agx::String &name="WarmStartingData")
virtual void configure(agx::TiXmlElement *eEntity) override
static WarmStartingDataPtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
virtual void construct(agxData::EntityPtr instance) override
static agxData::ScalarAttributeT< agx::Vec3 > * localForceAttribute
static agxData::ScalarAttributeT< agx::Vec3 > * shape1posAttribute
virtual void initAttributeAccessors() override
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
static agxData::ScalarAttributeT< agx::Vec4i8 > * indexSetAttribute
static agxData::ScalarAttributeT< agx::Vec3 > * shape1normalAttribute
Pointer to a entity instance of type Physics.WarmStartingData.
AGXPHYSICS_EXPORT agx::Vec4i8 & indexSet()
AGXPHYSICS_EXPORT agx::Vec3 const & shape2pos() const
AGXPHYSICS_EXPORT WarmStartingDataPtr(const agxData::EntityInstance &instance)
AGXPHYSICS_EXPORT WarmStartingDataPtr(agxData::EntityStorage *storage, agx::Index id)
AGXPHYSICS_EXPORT agx::Vec3 & shape1normal()
WarmStartingDataData * getData()
AGXPHYSICS_EXPORT agx::Vec3 const & shape1normal() const
AGXPHYSICS_EXPORT agx::Vec4i8 const & indexSet() const
AGXPHYSICS_EXPORT WarmStartingDataSemantics * operator->()
AGXPHYSICS_EXPORT const WarmStartingDataInstance instance() const
AGXPHYSICS_EXPORT agx::Vec3 & shape1pos()
AGXPHYSICS_EXPORT WarmStartingDataInstance instance()
AGXPHYSICS_EXPORT const WarmStartingDataSemantics * operator->() const
AGXPHYSICS_EXPORT WarmStartingDataPtr()
AGXPHYSICS_EXPORT agx::Vec3 const & localForce() const
const WarmStartingDataData * getData() const
AGXPHYSICS_EXPORT agx::Vec3 & localForce()
AGXPHYSICS_EXPORT agx::Vec3 const & shape1pos() const
AGXPHYSICS_EXPORT agx::Vec3 & shape2pos()
AGXPHYSICS_EXPORT WarmStartingDataPtr(const agxData::EntityPtr &ptr)
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:35
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
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
UInt32 Index
Definition: Integer.h:44