AGX Dynamics  2.37.3.2
BeamModel.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 having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 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 
17 #pragma once
18 
21 
22 #include <agxCollide/Geometry.h>
23 
24 namespace agxModel
25 {
33 
65  {
66  public:
73  void setProperties( BeamModelProperties* properties );
74 
78  BeamModelProperties* getProperties() const;
79 
89  BeamStiffnessDamping calculateStiffnessDamping( agx::UInt numBeamSegments,
90  agx::Real beamSegmentLength ) const;
91 
107  void setMomentOfInertiaScale( agx::Vec3 momentOfInertiaScale );
108 
112  agx::Vec3 getMomentOfInertiaScale() const;
113 
119  void setPolarMomentOfInertiaScale( agx::Real polarMomentOfInertiaScale );
120 
124  agx::Real getPolarMomentOfInertiaScale() const;
125 
126  public:
136  virtual agx::Vec3 getMomentOfInertia() const final;
137 
146  virtual agx::Vec3 calculateMomentOfInertia() const = 0;
147 
152  virtual agx::Real getCrossSectionArea() const = 0;
153 
158  virtual agx::Vec2 getMaxHeightWidth() const = 0;
159 
169  virtual agxCollide::GeometryRef getSegmentGeometry( agx::Real segmentLength ) const = 0;
170 
177  virtual agx::String validate() const = 0;
178 
179 
184  bool loadLibraryProperties(const agx::String& name);
185 
186 
191  static agx::StringVector getAvailableLibraryProperties();
192 
193 
194 
195  public:
197 
199 
200  virtual void store( agxStream::OutputArchive& out ) const override;
201  virtual void restore( agxStream::InputArchive& in ) override;
202 
203  protected:
204  BeamModel();
205  BeamModel( const BeamModel& ) = delete;
206  BeamModel( BeamModelProperties* properties );
207  virtual ~BeamModel();
208 
210 
211  private:
212  BeamModelPropertiesRef m_properties;
213  agx::Vec3 m_momentOfInertiaScale;
214  };
215 
242  {
243  public:
254  IBeam( agx::Real width,
255  agx::Real height,
256  agx::Real flangeThickness,
257  agx::Real webThickness,
258  BeamModelProperties* properties = nullptr );
259 
263  agx::Real getWidth() const;
264 
268  agx::Real getHeight() const;
269 
273  agx::Real getFlangeThickness() const;
274 
278  agx::Real getWebThickness() const;
279 
283  agx::Real getWebHeight() const;
284 
285  public:
287 
289 
297  virtual agx::Vec3 calculateMomentOfInertia() const override;
298 
302  virtual agx::Real getCrossSectionArea() const override;
303 
307  virtual agx::Vec2 getMaxHeightWidth() const override;
308 
312  virtual agxCollide::GeometryRef getSegmentGeometry( agx::Real segmentLength ) const override;
313 
320  virtual agx::String validate() const override;
321 
322  protected:
323  IBeam();
324  virtual ~IBeam();
325 
327 
328  private:
329  agx::Real m_width;
330  agx::Real m_height;
331  agx::Real m_flangeThickness;
332  agx::Real m_webThickness;
333  };
334 
358  {
359  public:
368  RectangularBeam( agx::Real width, agx::Real height, BeamModelProperties* properties = nullptr );
369 
373  agx::Real getWidth() const;
374 
378  agx::Real getHeight() const;
379 
380  public:
382 
384 
394  virtual agx::Vec3 calculateMomentOfInertia() const override;
395 
399  virtual agx::Real getCrossSectionArea() const override;
400 
404  virtual agx::Vec2 getMaxHeightWidth() const override;
405 
410  virtual agxCollide::GeometryRef getSegmentGeometry( agx::Real segmentLength ) const override;
411 
416  virtual agx::String validate() const override;
417 
418  protected:
419  RectangularBeam();
420  virtual ~RectangularBeam();
421 
423 
424  private:
425  agx::Real m_width;
426  agx::Real m_height;
427  };
428 
446  {
447  public:
455  CircularBeam( agx::Real radius, BeamModelProperties* properties = nullptr );
456 
460  agx::Real getRadius() const;
461 
462  public:
464 
466 
474  virtual agx::Vec3 calculateMomentOfInertia() const override;
475 
479  virtual agx::Real getCrossSectionArea() const override;
480 
484  virtual agx::Vec2 getMaxHeightWidth() const override;
485 
489  virtual agxCollide::GeometryRef getSegmentGeometry( agx::Real segmentLength ) const override;
490 
494  virtual agx::String validate() const override;
495 
496  protected:
497  CircularBeam();
498  virtual ~CircularBeam();
499 
501 
502  private:
503  agx::Real m_radius;
504  };
505 
530  {
531  public:
544  agx::Real height,
545  agx::Real thickness,
546  BeamModelProperties* properties = nullptr );
547 
551  agx::Real getWidth() const;
552 
556  agx::Real getHollowWidth() const;
557 
561  agx::Real getHeight() const;
562 
566  agx::Real getHollowHeight() const;
567 
571  agx::Real getThickness() const;
572 
573  public:
575 
577 
585  virtual agx::Vec3 calculateMomentOfInertia() const override;
586 
590  virtual agx::Real getCrossSectionArea() const override;
591 
595  virtual agx::Vec2 getMaxHeightWidth() const override;
596 
600  virtual agxCollide::GeometryRef getSegmentGeometry( agx::Real segmentLength ) const override;
601 
607  virtual agx::String validate() const override;
608 
609  protected:
611  virtual ~HollowRectangularBeam();
612 
614 
615  private:
616  agx::Real m_width;
617  agx::Real m_height;
618  agx::Real m_thickness;
619  };
620 
625  {
626  public:
636  agx::Real thickness,
637  BeamModelProperties* properties = nullptr );
638 
642  agx::Real getRadius() const;
643 
647  agx::Real getThickness() const;
648 
652  agx::Real getHollowRadius() const;
653 
654  public:
656 
658 
666  virtual agx::Vec3 calculateMomentOfInertia() const override;
667 
671  virtual agx::Real getCrossSectionArea() const override;
672 
676  virtual agx::Vec2 getMaxHeightWidth() const override;
677 
681  virtual agxCollide::GeometryRef getSegmentGeometry( agx::Real segmentLength ) const override;
682 
687  virtual agx::String validate() const override;
688 
689  protected:
691  virtual ~HollowCircularBeam();
692 
694 
695  private:
696  agx::Real m_radius;
697  agx::Real m_thickness;
698  };
699 
705  {
706  public:
711  GenericBeamModel( BeamModelProperties* properties = nullptr );
712 
713  public:
715 
716 
720  virtual agx::Vec3 calculateMomentOfInertia() const override;
721 
726  virtual agx::Real getCrossSectionArea() const override;
727 
732  virtual agx::Vec2 getMaxHeightWidth() const override;
733 
738  virtual agxCollide::GeometryRef getSegmentGeometry( agx::Real segmentLength ) const override;
739 
744  virtual agx::String validate() const override;
745 
746  protected:
747  virtual ~GenericBeamModel();
748 
750  };
751 }
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
Definition: InputArchive.h:400
Stiffness and damping data for constraints related to beam models.
Circular cross section beam model with a given radius.
Definition: BeamModel.h:445
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive...
I-beam model with a given width, height, flange thickness and web thickness.
Definition: BeamModel.h:241
Bulk beam model properties present in all agxModel::BeamModel instances, which in turn propagates the...
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Generic beam model throwing exceptions for non-implemented virtual methods.
Definition: BeamModel.h:704
Rectangular cross section beam model with a given width and height.
Definition: BeamModel.h:357
Base class providing referencing counted objects.
Definition: Referenced.h:119
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:36
Beam model interface requiring moment of inertia (area moment in x, y and polar moment in z)...
Definition: BeamModel.h:64
uint32_t UInt
Definition: Integer.h:34
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:51
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:56
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
Definition: Serializable.h:221
#define AGXMODEL_EXPORT
Hollow rectangular cross section beam model with a given width, height and thickness.
Definition: BeamModel.h:529
double Real
Definition: Real.h:42
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
Hollow circular cross section beam model with a given (outer) radius and thickness.
Definition: BeamModel.h:624
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97