HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
eval.h
Go to the documentation of this file.
1 //
2 // Copyright 2024 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 
8 #ifndef PXR_BASE_TS_EVAL_H
9 #define PXR_BASE_TS_EVAL_H
10 
11 #include "pxr/pxr.h"
12 #include "pxr/base/ts/api.h"
13 #include "pxr/base/ts/types.h"
14 
15 #include <optional>
16 
18 
19 struct Ts_SplineData;
20 
21 
23 {
27 };
28 
30 {
32  Ts_EvalAtTime, // AtTime is implemented identically to Post,
33  // but the intent of Post is a limit, while AtTime is exact.
35 };
36 
37 
38 // Evaluates a spline's value or derivative at a given time. An empty return
39 // value means there is no value or derivative at all.
40 //
41 TS_API
42 std::optional<double>
43 Ts_Eval(
44  const Ts_SplineData *data,
45  TsTime time,
46  Ts_EvalAspect aspect,
48 
49 // Ts_Breakdown is used for both TsSpline::Breakdown and CanBreakdown. It
50 // inserts (or reports whether it could insert) a knot at \c atTime while trying
51 // to maintain the shape of the curve as much as possible.
52 //
53 // \param data is a pointer to the spline's internal, untyped Ts_SplineData
54 // \param atTime is the time at which to insert a knot
55 // \param testOnly is a flag to test for allowed breakdown without making
56 // any changes.
57 // \param affectedIntervalOut is a pointer to a GfInterval that receives the
58 // time interval in the spline that was modified and, for example,
59 // may need to be redrawn in a GUI.
60 // \param reason is a pointer to a string into which a failure message will
61 // be stored if the breakdown operation fails.
62 //
63 // \return true if the breakdown operation succeeded or for CanBreakdown if the
64 // operation would succeed. Returns false if the operation did or would fail.
65 TS_API
66 bool
68  Ts_SplineData* const data,
69  TsTime atTime,
70  bool testOnly,
71  GfInterval *affectedIntervalOut,
72  std::string* reason);
73 
75 
76 #endif
Ts_EvalLocation
Definition: eval.h:29
TS_API bool Ts_Breakdown(Ts_SplineData *const data, TsTime atTime, bool testOnly, GfInterval *affectedIntervalOut, std::string *reason)
GT_API const UT_StringHolder time
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
Ts_EvalAspect
Definition: eval.h:22
GLint location
Definition: glcorearb.h:805
TS_API std::optional< double > Ts_Eval(const Ts_SplineData *data, TsTime time, Ts_EvalAspect aspect, Ts_EvalLocation location)
#define TS_API
Definition: api.h:24
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: format.h:1821