| 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 "ImageSetValidTests.h" |
| 10 |
|
| 11 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetCamera", "[ImageSetValid]") |
| 12 |
{ |
| 13 |
Json::Value dj = getDefaultImageSetJSON(); |
| 14 |
|
| 15 |
Json::Value camera; |
| 16 |
camera["camera type"] = "camera"; |
| 17 |
dj["camera blocks"]["fooCamera"] = camera; |
| 18 |
|
| 19 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 20 |
imageset["camera"] = "fooCamera"; |
| 21 |
|
| 22 |
checkPhactoriStringValidParse(ImagesetCamera, dj); |
| 23 |
} |
| 24 |
|
| 25 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetRepresentation", "[ImageSetValid]") |
| 26 |
{ |
| 27 |
Json::Value dj = getDefaultImageSetWithCameraJSON(); |
| 28 |
dj["representation blocks"]["fooRepresentation"] = Json::objectValue; |
| 29 |
|
| 30 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 31 |
imageset["representation"] = "fooRepresentation"; |
| 32 |
|
| 33 |
checkPhactoriStringValidParse(ImagesetRepresentation, dj); |
| 34 |
} |
| 35 |
|
| 36 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetOperation", "[ImageSetCameraValid]") |
| 37 |
{ |
| 38 |
Json::Value dj = getDefaultImageSetWithCameraJSON(); |
| 39 |
|
| 40 |
Json::Value clip; |
| 41 |
clip["type"] = "clip"; |
| 42 |
dj["operation blocks"]["fooOperation"] = clip; |
| 43 |
|
| 44 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 45 |
imageset["operation"] = "fooOperation"; |
| 46 |
|
| 47 |
checkPhactoriStringValidParse(ImagesetOperation, dj); |
| 48 |
} |
| 49 |
|
| 50 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetBasename", "[ImageSetValid]") |
| 51 |
{ |
| 52 |
Json::Value dj = getDefaultImageSetWithCameraJSON(); |
| 53 |
|
| 54 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 55 |
imageset["image basename"] = "foo"; |
| 56 |
|
| 57 |
checkPhactoriStringValidParse(ImagesetBasename, dj); |
| 58 |
} |
| 59 |
|
| 60 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetBasedirectory", "[ImageSetValid]") |
| 61 |
{ |
| 62 |
Json::Value dj = getDefaultImageSetWithCameraJSON(); |
| 63 |
|
| 64 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 65 |
imageset["image basedirectory"] = "foo"; |
| 66 |
|
| 67 |
checkPhactoriStringValidParse(ImagesetBasedirectory, dj); |
| 68 |
} |
| 69 |
|
| 70 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetFormat", "[ImageSetValid]") |
| 71 |
{ |
| 72 |
Json::Value dj = getDefaultImageSetWithCameraJSON(); |
| 73 |
|
| 74 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 75 |
imageset["image format"] = "jpg"; |
| 76 |
|
| 77 |
checkPhactoriStringValidParse(ImagesetFormat, dj); |
| 78 |
} |
| 79 |
|
| 80 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetColorSettings", "[ImageSetValid]") |
| 81 |
{ |
| 82 |
Json::Value dj = getDefaultImageSetWithCameraJSON(); |
| 83 |
|
| 84 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 85 |
imageset["axes color"][0] = 0.0; |
| 86 |
imageset["axes color"][1] = 1.0; |
| 87 |
imageset["axes color"][2] = 1.0; |
| 88 |
|
| 89 |
imageset["edge color"][0] = 1.0; |
| 90 |
imageset["edge color"][1] = 1.0; |
| 91 |
imageset["edge color"][2] = 0.0; |
| 92 |
|
| 93 |
imageset["text color"][0] = 1.0; |
| 94 |
imageset["text color"][1] = 0.0; |
| 95 |
imageset["text color"][2] = 1.0; |
| 96 |
|
| 97 |
imageset["background color"][0] = 0.0; |
| 98 |
imageset["background color"][1] = 0.0; |
| 99 |
imageset["background color"][2] = 0.0; |
| 100 |
|
| 101 |
imageset["show edges"] = true; |
| 102 |
imageset["show axes"] = true; |
| 103 |
imageset["show time annotation"] = true; |
| 104 |
imageset["color by scalar"] = "VON_MISES"; |
| 105 |
|
| 106 |
checkPhactoriStringValidParse(ImagesetColorSettings, dj); |
| 107 |
} |
| 108 |
|
| 109 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetDigitCount", "[ImageSetValid]") |
| 110 |
{ |
| 111 |
Json::Value dj = getDefaultImageSetWithCameraJSON(); |
| 112 |
|
| 113 |
Json::Value &imageset = dj["imageset blocks"]["fooImageset"]; |
| 114 |
imageset["image digit count"] = 6; |
| 115 |
|
| 116 |
checkPhactoriStringValidParse(ImagesetDigitCount, dj); |
| 117 |
} |
| 118 |
|
| 119 |
TEST_CASE_METHOD(CatalystTestFixture, "ImageFilenameDatetimeSimtime", "[notWorking]") |
| 120 |
{ |
| 121 |
Json::Value dj = getDefaultPhactoriJSON(); |
| 122 |
|
| 123 |
Json::Value camera; |
| 124 |
camera["camera type"] = "camera"; |
| 125 |
camera["look direction"][0] = -1.0; |
| 126 |
camera["look direction"][1] = -1.0; |
| 127 |
camera["look direction"][2] = -1.0; |
| 128 |
dj["camera blocks"]["singletestcamera"] = camera; |
| 129 |
|
| 130 |
Json::Value fooImageset1; |
| 131 |
fooImageset1["camera"] = "singletestcamera"; |
| 132 |
fooImageset1["image size"][0] = 800; |
| 133 |
fooImageset1["image size"][1] = 450; |
| 134 |
|
| 135 |
Json::Value fooImageset2(fooImageset1); |
| 136 |
Json::Value fooImageset3(fooImageset1); |
| 137 |
Json::Value fooImageset4(fooImageset1); |
| 138 |
Json::Value fooImageset5(fooImageset1); |
| 139 |
Json::Value fooImageset6(fooImageset1); |
| 140 |
|
| 141 |
fooImageset1["image basename"] = "is_datetime."; |
| 142 |
fooImageset1["image digit count"] = 6; |
| 143 |
fooImageset1["filename use datetime"] = true; |
| 144 |
|
| 145 |
fooImageset2["image basename"] = "is_iso_datetime."; |
| 146 |
fooImageset2["filename use datetime"] = true; |
| 147 |
fooImageset2["filename datetime convert to integer"] = false; |
| 148 |
|
| 149 |
fooImageset3["image basename"] = "is_simulation_time."; |
| 150 |
fooImageset3["image digit count"] = 6; |
| 151 |
fooImageset3["filename use simulation time"] = true; |
| 152 |
|
| 153 |
fooImageset4["image basename"] = "is_datetime_and_simulation_time."; |
| 154 |
fooImageset4["image digit count"] = 6; |
| 155 |
fooImageset4["filename use simulation time"] = true; |
| 156 |
fooImageset4["filename use datetime"] = true; |
| 157 |
|
| 158 |
fooImageset5["image basename"] = "is_datetime_and_simulation_time_no_call_count."; |
| 159 |
fooImageset5["filename use simulation time"] = true; |
| 160 |
fooImageset5["filename use datetime"] = true; |
| 161 |
fooImageset5["filename use call count"] = false; |
| 162 |
|
| 163 |
fooImageset6["filename use simulation time"] = true; |
| 164 |
fooImageset6["filename use datetime"] = true; |
| 165 |
fooImageset6["filename use call count"] = true; |
| 166 |
|
| 167 |
dj["imageset blocks"]["fooImageset1"] = fooImageset1; |
| 168 |
dj["imageset blocks"]["fooImageset2"] = fooImageset2; |
| 169 |
dj["imageset blocks"]["fooImageset3"] = fooImageset3; |
| 170 |
dj["imageset blocks"]["fooImageset4"] = fooImageset4; |
| 171 |
dj["imageset blocks"]["fooImageset5"] = fooImageset5; |
| 172 |
dj["imageset blocks"]["fooImageset6"] = fooImageset6; |
| 173 |
|
| 174 |
checkPhactoriStringValidParse(ImageFilenameDatetimeSimtime, dj); |
| 175 |
} |
| 176 |
|
| 177 |
TEST_CASE_METHOD(CatalystTestFixture, "ImagesetDefault", "[ImageSetValid]") |
| 178 |
{ |
| 179 |
Json::Value dj = getDefaultImageSetJSON(); |
| 180 |
|
| 181 |
Json::Value camera; |
| 182 |
camera["camera type"] = "camera"; |
| 183 |
camera["look direction"][0] = -1.0; |
| 184 |
camera["look direction"][1] = -1.0; |
| 185 |
camera["look direction"][2] = -1.0; |
| 186 |
dj["camera blocks"]["singletestcamera"] = camera; |
| 187 |
|
| 188 |
Json::Value imageset; |
| 189 |
imageset["camera"] = "singletestcamera"; |
| 190 |
dj["imageset blocks"]["fooImageset"] = imageset; |
| 191 |
|
| 192 |
checkPhactoriStringValidParse(ImagesetDefault, dj); |
| 193 |
} |