@@ -258,7 +258,8 @@ bool Load::SceneCommands(
258
258
result &= Load::SceneCommand (cmd, sources, scene, det_array, config);
259
259
if (cmd.IsError ()) {
260
260
std::cerr << " Error in " << cmd.filename << " , line "
261
- << cmd.line << " : " << cmd.ErrorMsg () << " \n " ;
261
+ << cmd.line << " :\n\" " << cmd.Original () << " \"\n "
262
+ << cmd.ErrorMsg () << " \n " ;
262
263
} else if (cmd.IsWarning ()) {
263
264
std::cout << " Warning in " << cmd.filename << " , line "
264
265
<< cmd.line << " : " << cmd.WarningMsg () << " \n " ;
@@ -302,7 +303,7 @@ bool Load::SceneCommand(
302
303
// the input file.
303
304
polygon_verts.push_back (point);
304
305
if (!status) {
305
- cmd.MarkError (" Invalid vertex point" );
306
+ cmd.MarkError (" vertex point format: [x] [y] [z] " );
306
307
return (true );
307
308
}
308
309
if ((int )polygon_verts.size () == no_polygon_verts) {
@@ -323,7 +324,8 @@ bool Load::SceneCommand(
323
324
axis.x , axis.y , axis.z ,
324
325
outer_radius, inner_radius, height))
325
326
{
326
- cmd.MarkError (" Invalid values for ann_cyl" );
327
+ cmd.MarkError (" format: ann_cyl [center xyz] [axis xyz]"
328
+ " [outer_radius] [inner_radius] [height]" );
327
329
return (false );
328
330
}
329
331
int det_id = -1 ;
@@ -344,7 +346,8 @@ bool Load::SceneCommand(
344
346
axis.x , axis.y , axis.z ,
345
347
radius1, radius2, height))
346
348
{
347
- cmd.MarkError (" Invalid values for elliptic_cyl" );
349
+ cmd.MarkError (" format: elliptic_cyl [center xyz] [axis xyz]"
350
+ " [radius1] [radius2] [height]" );
348
351
return (false );
349
352
}
350
353
std::unique_ptr<ViewableCylinder> vc (new ViewableCylinder ());
@@ -370,7 +373,8 @@ bool Load::SceneCommand(
370
373
if (!cmd.parse (center.x , center.y , center.z ,
371
374
axis.x , axis.y , axis.z , radius, height, activity))
372
375
{
373
- cmd.MarkError (" Invalid values for cyl_src" );
376
+ cmd.MarkError (" format: cyl_src [center xyz] [axis xyz]"
377
+ " [radius] [height] [activity]" );
374
378
return (false );
375
379
}
376
380
cur_matrix.Transform (¢er);
@@ -383,7 +387,7 @@ bool Load::SceneCommand(
383
387
VectorR3 center;
384
388
double radius, activity;
385
389
if (!cmd.parse (center.x , center.y , center.z , radius, activity)) {
386
- cmd.MarkError (" Invalid values for sp_src " );
390
+ cmd.MarkError (" format: sp_src [center xyz] [radius] [activity] " );
387
391
return (false );
388
392
}
389
393
cur_matrix.Transform (¢er);
@@ -398,7 +402,8 @@ bool Load::SceneCommand(
398
402
size.x , size.y , size.z ,
399
403
axis.x , axis.y , axis.z , activity))
400
404
{
401
- cmd.MarkError (" Invalid values for rect_src" );
405
+ cmd.MarkError (
406
+ " rect_src format [center xyz] [size xyz] [axis xyz] [act]" );
402
407
return (false );
403
408
}
404
409
cur_matrix.Transform (¢er);
@@ -412,7 +417,7 @@ bool Load::SceneCommand(
412
417
VectorR3 center;
413
418
double activity;
414
419
if (!cmd.parse (center.x , center.y , center.z , activity)) {
415
- cmd.MarkError (" Invalid values for pt_src " );
420
+ cmd.MarkError (" format: pt_src [center xyz] [activity] " );
416
421
return (false );
417
422
}
418
423
cur_matrix.Transform (¢er);
@@ -430,7 +435,8 @@ bool Load::SceneCommand(
430
435
if (!cmd.parse (center.x , center.y , center.z ,
431
436
size.x , size.y , size.z , filename, activity))
432
437
{
433
- cmd.MarkError (" Invalid values for voxel_src" );
438
+ cmd.MarkError (" format: voxel_src [center xyz] [size xyz]"
439
+ " [filename] [activity]" );
434
440
return (false );
435
441
}
436
442
// Make the file relative to whichever file in which the command was
@@ -534,7 +540,7 @@ bool Load::SceneCommand(
534
540
} else if (cmd == " m" ) {
535
541
std::string mat_name;
536
542
if (!cmd.parse (mat_name)) {
537
- cmd.MarkError (" Incorrect syntax for material" );
543
+ cmd.MarkError (" format: m [ material name] " );
538
544
return (false );
539
545
} else if (!scene.HasMaterial (mat_name)) {
540
546
cmd.MarkError (" Invalid material: " + mat_name);
@@ -553,7 +559,7 @@ bool Load::SceneCommand(
553
559
} else if (cmd == " t" ) {
554
560
VectorR3 trans;
555
561
if (!cmd.parse (trans.x , trans.y , trans.z )) {
556
- cmd.MarkError (" Invalid values for t (transltate) " );
562
+ cmd.MarkError (" format: t [shift xyz] " );
557
563
return (false );
558
564
}
559
565
// This doesn't seem to be the most obvious, or correct way to apply
@@ -586,7 +592,7 @@ bool Load::SceneCommand(
586
592
VectorR3 axis;
587
593
double degree;
588
594
if (!cmd.parse (axis.x , axis.y , axis.z , degree)) {
589
- cmd.MarkError (" Invalid values for raxis " );
595
+ cmd.MarkError (" format: raxis [axis xyz] [angle (deg)] " );
590
596
return (false );
591
597
}
592
598
const double theta = degree * (M_PI / 180.0 );
@@ -596,7 +602,7 @@ bool Load::SceneCommand(
596
602
VectorR3 center;
597
603
double radius;
598
604
if (!cmd.parse (center.x , center.y , center.z , radius)) {
599
- cmd.MarkError (" Invalid values for sphere " );
605
+ cmd.MarkError (" sphere format: [center xyz] [radius] " );
600
606
return (false );
601
607
}
602
608
std::unique_ptr<ViewableSphere> s (new ViewableSphere (center, radius));
@@ -610,7 +616,8 @@ bool Load::SceneCommand(
610
616
if (!cmd.parse (center.x , center.y , center.z ,
611
617
axis.x , axis.y , axis.z , radius, height))
612
618
{
613
- cmd.MarkError (" Invalid values for cyl" );
619
+ cmd.MarkError (" cyl format [center xyz] [axis xyz]"
620
+ " [radius] [height]" );
614
621
return (false );
615
622
}
616
623
std::unique_ptr<ViewableCylinder> vc (new ViewableCylinder ());
@@ -644,7 +651,7 @@ bool Load::SceneCommand(
644
651
} else if (cmd == " k" ) {
645
652
VectorR3 center, size;
646
653
if (!cmd.parse (center.x , center.y , center.z , size.x , size.y , size.z )) {
647
- cmd.MarkError (" Invalid values for rectangle " );
654
+ cmd.MarkError (" k format: [center xyz] [size xyz] " );
648
655
return (false );
649
656
}
650
657
@@ -669,7 +676,8 @@ bool Load::SceneCommand(
669
676
step.x , step.y , step.z ,
670
677
size.x , size.y , size.z ))
671
678
{
672
- cmd.MarkError (" Invalid values for array" );
679
+ cmd.MarkError (" array format: [center xyz] [no steps xyz]"
680
+ " [pitch xyz] [size xyz]" );
673
681
return (false );
674
682
}
675
683
0 commit comments