41 inline const char*
name()
const {
return "translate_x"; };
53 inline const char*
name()
const {
return "translate_y"; };
65 inline const char*
name()
const {
return "translate_z"; };
77 inline const char*
name()
const {
return "translate_xyz"; };
91 inline const char*
name()
const {
return "scale_x"; };
103 inline const char*
name()
const {
return "scale_y"; };
115 inline const char*
name()
const {
return "scale_z"; };
127 inline const char*
name()
const {
return "scale_xyz"; };
141 inline const char*
name()
const {
return "translate_then_scale_x"; };
154 inline const char*
name()
const {
return "translate_then_scale_y"; };
167 inline const char*
name()
const {
return "translate_then_scale_z"; };
180 inline const char*
name()
const {
return "rotate_xy"; };
184 point->
set_x(cos_angle*x - sin_angle*y + x_offset);
185 point->
set_y(cos_angle*y + sin_angle*x + y_offset);
187 LASoperationRotateXY(
F64 angle,
F64 x_offset,
F64 y_offset) { this->x_offset = x_offset; this->y_offset = y_offset; cos_angle = cos(3.141592653589793238462643383279502884197169/180*angle); sin_angle = sin(3.141592653589793238462643383279502884197169/180*angle); };
196 inline const char*
name()
const {
return "clamp_z"; };
199 if (z < min) point->
set_z(min);
200 else if (z > max) point->
set_z(max);
210 inline const char*
name()
const {
return "clamp_z_min"; };
213 if (z < min) point->
set_z(min);
223 inline const char*
name()
const {
return "clamp_z_max"; };
226 if (z > max) point->
set_z(max);
236 inline const char*
name()
const {
return "translate_raw_x"; };
248 inline const char*
name()
const {
return "translate_raw_y"; };
260 inline const char*
name()
const {
return "translate_raw_z"; };
272 inline const char*
name()
const {
return "translate_raw_xyz"; };
286 inline const char*
name()
const {
return "clamp_raw_z"; };
288 if (point->
z < min) point->
z = min;
289 else if (point->
z > max) point->
z = max;
299 inline const char*
name()
const {
return "scale_intensity"; };
312 inline const char*
name()
const {
return "translate_intensity"; };
325 inline const char*
name()
const {
return "translate_then_scale_intensity"; };
339 inline const char*
name()
const {
return "scale_scan_angle"; };
352 inline const char*
name()
const {
return "translate_scan_angle"; };
365 inline const char*
name()
const {
return "translate_then_scale_scan_angle"; };
379 inline const char*
name()
const {
return "change_classification_from_to"; };
390 inline const char*
name()
const {
return "change_point_source_from_to"; };
401 inline const char*
name()
const {
return "repair_zero_returns"; };
408 inline const char*
name()
const {
return "change_return_number_from_to"; };
419 inline const char*
name()
const {
return "change_number_of_returns_from_to"; };
430 inline const char*
name()
const {
return "translate_gps_time"; };
440 inline const char*
name()
const {
return "scale_rgb_down"; };
447 inline const char*
name()
const {
return "scale_rgb_up"; };
454 inline const char*
name()
const {
return "switch_x_y"; };
461 inline const char*
name()
const {
return "switch_x_z"; };
468 inline const char*
name()
const {
return "switch_y_z"; };
475 inline const char*
name()
const {
return "flip_waveform_direction"; };
482 for (i = 0; i < num_operations; i++)
484 delete operations[i];
486 if (operations)
delete [] operations;
487 change_coordinates =
FALSE;
488 alloc_operations = 0;
495 fprintf(stderr,
"Transform coordinates.\n");
496 fprintf(stderr,
" -translate_x -2.5\n");
497 fprintf(stderr,
" -scale_z 0.3048\n");
498 fprintf(stderr,
" -rotate_xy 15.0 620000 4100000 (angle + origin)\n");
499 fprintf(stderr,
" -translate_xyz 0.5 0.5 0\n");
500 fprintf(stderr,
" -translate_then_scale_y -0.5 1.001\n");
501 fprintf(stderr,
" -clamp_z_min 70.5\n");
502 fprintf(stderr,
" -clamp_z 70.5 72.5\n");
503 fprintf(stderr,
"Transform raw xyz integers.\n");
504 fprintf(stderr,
" -translate_raw_z 20\n");
505 fprintf(stderr,
" -translate_raw_xyz 1 1 0\n");
506 fprintf(stderr,
" -clamp_raw_z 500 800\n");
507 fprintf(stderr,
"Transform intensity.\n");
508 fprintf(stderr,
" -scale_intensity 2.5\n");
509 fprintf(stderr,
" -translate_intensity 50\n");
510 fprintf(stderr,
" -translate_then_scale_intensity 0.5 3.1\n");
511 fprintf(stderr,
"Transform scan_angle.\n");
512 fprintf(stderr,
" -scale_scan_angle 1.944445\n");
513 fprintf(stderr,
" -translate_scan_angle -5\n");
514 fprintf(stderr,
" -translate_then_scale_scan_angle -0.5 2.1\n");
515 fprintf(stderr,
"Change the return number or return count of points.\n");
516 fprintf(stderr,
" -repair_zero_returns\n");
517 fprintf(stderr,
" -change_return_number_from_to 2 1\n");
518 fprintf(stderr,
" -change_number_of_returns_from_to 0 2\n");
519 fprintf(stderr,
"Change classification by replacing one with another.\n");
520 fprintf(stderr,
" -change_classification_from_to 2 4\n");
521 fprintf(stderr,
"Change point source ID by replacing one with another.\n");
522 fprintf(stderr,
" -change_point_source_from_to 1023 1024\n");
523 fprintf(stderr,
"Transform gps_time.\n");
524 fprintf(stderr,
" -translate_gps_time 40.50\n");
525 fprintf(stderr,
"Transform RGB colors.\n");
526 fprintf(stderr,
" -scale_rgb_down (by 256)\n");
527 fprintf(stderr,
" -scale_rgb_up (by 256)\n");
534 for (i = 1; i <
argc; i++)
536 if (argv[i][0] ==
'\0')
540 else if (strcmp(argv[i],
"-h") == 0 || strcmp(argv[i],
"-help") == 0)
545 else if (strcmp(argv[i],
"-translate_x") == 0)
549 fprintf(stderr,
"ERROR: '%s' needs 1 argument: offset\n", argv[i]);
552 change_coordinates =
TRUE;
554 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
556 else if (strcmp(argv[i],
"-translate_y") == 0)
560 fprintf(stderr,
"ERROR: '%s' needs 1 argument: offset\n", argv[i]);
563 change_coordinates =
TRUE;
565 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
567 else if (strcmp(argv[i],
"-translate_z") == 0)
571 fprintf(stderr,
"ERROR: '%s' needs 1 argument: offset\n", argv[i]);
574 change_coordinates =
TRUE;
576 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
578 else if (strcmp(argv[i],
"-translate_xyz") == 0)
582 fprintf(stderr,
"ERROR: '%s' needs 3 arguments: offset_x offset_y offset_z\n", argv[i]);
585 change_coordinates =
TRUE;
587 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; *argv[i+3]=
'\0'; i+=3;
589 else if (strcmp(argv[i],
"-scale_x") == 0)
593 fprintf(stderr,
"ERROR: '%s' needs 1 argument: scale\n", argv[i]);
596 change_coordinates =
TRUE;
598 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
600 else if (strcmp(argv[i],
"-scale_y") == 0)
604 fprintf(stderr,
"ERROR: '%s' needs 1 argument: scale\n", argv[i]);
607 change_coordinates =
TRUE;
609 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
611 else if (strcmp(argv[i],
"-scale_z") == 0)
615 fprintf(stderr,
"ERROR: '%s' needs 1 argument: scale\n", argv[i]);
618 change_coordinates =
TRUE;
620 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
622 else if (strcmp(argv[i],
"-scale_xyz") == 0)
626 fprintf(stderr,
"ERROR: '%s' needs 3 arguments: scale_x scale_y scale_z\n", argv[i]);
629 change_coordinates =
TRUE;
631 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; *argv[i+3]=
'\0'; i+=3;
633 else if (strcmp(argv[i],
"-translate_then_scale_x") == 0)
637 fprintf(stderr,
"ERROR: '%s' needs 2 arguments: offset scale\n", argv[i]);
640 change_coordinates =
TRUE;
642 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; i+=2;
644 else if (strcmp(argv[i],
"-translate_then_scale_y") == 0)
648 fprintf(stderr,
"ERROR: '%s' needs 2 arguments: offset scale\n", argv[i]);
651 change_coordinates =
TRUE;
653 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; i+=2;
655 else if (strcmp(argv[i],
"-translate_then_scale_z") == 0)
659 fprintf(stderr,
"ERROR: '%s' needs 2 arguments: offset scale\n", argv[i]);
662 change_coordinates =
TRUE;
664 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; i+=2;
666 else if (strcmp(argv[i],
"-rotate_xy") == 0)
670 fprintf(stderr,
"ERROR: '%s' needs 3 arguments: angle, x, y\n", argv[i]);
673 change_coordinates =
TRUE;
675 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; *argv[i+3]=
'\0'; i+=3;
677 else if (strcmp(argv[i],
"-clamp_z") == 0)
681 fprintf(stderr,
"ERROR: '%s' needs 2 arguments: min, max\n", argv[i]);
684 change_coordinates =
TRUE;
686 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; i+=2;
688 else if (strcmp(argv[i],
"-clamp_z_min") == 0)
692 fprintf(stderr,
"ERROR: '%s' needs 1 argument: min\n", argv[i]);
695 change_coordinates =
TRUE;
697 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
699 else if (strcmp(argv[i],
"-clamp_z_max") == 0)
703 fprintf(stderr,
"ERROR: '%s' needs 1 argument: max\n", argv[i]);
706 change_coordinates =
TRUE;
708 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
710 else if (strcmp(argv[i],
"-translate_raw_x") == 0)
714 fprintf(stderr,
"ERROR: '%s' needs 1 argument: offset\n", argv[i]);
717 change_coordinates =
TRUE;
719 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
721 else if (strcmp(argv[i],
"-translate_raw_y") == 0)
725 fprintf(stderr,
"ERROR: '%s' needs 1 argument: offset\n", argv[i]);
728 change_coordinates =
TRUE;
730 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
732 else if (strcmp(argv[i],
"-translate_raw_z") == 0)
736 fprintf(stderr,
"ERROR: '%s' needs 1 argument: offset\n", argv[i]);
739 change_coordinates =
TRUE;
741 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
743 else if (strcmp(argv[i],
"-translate_raw_xyz") == 0)
747 fprintf(stderr,
"ERROR: '%s' needs 3 arguments: offset_x offset_y offset_z\n", argv[i]);
750 change_coordinates =
TRUE;
752 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; *argv[i+3]=
'\0'; i+=3;
754 else if (strcmp(argv[i],
"-clamp_raw_z") == 0)
758 fprintf(stderr,
"ERROR: '%s' needs 2 arguments: min, max\n", argv[i]);
761 change_coordinates =
TRUE;
763 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; i+=2;
765 else if (strcmp(argv[i],
"-scale_intensity") == 0)
769 fprintf(stderr,
"ERROR: '%s' needs 1 argument: scale\n", argv[i]);
773 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
775 else if (strcmp(argv[i],
"-translate_intensity") == 0)
779 fprintf(stderr,
"ERROR: '%s' needs 1 argument: offset\n", argv[i]);
783 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
785 else if (strcmp(argv[i],
"-translate_then_scale_intensity") == 0)
789 fprintf(stderr,
"ERROR: '%s' needs 2 arguments: offset scale\n", argv[i]);
793 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; i+=2;
795 else if (strcmp(argv[i],
"-scale_scan_angle") == 0)
799 fprintf(stderr,
"ERROR: '%s' needs 1 argument: scale\n", argv[i]);
803 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
805 else if (strcmp(argv[i],
"-translate_scan_angle") == 0)
809 fprintf(stderr,
"ERROR: '%s' needs 1 argument: offset\n", argv[i]);
813 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
815 else if (strcmp(argv[i],
"-translate_then_scale_scan_angle") == 0)
819 fprintf(stderr,
"ERROR: '%s' needs 2 arguments: offset scale\n", argv[i]);
823 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; i+=2;
825 else if (strcmp(argv[i],
"-change_classification_from_to") == 0)
829 fprintf(stderr,
"ERROR: '%s' needs 2 arguments: from_class to_class\n", argv[i]);
833 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; i+=2;
835 else if (strcmp(argv[i],
"-change_point_source_from_to") == 0)
839 fprintf(stderr,
"ERROR: '%s' needs 2 arguments: from_psid to_psid\n", argv[i]);
843 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; i+=2;
845 else if (strcmp(argv[i],
"-repair_zero_returns") == 0)
850 else if (strcmp(argv[i],
"-change_return_number_from_to") == 0)
854 fprintf(stderr,
"ERROR: '%s' needs 2 arguments: from_return_number to_return_number\n", argv[i]);
858 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; i+=2;
860 else if (strcmp(argv[i],
"-change_number_of_returns_from_to") == 0)
864 fprintf(stderr,
"ERROR: '%s' needs 2 arguments: from_number_of_returns to_number_of_returns\n", argv[i]);
868 *argv[i]=
'\0'; *argv[i+1]=
'\0'; *argv[i+2]=
'\0'; i+=2;
870 else if (strcmp(argv[i],
"-translate_gps_time") == 0)
874 fprintf(stderr,
"ERROR: '%s' needs 1 argument: offset\n", argv[i]);
878 *argv[i]=
'\0'; *argv[i+1]=
'\0'; i+=1;
880 else if (strcmp(argv[i],
"-scale_rgb_down") == 0 || strcmp(argv[i],
"-scale_rbg_down") == 0)
885 else if (strcmp(argv[i],
"-scale_rgb_up") == 0 || strcmp(argv[i],
"-scale_rbg_up") == 0)
890 else if (strcmp(argv[i],
"-switch_x_y") == 0)
895 else if (strcmp(argv[i],
"-switch_x_z") == 0)
900 else if (strcmp(argv[i],
"-switch_y_z") == 0)
905 else if (strcmp(argv[i],
"-flip_waveform_direction") == 0)
917 for (i = 0; i < num_operations; i++) operations[i]->
transform(point);
922 change_coordinates =
FALSE;
923 alloc_operations = 0;
930 if (operations) clean();
935 if (num_operations == alloc_operations)
938 alloc_operations += 16;
942 for (i = 0; i < num_operations; i++)
944 temp_operations[i] = operations[i];
946 delete [] operations;
948 operations = temp_operations;
950 operations[num_operations] = transform_operation;
void transform(LASpoint *point) const
const char * name() const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
const char * name() const
const char * name() const
const char * name() const
const char * name() const
const char * name() const
const char * name() const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
const char * name() const
const char * name() const
const char * name() const
const char * name() const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
const char * name() const
const char * name() const
U8 number_of_returns_from
void transform(LASpoint *point) const
const char * name() const
void transform(LASpoint *point) const
const char * name() const
const char * name() const
const char * name() const
LASoperationChangeClassificationFromTo(U8 class_from, U8 class_to)
const char * name() const
const char * name() const
const char * name() const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
const char * name() const
const char * name() const
const char * name() const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
const char * name() const
void transform(LASpoint *point) const
const char * name() const
const char * name() const
const char * name() const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
const char * name() const
const char * name() const
const char * name() const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
const char * name() const
const char * name() const
const char * name() const
void transform(LASpoint *point) const
void transform(LASpoint *point) const
const char * name() const
void transform(LASpoint *point) const
LASoperationTranslateX(F64 offset)
void transform(LASpoint *point) const
void transform(LASpoint *point) const
const char * name() const
const char * name() const
void transform(LASpoint *point) const
const char * name() const
U8 number_of_returns_of_given_pulse
void transform(LASpoint *point) const
void transform(LASpoint *point) const