AGX Dynamics  2.37.3.2
ContactMaterialEntity.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_CONTACTMATERIAL_H_PLUGIN
22 #define GENERATED_AGX_PHYSICS_CONTACTMATERIAL_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>
47 #include <agx/ReferencedEntity.h>
48 #include <agx/Integer.h>
50 #include <agx/Vec3.h>
51 #include <agx/Real.h>
52 namespace agx { class ContactMaterial; }
53 
54 namespace agx { namespace Physics { class MaterialPtr; }}
55 namespace agx { namespace Physics { class MaterialPtr; }}
56 
57 namespace agx
58 {
59  namespace Physics
60  {
61 
62  class ContactMaterialModel;
63  class ContactMaterialData;
64  class ContactMaterialPtr;
65  class ContactMaterialInstance;
66  class ContactMaterialSemantics;
67 
68 
70 
75  {
76  public:
78 
79  ContactMaterialModel(const agx::String& name = "ContactMaterial");
80 
82  static ContactMaterialModel* instance();
83 
85  static ContactMaterialPtr createInstance();
86 
88  static agxData::EntityStorage* defaultStorage();
89 
91  virtual void shutdownCleanup() override;
92 
93 
94 
95  /* Attributes */
119 
120  protected:
121  virtual ~ContactMaterialModel();
122  virtual agxData::EntityData* createData(agxData::EntityStorage* storage) override;
123  virtual void configure(agx::TiXmlElement* eEntity) override;
124  virtual void initAttributeAccessors() override;
125  virtual void construct(agxData::EntityPtr instance) override;
126  void construct(agx::Physics::ContactMaterialPtr contactMaterial);
127  };
128 
129 
131  #ifndef AGX_PHYSICS_CONTACTMATERIAL_DATA_SET_OVERRIDE
132  #define AGX_PHYSICS_CONTACTMATERIAL_DATA_SET
133  class AGXPHYSICS_EXPORT ContactMaterialData : public agx::ReferencedData
134  {
135  public:
136  ContactMaterialInstance operator[] (size_t index);
137 
138  public:
140  agxData::Array< agx::Bool > isExplicit;
143  agxData::Array< agx::Vec3 > restitution;
146  agxData::Array< agx::Real > adhesiveOverlap;
147  agxData::Array< agx::Vec3 > viscosity;
148  agxData::Array< agx::Bool > surfaceFrictionEnabled;
149  agxData::Array< agx::UInt8 > contactReductionMode;
150  agxData::Array< agx::UInt8 > contactReductionBinResolution;
151  agxData::Array< agx::Bool > useContactAreaApproach;
152  agxData::Array< agx::Vec3 > wireFriction;
153  agxData::Array< agx::Real > youngsModulus;
155  agxData::Array< agx::Real > minElasticRestLength;
156  agxData::Array< agx::Real > maxElasticRestLength;
157  agxData::Array< agx::Real > impactCompliance;
158  agxData::Array< agx::Real > rollingResistanceCoefficient;
159  agxData::Array< agx::Real > twistingResistanceCoefficient;
160  agxData::Array< agx::Real > rollingResistanceCompliance;
161  agxData::Array< agx::Real > twistingResistanceCompliance;
163 
164  public:
165  typedef agx::Bool isExplicitType;
166  typedef agx::Physics::MaterialPtr material1Type;
167  typedef agx::Physics::MaterialPtr material2Type;
168  typedef agx::Vec3 restitutionType;
169  typedef agx::Vec3 frictionType;
170  typedef agx::Real adhesionType;
171  typedef agx::Real adhesiveOverlapType;
172  typedef agx::Vec3 viscosityType;
173  typedef agx::Bool surfaceFrictionEnabledType;
174  typedef agx::UInt8 contactReductionModeType;
175  typedef agx::UInt8 contactReductionBinResolutionType;
176  typedef agx::Bool useContactAreaApproachType;
177  typedef agx::Vec3 wireFrictionType;
178  typedef agx::Real youngsModulusType;
179  typedef agx::Real dampingType;
180  typedef agx::Real minElasticRestLengthType;
181  typedef agx::Real maxElasticRestLengthType;
182  typedef agx::Real impactComplianceType;
183  typedef agx::Real rollingResistanceCoefficientType;
184  typedef agx::Real twistingResistanceCoefficientType;
185  typedef agx::Real rollingResistanceComplianceType;
186  typedef agx::Real twistingResistanceComplianceType;
187  typedef agx::ContactMaterial* modelType;
188 
189  public:
190  ContactMaterialData(agxData::EntityStorage* storage);
191  ContactMaterialData();
192 
193  protected:
194  virtual ~ContactMaterialData() {}
195  virtual void setNumElements(agx::Index numElements) override;
196 
197  private:
198  ContactMaterialData& operator= (const ContactMaterialData&) { return *this; }
199 
200  };
201  #endif
203 
204 
206  class AGXPHYSICS_EXPORT ContactMaterialSemantics : public agx::ReferencedSemantics
207  {
208  public:
209 
210  // Automatic getters
211  agx::Bool const& getIsExplicit() const;
212  agx::Physics::MaterialPtr const& getMaterial1() const;
213  agx::Physics::MaterialPtr const& getMaterial2() const;
214  agx::Vec3 const& getRestitution() const;
215  agx::Vec3 const& getFriction() const;
216  agx::Real const& getAdhesion() const;
217  agx::Real const& getAdhesiveOverlap() const;
218  agx::Vec3 const& getViscosity() const;
219  agx::Bool const& getSurfaceFrictionEnabled() const;
220  agx::UInt8 const& getContactReductionMode() const;
221  agx::UInt8 const& getContactReductionBinResolution() const;
222  agx::Bool const& getUseContactAreaApproach() const;
223  agx::Vec3 const& getWireFriction() const;
224  agx::Real const& getYoungsModulus() const;
225  agx::Real const& getDamping() const;
226  agx::Real const& getMinElasticRestLength() const;
227  agx::Real const& getMaxElasticRestLength() const;
228  agx::Real const& getImpactCompliance() const;
229  agx::Real const& getRollingResistanceCoefficient() const;
230  agx::Real const& getTwistingResistanceCoefficient() const;
231  agx::Real const& getRollingResistanceCompliance() const;
232  agx::Real const& getTwistingResistanceCompliance() const;
233  agx::ContactMaterial* const& getModel() const;
234 
235  // Semantics defined by explicit kernels
236 
237  // Automatic setters
238  void setIsExplicit(agx::Bool const& value);
239  void setMaterial1(agx::Physics::MaterialPtr const& value);
240  void setMaterial2(agx::Physics::MaterialPtr const& value);
241  void setRestitution(agx::Vec3 const& value);
242  void setFriction(agx::Vec3 const& value);
243  void setAdhesion(agx::Real const& value);
244  void setAdhesiveOverlap(agx::Real const& value);
245  void setViscosity(agx::Vec3 const& value);
246  void setSurfaceFrictionEnabled(agx::Bool const& value);
247  void setContactReductionMode(agx::UInt8 const& value);
248  void setContactReductionBinResolution(agx::UInt8 const& value);
249  void setUseContactAreaApproach(agx::Bool const& value);
250  void setWireFriction(agx::Vec3 const& value);
251  void setYoungsModulus(agx::Real const& value);
252  void setDamping(agx::Real const& value);
253  void setMinElasticRestLength(agx::Real const& value);
254  void setMaxElasticRestLength(agx::Real const& value);
255  void setImpactCompliance(agx::Real const& value);
256  void setRollingResistanceCoefficient(agx::Real const& value);
257  void setTwistingResistanceCoefficient(agx::Real const& value);
258  void setRollingResistanceCompliance(agx::Real const& value);
259  void setTwistingResistanceCompliance(agx::Real const& value);
260  void setModel(agx::ContactMaterial* const& value);
261 
262 
263  protected:
264  friend class ContactMaterialPtr;
265  friend class ContactMaterialInstance;
266  ContactMaterialSemantics();
267  };
269 
270 
271 
275  {
276  public:
278  typedef ContactMaterialData DataType;
279  typedef ContactMaterialInstance InstanceType;
280 
281  public:
287  AGXPHYSICS_EXPORT ContactMaterialPtr& operator= (const agxData::EntityInstance& instance);
288  AGXPHYSICS_EXPORT ContactMaterialInstance instance();
289  AGXPHYSICS_EXPORT const ContactMaterialInstance instance() const;
290 
291  AGXPHYSICS_EXPORT ContactMaterialSemantics* operator->();
292  AGXPHYSICS_EXPORT const ContactMaterialSemantics* operator->() const;
293 
294  ContactMaterialData* getData();
295  const ContactMaterialData* getData() const;
296 
297 
299  AGXPHYSICS_EXPORT agx::Bool& isExplicit();
301  AGXPHYSICS_EXPORT agx::Bool const& isExplicit() const;
302 
306  AGXPHYSICS_EXPORT agx::Physics::MaterialPtr const& material1() const;
307 
311  AGXPHYSICS_EXPORT agx::Physics::MaterialPtr const& material2() const;
312 
314  AGXPHYSICS_EXPORT agx::Vec3& restitution();
316  AGXPHYSICS_EXPORT agx::Vec3 const& restitution() const;
317 
319  AGXPHYSICS_EXPORT agx::Vec3& friction();
321  AGXPHYSICS_EXPORT agx::Vec3 const& friction() const;
322 
324  AGXPHYSICS_EXPORT agx::Real& adhesion();
326  AGXPHYSICS_EXPORT agx::Real const& adhesion() const;
327 
329  AGXPHYSICS_EXPORT agx::Real& adhesiveOverlap();
331  AGXPHYSICS_EXPORT agx::Real const& adhesiveOverlap() const;
332 
334  AGXPHYSICS_EXPORT agx::Vec3& viscosity();
336  AGXPHYSICS_EXPORT agx::Vec3 const& viscosity() const;
337 
339  AGXPHYSICS_EXPORT agx::Bool& surfaceFrictionEnabled();
341  AGXPHYSICS_EXPORT agx::Bool const& surfaceFrictionEnabled() const;
342 
344  AGXPHYSICS_EXPORT agx::UInt8& contactReductionMode();
346  AGXPHYSICS_EXPORT agx::UInt8 const& contactReductionMode() const;
347 
349  AGXPHYSICS_EXPORT agx::UInt8& contactReductionBinResolution();
351  AGXPHYSICS_EXPORT agx::UInt8 const& contactReductionBinResolution() const;
352 
354  AGXPHYSICS_EXPORT agx::Bool& useContactAreaApproach();
356  AGXPHYSICS_EXPORT agx::Bool const& useContactAreaApproach() const;
357 
359  AGXPHYSICS_EXPORT agx::Vec3& wireFriction();
361  AGXPHYSICS_EXPORT agx::Vec3 const& wireFriction() const;
362 
364  AGXPHYSICS_EXPORT agx::Real& youngsModulus();
366  AGXPHYSICS_EXPORT agx::Real const& youngsModulus() const;
367 
369  AGXPHYSICS_EXPORT agx::Real& damping();
371  AGXPHYSICS_EXPORT agx::Real const& damping() const;
372 
374  AGXPHYSICS_EXPORT agx::Real& minElasticRestLength();
376  AGXPHYSICS_EXPORT agx::Real const& minElasticRestLength() const;
377 
379  AGXPHYSICS_EXPORT agx::Real& maxElasticRestLength();
381  AGXPHYSICS_EXPORT agx::Real const& maxElasticRestLength() const;
382 
384  AGXPHYSICS_EXPORT agx::Real& impactCompliance();
386  AGXPHYSICS_EXPORT agx::Real const& impactCompliance() const;
387 
389  AGXPHYSICS_EXPORT agx::Real& rollingResistanceCoefficient();
391  AGXPHYSICS_EXPORT agx::Real const& rollingResistanceCoefficient() const;
392 
394  AGXPHYSICS_EXPORT agx::Real& twistingResistanceCoefficient();
396  AGXPHYSICS_EXPORT agx::Real const& twistingResistanceCoefficient() const;
397 
399  AGXPHYSICS_EXPORT agx::Real& rollingResistanceCompliance();
401  AGXPHYSICS_EXPORT agx::Real const& rollingResistanceCompliance() const;
402 
404  AGXPHYSICS_EXPORT agx::Real& twistingResistanceCompliance();
406  AGXPHYSICS_EXPORT agx::Real const& twistingResistanceCompliance() const;
407 
411  AGXPHYSICS_EXPORT agx::ContactMaterial* const& model() const;
412 
413  };
414 
415  // Entity is Referenced
417 
418 
420  class AGXPHYSICS_EXPORT ContactMaterialInstance : public agx::ReferencedInstance
421  {
422  public:
423  ContactMaterialInstance();
424  ContactMaterialInstance(ContactMaterialData* data, agx::Index index);
425  ContactMaterialInstance(agxData::EntityStorage *storage, agx::Index index);
426  ContactMaterialInstance(const agxData::EntityInstance& other);
427  ContactMaterialInstance(const agxData::EntityPtr& ptr);
428 
429  ContactMaterialData* getData();
430  const ContactMaterialData* getData() const;
431 
432  public:
434  agx::Bool& isExplicit();
436  agx::Bool const& isExplicit() const;
437 
439  agx::Physics::MaterialPtr& material1();
441  agx::Physics::MaterialPtr const& material1() const;
442 
444  agx::Physics::MaterialPtr& material2();
446  agx::Physics::MaterialPtr const& material2() const;
447 
449  agx::Vec3& restitution();
451  agx::Vec3 const& restitution() const;
452 
454  agx::Vec3& friction();
456  agx::Vec3 const& friction() const;
457 
459  agx::Real& adhesion();
461  agx::Real const& adhesion() const;
462 
464  agx::Real& adhesiveOverlap();
466  agx::Real const& adhesiveOverlap() const;
467 
469  agx::Vec3& viscosity();
471  agx::Vec3 const& viscosity() const;
472 
474  agx::Bool& surfaceFrictionEnabled();
476  agx::Bool const& surfaceFrictionEnabled() const;
477 
479  agx::UInt8& contactReductionMode();
481  agx::UInt8 const& contactReductionMode() const;
482 
484  agx::UInt8& contactReductionBinResolution();
486  agx::UInt8 const& contactReductionBinResolution() const;
487 
489  agx::Bool& useContactAreaApproach();
491  agx::Bool const& useContactAreaApproach() const;
492 
494  agx::Vec3& wireFriction();
496  agx::Vec3 const& wireFriction() const;
497 
499  agx::Real& youngsModulus();
501  agx::Real const& youngsModulus() const;
502 
504  agx::Real& damping();
506  agx::Real const& damping() const;
507 
509  agx::Real& minElasticRestLength();
511  agx::Real const& minElasticRestLength() const;
512 
514  agx::Real& maxElasticRestLength();
516  agx::Real const& maxElasticRestLength() const;
517 
519  agx::Real& impactCompliance();
521  agx::Real const& impactCompliance() const;
522 
524  agx::Real& rollingResistanceCoefficient();
526  agx::Real const& rollingResistanceCoefficient() const;
527 
529  agx::Real& twistingResistanceCoefficient();
531  agx::Real const& twistingResistanceCoefficient() const;
532 
534  agx::Real& rollingResistanceCompliance();
536  agx::Real const& rollingResistanceCompliance() const;
537 
539  agx::Real& twistingResistanceCompliance();
541  agx::Real const& twistingResistanceCompliance() const;
542 
544  agx::ContactMaterial*& model();
546  agx::ContactMaterial* const& model() const;
547 
548  };
550 
551 
552 
555 
556 
557 
559  /* Implementation */
560  //-----------------------------------------------------------------------------------------------------
561  //-----------------------------------------------------------------------------------------------------
562  inline ContactMaterialInstance agx::Physics::ContactMaterialData::operator[] (size_t index) { return ContactMaterialInstance(this, (agx::Index)index); }
563  //-----------------------------------------------------------------------------------------------------
567  {
569  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
571  }
572 
574  {
575  agxAssertN(!instance || instance.isInstanceOf(ContactMaterialModel::instance()),
576  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
578  }
579 
581  {
584  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
586  return *this;
587  }
588 
590  {
592  agxAssertN(!instance || instance.isInstanceOf(ContactMaterialModel::instance()),
593  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
595  return *this;
596  }
597 
598  inline ContactMaterialInstance ContactMaterialPtr::instance() { return agxData::EntityPtr::instance(); }
599  inline const ContactMaterialInstance ContactMaterialPtr::instance() const { return agxData::EntityPtr::instance(); }
600  AGX_FORCE_INLINE ContactMaterialSemantics* ContactMaterialPtr::operator->() { return (ContactMaterialSemantics* )this; }
601  AGX_FORCE_INLINE const ContactMaterialSemantics* ContactMaterialPtr::operator->() const { return (const ContactMaterialSemantics* )this; }
602  AGX_FORCE_INLINE ContactMaterialData* ContactMaterialPtr::getData() { return static_cast<ContactMaterialData* >(agxData::EntityPtr::getData()); }
603  AGX_FORCE_INLINE const ContactMaterialData* ContactMaterialPtr::getData() const { return static_cast<const ContactMaterialData* >(agxData::EntityPtr::getData()); }
604 
605  AGX_FORCE_INLINE agx::Bool& ContactMaterialPtr::isExplicit() { verifyIndex(); return getData()->isExplicit[calculateIndex()]; }
606  AGX_FORCE_INLINE agx::Bool const& ContactMaterialPtr::isExplicit() const { verifyIndex(); return getData()->isExplicit[calculateIndex()]; }
607 
608  AGX_FORCE_INLINE agx::Physics::MaterialPtr& ContactMaterialPtr::material1() { verifyIndex(); return getData()->material1[calculateIndex()]; }
609  AGX_FORCE_INLINE agx::Physics::MaterialPtr const& ContactMaterialPtr::material1() const { verifyIndex(); return getData()->material1[calculateIndex()]; }
610 
611  AGX_FORCE_INLINE agx::Physics::MaterialPtr& ContactMaterialPtr::material2() { verifyIndex(); return getData()->material2[calculateIndex()]; }
612  AGX_FORCE_INLINE agx::Physics::MaterialPtr const& ContactMaterialPtr::material2() const { verifyIndex(); return getData()->material2[calculateIndex()]; }
613 
614  AGX_FORCE_INLINE agx::Vec3& ContactMaterialPtr::restitution() { verifyIndex(); return getData()->restitution[calculateIndex()]; }
615  AGX_FORCE_INLINE agx::Vec3 const& ContactMaterialPtr::restitution() const { verifyIndex(); return getData()->restitution[calculateIndex()]; }
616 
617  AGX_FORCE_INLINE agx::Vec3& ContactMaterialPtr::friction() { verifyIndex(); return getData()->friction[calculateIndex()]; }
618  AGX_FORCE_INLINE agx::Vec3 const& ContactMaterialPtr::friction() const { verifyIndex(); return getData()->friction[calculateIndex()]; }
619 
620  AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::adhesion() { verifyIndex(); return getData()->adhesion[calculateIndex()]; }
621  AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::adhesion() const { verifyIndex(); return getData()->adhesion[calculateIndex()]; }
622 
623  AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::adhesiveOverlap() { verifyIndex(); return getData()->adhesiveOverlap[calculateIndex()]; }
624  AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::adhesiveOverlap() const { verifyIndex(); return getData()->adhesiveOverlap[calculateIndex()]; }
625 
626  AGX_FORCE_INLINE agx::Vec3& ContactMaterialPtr::viscosity() { verifyIndex(); return getData()->viscosity[calculateIndex()]; }
627  AGX_FORCE_INLINE agx::Vec3 const& ContactMaterialPtr::viscosity() const { verifyIndex(); return getData()->viscosity[calculateIndex()]; }
628 
629  AGX_FORCE_INLINE agx::Bool& ContactMaterialPtr::surfaceFrictionEnabled() { verifyIndex(); return getData()->surfaceFrictionEnabled[calculateIndex()]; }
630  AGX_FORCE_INLINE agx::Bool const& ContactMaterialPtr::surfaceFrictionEnabled() const { verifyIndex(); return getData()->surfaceFrictionEnabled[calculateIndex()]; }
631 
632  AGX_FORCE_INLINE agx::UInt8& ContactMaterialPtr::contactReductionMode() { verifyIndex(); return getData()->contactReductionMode[calculateIndex()]; }
633  AGX_FORCE_INLINE agx::UInt8 const& ContactMaterialPtr::contactReductionMode() const { verifyIndex(); return getData()->contactReductionMode[calculateIndex()]; }
634 
635  AGX_FORCE_INLINE agx::UInt8& ContactMaterialPtr::contactReductionBinResolution() { verifyIndex(); return getData()->contactReductionBinResolution[calculateIndex()]; }
636  AGX_FORCE_INLINE agx::UInt8 const& ContactMaterialPtr::contactReductionBinResolution() const { verifyIndex(); return getData()->contactReductionBinResolution[calculateIndex()]; }
637 
638  AGX_FORCE_INLINE agx::Bool& ContactMaterialPtr::useContactAreaApproach() { verifyIndex(); return getData()->useContactAreaApproach[calculateIndex()]; }
639  AGX_FORCE_INLINE agx::Bool const& ContactMaterialPtr::useContactAreaApproach() const { verifyIndex(); return getData()->useContactAreaApproach[calculateIndex()]; }
640 
641  AGX_FORCE_INLINE agx::Vec3& ContactMaterialPtr::wireFriction() { verifyIndex(); return getData()->wireFriction[calculateIndex()]; }
642  AGX_FORCE_INLINE agx::Vec3 const& ContactMaterialPtr::wireFriction() const { verifyIndex(); return getData()->wireFriction[calculateIndex()]; }
643 
644  AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::youngsModulus() { verifyIndex(); return getData()->youngsModulus[calculateIndex()]; }
645  AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::youngsModulus() const { verifyIndex(); return getData()->youngsModulus[calculateIndex()]; }
646 
647  AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::damping() { verifyIndex(); return getData()->damping[calculateIndex()]; }
648  AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::damping() const { verifyIndex(); return getData()->damping[calculateIndex()]; }
649 
650  AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::minElasticRestLength() { verifyIndex(); return getData()->minElasticRestLength[calculateIndex()]; }
651  AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::minElasticRestLength() const { verifyIndex(); return getData()->minElasticRestLength[calculateIndex()]; }
652 
653  AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::maxElasticRestLength() { verifyIndex(); return getData()->maxElasticRestLength[calculateIndex()]; }
654  AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::maxElasticRestLength() const { verifyIndex(); return getData()->maxElasticRestLength[calculateIndex()]; }
655 
656  AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::impactCompliance() { verifyIndex(); return getData()->impactCompliance[calculateIndex()]; }
657  AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::impactCompliance() const { verifyIndex(); return getData()->impactCompliance[calculateIndex()]; }
658 
659  AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::rollingResistanceCoefficient() { verifyIndex(); return getData()->rollingResistanceCoefficient[calculateIndex()]; }
660  AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::rollingResistanceCoefficient() const { verifyIndex(); return getData()->rollingResistanceCoefficient[calculateIndex()]; }
661 
662  AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::twistingResistanceCoefficient() { verifyIndex(); return getData()->twistingResistanceCoefficient[calculateIndex()]; }
663  AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::twistingResistanceCoefficient() const { verifyIndex(); return getData()->twistingResistanceCoefficient[calculateIndex()]; }
664 
665  AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::rollingResistanceCompliance() { verifyIndex(); return getData()->rollingResistanceCompliance[calculateIndex()]; }
666  AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::rollingResistanceCompliance() const { verifyIndex(); return getData()->rollingResistanceCompliance[calculateIndex()]; }
667 
668  AGX_FORCE_INLINE agx::Real& ContactMaterialPtr::twistingResistanceCompliance() { verifyIndex(); return getData()->twistingResistanceCompliance[calculateIndex()]; }
669  AGX_FORCE_INLINE agx::Real const& ContactMaterialPtr::twistingResistanceCompliance() const { verifyIndex(); return getData()->twistingResistanceCompliance[calculateIndex()]; }
670 
671  AGX_FORCE_INLINE agx::ContactMaterial*& ContactMaterialPtr::model() { verifyIndex(); return getData()->model[calculateIndex()]; }
672  AGX_FORCE_INLINE agx::ContactMaterial* const& ContactMaterialPtr::model() const { verifyIndex(); return getData()->model[calculateIndex()]; }
673 
674  //-----------------------------------------------------------------------------------------------------
675  AGX_FORCE_INLINE ContactMaterialInstance::ContactMaterialInstance() {}
676  AGX_FORCE_INLINE ContactMaterialInstance::ContactMaterialInstance(ContactMaterialData* data, agx::Index index) : agx::ReferencedInstance(data, index) {}
677  AGX_FORCE_INLINE ContactMaterialInstance::ContactMaterialInstance(agxData::EntityStorage* storage, agx::Index index) : agx::ReferencedInstance(storage, index) {}
678  AGX_FORCE_INLINE ContactMaterialInstance::ContactMaterialInstance(const agxData::EntityInstance& other) : agx::ReferencedInstance(other)
679  {
681  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
683  }
684 
685  AGX_FORCE_INLINE ContactMaterialInstance::ContactMaterialInstance(const agxData::EntityPtr& ptr) : agx::ReferencedInstance(ptr)
686  {
688  "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
690  }
691 
692 
693  AGX_FORCE_INLINE ContactMaterialData* ContactMaterialInstance::getData() { return static_cast<ContactMaterialData* >(agxData::EntityInstance::getData()); }
694  AGX_FORCE_INLINE const ContactMaterialData* ContactMaterialInstance::getData() const { return static_cast<const ContactMaterialData* >(agxData::EntityInstance::getData()); }
695 
696  AGX_FORCE_INLINE agx::Bool& ContactMaterialInstance::isExplicit() { verifyIndex(); return getData()->isExplicit[getIndex()]; }
697  AGX_FORCE_INLINE agx::Bool const& ContactMaterialInstance::isExplicit() const { verifyIndex(); return getData()->isExplicit[getIndex()]; }
698 
699  AGX_FORCE_INLINE agx::Physics::MaterialPtr& ContactMaterialInstance::material1() { verifyIndex(); return getData()->material1[getIndex()]; }
700  AGX_FORCE_INLINE agx::Physics::MaterialPtr const& ContactMaterialInstance::material1() const { verifyIndex(); return getData()->material1[getIndex()]; }
701 
702  AGX_FORCE_INLINE agx::Physics::MaterialPtr& ContactMaterialInstance::material2() { verifyIndex(); return getData()->material2[getIndex()]; }
703  AGX_FORCE_INLINE agx::Physics::MaterialPtr const& ContactMaterialInstance::material2() const { verifyIndex(); return getData()->material2[getIndex()]; }
704 
705  AGX_FORCE_INLINE agx::Vec3& ContactMaterialInstance::restitution() { verifyIndex(); return getData()->restitution[getIndex()]; }
706  AGX_FORCE_INLINE agx::Vec3 const& ContactMaterialInstance::restitution() const { verifyIndex(); return getData()->restitution[getIndex()]; }
707 
708  AGX_FORCE_INLINE agx::Vec3& ContactMaterialInstance::friction() { verifyIndex(); return getData()->friction[getIndex()]; }
709  AGX_FORCE_INLINE agx::Vec3 const& ContactMaterialInstance::friction() const { verifyIndex(); return getData()->friction[getIndex()]; }
710 
711  AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::adhesion() { verifyIndex(); return getData()->adhesion[getIndex()]; }
712  AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::adhesion() const { verifyIndex(); return getData()->adhesion[getIndex()]; }
713 
714  AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::adhesiveOverlap() { verifyIndex(); return getData()->adhesiveOverlap[getIndex()]; }
715  AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::adhesiveOverlap() const { verifyIndex(); return getData()->adhesiveOverlap[getIndex()]; }
716 
717  AGX_FORCE_INLINE agx::Vec3& ContactMaterialInstance::viscosity() { verifyIndex(); return getData()->viscosity[getIndex()]; }
718  AGX_FORCE_INLINE agx::Vec3 const& ContactMaterialInstance::viscosity() const { verifyIndex(); return getData()->viscosity[getIndex()]; }
719 
720  AGX_FORCE_INLINE agx::Bool& ContactMaterialInstance::surfaceFrictionEnabled() { verifyIndex(); return getData()->surfaceFrictionEnabled[getIndex()]; }
721  AGX_FORCE_INLINE agx::Bool const& ContactMaterialInstance::surfaceFrictionEnabled() const { verifyIndex(); return getData()->surfaceFrictionEnabled[getIndex()]; }
722 
723  AGX_FORCE_INLINE agx::UInt8& ContactMaterialInstance::contactReductionMode() { verifyIndex(); return getData()->contactReductionMode[getIndex()]; }
724  AGX_FORCE_INLINE agx::UInt8 const& ContactMaterialInstance::contactReductionMode() const { verifyIndex(); return getData()->contactReductionMode[getIndex()]; }
725 
726  AGX_FORCE_INLINE agx::UInt8& ContactMaterialInstance::contactReductionBinResolution() { verifyIndex(); return getData()->contactReductionBinResolution[getIndex()]; }
727  AGX_FORCE_INLINE agx::UInt8 const& ContactMaterialInstance::contactReductionBinResolution() const { verifyIndex(); return getData()->contactReductionBinResolution[getIndex()]; }
728 
729  AGX_FORCE_INLINE agx::Bool& ContactMaterialInstance::useContactAreaApproach() { verifyIndex(); return getData()->useContactAreaApproach[getIndex()]; }
730  AGX_FORCE_INLINE agx::Bool const& ContactMaterialInstance::useContactAreaApproach() const { verifyIndex(); return getData()->useContactAreaApproach[getIndex()]; }
731 
732  AGX_FORCE_INLINE agx::Vec3& ContactMaterialInstance::wireFriction() { verifyIndex(); return getData()->wireFriction[getIndex()]; }
733  AGX_FORCE_INLINE agx::Vec3 const& ContactMaterialInstance::wireFriction() const { verifyIndex(); return getData()->wireFriction[getIndex()]; }
734 
735  AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::youngsModulus() { verifyIndex(); return getData()->youngsModulus[getIndex()]; }
736  AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::youngsModulus() const { verifyIndex(); return getData()->youngsModulus[getIndex()]; }
737 
738  AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::damping() { verifyIndex(); return getData()->damping[getIndex()]; }
739  AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::damping() const { verifyIndex(); return getData()->damping[getIndex()]; }
740 
741  AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::minElasticRestLength() { verifyIndex(); return getData()->minElasticRestLength[getIndex()]; }
742  AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::minElasticRestLength() const { verifyIndex(); return getData()->minElasticRestLength[getIndex()]; }
743 
744  AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::maxElasticRestLength() { verifyIndex(); return getData()->maxElasticRestLength[getIndex()]; }
745  AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::maxElasticRestLength() const { verifyIndex(); return getData()->maxElasticRestLength[getIndex()]; }
746 
747  AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::impactCompliance() { verifyIndex(); return getData()->impactCompliance[getIndex()]; }
748  AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::impactCompliance() const { verifyIndex(); return getData()->impactCompliance[getIndex()]; }
749 
750  AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::rollingResistanceCoefficient() { verifyIndex(); return getData()->rollingResistanceCoefficient[getIndex()]; }
751  AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::rollingResistanceCoefficient() const { verifyIndex(); return getData()->rollingResistanceCoefficient[getIndex()]; }
752 
753  AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::twistingResistanceCoefficient() { verifyIndex(); return getData()->twistingResistanceCoefficient[getIndex()]; }
754  AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::twistingResistanceCoefficient() const { verifyIndex(); return getData()->twistingResistanceCoefficient[getIndex()]; }
755 
756  AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::rollingResistanceCompliance() { verifyIndex(); return getData()->rollingResistanceCompliance[getIndex()]; }
757  AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::rollingResistanceCompliance() const { verifyIndex(); return getData()->rollingResistanceCompliance[getIndex()]; }
758 
759  AGX_FORCE_INLINE agx::Real& ContactMaterialInstance::twistingResistanceCompliance() { verifyIndex(); return getData()->twistingResistanceCompliance[getIndex()]; }
760  AGX_FORCE_INLINE agx::Real const& ContactMaterialInstance::twistingResistanceCompliance() const { verifyIndex(); return getData()->twistingResistanceCompliance[getIndex()]; }
761 
762  AGX_FORCE_INLINE agx::ContactMaterial*& ContactMaterialInstance::model() { verifyIndex(); return getData()->model[getIndex()]; }
763  AGX_FORCE_INLINE agx::ContactMaterial* const& ContactMaterialInstance::model() const { verifyIndex(); return getData()->model[getIndex()]; }
764 
765  //-----------------------------------------------------------------------------------------------------
766  AGX_FORCE_INLINE ContactMaterialSemantics::ContactMaterialSemantics() {}
767  //-----------------------------------------------------------------------------------------------------
769  }
770 }
771 
772 AGX_TYPE_BINDING(agx::Physics::ContactMaterialPtr, "Physics.ContactMaterialPtr")
773 AGX_TYPE_BINDING(agx::Physics::ContactMaterialInstance, "Physics.ContactMaterialInstance")
774 
775 #ifdef _MSC_VER
776 # pragma warning(pop)
777 #endif
778 
779 #undef AGX_ENTITY_WRAPPER
780 #undef AGX_ENTITY_NAMESPACE
781 #endif
782 
This class store the combine material properties between two agx::Material&#39;s.
Definition: Material.h:515
static ContactMaterialModel * instance()
static agxData::ScalarAttributeT< agx::Bool > * surfaceFrictionEnabledAttribute
AGXPHYSICS_EXPORT agx::Bool & useContactAreaApproach()
agxData::EntityData * getData()
AGXPHYSICS_EXPORT agx::Real & twistingResistanceCoefficient()
AGXPHYSICS_EXPORT ContactMaterialSemantics * operator->()
static agxData::ScalarAttributeT< agx::Real > * maxElasticRestLengthAttribute
agxData::EntityInstance instance()
Definition: EntityPtr.h:269
AGXPHYSICS_EXPORT agx::Real & minElasticRestLength()
AGXPHYSICS_EXPORT agx::Real & twistingResistanceCompliance()
bool Bool
Definition: Integer.h:48
Data storage for a collection of entity instances of a specified EntityModel.
Definition: EntityStorage.h:72
static agxData::ScalarAttributeT< agx::Real > * youngsModulusAttribute
Pointer to a entity instance of type Physics.Material.
#define agxAssertN(expr, format,...)
Definition: debug.h:145
agxData::EntityData * getData()
agx::String fullPath() const
AGXPHYSICS_EXPORT agx::Real & maxElasticRestLength()
#define AGX_TYPE_BINDING(_Type, _Name)
Definition: Type.h:179
AGXPHYSICS_EXPORT ContactMaterialPtr()
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())
Definition: Object.h:363
static agxData::ScalarAttributeT< agx::Bool > * isExplicitAttribute
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr & material2()
uint8_t UInt8
Definition: Integer.h:38
#define AGXPHYSICS_EXPORT
agxData::EntityRef< ContactMaterialPtr > ContactMaterialRef
Entity instance provides access to a single instance in an EntityStorage.
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
Definition: EntityPtr.h:51
static agxData::ScalarAttributeT< agx::Real > * impactComplianceAttribute
AGXPHYSICS_EXPORT agx::Real & adhesiveOverlap()
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
bool isInstanceOf(agxData::EntityModel *model) const
AGXPHYSICS_EXPORT agx::Bool & isExplicit()
#define AGX_FORCE_INLINE
Definition: Object.h:59
static agxData::ScalarAttributeT< agx::UInt8 > * contactReductionBinResolutionAttribute
AGXPHYSICS_EXPORT agx::Real & impactCompliance()
static agxData::ScalarAttributeT< agx::Real > * minElasticRestLengthAttribute
Type-specific Array used for fast access into the data held by a Buffer.
Definition: agxData.h:30
static agxData::ScalarAttributeT< agx::UInt8 > * contactReductionModeAttribute
AGXPHYSICS_EXPORT agx::ContactMaterial *& model()
AGXPHYSICS_EXPORT agx::Physics::MaterialPtr & material1()
static agxData::ScalarAttributeT< agx::Real > * twistingResistanceComplianceAttribute
static agxData::PointerAttributeT< agx::ContactMaterial * > * modelAttribute
AGXPHYSICS_EXPORT agx::UInt8 & contactReductionBinResolution()
static agxData::ScalarAttributeT< agx::Vec3 > * viscosityAttribute
Vector containing &#39;raw&#39; data.
Definition: Vector.h:245
EntityPtr & operator=(const EntityPtr &other)=default
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
AGXPHYSICS_EXPORT agx::Real & rollingResistanceCompliance()
static agxData::ScalarAttributeT< agx::Vec3 > * restitutionAttribute
Contains classes for low level data storage for AGX.
Definition: Container.h:23
UInt32 Index
Definition: Integer.h:52
AGXPHYSICS_EXPORT agx::Real & youngsModulus()
ContactMaterialData * getData()
Abstract description of the data attributes for the Physics.ContactMaterial entity.
static agxData::ScalarAttributeT< agx::Real > * adhesionAttribute
AGXPHYSICS_EXPORT agx::Bool & surfaceFrictionEnabled()
AGXPHYSICS_EXPORT agx::Vec3 & viscosity()
#define CALLABLE
Definition: Object.h:73
AGXPHYSICS_EXPORT agx::Vec3 & friction()
Abstract description of the data attributes for the Referenced entity.
AGXFMI_EXPORT InputVariable_Real * setDamping(agx::Constraint *constraint)
bool isInstanceOf(agxData::EntityModel *model) const
AGXPHYSICS_EXPORT ContactMaterialPtr & operator=(const agxData::EntityPtr &ptr)
static agxData::ScalarAttributeT< agx::Real > * rollingResistanceCoefficientAttribute
Pointer to a entity instance of type Referenced.
static agxData::ScalarAttributeT< agx::Real > * rollingResistanceComplianceAttribute
static agxData::ScalarAttributeT< agx::Real > * adhesiveOverlapAttribute
double Real
Definition: Real.h:42
static agxData::ScalarAttributeT< agx::Vec3 > * frictionAttribute
AGXPHYSICS_EXPORT agx::UInt8 & contactReductionMode()
AGXPHYSICS_EXPORT agx::Vec3 & wireFriction()
static agxData::ScalarAttributeT< agx::Bool > * useContactAreaApproachAttribute
static agxData::ScalarAttributeT< agx::Vec3 > * wireFrictionAttribute
AGXPHYSICS_EXPORT agx::Vec3 & restitution()
AGXPHYSICS_EXPORT agx::Real & rollingResistanceCoefficient()
AGXPHYSICS_EXPORT ContactMaterialInstance instance()
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
AGXPHYSICS_EXPORT agx::Real & adhesion()
static agxData::ScalarAttributeT< agx::Physics::MaterialPtr > * material2Attribute
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97
static agxData::ScalarAttributeT< agx::Real > * dampingAttribute
Pointer to a entity instance of type Physics.ContactMaterial.
static agxData::ScalarAttributeT< agx::Physics::MaterialPtr > * material1Attribute
AGXPHYSICS_EXPORT agx::Real & damping()
static agxData::ScalarAttributeT< agx::Real > * twistingResistanceCoefficientAttribute