VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
visutwin::canvas::Curve Class Reference

#include <core/math/curve.h>

Public Member Functions

std::pair< float, float > add (float time, float value)
Curve clone () const
std::pair< float, float > closest (float time) const
 Curve ()
 Curve (const Curve &other)
 Curve (const std::vector< float > &data)
 Curve (Curve &&other) noexcept
std::pair< float, float > get (size_t index) const
size_t length () const
Curveoperator= (const Curve &other)
Curveoperator= (Curve &&other) noexcept
std::vector< float > quantize (size_t precision)
std::vector< float > quantizeClamped (size_t precision, float min, float max)
void sort ()
float value (float time)
 ~Curve ()

Public Attributes

std::vector< std::pair< float, float > > keys
float tension = 0.5f
CurveType type = CURVE_SMOOTHSTEP

Detailed Description

Definition at line 24 of file curve.h.

Constructor & Destructor Documentation

◆ Curve() [1/4]

visutwin::canvas::Curve::Curve ( )

Definition at line 13 of file curve.cpp.

Referenced by clone(), Curve(), Curve(), operator=(), and operator=().

◆ Curve() [2/4]

visutwin::canvas::Curve::Curve ( const std::vector< float > & data)
explicit

Definition at line 17 of file curve.cpp.

References keys, and sort().

◆ Curve() [3/4]

visutwin::canvas::Curve::Curve ( const Curve & other)

Definition at line 26 of file curve.cpp.

References Curve(), keys, tension, and type.

◆ Curve() [4/4]

visutwin::canvas::Curve::Curve ( Curve && other)
noexcept

Definition at line 44 of file curve.cpp.

References Curve(), keys, tension, and type.

◆ ~Curve()

visutwin::canvas::Curve::~Curve ( )
default

Member Function Documentation

◆ add()

std::pair< float, float > visutwin::canvas::Curve::add ( float time,
float value )

Definition at line 64 of file curve.cpp.

References keys, and value().

◆ clone()

Curve visutwin::canvas::Curve::clone ( ) const
nodiscard

Definition at line 120 of file curve.cpp.

References Curve(), keys, tension, and type.

◆ closest()

std::pair< float, float > visutwin::canvas::Curve::closest ( float time) const
nodiscard

Definition at line 97 of file curve.cpp.

References keys.

◆ get()

std::pair< float, float > visutwin::canvas::Curve::get ( size_t index) const

Definition at line 80 of file curve.cpp.

References keys.

◆ length()

size_t visutwin::canvas::Curve::length ( ) const
inlinenodiscard

Definition at line 39 of file curve.h.

References keys.

◆ operator=() [1/2]

Curve & visutwin::canvas::Curve::operator= ( const Curve & other)

Definition at line 31 of file curve.cpp.

References Curve(), keys, tension, and type.

◆ operator=() [2/2]

Curve & visutwin::canvas::Curve::operator= ( Curve && other)
noexcept

Definition at line 49 of file curve.cpp.

References Curve(), keys, tension, and type.

◆ quantize()

std::vector< float > visutwin::canvas::Curve::quantize ( size_t precision)
nodiscard

Definition at line 129 of file curve.cpp.

Referenced by quantizeClamped().

◆ quantizeClamped()

std::vector< float > visutwin::canvas::Curve::quantizeClamped ( size_t precision,
float min,
float max )
nodiscard

Definition at line 144 of file curve.cpp.

References quantize().

◆ sort()

void visutwin::canvas::Curve::sort ( )

Definition at line 85 of file curve.cpp.

References keys.

Referenced by Curve().

◆ value()

float visutwin::canvas::Curve::value ( float time)
nodiscard

Definition at line 92 of file curve.cpp.

Referenced by add().

Member Data Documentation

◆ keys

std::vector<std::pair<float, float> > visutwin::canvas::Curve::keys

Definition at line 27 of file curve.h.

Referenced by add(), clone(), closest(), Curve(), Curve(), Curve(), get(), length(), operator=(), operator=(), and sort().

◆ tension

float visutwin::canvas::Curve::tension = 0.5f

Definition at line 29 of file curve.h.

Referenced by clone(), Curve(), Curve(), operator=(), and operator=().

◆ type

CurveType visutwin::canvas::Curve::type = CURVE_SMOOTHSTEP

Definition at line 28 of file curve.h.

Referenced by clone(), Curve(), Curve(), operator=(), and operator=().


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