comparison Framework/Toolbox/DicomStructureSet.cpp @ 794:04f518ebd132

LoaderStateMachine
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 28 May 2019 12:26:16 +0200
parents 4fe4b221a31f
children 61ba4b504e9a
comparison
equal deleted inserted replaced
793:f72b49954f62 794:04f518ebd132
676 } 676 }
677 } 677 }
678 678
679 679
680 bool DicomStructureSet::ProjectStructure(std::vector< std::vector<PolygonPoint> >& polygons, 680 bool DicomStructureSet::ProjectStructure(std::vector< std::vector<PolygonPoint> >& polygons,
681 Structure& structure, 681 const Structure& structure,
682 const CoordinateSystem3D& slice) 682 const CoordinateSystem3D& slice) const
683 { 683 {
684 polygons.clear(); 684 polygons.clear();
685 685
686 Vector normal = GetNormal(); 686 Vector normal = GetNormal();
687 687
688 bool isOpposite; 688 bool isOpposite;
689 if (GeometryToolbox::IsParallelOrOpposite(isOpposite, normal, slice.GetNormal())) 689 if (GeometryToolbox::IsParallelOrOpposite(isOpposite, normal, slice.GetNormal()))
690 { 690 {
691 // This is an axial projection 691 // This is an axial projection
692 692
693 for (Polygons::iterator polygon = structure.polygons_.begin(); 693 for (Polygons::const_iterator polygon = structure.polygons_.begin();
694 polygon != structure.polygons_.end(); ++polygon) 694 polygon != structure.polygons_.end(); ++polygon)
695 { 695 {
696 if (polygon->IsOnSlice(slice)) 696 if (polygon->IsOnSlice(slice))
697 { 697 {
698 polygons.push_back(std::vector<PolygonPoint>()); 698 polygons.push_back(std::vector<PolygonPoint>());
714 { 714 {
715 #if 1 715 #if 1
716 // Sagittal or coronal projection 716 // Sagittal or coronal projection
717 std::vector<BoostPolygon> projected; 717 std::vector<BoostPolygon> projected;
718 718
719 for (Polygons::iterator polygon = structure.polygons_.begin(); 719 for (Polygons::const_iterator polygon = structure.polygons_.begin();
720 polygon != structure.polygons_.end(); ++polygon) 720 polygon != structure.polygons_.end(); ++polygon)
721 { 721 {
722 double x1, y1, x2, y2; 722 double x1, y1, x2, y2;
723 if (polygon->Project(x1, y1, x2, y2, slice)) 723 if (polygon->Project(x1, y1, x2, y2, slice))
724 { 724 {