|
AGX Dynamics 2.41.1.2
|
Base class for splines. More...
#include <Spline.h>
Inheritance diagram for agxUtil::Spline:Classes | |
| class | Point |
| Point class for storing 3D point, tension, stretch and curvature. More... | |
| class | Tangent |
| Tangent. More... | |
Public Types | |
| typedef agx::Vector< Point > | PointVector |
| typedef agx::Vector< Tangent > | TangentVector |
Public Member Functions | |
| Spline () | |
| Default constructor. | |
| void | add (const agx::Vec3 &point, agx::Real tension=Point::DEFAULT_TENSION, agx::Real stretch=Point::DEFAULT_STRETCH, agx::Real curvature=Point::DEFAULT_CURVATURE) |
| Add point to the control points given tension (1 max, 0 min) and stretch. | |
| AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agxUtil::Spline) | |
| virtual void | clear () |
| Clears control points and tangents. | |
| virtual Point | evaluate (size_t index, agx::Real t) const =0 |
Interpolate from point with index index a time t forward (0 <= t <= 1) | |
| size_t | getNumPoints () const |
| PointVector & | getPoints () |
| const PointVector & | getPoints () const |
| virtual Tangent | getTangent (size_t, agx::Real) const |
| virtual agx::Real | getTension (size_t index, agx::Real time) const |
| Linear interpolate of tension from point at index. | |
| void | restore (agxStream::InputArchive &in) override |
| void | store (agxStream::OutputArchive &out) const override |
| virtual void | updateTangents ()=0 |
| All control points are added, computes the tangents. | |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. | |
| Referenced (const Referenced &) | |
| template<typename T > | |
| T * | as () |
| Subclass casting. | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. | |
| template<typename T > | |
| const T * | asSafe () const |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
Public Member Functions inherited from agxStream::Serializable | |
| virtual | ~Serializable () |
| Destructor for normal C++ use but hidden from SWIG bindings. | |
| virtual const char * | getClassName () const |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. | |
| virtual StorageAgent * | getStorageAgent () const =0 |
| agx::Uuid | getUuid () const |
| bool | isFinished () const |
| void | setEnableSerialization (bool flag) |
| Set to false to disable serialization of this object. | |
| void | setFinished () |
| Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. | |
Protected Member Functions | |
| virtual | ~Spline () |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Protected Member Functions inherited from agxStream::Serializable | |
| Serializable () | |
| Default constructor. | |
| Serializable (const Serializable &other) | |
| Copy constructor. | |
| void | generateUuid () |
Protected Attributes | |
| PointVector | m_points |
| TangentVector | m_tangents |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Additional Inherited Members | |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Static Public Member Functions inherited from agxStream::Serializable | |
| static void | setEnableUuidGeneration (bool flag) |
| Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. | |
Static Protected Member Functions inherited from agx::Referenced | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
| typedef agx::Vector< Point > agxUtil::Spline::PointVector |
| typedef agx::Vector< Tangent > agxUtil::Spline::TangentVector |
| agxUtil::Spline::Spline | ( | ) |
Default constructor.
|
inlineprotectedvirtual |
| void agxUtil::Spline::add | ( | const agx::Vec3 & | point, |
| agx::Real | tension = Point::DEFAULT_TENSION, |
||
| agx::Real | stretch = Point::DEFAULT_STRETCH, |
||
| agx::Real | curvature = Point::DEFAULT_CURVATURE |
||
| ) |
Add point to the control points given tension (1 max, 0 min) and stretch.
| point | - point to be added |
| tension | - tension at the specified point (clamped between 0 and 1) |
| stretch | - specified stretch at the point |
| curvature | - Specified curvature at the point |
| agxUtil::Spline::AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE | ( | agxUtil::Spline | ) |
|
virtual |
Clears control points and tangents.
Interpolate from point with index index a time t forward (0 <= t <= 1)
Implemented in agxUtil::CubicSpline, agxUtil::CardinalSpline, agxUtil::NonUniformCardinalSpline, agxUtil::ParameterizedCatmullRomSpline, agxUtil::BSpline, agxUtil::CPCatmullRomBSpline, and agxUtil::HermiteSpline.
|
inline |
|
inline |
|
inline |
Reimplemented in agxUtil::CubicSpline, agxUtil::CardinalSpline, agxUtil::NonUniformCardinalSpline, agxUtil::ParameterizedCatmullRomSpline, agxUtil::BSpline, agxUtil::CPCatmullRomBSpline, and agxUtil::HermiteSpline.
Linear interpolate of tension from point at index.
Definition at line 161 of file Spline.h.
References agx::Vector< T, Allocator >::back(), agx::clamp(), agx::equalsZero(), agx::equivalent(), agxUtil::Spline::Point::getTension(), m_points, agx::RealEpsilon, and agx::Container::size().
|
override |
|
override |
|
pure virtual |
All control points are added, computes the tangents.
Implemented in agxUtil::CubicSpline, agxUtil::CardinalSpline, agxUtil::NonUniformCardinalSpline, agxUtil::ParameterizedCatmullRomSpline, agxUtil::BSpline, agxUtil::CPCatmullRomBSpline, and agxUtil::HermiteSpline.
|
protected |
Definition at line 154 of file Spline.h.
Referenced by getTension().
|
protected |