Fix unused var warning

This commit is contained in:
Ahmed Essam 2020-09-16 02:59:50 +02:00
parent 6d91abc9e8
commit b6148a712b
4 changed files with 16 additions and 19 deletions

View File

@ -123,12 +123,12 @@ ArrangementDemoTabBase* ArrangementDemoWindow::makeTab(TraitsType tt)
demoTab =
new ArrangementDemoTab<typename decltype(type_holder)::type>(this);
});
this->addTab(demoTab, tabLabel, tt);
this->addTab(demoTab, tabLabel);
return demoTab;
}
void ArrangementDemoWindow::addTab(
ArrangementDemoTabBase* demoTab, QString tabLabel, TraitsType tt)
ArrangementDemoTabBase* demoTab, QString tabLabel)
{
this->tabs.push_back(demoTab);
@ -660,29 +660,27 @@ void ArrangementDemoWindow::on_actionOverlay_triggered()
{
demo_types::forEachArrangementType([&](auto type_holder) {
using Arr = typename decltype(type_holder)::type;
auto tt = demo_types::enumFromArrType<Arr>();
Arr* arr;
Arr* arr2;
if (CGAL::assign(arr, arrs[0]) && CGAL::assign(arr2, arrs[1]))
this->makeOverlayTab(arr, arr2, tt);
this->makeOverlayTab(arr, arr2);
});
}
}
}
template <class ArrType>
ArrangementDemoTabBase* ArrangementDemoWindow::makeTab(
std::unique_ptr<ArrType> arr, QString tabLabel, TraitsType tt)
ArrangementDemoTabBase*
ArrangementDemoWindow::makeTab(std::unique_ptr<ArrType> arr, QString tabLabel)
{
auto demoTab = new ArrangementDemoTab<ArrType>(this, std::move(arr));
this->addTab(demoTab, tabLabel, tt);
this->addTab(demoTab, tabLabel);
return demoTab;
}
template <class ArrType>
void ArrangementDemoWindow::makeOverlayTab(
ArrType* arr1, ArrType* arr2, TraitsType tt)
void ArrangementDemoWindow::makeOverlayTab(ArrType* arr1, ArrType* arr2)
{
QString tabLabel = QString("Overlay Tab");
@ -690,7 +688,7 @@ void ArrangementDemoWindow::makeOverlayTab(
CGAL::Arr_default_overlay_traits<ArrType> defaultTraits;
CGAL::overlay(*arr1, *arr2, *overlayArr, defaultTraits);
makeTab(std::move(overlayArr), tabLabel, tt);
makeTab(std::move(overlayArr), tabLabel);
}
struct ArrWriter
@ -827,7 +825,7 @@ ArrangementDemoTabBase* ArrangementDemoWindow::openArrFile(QString filename)
demo_types::visitArrangementType(tt, [&](auto type_holder) {
auto arr = ArrReader{ifs}(type_holder);
createdTab = this->makeTab(std::move(arr), this->makeTabLabel(tt), tt);
createdTab = this->makeTab(std::move(arr), this->makeTabLabel(tt));
});
return createdTab;

View File

@ -87,7 +87,7 @@ Q_SIGNALS:
protected:
void setupUi();
ArrangementDemoTabBase* makeTab(demo_types::TraitsType);
void addTab(ArrangementDemoTabBase*, QString, demo_types::TraitsType);
void addTab(ArrangementDemoTabBase*, QString);
void resetCallbackState(ArrangementDemoTabBase*);
void resetActionGroups(ArrangementDemoTabBase*, demo_types::TraitsType);
void hideInsertMethods();
@ -98,10 +98,10 @@ protected:
template <class ArrType>
ArrangementDemoTabBase*
makeTab(std::unique_ptr<ArrType> arr, QString, demo_types::TraitsType);
makeTab(std::unique_ptr<ArrType> arr, QString);
template <class ArrType>
void makeOverlayTab(ArrType* arr1, ArrType* arr2, demo_types::TraitsType);
void makeOverlayTab(ArrType* arr1, ArrType* arr2);
private:
Ui::ArrangementDemoWindow* ui;

View File

@ -85,7 +85,7 @@ if (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND)
${CGAL_Qt5_RESOURCE_FILES}
${CGAL_Qt5_MOC_FILES})
qt5_use_modules(arrangement_2 Core Gui Widgets)
target_link_libraries(arrangement_2 Qt5::Core Qt5::Gui Qt5::Widgets)
target_link_libraries(arrangement_2 CGAL::CGAL CGAL::CGAL_Qt5 CGAL::CGAL_Core)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS arrangement_2)

View File

@ -30,9 +30,9 @@ struct ConstructBoundingBox_impl
CGAL::Bbox_2 bbox;
try
{
bbox= curve.bbox();
bbox = curve.bbox();
}
// algebraic traits sometimes when calling bbox
// algebraic traits sometimes crash when calling bbox
// example: xy=0
catch (std::exception& ex)
{
@ -252,8 +252,7 @@ struct ConstructBoundingBox_impl<CGAL::Arr_Bezier_curve_traits_2<
CGAL::Bbox_2
operator()(const X_monotone_curve_2& curve)
{
// TODO: find a way to find bounding box of a X_monotone_curve of bezier
// arrangements
// TODO: find a way to find the bounding box of a bezier X_monotone_curve
return curve.supporting_curve().bbox();
}