5 #include <OscillatingMirrorBeamDeflector.h>
6 #include <HelicopterPlatform.h>
7 #include <FullWaveformPulseDetector.h>
8 #include <scanner/SingleScanner.h>
10 namespace HeliosTests{
36 std::shared_ptr<Survey> survey = std::make_shared<Survey>();
37 survey->name =
"MySurvey";
39 survey->simSpeedFactor = 1;
40 std::list<int> pulseFreqs;
41 pulseFreqs.push_back(100);
42 pulseFreqs.push_back(30);
43 pulseFreqs.push_back(70);
44 survey->scanner = std::make_shared<SingleScanner>(
46 glm::dvec3(2.0, 3.0, 0.0),
62 survey->scanner->setScannerHead(std::make_shared<ScannerHead>(
63 glm::dvec3(0.4, 0.7, 0.1), 0.067
65 survey->scanner->setBeamDeflector(
66 std::make_shared<OscillatingMirrorBeamDeflector>(
72 survey->scanner->platform = std::make_shared<HelicopterPlatform>();
73 survey->scanner->setDetector(std::make_shared<FullWaveformPulseDetector>(
78 survey->legs.push_back(std::make_shared<Leg>());
79 survey->legs[0]->mPlatformSettings = std::make_shared<PlatformSettings>();
80 survey->legs[0]->mPlatformSettings->onGround =
false;
81 survey->scanner->platform->scene = std::make_shared<Scene>();
82 std::shared_ptr<Scene> baseScene = survey->scanner->platform->scene;
83 baseScene->primitives.push_back(
new Triangle(
86 baseScene->primitives[0]->part = std::make_shared<ScenePart>();
87 baseScene->primitives[0]->part->mPrimitives.push_back(
88 baseScene->primitives[0]);
89 baseScene->primitives[0]->part->onRayIntersectionMode =
"TRANSMITTIVE";
91 glm::dvec3(0.0, 0.0, 0.5),
93 std::vector<int>({1,2}),
94 std::vector<double>({0.1, 0.2, 0.3})
96 baseScene->primitives[1]->material = std::make_shared<Material>();
97 baseScene->primitives[1]->material->ka[0] = 1.1;
98 baseScene->primitives[1]->material->ks[1] = 1.2;
101 std::shared_ptr<Survey> copy = std::make_shared<Survey>(*survey);
104 copy->name =
"CopiedSurvey";
106 copy->scanner->name =
"CopiedScanner";
108 copy->scanner->getScannerHead()->getMountRelativeAttitudeByReference();
109 copyMRA.setQ3(copyMRA.
getQ3() + 0.1);
110 copy->scanner->getBeamDeflector()->cfg_device_scanFreqMax_Hz += 1.0;
111 copy->scanner->platform->cfg_device_relativeMountPosition.x += 0.01;
117 r.setQ2(r.
getQ2()+0.1);
118 copy->scanner->getFWFSettings().minEchoWidth += 0.001;
119 copy->legs[0]->mPlatformSettings->onGround =
true;
120 std::shared_ptr<Scene> copyScene = copy->scanner->platform->scene;
121 copyScene->primitives[0]->getVertices()[0].pos.x += 0.1;
122 copyScene->primitives[0]->part->onRayIntersectionArgument += 0.034;
123 copyScene->primitives[1]->material->ks[1] += 0.1;
128 if(copy->name == survey->name)
return false;
129 if(copy->numRuns == survey->numRuns)
return false;
130 if(copy->simSpeedFactor != survey->simSpeedFactor)
return false;
131 if(copy->scanner->name == survey->scanner->name)
return false;
132 if(copy->scanner->getNumTimeBins()!=survey->scanner->getNumTimeBins())
134 if(copy->scanner->isCalcEchowidth() != survey->scanner->isCalcEchowidth())
136 if(copy->scanner->getFWFSettings().minEchoWidth ==
137 survey->scanner->getFWFSettings().minEchoWidth)
139 if(copy->scanner->getFWFSettings().apertureDiameter !=
140 survey->scanner->getFWFSettings().apertureDiameter)
142 if(copy->scanner->getScannerHead()->getRotatePerSecMax() !=
143 survey->scanner->getScannerHead()->getRotatePerSecMax())
145 Rotation &baseMRA = survey->scanner->getScannerHead()
146 ->getMountRelativeAttitudeByReference();
149 if(copy->scanner->getBeamDeflector()->cfg_device_scanFreqMin_Hz !=
150 survey->scanner->getBeamDeflector()->cfg_device_scanFreqMin_Hz)
152 if(copy->scanner->getBeamDeflector()->cfg_device_scanFreqMax_Hz ==
153 survey->scanner->getBeamDeflector()->cfg_device_scanFreqMax_Hz)
155 if(copy->scanner->platform->cfg_device_relativeMountPosition.x ==
156 survey->scanner->platform->cfg_device_relativeMountPosition.x)
158 if(copy->scanner->platform->cfg_device_relativeMountPosition.y !=
159 survey->scanner->platform->cfg_device_relativeMountPosition.y)
167 if(copySpeedXy.x == baseSpeedXy.x)
return false;
168 if(copySpeedXy.y != baseSpeedXy.y)
return false;
171 if(copyRot.
getQ1() != baseRot.
getQ1())
return false;
172 if(copyRot.
getQ2() == baseRot.
getQ2())
return false;
173 if(copy->legs[0]->mPlatformSettings->onGround ==
174 survey->legs[0]->mPlatformSettings->onGround)
176 if(copy->legs[0]->mPlatformSettings->stopAndTurn !=
177 survey->legs[0]->mPlatformSettings->stopAndTurn)
179 if(copyScene->primitives[0]->getVertices()[0].pos.x ==
180 baseScene->primitives[0]->getVertices()[0].pos.x)
182 if(copyScene->primitives[0]->getVertices()[0].pos.y !=
183 baseScene->primitives[0]->getVertices()[0].pos.y)
185 if(copyScene->primitives[0]->part->onRayIntersectionArgument ==
186 baseScene->primitives[0]->part->onRayIntersectionArgument)
188 if(copyScene->primitives[0]->part->onRayIntersectionMode !=
189 baseScene->primitives[0]->part->onRayIntersectionMode)
191 if(copyScene->primitives[1]->material->ka[0] !=
192 baseScene->primitives[1]->material->ka[0])
194 if(copyScene->primitives[1]->material->ks[1] ==
195 baseScene->primitives[1]->material->ks[1])
199 if((*baseDv)[0] != (*copyDv)[0])
return false;
200 if((*baseDv)[1] == (*copyDv)[1])
return false;
Class which extends Voxel to support AMAPVox format with extra features.
Definition: DetailedVoxel.h:15
BaseTest class.
Definition: BaseTest.h:20
Test survey copy.
Definition: SurveyCopyTest.h:17
bool run() override
Definition: SurveyCopyTest.h:34
SurveyCopyTest()
Survey copy test constructor.
Definition: SurveyCopyTest.h:24
Definition: Rotation.h:80
double getQ2() const
Get the second coordinate of the vectorial part of the quaternion.
Definition: Rotation.h:130
double getQ1() const
Get the first coordinate of the vectorial part of the quaternion.
Definition: Rotation.h:122
double getQ3() const
Get the third coordinate of the vectorial part of the quaternion.
Definition: Rotation.h:137
double getQ0() const
Get the scalar coordinate of the quaternion.
Definition: Rotation.h:115
Class representing triangle primitive.
Definition: Triangle.h:13
Class representing a vertex.
Definition: Vertex.h:14