Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit a2e9b6e7 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Added more test cases.

parent 412f2e72
...@@ -34,7 +34,7 @@ namespace campvis { ...@@ -34,7 +34,7 @@ namespace campvis {
DVRVis::DVRVis(DataContainer* dc) DVRVis::DVRVis(DataContainer* dc)
: AutoEvaluationPipeline(dc) : AutoEvaluationPipeline(dc)
, _camera("camera", "Camera") , _camera("Camera", "Camera")
, _lsp() , _lsp()
, _imageReader() , _imageReader()
, _pgGenerator() , _pgGenerator()
...@@ -96,15 +96,15 @@ namespace campvis { ...@@ -96,15 +96,15 @@ namespace campvis {
_dvrNormal.p_targetImageID.setValue("drr.output"); _dvrNormal.p_targetImageID.setValue("drr.output");
_dvrVM.p_targetImageID.setValue("dvr.output"); _dvrVM.p_targetImageID.setValue("dvr.output");
Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, tgt::vec2(0.f, .05f)); Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, tgt::vec2(0.f, .05f));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.4f, .42f), tgt::col4(255, 0, 0, 255), tgt::col4(255, 0, 0, 255))); dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.12f, .15f), tgt::col4(85, 0, 0, 128), tgt::col4(255, 0, 0, 128)));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.45f, .5f), tgt::col4(0, 255, 0, 255), tgt::col4(0, 255, 0, 255))); dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.19f, .28f), tgt::col4(89, 89, 89, 155), tgt::col4(89, 89, 89, 155)));
_dvrNormal.p_transferFunction.replaceTF(dvrTF); dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.41f, .51f), tgt::col4(170, 170, 128, 64), tgt::col4(192, 192, 128, 64)));
_dvrNormal.p_transferFunction.replaceTF(dvrTF);
Geometry1DTransferFunction* vmTF = new Geometry1DTransferFunction(128, tgt::vec2(0.f, .05f)); Geometry1DTransferFunction* vmTF = new Geometry1DTransferFunction(128, tgt::vec2(0.f, .05f));
vmTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.4f, .42f), tgt::col4(255, 0, 0, 255), tgt::col4(255, 0, 0, 255))); vmTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.41f, .51f), tgt::col4(170, 170, 128, 64), tgt::col4(192, 192, 128, 64)));
vmTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.45f, .5f), tgt::col4(0, 255, 0, 255), tgt::col4(0, 255, 0, 255))); _dvrVM.p_transferFunction.replaceTF(vmTF);
_dvrVM.p_transferFunction.replaceTF(vmTF);
_vmRenderer.p_renderTargetID.addSharedProperty(&_combine.p_mirrorRenderID); _vmRenderer.p_renderTargetID.addSharedProperty(&_combine.p_mirrorRenderID);
_vmEepGenerator.p_entryImageID.setValue("vm.eep.entry"); _vmEepGenerator.p_entryImageID.setValue("vm.eep.entry");
...@@ -124,8 +124,8 @@ namespace campvis { ...@@ -124,8 +124,8 @@ namespace campvis {
_vmgGenerator.p_mirrorID.addSharedProperty(&_vmEepGenerator.p_mirrorID); _vmgGenerator.p_mirrorID.addSharedProperty(&_vmEepGenerator.p_mirrorID);
_vmgGenerator.p_mirrorID.addSharedProperty(&_vmRenderer.p_geometryID); _vmgGenerator.p_mirrorID.addSharedProperty(&_vmRenderer.p_geometryID);
_vmgGenerator.p_mirrorCenter.setValue(tgt::vec3(0.f, 0.f, -20.f)); _vmgGenerator.p_mirrorCenter.setValue(tgt::vec3(0.f, 0.f, -20.f));
_vmgGenerator.p_poi.setValue(tgt::vec3(40.f, 40.f, 40.f)); _vmgGenerator.p_poi.setValue(tgt::vec3(50.f, 80.f, 15.f));
_vmgGenerator.p_size.setValue(60.f); _vmgGenerator.p_size.setValue(128.f);
_eepGenerator.p_entryImageID.addSharedProperty(&_dvrNormal.p_entryImageID); _eepGenerator.p_entryImageID.addSharedProperty(&_dvrNormal.p_entryImageID);
_vmEepGenerator.p_entryImageID.addSharedProperty(&_dvrVM.p_entryImageID); _vmEepGenerator.p_entryImageID.addSharedProperty(&_dvrVM.p_entryImageID);
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "core/datastructures/datacontainer.h" #include "core/datastructures/datacontainer.h"
#include "core/datastructures/renderdata.h" #include "core/datastructures/renderdata.h"
#include "core/pipeline/abstractpipeline.h" #include "core/pipeline/abstractpipeline.h"
#include "core/properties/allproperties.h"
#include "core/tools/stringutils.h" #include "core/tools/stringutils.h"
#include "modules/pipelinefactory.h" #include "modules/pipelinefactory.h"
...@@ -89,22 +90,23 @@ protected: ...@@ -89,22 +90,23 @@ protected:
_pipeline->init(); _pipeline->init();
_pipeline->setEnabled(true); _pipeline->setEnabled(true);
_pipeline->setRenderTargetSize(tgt::ivec2(1024, 1024)); _pipeline->setRenderTargetSize(tgt::ivec2(1024, 1024));
}
}
void execute() {
if (_pipeline != nullptr) {
// invalidate each processor // invalidate each processor
std::vector<AbstractProcessor*> processors = _pipeline->getProcessors(); std::vector<AbstractProcessor*> processors = _pipeline->getProcessors();
for (size_t i = 0; i < processors.size(); ++i) { for (size_t i = 0; i < processors.size(); ++i) {
processors[i]->invalidate(AbstractProcessor::INVALID_RESULT); processors[i]->invalidate(AbstractProcessor::INVALID_RESULT);
} }
}
}
void execute() {
if (_pipeline != nullptr) {
_pipeline->executePipeline(); _pipeline->executePipeline();
// write result image // write result image
_imageWriter.p_inputImage.setValue(_pipeline->getRenderTargetID()); _imageWriter.p_inputImage.setValue(_pipeline->getRenderTargetID());
_imageWriter.p_url.setValue(_fileName); _imageWriter.p_url.setValue(_fileName);
_imageWriter.invalidate(AbstractProcessor::INVALID_RESULT);
_imageWriter.process(_dataContainer); _imageWriter.process(_dataContainer);
_wroteFile = tgt::FileSystem::fileExists(_fileName); _wroteFile = tgt::FileSystem::fileExists(_fileName);
...@@ -127,7 +129,7 @@ int PipelineWriteResultImageTest::_prevNoCases = 0; ...@@ -127,7 +129,7 @@ int PipelineWriteResultImageTest::_prevNoCases = 0;
TEST_F(PipelineWriteResultImageTest, VolumeExplorerDemo) { TEST_F(PipelineWriteResultImageTest, VolumeExplorerDemo) {
_pipelineName = "VolumeExplorerDemo"; _pipelineName = "VolumeExplorerDemo";
_fileName = _basePath +"volumeexplorerdemo.png"; _fileName = _basePath + "volumeexplorerdemo.png";
init(); init();
execute(); execute();
EXPECT_TRUE(_wroteFile); EXPECT_TRUE(_wroteFile);
...@@ -143,9 +145,66 @@ TEST_F(PipelineWriteResultImageTest, GeometryRendererDemo) { ...@@ -143,9 +145,66 @@ TEST_F(PipelineWriteResultImageTest, GeometryRendererDemo) {
TEST_F(PipelineWriteResultImageTest, SliceVis) { TEST_F(PipelineWriteResultImageTest, SliceVis) {
_pipelineName = "SliceVis"; _pipelineName = "SliceVis";
_fileName = _basePath +"slicevis.png"; _fileName = _basePath + "slicevis.png";
init();
execute();
EXPECT_TRUE(_wroteFile);
}
TEST_F(PipelineWriteResultImageTest, AdvancedUsVis) {
_pipelineName = "AdvancedUsVis";
_fileName = _basePath + "advancedusvis.png";
init();
execute();
EXPECT_TRUE(_wroteFile);
}
TEST_F(PipelineWriteResultImageTest, VectorFieldDemo) {
_pipelineName = "VectorFieldDemo";
_fileName = _basePath + "vectorfielddemo.png";
init();
execute();
AbstractProperty* p = _pipeline->getProperty("SliceNuber");
if (IntProperty* tester = dynamic_cast<IntProperty*>(p)) {
tester->setValue(64);
}
execute();
EXPECT_TRUE(_wroteFile);
}
TEST_F(PipelineWriteResultImageTest, DVRVis) {
_pipelineName = "DVRVis";
_fileName = _basePath + "dvrvis.png";
init();
execute();
AbstractProperty* p = _pipeline->getProperty("Camera");
if (CameraProperty* tester = dynamic_cast<CameraProperty*>(p)) {
tgt::Camera c = tester->getValue();
c.setPosition(tgt::vec3(417.f, 44.5f, -112.5f));
c.setFocus(tgt::vec3(91.f, 91.f, 80.f));
c.setUpVector(tgt::vec3(-0.487f, 0.142f, -0.861f));
tester->setValue(c);
}
execute();
EXPECT_TRUE(_wroteFile);
}
TEST_F(PipelineWriteResultImageTest, TensorDemo) {
_pipelineName = "TensorDemo";
_fileName = _basePath + "tensordemo.png";
init(); init();
execute(); execute();
AbstractProperty* p = _pipeline->getProperty("SliceNuber");
if (IntProperty* tester = dynamic_cast<IntProperty*>(p)) {
tester->setValue(6);
}
execute();
EXPECT_TRUE(_wroteFile); EXPECT_TRUE(_wroteFile);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment