Loading...
Searching...
No Matches
tsTest_Museum.h
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_TS_TEST_MUSEUM_H
9#define PXR_BASE_TS_TS_TEST_MUSEUM_H
10
11#include "pxr/pxr.h"
12#include "pxr/base/ts/api.h"
13#include "pxr/base/ts/tsTest_SplineData.h"
14
15#include <vector>
16#include <string>
17
18PXR_NAMESPACE_OPEN_SCOPE
19
20
21// A collection of museum exhibits. These are spline cases that can be used by
22// tests to exercise various behaviors.
23//
24class TsTest_Museum
25{
26public:
27 enum DataId
28 {
29 // Single-segment ordinary curves.
30 TwoKnotBezier,
31 TwoKnotBezierAutoEase,
32 TwoKnotHermite,
33 TwoKnotLinear,
34
35 // Longer splines.
36 FourKnotBezier,
37 FourKnotHermite,
38
39 // Looping cases.
40 SimpleInnerLoop,
41 InnerLoop2and2,
42 InnerLoopPre,
43 InnerLoopPost,
44 ExtrapLoopRepeat,
45 ExtrapLoopRepeatDualValued,
46 ExtrapLoopReset,
47 ExtrapLoopResetDualValued,
48 ExtrapLoopOscillate,
49 InnerAndExtrapLoops,
50
51 // Tests of several regressive Bezier cases.
52 RegressiveLoop,
53 RegressiveS,
54 RegressiveSStandard,
55 RegressiveSPreOut,
56 RegressiveSPostOut,
57 RegressiveSBothOut,
58 RegressivePreJ,
59 RegressivePostJ,
60 RegressivePreC,
61 RegressivePostC,
62 RegressivePreG,
63 RegressivePostG,
64 RegressivePreFringe,
65 RegressivePostFringe,
66
67 // Bold case: escaped tangents, but not regressive.
68 BoldS,
69
70 // Edge case: cusp. Valid but just barely; undefined tangent.
71 Cusp,
72
73 // Edge case: vertical tangent in center. Also a less extreme variant.
74 CenterVertical,
75 NearCenterVertical,
76
77 // A case that hit an old bug. A particular case of a single vertical.
78 VerticalTorture,
79
80 // Edge case: 4/3 + 1/3 tangents. Vertical at 24/27.
81 // Also the inverse.
82 FourThirdOneThird,
83 OneThirdFourThird,
84
85 // Edge cases: single verticals at start and end.
86 StartVert,
87 EndVert,
88
89 // Fringe vertical between FourThirdOneThird and EndVert.
90 FringeVert,
91
92 // N-shape, with near-vertical tangents.
93 MarginalN,
94
95 // Both tangents zero-length.
96 ZeroTans,
97
98 // Exercise many features of the object model.
99 ComplexParams
100 };
101
102 // Get a case by ID.
103 TS_API
104 static TsTest_SplineData GetData(DataId id);
105
106 // Get all case names.
107 TS_API
108 static std::vector<std::string> GetAllNames();
109
110 // Get a case by name.
111 TS_API
112 static TsTest_SplineData GetDataByName(const std::string &name);
113};
114
115
116PXR_NAMESPACE_CLOSE_SCOPE
117
118
119#endif