WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::MechanismLigament2d Class Reference

Ligament node on a Mechanism2d. More...

#include <wpi/smartdashboard/MechanismLigament2d.hpp>

Inheritance diagram for wpi::MechanismLigament2d:
wpi::MechanismObject2d

Public Member Functions

 MechanismLigament2d (std::string_view name, double length, wpi::units::degree_t angle, double lineWidth=6, const wpi::util::Color8Bit &color={235, 137, 52})
void SetColor (const wpi::util::Color8Bit &color)
 Set the ligament color.
wpi::util::Color8Bit GetColor ()
 Get the ligament color.
void SetLength (double length)
 Set the ligament's length.
double GetLength ()
 Get the ligament length.
void SetAngle (wpi::units::degree_t angle)
 Set the ligament's angle relative to its parent.
double GetAngle ()
 Get the ligament's angle relative to its parent.
void SetLineWeight (double lineWidth)
 Set the line thickness.
double GetLineWeight ()
 Get the line thickness.
Public Member Functions inherited from wpi::MechanismObject2d
virtual ~MechanismObject2d ()=default
const std::string & GetName () const
 Retrieve the object's name.
template<typename T, typename... Args>
requires std::convertible_to<T*, MechanismObject2d*>
T * Append (std::string_view name, Args &&... args)
 Append a Mechanism object that is based on this one.

Protected Member Functions

void UpdateEntries (std::shared_ptr< wpi::nt::NetworkTable > table) override
 Update all entries with new ones from a new table.
Protected Member Functions inherited from wpi::MechanismObject2d
 MechanismObject2d (std::string_view name)

Additional Inherited Members

Protected Attributes inherited from wpi::MechanismObject2d
wpi::util::mutex m_mutex

Detailed Description

Ligament node on a Mechanism2d.

A ligament can have its length changed (like an elevator) or angle changed, like an arm.

See also
Mechanism2d

Constructor & Destructor Documentation

◆ MechanismLigament2d()

wpi::MechanismLigament2d::MechanismLigament2d ( std::string_view name,
double length,
wpi::units::degree_t angle,
double lineWidth = 6,
const wpi::util::Color8Bit & color = {235, 137, 52} )

Member Function Documentation

◆ GetAngle()

double wpi::MechanismLigament2d::GetAngle ( )

Get the ligament's angle relative to its parent.

Returns
the angle

◆ GetColor()

wpi::util::Color8Bit wpi::MechanismLigament2d::GetColor ( )

Get the ligament color.

Returns
the color of the line

◆ GetLength()

double wpi::MechanismLigament2d::GetLength ( )

Get the ligament length.

Returns
the line length

◆ GetLineWeight()

double wpi::MechanismLigament2d::GetLineWeight ( )

Get the line thickness.

Returns
the line thickness

◆ SetAngle()

void wpi::MechanismLigament2d::SetAngle ( wpi::units::degree_t angle)

Set the ligament's angle relative to its parent.

Parameters
anglethe angle

◆ SetColor()

void wpi::MechanismLigament2d::SetColor ( const wpi::util::Color8Bit & color)

Set the ligament color.

Parameters
colorthe color of the line

◆ SetLength()

void wpi::MechanismLigament2d::SetLength ( double length)

Set the ligament's length.

Parameters
lengththe line length

◆ SetLineWeight()

void wpi::MechanismLigament2d::SetLineWeight ( double lineWidth)

Set the line thickness.

Parameters
lineWidththe line thickness

◆ UpdateEntries()

void wpi::MechanismLigament2d::UpdateEntries ( std::shared_ptr< wpi::nt::NetworkTable > table)
overrideprotectedvirtual

Update all entries with new ones from a new table.

Parameters
tablethe new table.

Implements wpi::MechanismObject2d.


The documentation for this class was generated from the following file: