| 217 | |
| 218 | |
| 219 | TEST(BundleControlPoint, Rectangular) { |
| 220 | BundleSettingsQsp settings(new BundleSettings); |
| 221 | settings->setSolveOptions( |
| 222 | false, false, false, false, |
| 223 | SurfacePoint::Rectangular, SurfacePoint::Rectangular, |
| 224 | 2.0, 3.0, 4.0); |
| 225 | std::unique_ptr<ControlPoint> freePoint = std::make_unique<ControlPoint>("FreePoint"); |
| 226 | ControlMeasure *cm1 = new ControlMeasure; |
| 227 | cm1->SetCubeSerialNumber("Ignored"); |
| 228 | cm1->SetIgnored(true); |
| 229 | freePoint->Add(cm1); |
| 230 | ControlMeasure *cm2 = new ControlMeasure; |
| 231 | cm2->SetCubeSerialNumber("NotIgnored"); |
| 232 | cm2->SetIgnored(false); |
| 233 | cm2->SetCoordinate(1.0, 2.0); |
| 234 | cm2->SetResidual(-3.0, 4.0); |
| 235 | freePoint->Add(cm2); |
| 236 | |
| 237 | SurfacePoint aprioriPoint( |
| 238 | Latitude(45, Angle::Degrees), |
| 239 | Longitude(90, Angle::Degrees), |
| 240 | Distance(1000, Distance::Kilometers)); |
| 241 | SurfacePoint adjustedPoint( |
| 242 | Latitude(55, Angle::Degrees), |
| 243 | Longitude(80, Angle::Degrees), |
| 244 | Distance(1100, Distance::Kilometers), |
| 245 | Angle(5.0, Angle::Degrees), |
| 246 | Angle(50.0, Angle::Degrees), |
| 247 | Distance(500, Distance::Kilometers)); |
| 248 | freePoint->SetAdjustedSurfacePoint(adjustedPoint); |
| 249 | freePoint->SetAprioriSurfacePoint(aprioriPoint); |
| 250 | |
| 251 | BundleControlPointQsp bundlePoint(new BundleControlPoint(settings, freePoint.get())); |
| 252 | |
| 253 | boost::numeric::ublas::bounded_vector< double, 3 > weights = bundlePoint->weights(); |
| 254 | EXPECT_DOUBLE_EQ(weights[0], 250000); |
| 255 | EXPECT_DOUBLE_EQ(weights[1], 111111.11111111111); |
| 256 | EXPECT_DOUBLE_EQ(weights[2], 62500); |
| 257 | |
| 258 | QString summaryString = bundlePoint->formatBundleOutputSummaryString(false); |
| 259 | EXPECT_THAT( |
| 260 | summaryString.toStdString(), |
| 261 | ::testing::HasSubstr("FreePoint FREE 1 of 1 3.54 109.56055322 621.34877361 901.06724872 N/A N/A N/A")); |
| 262 | |
| 263 | QString detailString = bundlePoint->formatBundleOutputDetailString(false); |
| 264 | // Header |
| 265 | EXPECT_THAT( |
| 266 | detailString.toStdString(), |
| 267 | ::testing::HasSubstr(" Point Initial Total Final Initial Final\n" |
| 268 | " Coordinate Value Correction Value Accuracy Accuracy\n" |
| 269 | " (km/km/km) (km) (km/km/km) (Meters) (Meters)")); |
| 270 | |
| 271 | // Contents |
| 272 | EXPECT_THAT( |
| 273 | detailString.toStdString(), |
| 274 | ::testing::HasSubstr(" BODY-FIXED-X 109.56055322 0.00000000 109.56055322 2.00000000 N/A\n" |
| 275 | " BODY-FIXED-Y 621.34877361 0.00000000 621.34877361 3.00000000 N/A\n" |
| 276 | " BODY-FIXED-Z 901.06724872 0.00000000 901.06724872 4.00000000 N/A")); |
nothing calls this directly
no test coverage detected