Loading...
Searching...
No Matches
loopParams.h
1//
2// Copyright 2023 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_LOOP_PARAMS_H
9#define PXR_BASE_TS_LOOP_PARAMS_H
10
11#include "pxr/pxr.h"
12#include "pxr/base/ts/api.h"
13#include "pxr/base/ts/types.h"
14
15#include <iosfwd>
16#include <string>
17
18PXR_NAMESPACE_OPEN_SCOPE
19
20class TsLoopParams
21{
22public:
23 TS_API
24 TsLoopParams(
25 bool looping,
26 TsTime start,
27 TsTime period,
28 TsTime preRepeatFrames,
29 TsTime repeatFrames,
30 double valueOffset);
31
32 TS_API
33 TsLoopParams();
34
35 TS_API
36 void SetLooping(bool looping);
37
38 TS_API
39 bool GetLooping() const;
40
41 TS_API
42 double GetStart() const;
43
44 TS_API
45 double GetPeriod() const;
46
47 TS_API
48 double GetPreRepeatFrames() const;
49
50 TS_API
51 double GetRepeatFrames() const;
52
53 TS_API
54 const GfInterval &GetMasterInterval() const;
55
56 TS_API
57 const GfInterval &GetLoopedInterval() const;
58
59 TS_API
60 bool IsValid() const;
61
62 TS_API
63 void SetValueOffset(double valueOffset);
64
65 TS_API
66 double GetValueOffset() const;
67
68 TS_API
69 bool operator==(const TsLoopParams &rhs) const {
70 return _looping == rhs._looping &&
71 _loopedInterval == rhs._loopedInterval &&
72 _masterInterval == rhs._masterInterval &&
73 _valueOffset == rhs._valueOffset;
74 }
75
76 TS_API
77 bool operator!=(const TsLoopParams &rhs) const {
78 return !(*this == rhs);
79 }
80
81private:
82 bool _looping;
83 GfInterval _loopedInterval;
84 GfInterval _masterInterval;
85 double _valueOffset;
86};
87
88TS_API
89std::ostream& operator<<(std::ostream& out, const TsLoopParams& lp);
90
91PXR_NAMESPACE_CLOSE_SCOPE
92
93#endif
A basic mathematical interval class.
Definition: interval.h:33
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].