Skip to content

Commit 696f147

Browse files
committed
Working on latvol
1 parent a5c95a9 commit 696f147

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

src/Modules/Visualization/Tests/OsprayFieldRenderTests.cc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ class OsprayFieldRenderTest : public ParameterizedModuleTest<int>
7272
{
7373
Log::get().setVerbose(false);
7474
auto size = GetParam();
75-
latVol = CreateEmptyLatVol(size, size, size);
75+
auto max = static_cast<double>(size);
76+
latVol = CreateEmptyLatVol(size, size, size, DOUBLE_E, { 0, 0, 0 }, { max, max, max });
7677
Log::get() << INFO << "Setting up ShowField with size " << size << "^3 latvol" << std::endl;
7778
}
7879

@@ -123,17 +124,18 @@ namespace osprayImpl
123124

124125
int renderLatVol(FieldHandle latvol, float cameraSteps)
125126
{
126-
if (false)
127+
FieldHandle trisurf;
128+
//if (false)
127129
{
128130
GetFieldBoundaryAlgo getfieldbound_algo;
129131
FieldHandle field_boundary;
130132
getfieldbound_algo.run(latvol, field_boundary);
131133
ConvertMeshToTriSurfMeshAlgo converter;
132-
FieldHandle trisurf;
134+
133135
converter.run(field_boundary, trisurf);
134136
}
135137

136-
auto trisurf = TriangleTriSurfLinearBasis(DOUBLE_E);
138+
//trisurf = TriangleTriSurfLinearBasis(DOUBLE_E);
137139
auto facade(trisurf->mesh()->getFacade());
138140

139141
//std::ostringstream ostr;
@@ -158,10 +160,10 @@ namespace osprayImpl
158160
imgSize.y = 768; // height
159161

160162
// camera
161-
float cam_pos[] = { -1.f, 0.f, 1.f };
163+
float cam_pos[] = { -1.f, 0.f, -5.f };
162164
cam_pos[0] += cameraSteps;
163165
float cam_up[] = { 0.f, 1.f, 0.f };
164-
float cam_view[] = { 0.5f, 0.5f, -1.f };
166+
float cam_view[] = { 0.5f, 0.5f, 1.f };
165167
//cam_view[2] += cam_pos[2];
166168

167169
// triangle mesh data
@@ -317,7 +319,7 @@ TEST_P(OsprayFieldRenderTest, RenderLatVolWithOspray)
317319
INSTANTIATE_TEST_CASE_P(
318320
RenderLatVolWithOspray,
319321
OsprayFieldRenderTest,
320-
Values(2//, 40, 60, 80
322+
Values(4//, 40, 60, 80
321323
//, 100, 120, 150//, //200 //to speed up make test
322324
//, 256 // probably runs out of memory
323325
)

src/Testing/Utils/SCIRunFieldSamples.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,14 @@ FieldHandle SCIRun::TestUtils::CreateEmptyLatVol()
297297
return CreateEmptyLatVol(sizex, sizey, sizez);
298298
}
299299

300-
FieldHandle SCIRun::TestUtils::CreateEmptyLatVol(size_type sizex, size_type sizey, size_type sizez, data_info_type type)
300+
FieldHandle SCIRun::TestUtils::CreateEmptyLatVol(size_type sizex, size_type sizey, size_type sizez, data_info_type type,
301+
const Core::Geometry::Point& minb, const Core::Geometry::Point& maxb)
301302
{
302303
FieldInformation lfi(LATVOLMESH_E, LINEARDATA_E, type);
303304

304-
Point minb(-1.0, -1.0, -1.0);
305-
Point maxb(1.0, 1.0, 1.0);
306305
MeshHandle mesh = CreateMesh(lfi, sizex, sizey, sizez, minb, maxb);
307306
FieldHandle ofh = CreateField(lfi, mesh);
308307
ofh->vfield()->clear_all_values();
309308
return ofh;
310309
}
310+

src/Testing/Utils/SCIRunFieldSamples.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define TESTING_UTIL_SCIRUNFIELDSAMPLES 1
3131

3232
#include <Core/Datatypes/Legacy/Field/FieldInformation.h>
33+
#include <Core/GeometryPrimitives/Point.h>
3334

3435
#include <Testing/Utils/share.h>
3536

@@ -90,7 +91,9 @@ SCISHARE FieldHandle TetrahedronTriSurfConstantBasis(data_info_type type);
9091
SCISHARE FieldHandle TetrahedronTriSurfLinearBasis(data_info_type type);
9192

9293
SCISHARE FieldHandle CreateEmptyLatVol();
93-
SCISHARE FieldHandle CreateEmptyLatVol(size_type sizex, size_type sizey, size_type sizez, data_info_type type = DOUBLE_E);
94+
SCISHARE FieldHandle CreateEmptyLatVol(size_type sizex, size_type sizey, size_type sizez,
95+
data_info_type type = DOUBLE_E,
96+
const Core::Geometry::Point& minb = { -1, -1, -1 }, const Core::Geometry::Point& maxb = {1,1,1});
9497

9598
}}
9699

0 commit comments

Comments
 (0)