@@ -40,33 +40,54 @@ void FaultMultiPatchTriangulatedSetRepresentationTest::initRepo()
4040 TriangulatedSetRepresentation* rep = repo->createTriangulatedSetRepresentation (interp, defaultUuid, defaultTitle);
4141 REQUIRE ( rep != nullptr );
4242
43- // Patch 0
44- double explicitPointsFault1Patch0[18 ] = {150 , 0 , 200 , 150 , 100 , 200 , 150 , 200 , 200 ,
45- 250 , 0 , 300 , 250 , 100 , 300 , 250 , 200 , 300 };
46- unsigned int triangleNodeIndexFaultPatch0[12 ] = {0 ,4 ,3 , 0 ,1 ,4 , 1 ,2 ,4 , 2 ,5 ,4 };
4743 rep->pushBackTrianglePatch (6 , explicitPointsFault1Patch0, 4 , triangleNodeIndexFaultPatch0, repo->getHdfProxySet ()[0 ]);
48- // Patch 1
49- double explicitPointsFault1Patch1[18 ] = {250 , 0 , 300 , 250 , 100 , 300 , 250 , 200 , 300 ,
50- 300 , 0 , 350 , 300 , 100 , 350 , 300 , 200 , 350 };
51- unsigned int triangleNodeIndexFaultPatch1[12 ] = {6 ,10 ,9 , 6 ,7 ,10 , 7 ,8 ,10 , 8 ,11 ,10 };
5244 rep->pushBackTrianglePatch (6 , explicitPointsFault1Patch1, 4 , triangleNodeIndexFaultPatch1, repo->getHdfProxySet ()[0 ]);
53- // Patch 2
54- double explicitPointsFault1Patch2[18 ] = {300 , 0 , 350 , 300 , 100 , 350 , 300 , 200 , 350 ,
55- 450 , 0 , 500 , 450 , 100 , 500 , 450 , 200 , 500 };
56- unsigned int triangleNodeIndexFaultPatch2[12 ] = {12 ,16 ,15 , 12 ,13 ,16 , 13 ,14 ,16 , 14 ,17 ,16 };
5745 rep->pushBackTrianglePatch (6 , explicitPointsFault1Patch2, 4 , triangleNodeIndexFaultPatch2, repo->getHdfProxySet ()[0 ]);
58- // Patch 3
59- double explicitPointsFault1Patch3[18 ] = {450 , 0 , 500 , 450 , 100 , 500 , 450 , 200 , 500 ,
60- 500 , 0 , 550 , 500 , 100 , 550 ,500 , 200 , 550 };
61- unsigned int triangleNodeIndexFaultPatch3[12 ] = {18 ,22 ,21 , 18 ,19 ,22 , 19 ,20 ,22 , 20 ,23 ,22 };
6246 rep->pushBackTrianglePatch (6 , explicitPointsFault1Patch3, 4 , triangleNodeIndexFaultPatch3, repo->getHdfProxySet ()[0 ]);
63- // Patch 4
64- double explicitPointsFault1Patch4[18 ] = {500 , 0 , 550 , 500 , 100 , 550 ,500 , 200 , 550 ,
65- 600 , 0 , 650 , 600 , 100 , 650 , 600 , 200 , 650 };
66- unsigned int triangleNodeIndexFaultPatch4[12 ] = {24 ,28 ,27 , 24 ,25 ,28 , 25 ,26 ,28 , 26 ,29 ,28 };
6747 rep->pushBackTrianglePatch (6 , explicitPointsFault1Patch4, 4 , triangleNodeIndexFaultPatch4, repo->getHdfProxySet ()[0 ]);
6848}
6949
7050void FaultMultiPatchTriangulatedSetRepresentationTest::readRepo ()
7151{
52+ RESQML2_NS::TriangulatedSetRepresentation* rep = repo->getDataObjectByUuid <RESQML2_NS::TriangulatedSetRepresentation>(defaultUuid);
53+ REQUIRE (rep->getSeismicSupportOfPatch (0 ) == nullptr );
54+ REQUIRE (rep->getPatchCount () == 5 );
55+ REQUIRE (rep->getRepresentationSetRepresentationCount () == 0 );
56+ REQUIRE (rep->getPropertySet ().empty ());
57+ REQUIRE (rep->getPointsPropertyCount () == 0 );
58+ REQUIRE (rep->getSubRepresentationCount () == 0 );
59+ REQUIRE (rep->getValuesPropertyCount () == 0 );
60+ REQUIRE (rep->getTimeSeries () == nullptr );
61+ REQUIRE (rep->getTitle () == defaultTitle);
62+ REQUIRE (rep->getUuid () == defaultUuid);
63+ for (size_t patchIdx = 0 ; patchIdx < 5 ; ++patchIdx) {
64+ REQUIRE (rep->getTriangleCountOfPatch (patchIdx) == 4 );
65+ REQUIRE (rep->getXyzPointCountOfPatch (0 ) == 6 );
66+ }
67+ REQUIRE (rep->getTriangleCountOfAllPatches () == 20 );
68+ REQUIRE (rep->getXyzPointCountOfAllPatches () == 30 );
69+
70+ uint32_t triangleNodeIndexFaultPatch[12 ];
71+ rep->getTriangleNodeIndicesOfPatch (0 , triangleNodeIndexFaultPatch);
72+ REQUIRE (std::equal (begin (triangleNodeIndexFaultPatch0), end (triangleNodeIndexFaultPatch0), begin (triangleNodeIndexFaultPatch)));
73+ rep->getTriangleNodeIndicesOfPatch (1 , triangleNodeIndexFaultPatch);
74+ REQUIRE (std::equal (begin (triangleNodeIndexFaultPatch1), end (triangleNodeIndexFaultPatch1), begin (triangleNodeIndexFaultPatch)));
75+ rep->getTriangleNodeIndicesOfPatch (2 , triangleNodeIndexFaultPatch);
76+ REQUIRE (std::equal (begin (triangleNodeIndexFaultPatch2), end (triangleNodeIndexFaultPatch2), begin (triangleNodeIndexFaultPatch)));
77+ rep->getTriangleNodeIndicesOfPatch (3 , triangleNodeIndexFaultPatch);
78+ REQUIRE (std::equal (begin (triangleNodeIndexFaultPatch3), end (triangleNodeIndexFaultPatch3), begin (triangleNodeIndexFaultPatch)));
79+ rep->getTriangleNodeIndicesOfPatch (4 , triangleNodeIndexFaultPatch);
80+ REQUIRE (std::equal (begin (triangleNodeIndexFaultPatch4), end (triangleNodeIndexFaultPatch4), begin (triangleNodeIndexFaultPatch)));
81+
82+ double explicitPointsFault[18 ];
83+ rep->getXyzPointsOfPatch (0 , explicitPointsFault);
84+ REQUIRE (std::equal (begin (explicitPointsFault1Patch0), end (explicitPointsFault1Patch0), begin (explicitPointsFault)));
85+ rep->getXyzPointsOfPatch (1 , explicitPointsFault);
86+ REQUIRE (std::equal (begin (explicitPointsFault1Patch1), end (explicitPointsFault1Patch1), begin (explicitPointsFault)));
87+ rep->getXyzPointsOfPatch (2 , explicitPointsFault);
88+ REQUIRE (std::equal (begin (explicitPointsFault1Patch2), end (explicitPointsFault1Patch2), begin (explicitPointsFault)));
89+ rep->getXyzPointsOfPatch (3 , explicitPointsFault);
90+ REQUIRE (std::equal (begin (explicitPointsFault1Patch3), end (explicitPointsFault1Patch3), begin (explicitPointsFault)));
91+ rep->getXyzPointsOfPatch (4 , explicitPointsFault);
92+ REQUIRE (std::equal (begin (explicitPointsFault1Patch4), end (explicitPointsFault1Patch4), begin (explicitPointsFault)));
7293}
0 commit comments