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 TwoKnotHermite,
32 TwoKnotLinear,
33
34 // Longer splines.
35 FourKnotBezier,
36 FourKnotHermite,
37
38 // Looping cases.
39 SimpleInnerLoop,
40 InnerLoop2and2,
41 InnerLoopPre,
42 InnerLoopPost,
43 ExtrapLoopRepeat,
44 ExtrapLoopReset,
45 ExtrapLoopOscillate,
46 InnerAndExtrapLoops,
47
48 // Tests of several regressive Bezier cases.
49 RegressiveLoop,
50 RegressiveS,
51 RegressiveSStandard,
52 RegressiveSPreOut,
53 RegressiveSPostOut,
54 RegressiveSBothOut,
55 RegressivePreJ,
56 RegressivePostJ,
57 RegressivePreC,
58 RegressivePostC,
59 RegressivePreG,
60 RegressivePostG,
61 RegressivePreFringe,
62 RegressivePostFringe,
63
64 // Bold case: escaped tangents, but not regressive.
65 BoldS,
66
67 // Edge case: cusp. Valid but just barely; undefined tangent.
68 Cusp,
69
70 // Edge case: vertical tangent in center. Also a less extreme variant.
71 CenterVertical,
72 NearCenterVertical,
73
74 // A case that hit an old bug. A particular case of a single vertical.
75 VerticalTorture,
76
77 // Edge case: 4/3 + 1/3 tangents. Vertical at 24/27.
78 // Also the inverse.
79 FourThirdOneThird,
80 OneThirdFourThird,
81
82 // Edge cases: single verticals at start and end.
83 StartVert,
84 EndVert,
85
86 // Fringe vertical between FourThirdOneThird and EndVert.
87 FringeVert,
88
89 // N-shape, with near-vertical tangents.
90 MarginalN,
91
92 // Both tangents zero-length.
93 ZeroTans,
94
95 // Exercise many features of the object model.
96 ComplexParams
97 };
98
99 // Get a case by ID.
100 TS_API
101 static TsTest_SplineData GetData(DataId id);
102
103 // Get all case names.
104 TS_API
105 static std::vector<std::string> GetAllNames();
106
107 // Get a case by name.
108 TS_API
109 static TsTest_SplineData GetDataByName(const std::string &name);
110};
111
112
113PXR_NAMESPACE_CLOSE_SCOPE
114
115
116#endif