AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
SolveGroupEntity.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_SOLVEGROUP_H_PLUGIN
22#define GENERATED_AGX_PHYSICS_SOLVEGROUP_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>
49namespace agx { class SolveModel; }
50
51namespace agx { namespace Physics { class SolveIslandPtr; }}
52
53namespace agx
54{
55 namespace Physics
56 {
57
58 class SolveGroupModel;
59 class SolveGroupData;
60 class SolveGroupPtr;
61 class SolveGroupInstance;
62 class SolveGroupSemantics;
63
64
66
71 {
72 public:
74
75 SolveGroupModel(const agx::String& name = "SolveGroup");
76
79
82
85
87 virtual void shutdownCleanup() override;
88
89
90
91 /* Attributes */
94
95 protected:
97 virtual agxData::EntityData* createData(agxData::EntityStorage* storage) override;
98 virtual void configure(agx::TiXmlElement* eEntity) override;
99 virtual void initAttributeAccessors() override;
100 virtual void construct(agxData::EntityPtr instance) override;
102 };
103
104
106 #ifndef AGX_PHYSICS_SOLVEGROUP_DATA_SET_OVERRIDE
107 #define AGX_PHYSICS_SOLVEGROUP_DATA_SET
108 class AGXPHYSICS_EXPORT SolveGroupData : public agx::Physics::InteractionGroupData
109 {
110 public:
111 SolveGroupInstance operator[] (size_t index);
112
113 public:
117
118 public:
119 typedef agx::Physics::SolveIslandPtr islandType;
120 typedef agx::SolveModel* solveModelType;
121
122 public:
123 SolveGroupData(agxData::EntityStorage* storage);
124 SolveGroupData();
125
126 protected:
127 virtual ~SolveGroupData() {}
128 virtual void setNumElements(agx::Index numElements) override;
129
130 private:
131 SolveGroupData& operator= (const SolveGroupData&) { return *this; }
132
133 };
134 #endif
136
137
139 class AGXPHYSICS_EXPORT SolveGroupSemantics : public agx::Physics::InteractionGroupSemantics
140 {
141 public:
142
143 // Automatic getters
144 agx::Physics::SolveIslandPtr const& getIsland() const;
145 agx::SolveModel* const& getSolveModel() const;
146
147 // Semantics defined by explicit kernels
148
149 // Automatic setters
150 void setIsland(agx::Physics::SolveIslandPtr const& value);
151 void setSolveModel(agx::SolveModel* const& value);
152
153
154 protected:
155 friend class SolveGroupPtr;
156 friend class SolveGroupInstance;
157 SolveGroupSemantics();
158 };
160
161
162
166 {
167 public:
169 typedef SolveGroupData DataType;
170 typedef SolveGroupInstance InstanceType;
171
172 public:
179 AGXPHYSICS_EXPORT SolveGroupInstance instance();
180 AGXPHYSICS_EXPORT const SolveGroupInstance instance() const;
181
182 AGXPHYSICS_EXPORT SolveGroupSemantics* operator->();
183 AGXPHYSICS_EXPORT const SolveGroupSemantics* operator->() const;
184
185 SolveGroupData* getData();
186 const SolveGroupData* getData() const;
187
188
193
195 AGXPHYSICS_EXPORT agx::SolveModel*& solveModel();
197 AGXPHYSICS_EXPORT agx::SolveModel* const& solveModel() const;
198
199 };
200
201
203 class AGXPHYSICS_EXPORT SolveGroupInstance : public agx::Physics::InteractionGroupInstance
204 {
205 public:
206 SolveGroupInstance();
207 SolveGroupInstance(SolveGroupData* data, agx::Index index);
208 SolveGroupInstance(agxData::EntityStorage *storage, agx::Index index);
209 SolveGroupInstance(const agxData::EntityInstance& other);
210 SolveGroupInstance(const agxData::EntityPtr& ptr);
211
212 SolveGroupData* getData();
213 const SolveGroupData* getData() const;
214
215 public:
219 agx::Physics::SolveIslandPtr const& island() const;
220
222 agx::SolveModel*& solveModel();
224 agx::SolveModel* const& solveModel() const;
225
226 };
228
229
230
233
234
235
237 /* Implementation */
238 //-----------------------------------------------------------------------------------------------------
239 //-----------------------------------------------------------------------------------------------------
240 inline SolveGroupInstance agx::Physics::SolveGroupData::operator[] (size_t index) { return SolveGroupInstance(this, (agx::Index)index); }
241 //-----------------------------------------------------------------------------------------------------
243 AGX_FORCE_INLINE SolveGroupPtr::SolveGroupPtr(agxData::EntityStorage* storage, agx::Index id) : agx::Physics::InteractionGroupPtr(storage, id) {}
244 AGX_FORCE_INLINE SolveGroupPtr::SolveGroupPtr(const agxData::EntityPtr& ptr) : agx::Physics::InteractionGroupPtr(ptr)
245 {
247 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
248 EntityPtr::getModel()->fullPath().c_str(), SolveGroupModel::instance()->fullPath().c_str());
249 }
250
251 AGX_FORCE_INLINE SolveGroupPtr::SolveGroupPtr(const agxData::EntityInstance& instance) : agx::Physics::InteractionGroupPtr(instance)
252 {
253 agxAssertN(!instance || instance.isInstanceOf(SolveGroupModel::instance()),
254 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
255 EntityPtr::getModel()->fullPath().c_str(), SolveGroupModel::instance()->fullPath().c_str());
256 }
257
258 AGX_FORCE_INLINE SolveGroupPtr& SolveGroupPtr::operator= (const agxData::EntityPtr& ptr)
259 {
261 agxAssertN(!ptr || ptr.isInstanceOf(SolveGroupModel::instance()),
262 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
263 EntityPtr::getModel()->fullPath().c_str(), SolveGroupModel::instance()->fullPath().c_str());
264 return *this;
265 }
266
267 AGX_FORCE_INLINE SolveGroupPtr& SolveGroupPtr::operator= (const agxData::EntityInstance& instance)
268 {
270 agxAssertN(!instance || instance.isInstanceOf(SolveGroupModel::instance()),
271 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
272 EntityPtr::getModel()->fullPath().c_str(), SolveGroupModel::instance()->fullPath().c_str());
273 return *this;
274 }
275
276 inline SolveGroupInstance SolveGroupPtr::instance() { return agxData::EntityPtr::instance(); }
277 inline const SolveGroupInstance SolveGroupPtr::instance() const { return agxData::EntityPtr::instance(); }
278 AGX_FORCE_INLINE SolveGroupSemantics* SolveGroupPtr::operator->() { return (SolveGroupSemantics* )this; }
279 AGX_FORCE_INLINE const SolveGroupSemantics* SolveGroupPtr::operator->() const { return (const SolveGroupSemantics* )this; }
280 AGX_FORCE_INLINE SolveGroupData* SolveGroupPtr::getData() { return static_cast<SolveGroupData* >(agxData::EntityPtr::getData()); }
281 AGX_FORCE_INLINE const SolveGroupData* SolveGroupPtr::getData() const { return static_cast<const SolveGroupData* >(agxData::EntityPtr::getData()); }
282
283 AGX_FORCE_INLINE agx::Physics::SolveIslandPtr& SolveGroupPtr::island() { verifyIndex(); return getData()->island[calculateIndex()]; }
284 AGX_FORCE_INLINE agx::Physics::SolveIslandPtr const& SolveGroupPtr::island() const { verifyIndex(); return getData()->island[calculateIndex()]; }
285
286 AGX_FORCE_INLINE agx::SolveModel*& SolveGroupPtr::solveModel() { verifyIndex(); return getData()->solveModel[calculateIndex()]; }
287 AGX_FORCE_INLINE agx::SolveModel* const& SolveGroupPtr::solveModel() const { verifyIndex(); return getData()->solveModel[calculateIndex()]; }
288
289 //-----------------------------------------------------------------------------------------------------
290 AGX_FORCE_INLINE SolveGroupInstance::SolveGroupInstance() {}
291 AGX_FORCE_INLINE SolveGroupInstance::SolveGroupInstance(SolveGroupData* data, agx::Index index) : agx::Physics::InteractionGroupInstance(data, index) {}
292 AGX_FORCE_INLINE SolveGroupInstance::SolveGroupInstance(agxData::EntityStorage* storage, agx::Index index) : agx::Physics::InteractionGroupInstance(storage, index) {}
293 AGX_FORCE_INLINE SolveGroupInstance::SolveGroupInstance(const agxData::EntityInstance& other) : agx::Physics::InteractionGroupInstance(other)
294 {
296 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
297 EntityInstance::getModel()->fullPath().c_str(), SolveGroupModel::instance()->fullPath().c_str());
298 }
299
300 AGX_FORCE_INLINE SolveGroupInstance::SolveGroupInstance(const agxData::EntityPtr& ptr) : agx::Physics::InteractionGroupInstance(ptr)
301 {
303 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
304 EntityInstance::getModel()->fullPath().c_str(), SolveGroupModel::instance()->fullPath().c_str());
305 }
306
307
308 AGX_FORCE_INLINE SolveGroupData* SolveGroupInstance::getData() { return static_cast<SolveGroupData* >(agxData::EntityInstance::getData()); }
309 AGX_FORCE_INLINE const SolveGroupData* SolveGroupInstance::getData() const { return static_cast<const SolveGroupData* >(agxData::EntityInstance::getData()); }
310
311 AGX_FORCE_INLINE agx::Physics::SolveIslandPtr& SolveGroupInstance::island() { verifyIndex(); return getData()->island[getIndex()]; }
312 AGX_FORCE_INLINE agx::Physics::SolveIslandPtr const& SolveGroupInstance::island() const { verifyIndex(); return getData()->island[getIndex()]; }
313
314 AGX_FORCE_INLINE agx::SolveModel*& SolveGroupInstance::solveModel() { verifyIndex(); return getData()->solveModel[getIndex()]; }
315 AGX_FORCE_INLINE agx::SolveModel* const& SolveGroupInstance::solveModel() const { verifyIndex(); return getData()->solveModel[getIndex()]; }
316
317 //-----------------------------------------------------------------------------------------------------
318 AGX_FORCE_INLINE SolveGroupSemantics::SolveGroupSemantics() {}
319 //-----------------------------------------------------------------------------------------------------
321 }
322}
323
324AGX_TYPE_BINDING(agx::Physics::SolveGroupPtr, "Physics.SolveGroupPtr")
325AGX_TYPE_BINDING(agx::Physics::SolveGroupInstance, "Physics.SolveGroupInstance")
326
327#ifdef _MSC_VER
328# pragma warning(pop)
329#endif
330
331#undef AGX_ENTITY_WRAPPER
332#undef AGX_ENTITY_NAMESPACE
333#endif
334
#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.InteractionGroup entity.
Pointer to a entity instance of type Physics.InteractionGroup.
Abstract description of the data attributes for the Physics.SolveGroup entity.
void construct(agx::Physics::SolveGroupPtr solveGroup)
virtual void configure(agx::TiXmlElement *eEntity) override
virtual void construct(agxData::EntityPtr instance) override
static agxData::ScalarAttributeT< agx::Physics::SolveIslandPtr > * islandAttribute
static agxData::EntityStorage * defaultStorage()
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
static agxData::PointerAttributeT< agx::SolveModel * > * solveModelAttribute
static SolveGroupModel * instance()
static SolveGroupPtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
SolveGroupModel(const agx::String &name="SolveGroup")
virtual void initAttributeAccessors() override
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
Pointer to a entity instance of type Physics.SolveGroup.
SolveGroupInstance InstanceType
AGXPHYSICS_EXPORT agx::Physics::SolveIslandPtr & island()
const SolveGroupData * getData() const
AGXPHYSICS_EXPORT SolveGroupPtr(const agxData::EntityInstance &instance)
AGXPHYSICS_EXPORT const SolveGroupInstance instance() const
AGXPHYSICS_EXPORT agx::SolveModel *& solveModel()
AGXPHYSICS_EXPORT const SolveGroupSemantics * operator->() const
AGXPHYSICS_EXPORT SolveGroupPtr()
AGXPHYSICS_EXPORT SolveGroupPtr(const agxData::EntityPtr &ptr)
AGXPHYSICS_EXPORT SolveGroupSemantics * operator->()
AGXPHYSICS_EXPORT agx::Physics::SolveIslandPtr const & island() const
AGXPHYSICS_EXPORT SolveGroupPtr(agxData::EntityStorage *storage, agx::Index id)
AGXPHYSICS_EXPORT SolveGroupInstance instance()
AGXPHYSICS_EXPORT agx::SolveModel *const & solveModel() const
SolveGroupData * getData()
Pointer to a entity instance of type Physics.SolveIsland.
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