MCPcopy Create free account
hub / github.com/DOI-USGS/ISIS3 / printPoint

Function printPoint

isis/src/control/objs/ControlPoint/unitTest.cpp:277–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277void printPoint(Isis::ControlPoint &p, bool testRect) {
278 bool wasLocked = p.IsEditLocked();
279 p.SetEditLock(false);
280 p.SetChooserName("cnetref");
281 p.SetDateTime("2005-05-03T00:00:00");
282 p.SetEditLock(wasLocked);
283
284 std::cout << std::endl;
285 std::cout << "Testing point has ChooserName: ";
286 if ( p.HasChooserName() ) {
287 std::cout << "TRUE" << std::endl;
288 }
289 else {
290 std::cout << "FALSE" << std::endl;
291 }
292
293 std::cout << "Testing point has DateTime: ";
294 if ( p.HasDateTime() ) {
295 std::cout << "TRUE" << std::endl;
296 }
297 else {
298 std::cout << "FALSE" << std::endl;
299 }
300 std::cout << std::endl;
301 ControlNet net;
302
303 ControlPoint *copyPoint = new ControlPoint(p);
304 wasLocked = copyPoint->IsEditLocked();
305 copyPoint->SetEditLock(false);
306 for (int i = 0; i < copyPoint->GetNumMeasures(); i++) {
307 ControlMeasure *measure = copyPoint->GetMeasure(i);
308 bool explicitLock = measure->IsEditLocked();
309 measure->SetEditLock(false);
310 measure->SetChooserName("seedgrid");
311 measure->SetDateTime("2005-05-03T00:00:00");
312 measure->SetEditLock(explicitLock);
313 }
314 copyPoint->SetEditLock(wasLocked);
315
316 net.AddPoint(copyPoint);
317 net.SetNetworkId("Identifier");
318 net.SetCreatedDate("Yesterday");
319 net.SetModifiedDate("Yesterday");
320 net.Write("./tmp.net", true);
321 Pvl tmp("./tmp.net");
322 cout << "Printing point:\n" << tmp << "\nDone printing point." << std::endl;
323 std::cout << std::endl;
324 remove("./tmp.net");
325
326 // Add test with coordinate type set to Rectangular *** TBD *** Add test once
327 // changes are made to the protocol buffer.
328 if (testRect) {
329 ControlNet recNet;
330 recNet.AddPoint(copyPoint);
331 recNet.SetNetworkId("Identifier");
332 recNet.SetCreatedDate("Yesterday");
333 recNet.SetModifiedDate("Yesterday");
334 recNet.Write("./tmpR.net", true);

Callers 1

mainFunction · 0.85

Calls 13

GetMeasureMethod · 0.80
SetNetworkIdMethod · 0.80
SetCreatedDateMethod · 0.80
SetModifiedDateMethod · 0.80
IsEditLockedMethod · 0.45
SetEditLockMethod · 0.45
SetChooserNameMethod · 0.45
SetDateTimeMethod · 0.45
HasChooserNameMethod · 0.45
HasDateTimeMethod · 0.45
GetNumMeasuresMethod · 0.45
AddPointMethod · 0.45

Tested by

no test coverage detected