mirror of https://github.com/CGAL/cgal
Removed textoutput, Edit, and renamed Tools to Algorithms
This commit is contained in:
parent
19dfb6d743
commit
40e63c3bde
|
|
@ -162,46 +162,13 @@ MainWindow::processInput(CGAL::Object o)
|
||||||
std::list<Point_2> points;
|
std::list<Point_2> points;
|
||||||
if(CGAL::assign(points, o)){
|
if(CGAL::assign(points, o)){
|
||||||
if((points.size() == 1)&& poly.size()>0){
|
if((points.size() == 1)&& poly.size()>0){
|
||||||
Point_2 p = points.front();
|
|
||||||
// make the inside test
|
|
||||||
CGAL::Bounded_side bside = poly.bounded_side(p);
|
|
||||||
switch (bside) {
|
|
||||||
case CGAL::ON_BOUNDED_SIDE:
|
|
||||||
textEdit->append(" The point is inside the polygon"); break;
|
|
||||||
case CGAL::ON_BOUNDARY:
|
|
||||||
textEdit->append(" The point is on the boundary of the polygon"); break;
|
|
||||||
case CGAL::ON_UNBOUNDED_SIDE:
|
|
||||||
textEdit->append(" The point is outside the polygon"); break;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
poly.clear();
|
poly.clear();
|
||||||
if(points.front() == points.back()){
|
if(points.front() == points.back()){
|
||||||
points.pop_back();
|
points.pop_back();
|
||||||
}
|
}
|
||||||
poly.insert(poly.vertices_begin(), points.begin(), points.end());
|
poly.insert(poly.vertices_begin(), points.begin(), points.end());
|
||||||
textEdit->clear();
|
|
||||||
if(poly.is_empty()){
|
|
||||||
textEdit->append("P is empty!");
|
|
||||||
} else {
|
|
||||||
if(poly.is_simple()){
|
|
||||||
textEdit->append("P is simple");
|
|
||||||
CGAL::Orientation o = poly.orientation();
|
|
||||||
switch (o) {
|
|
||||||
case CGAL::CLOCKWISE:
|
|
||||||
textEdit->append("P.orientation() == CLOCKWISE");
|
|
||||||
break;
|
|
||||||
case CGAL::COUNTERCLOCKWISE:
|
|
||||||
textEdit->append("P.orientation() == COUNTERCLOCKWISE");
|
|
||||||
break;
|
|
||||||
case CGAL::COLLINEAR:
|
|
||||||
textEdit->append("P.orientation() == COLLINEAR");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
textEdit->append(QString("The area of P is %1").arg(poly.area()));
|
|
||||||
} else {
|
|
||||||
textEdit->append("P is not simple");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
emit(changed());
|
emit(changed());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,14 +44,6 @@
|
||||||
<enum>QGraphicsView::NoAnchor</enum>
|
<enum>QGraphicsView::NoAnchor</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QTextEdit" name="textEdit" >
|
|
||||||
<property name="sizePolicy" >
|
|
||||||
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
|
||||||
<horstretch>1</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -103,14 +95,9 @@
|
||||||
<addaction name="separator" />
|
<addaction name="separator" />
|
||||||
<addaction name="actionQuit" />
|
<addaction name="actionQuit" />
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuEdit" >
|
|
||||||
<property name="title" >
|
|
||||||
<string>&Edit</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QMenu" name="menuTools" >
|
<widget class="QMenu" name="menuTools" >
|
||||||
<property name="title" >
|
<property name="title" >
|
||||||
<string>&Tools</string>
|
<string>&Algorithms</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="separator" />
|
<addaction name="separator" />
|
||||||
<addaction name="actionRecenter" />
|
<addaction name="actionRecenter" />
|
||||||
|
|
@ -123,7 +110,6 @@
|
||||||
<addaction name="actionLinearLeastSquaresFittingOfSegments" />
|
<addaction name="actionLinearLeastSquaresFittingOfSegments" />
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="menuFile" />
|
<addaction name="menuFile" />
|
||||||
<addaction name="menuEdit" />
|
|
||||||
<addaction name="menuTools" />
|
<addaction name="menuTools" />
|
||||||
</widget>
|
</widget>
|
||||||
<action name="actionAbout" >
|
<action name="actionAbout" >
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue