21 pxr::UsdStageRefPtr
stage = pxr::UsdStage::CreateInMemory();
24 FAIL() <<
"Couldn't create in-memory stage.";
28 pxr::UsdGeomCapsule capsule = pxr::UsdGeomCapsule::Define(
stage, pxr::SdfPath(
"/Capsule"));
31 FAIL() <<
"Couldn't create UsdGeomCapsule.";
35 pxr::UsdImagingCapsuleAdapter capsule_adapter;
36 pxr::VtValue points_value = capsule_adapter.GetPoints(capsule.GetPrim(),
37 pxr::UsdTimeCode::Default());
38 if (!points_value.IsHolding<pxr::VtArray<pxr::GfVec3f>>()) {
39 FAIL() <<
"Mesh points value holding unexpected type.";
43 pxr::VtArray<pxr::GfVec3f> points = points_value.Get<pxr::VtArray<pxr::GfVec3f>>();
44 EXPECT_FALSE(points.empty());
46 pxr::VtValue topology_value = capsule_adapter.GetTopology(
47 capsule.GetPrim(), pxr::SdfPath(), pxr::UsdTimeCode::Default());
49 if (!topology_value.IsHolding<pxr::HdMeshTopology>()) {
50 FAIL() <<
"Mesh topology value holding unexpected type.";
54 pxr::HdMeshTopology topology = topology_value.Get<pxr::HdMeshTopology>();
56 pxr::VtArray<int> vertex_counts = topology.GetFaceVertexCounts();
57 EXPECT_FALSE(vertex_counts.empty());
59 pxr::VtArray<int> vertex_indices = topology.GetFaceVertexIndices();
60 EXPECT_FALSE(vertex_indices.empty());