Class SubhingeBase#

Inheritance Relationships#

Base Type#

Derived Types#

Class Documentation#

class SubhingeBase : public Karana::Dynamics::CoordBase#

Represents the abstract base class for articulation subhinges.

This class is the base class for subhinges from which physical and compound subhinge classes are derived. See Subhinges for more discussion about subhinges.

Subclassed by Karana::Dynamics::CompoundSubhinge, Karana::Dynamics::PhysicalSubhinge

Public Functions

virtual ~SubhingeBase()#

SubhingeBase destructor.

virtual std::string_view typeString(bool brief = true) const noexcept override = 0#

Returns the type string of the object.

Parameters:

brief – if true, return the short form of the class type name, else the full type name

Returns:

The type string.

virtual SubhingeType subhingeType() const = 0#

Helper method to return the subhinge type.

Returns:

the subhinge type

inline virtual void setPrescribed(bool flag)#

Set the prescribed flag for the subhinge.

Parameters:

flag – the enable/disable flag

inline bool getPrescribed() const#

Return the prescribed flag for the subhinge.

Returns:

the prescribed mode status

inline const kc::ks_ptr<HingeBase> &parentHinge() const#

Return the parent hinge for the subhinge.

Returns:

the PhysicalHinge parent hinge

const km::Mat &getRangeLimits() const#

Return the range limits matrix for this subhinge.

A NaN value indicates an undetermined limit, while infinite value implies that the limit is unbounded.

Returns:

the range limits matrix

void setRangeLimits(km::Vec limits, unsigned int offset)#

Set the range limits matrix for a subhinge Q component.

A NaN value indicates an undetermined limit, while infinite value implies that the limit is unbounded.

Parameters:
  • limits – the lower/upper range limits

  • offset – the offset of the Q coordinate that this applies to e.g., 0 means these limits are for the first coordinate of the subhinge

Public Static Functions

static std::string subhingeTypeString(SubhingeType shtype)#

Helper method to return the string name for a SubhingeType subhinge type.

Parameters:

shtype – the subhinge type

Returns:

the subhinge type as a string

Protected Functions

SubhingeBase(std::string_view nm, kc::ks_ptr<HingeBase> hge)#

Constructs a SubhingeBase.

Parameters:
  • nm – the name for the subhinge

  • hge – the parent hinge

Protected Attributes

kc::ks_ptr<HingeBase> _parent_hinge = nullptr#

the parent hinge

bool _prescribed = false#

flag indicating whether the subhinge is prescribed

km::Mat _range_limits#

Matrix of nQx2 size with each row containing the range limits for each Q coordinate value for the subhinge. While joint limit values (for 1 dof physical subhinges) represent limits from the physical system. range limit values are used to track the range of coordinates values that can legally satisfy the loop constraints that the subhinge is involved in. These values are typically computed using the CK solver and stored here for subsequent use.

The limits can vary when constraints come and go, and it is the responsibility of the application to update them if needed.

A NaN value indicates an undetermined limit, while infinite value implies that the limit is unbounded.