45 this->ProcessObjectType::SetNthInput(0,
46 const_cast<LineSpatialObjectListType *>(input));
54 (this->ProcessObjectType::GetInput(0));
62 (this->ProcessObjectType::GetOutput(0));
81 LineSpatialObjectListType::const_iterator itLineListA = inputLine->begin();
82 LineSpatialObjectListType::const_iterator itLineListAEnd = inputLine->end();
83 LineSpatialObjectListType::const_iterator itLineListB;
84 LineSpatialObjectListType::const_iterator itLineListBEnd = inputLine->end();
86 double x1(0.), y1(0.), x2(0.), y2(0.), x3(0.), y3(0.), x4(0.), y4(0.);
87 double xTemp(0.), yTemp(0.);
88 double R13(0.), R14(0.), R23(0.), R24(0.);
91 PointListType::const_iterator itPoints;
93 CosTheta = vcl_cos(m_AngularBeam);
96 while (itLineListA != itLineListAEnd)
98 itLineListB = itLineListA;
102 itPoints = pointsList.begin();
104 x1 = (*itPoints).GetPosition()[0];
105 y1 = (*itPoints).GetPosition()[1];
108 x2 = (*itPoints).GetPosition()[0];
109 y2 = (*itPoints).GetPosition()[1];
115 pointList.push_back(point);
117 pointList.push_back(point);
121 line->SetPoints(pointList);
122 line->ComputeBoundingBox();
123 outputLine->push_back(line);
125 while (itLineListB != itLineListBEnd)
128 pointsList = (*itLineListB)->GetPoints();
129 itPoints = pointsList.begin();
131 x3 = (*itPoints).GetPosition()[0];
132 y3 = (*itPoints).GetPosition()[1];
135 x4 = (*itPoints).GetPosition()[0];
136 y4 = (*itPoints).GetPosition()[1];
140 R13 = vcl_sqrt((x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3));
141 R14 = vcl_sqrt((x1 - x4) * (x1 - x4) + (y1 - y4) * (y1 - y4));
142 R23 = vcl_sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3));
143 R24 = vcl_sqrt((x2 - x4) * (x2 - x4) + (y2 - y4) * (y2 - y4));
145 double Rmin = m_Radius;
148 if (R13 < Rmin) Rmin = R13;
149 if (R14 < Rmin) Rmin = R14;
150 if (R23 < Rmin) Rmin = R23;
151 if (R24 < Rmin) Rmin = R24;
196 double Angle12_23, Angle12_34, Angle23_34;
204 Angle12_23 = vcl_cos(vcl_atan2((y2 - y1), (x2 - x1)) - vcl_atan2((y3 - y2), (x3 - x2)));
205 Angle12_34 = vcl_cos(vcl_atan2((y2 - y1), (x2 - x1)) - vcl_atan2((y4 - y3), (x4 - x3)));
206 Angle23_34 = vcl_cos(vcl_atan2((y3 - y2), (x3 - x2)) - vcl_atan2((y4 - y3), (x4 - x3)));
208 if ((Angle12_23 > CosTheta) && (Angle12_34 > CosTheta) && (Angle23_34 > CosTheta))
216 pointList.push_back(point);
218 pointList.push_back(point);
222 line->SetPoints(pointList);
223 line->ComputeBoundingBox();
224 outputLine->push_back(line);
242 pointList.push_back(point);
244 pointList.push_back(point);
248 line->SetPoints(pointList);
249 line->ComputeBoundingBox();
250 outputLine->push_back(line);
264 Superclass::PrintSelf(os, indent);