WPILibC++ 2024.3.2
frc::MechanismRoot2d Class Reference

Root Mechanism2d node. More...

#include <frc/smartdashboard/MechanismRoot2d.h>

Inheritance diagram for frc::MechanismRoot2d:
frc::MechanismObject2d

Public Member Functions

 MechanismRoot2d (std::string_view name, double x, double y, const private_init &)
 
void SetPosition (double x, double y)
 Set the root's position. More...
 
const std::string & GetName () const
 Retrieve the object's name. More...
 
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. More...
 

Friends

class Mechanism2d
 

Detailed Description

Root Mechanism2d node.

A root is the anchor point of other nodes (such as ligaments).

Do not create objects of this class directly! Obtain pointers from the Mechanism2d.GetRoot() factory method.

Append other nodes by using Append().

Constructor & Destructor Documentation

◆ MechanismRoot2d()

frc::MechanismRoot2d::MechanismRoot2d ( std::string_view  name,
double  x,
double  y,
const private_init &   
)

Member Function Documentation

◆ Append()

template<typename T , typename... Args>
requires std::convertible_to<T*, MechanismObject2d*>
T * frc::MechanismObject2d::Append ( std::string_view  name,
Args &&...  args 
)
inline

Append a Mechanism object that is based on this one.

Parameters
namethe name of the new object.
argsconstructor arguments of the object type.
Returns
the constructed and appended object, useful for variable assignments and call chaining.
Exceptions
ifan object with the given name already exists.

◆ GetName()

const std::string & frc::MechanismObject2d::GetName ( ) const

Retrieve the object's name.

Returns
the object's name relative to its parent.

◆ SetPosition()

void frc::MechanismRoot2d::SetPosition ( double  x,
double  y 
)

Set the root's position.

Parameters
xnew x coordinate
ynew y coordinate

Friends And Related Function Documentation

◆ Mechanism2d

friend class Mechanism2d
friend

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