5 #include <OscillatingMirrorBeamDeflector.h> 6 #include <HelicopterPlatform.h> 7 #include <FullWaveformPulseDetector.h> 36 survey->
name =
"MySurvey";
39 std::list<int> pulseFreqs;
40 pulseFreqs.push_back(100);
41 pulseFreqs.push_back(30);
42 pulseFreqs.push_back(70);
43 survey->
scanner = std::make_shared<Scanner>(
45 glm::dvec3(2.0, 3.0, 0.0),
61 survey->
scanner->scannerHead = std::make_shared<ScannerHead>(
62 glm::dvec3(0.4, 0.7, 0.1), 0.067
64 survey->
scanner->beamDeflector =
65 std::make_shared<OscillatingMirrorBeamDeflector>(
71 survey->
scanner->platform = std::make_shared<HelicopterPlatform>();
72 survey->
scanner->detector = std::make_shared<FullWaveformPulseDetector>(
77 survey->
legs.push_back(std::make_shared<Leg>());
78 survey->
legs[0]->mPlatformSettings = std::make_shared<PlatformSettings>();
79 survey->
legs[0]->mPlatformSettings->onGround =
false;
80 survey->
scanner->platform->scene = std::make_shared<Scene>();
81 std::shared_ptr<Scene> baseScene = survey->
scanner->platform->scene;
82 baseScene->primitives.push_back(
new Triangle(
85 baseScene->primitives[0]->part = std::make_shared<ScenePart>();
86 baseScene->primitives[0]->part->mPrimitives.push_back(
87 baseScene->primitives[0]);
88 baseScene->primitives[0]->part->onRayIntersectionMode =
"TRANSMITTIVE";
90 glm::dvec3(0.0, 0.0, 0.5),
92 std::vector<int>({1,2}),
93 std::vector<double>({0.1, 0.2, 0.3})
95 baseScene->primitives[1]->material = std::make_shared<Material>();
96 baseScene->primitives[1]->material->ka[0] = 1.1;
97 baseScene->primitives[1]->material->ks[1] = 1.2;
103 copy->
name =
"CopiedSurvey";
105 copy->
scanner->name =
"CopiedScanner";
107 copy->
scanner->scannerHead->getMountRelativeAttitudeByReference();
108 copyMRA.setQ3(copyMRA.
getQ3() + 0.1);
109 copy->
scanner->beamDeflector->cfg_device_scanFreqMax_Hz += 1.0;
110 copy->
scanner->platform->cfg_device_relativeMountPosition.x += 0.01;
116 r.setQ2(r.
getQ2()+0.1);
117 copy->
scanner->FWF_settings.minEchoWidth += 0.001;
118 copy->
legs[0]->mPlatformSettings->onGround =
true;
119 std::shared_ptr<Scene> copyScene = copy->
scanner->platform->scene;
120 copyScene->primitives[0]->getVertices()[0].pos.x += 0.1;
121 copyScene->primitives[0]->part->onRayIntersectionArgument += 0.034;
122 copyScene->primitives[1]->material->ks[1] += 0.1;
127 if(copy->
name == survey->
name)
return false;
131 if(copy->
scanner->numTimeBins!=survey->
scanner->numTimeBins)
return false;
132 if(copy->
scanner->isCalcEchowidth() != survey->
scanner->isCalcEchowidth())
134 if(copy->
scanner->FWF_settings.minEchoWidth ==
135 survey->
scanner->FWF_settings.minEchoWidth)
137 if(copy->
scanner->FWF_settings.apertureDiameter !=
138 survey->
scanner->FWF_settings.apertureDiameter)
140 if(copy->
scanner->scannerHead->getRotatePerSecMax() !=
141 survey->
scanner->scannerHead->getRotatePerSecMax())
144 survey->
scanner->scannerHead->getMountRelativeAttitudeByReference();
147 if(copy->
scanner->beamDeflector->cfg_device_scanFreqMin_Hz !=
148 survey->
scanner->beamDeflector->cfg_device_scanFreqMin_Hz)
150 if(copy->
scanner->beamDeflector->cfg_device_scanFreqMax_Hz ==
151 survey->
scanner->beamDeflector->cfg_device_scanFreqMax_Hz)
153 if(copy->
scanner->platform->cfg_device_relativeMountPosition.x ==
154 survey->
scanner->platform->cfg_device_relativeMountPosition.x)
156 if(copy->
scanner->platform->cfg_device_relativeMountPosition.y !=
157 survey->
scanner->platform->cfg_device_relativeMountPosition.y)
165 if(copySpeedXy.x == baseSpeedXy.x)
return false;
166 if(copySpeedXy.y != baseSpeedXy.y)
return false;
169 if(copyRot.
getQ1() != baseRot.
getQ1())
return false;
170 if(copyRot.
getQ2() == baseRot.
getQ2())
return false;
171 if(copy->
legs[0]->mPlatformSettings->onGround ==
172 survey->
legs[0]->mPlatformSettings->onGround)
174 if(copy->
legs[0]->mPlatformSettings->stopAndTurn !=
175 survey->
legs[0]->mPlatformSettings->stopAndTurn)
177 if(copyScene->primitives[0]->getVertices()[0].pos.x ==
178 baseScene->primitives[0]->getVertices()[0].pos.x)
180 if(copyScene->primitives[0]->getVertices()[0].pos.y !=
181 baseScene->primitives[0]->getVertices()[0].pos.y)
183 if(copyScene->primitives[0]->part->onRayIntersectionArgument ==
184 baseScene->primitives[0]->part->onRayIntersectionArgument)
186 if(copyScene->primitives[0]->part->onRayIntersectionMode !=
187 baseScene->primitives[0]->part->onRayIntersectionMode)
189 if(copyScene->primitives[1]->material->ka[0] !=
190 baseScene->primitives[1]->material->ka[0])
192 if(copyScene->primitives[1]->material->ks[1] ==
193 baseScene->primitives[1]->material->ks[1])
197 if((*baseDv)[0] != (*copyDv)[0])
return false;
198 if((*baseDv)[1] == (*copyDv)[1])
return false;
Test survey copy.
Definition: SurveyCopyTest.h:16
Definition: Rotation.h:80
double simSpeedFactor
Simulation speed factor for the survey.
Definition: Survey.h:31
double getQ0()
Get the scalar coordinate of the quaternion.
Definition: Rotation.h:115
std::string name
Survey name.
Definition: Survey.h:18
int numRuns
Number of runs for the survey.
Definition: Survey.h:22
double getQ3()
Get the third coordinate of the vectorial part of the quaternion.
Definition: Rotation.h:137
BaseTest class.
Definition: BaseTest.h:19
std::shared_ptr< Scanner > scanner
Scanner used by the survey.
Definition: Survey.h:27
Class which extends Voxel to support AMAPVox format with extra features.
Definition: DetailedVoxel.h:12
Class representing a Helios++ survey.
Definition: Survey.h:11
SurveyCopyTest()
Survey copy test constructor.
Definition: SurveyCopyTest.h:23
bool run() override
Definition: SurveyCopyTest.h:33
double getQ1()
Get the first coordinate of the vectorial part of the quaternion.
Definition: Rotation.h:122
Class representing triangle primitive.
Definition: Triangle.h:13
std::vector< std::shared_ptr< Leg > > legs
All legs belonging to the survey.
Definition: Survey.h:36
double getQ2()
Get the second coordinate of the vectorial part of the quaternion.
Definition: Rotation.h:130
Class representing a vertex.
Definition: Vertex.h:14