| 1 |
// Copyright(C) 1999-2021 National Technology & Engineering Solutions |
| 2 |
// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 3 |
// NTESS, the U.S. Government retains certain rights in this software. |
| 4 |
// |
| 5 |
// See packages/seacas/LICENSE for details |
| 6 |
|
| 7 |
#include "CatalystTestFixture.h" |
| 8 |
#include "catch.hpp" |
| 9 |
#include "ImageSetCameraValidTests.h" |
| 10 |
|
| 11 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetCameraLookAtAbsolutePoint", "[ImageSetCameraValid]") |
| 12 |
{ |
| 13 |
Json::Value dj = getDefaultImageSetJSON(); |
| 14 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 15 |
imageset["look at absolute point"][0] = 1.1; |
| 16 |
imageset["look at absolute point"][1] = 2.0; |
| 17 |
imageset["look at absolute point"][2] = 3e-8; |
| 18 |
|
| 19 |
checkPhactoriStringValidParse(ImagesetCameraLookAtAbsolutePoint, dj); |
| 20 |
} |
| 21 |
|
| 22 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetCameraLookAtRelativePoint", "[ImageSetCameraValid]") |
| 23 |
{ |
| 24 |
Json::Value dj = getDefaultImageSetJSON(); |
| 25 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 26 |
imageset["look at relative point"][0] = 1.5; |
| 27 |
imageset["look at relative point"][1] = 0.5; |
| 28 |
imageset["look at relative point"][2] = 0.5; |
| 29 |
|
| 30 |
checkPhactoriStringValidParse(ImagesetCameraLookAtRelativePoint, dj); |
| 31 |
} |
| 32 |
|
| 33 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetCameraLookAtElement", "[ImageSetCameraValid]") |
| 34 |
{ |
| 35 |
Json::Value dj = getDefaultImageSetJSON(); |
| 36 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 37 |
imageset["look at element"] = 17; |
| 38 |
|
| 39 |
checkPhactoriStringValidParse(ImagesetCameraLookAtElement, dj); |
| 40 |
} |
| 41 |
|
| 42 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetCameraLookAtNode", "[ImageSetCameraValid]") |
| 43 |
{ |
| 44 |
Json::Value dj = getDefaultImageSetJSON(); |
| 45 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 46 |
imageset["look at node"] = 20; |
| 47 |
|
| 48 |
checkPhactoriStringValidParse(ImagesetCameraLookAtNode, dj); |
| 49 |
} |
| 50 |
|
| 51 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetCameraLookAtRelativeDistance", |
| 52 |
"[ImageSetCameraValid]") |
| 53 |
{ |
| 54 |
Json::Value dj = getDefaultImageSetJSON(); |
| 55 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 56 |
imageset["look at relative distance"] = 2.0; |
| 57 |
|
| 58 |
checkPhactoriStringValidParse(ImagesetCameraLookAtRelativeDistance, dj); |
| 59 |
} |
| 60 |
|
| 61 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetCameraLookAtAbsoluteDistance", |
| 62 |
"[ImageSetCameraValid]") |
| 63 |
{ |
| 64 |
Json::Value dj = getDefaultImageSetJSON(); |
| 65 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 66 |
imageset["look at absolute distance"] = 15.0; |
| 67 |
|
| 68 |
checkPhactoriStringValidParse(ImagesetCameraLookAtAbsoluteDistance, dj); |
| 69 |
} |
| 70 |
|
| 71 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetCameraUpVector", "[ImageSetCameraValid]") |
| 72 |
{ |
| 73 |
Json::Value dj = getDefaultImageSetJSON(); |
| 74 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 75 |
imageset["up vector"][0] = 0.0; |
| 76 |
imageset["up vector"][1] = 1.0; |
| 77 |
imageset["up vector"][2] = 2.0; |
| 78 |
|
| 79 |
checkPhactoriStringValidParse(ImagesetCameraUpVector, dj); |
| 80 |
} |
| 81 |
|
| 82 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetCameraFOV", "[ImageSetCameraValid]") |
| 83 |
{ |
| 84 |
Json::Value dj = getDefaultImageSetJSON(); |
| 85 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 86 |
imageset["camera fov"] = 45.0; |
| 87 |
imageset["look at relative point"][0] = 0.0; |
| 88 |
imageset["look at relative point"][1] = 0.0; |
| 89 |
imageset["look at relative point"][2] = 0.0; |
| 90 |
imageset["look at absolute distance"] = 10.0; |
| 91 |
|
| 92 |
checkPhactoriStringValidParse(ImagesetCameraFOV, dj); |
| 93 |
} |