Skip to content

Commit 51dd2fe

Browse files
committed
Progress importing changes from develop
1 parent 40856c3 commit 51dd2fe

File tree

17 files changed

+1953
-1488
lines changed

17 files changed

+1953
-1488
lines changed

apps/RawLogViewer/ViewOptions3DPoints.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,16 @@ ViewOptions3DPoints::ViewOptions3DPoints(wxWindow* parent, wxWindowID id)
132132
FlexGridSizer3->Add(
133133
cbOnlyPointsWithColor, 1, wxALL | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, 5);
134134

135-
rbColorByAxis = new wxRadioBox(
136-
this, ID_RADIOBOX1, _("Otherwise, color from: "), wxDefaultPosition, wxDefaultSize, 4,
137-
__wxRadioBoxChoices_1, 1, 0, wxDefaultValidator, _T("ID_RADIOBOX1"));
138-
FlexGridSizer3->Add(rbColorByAxis, 1, wxEXPAND, 5);
135+
const wxString colorOptions[] = {"x", "y", "z", "i", "intensity", "ambient",
136+
"r", "t", "time", "timestamp", "reflectivity"};
137+
138+
cbColorByAxis = new wxComboBox(
139+
this, ID_RADIOBOX1, _("Otherwise, color from:"), wxDefaultPosition, wxDefaultSize,
140+
WXSIZEOF(colorOptions), colorOptions,
141+
wxCB_READONLY, // prevents typing arbitrary values
142+
wxDefaultValidator, _T("ID_COMBOBOX_COLORBY"));
143+
144+
FlexGridSizer3->Add(cbColorByAxis, 1, wxEXPAND, 5);
139145
wxString __wxRadioBoxChoices_2[3] = {_("cmGRAYSCALE"), _("cmJET"), _("cmHOT")};
140146
RadioBox1 = new wxRadioBox(
141147
this, ID_RADIOBOX2, _("Color map"), wxDefaultPosition, wxDefaultSize, 3,
@@ -220,7 +226,7 @@ ViewOptions3DPoints::ViewOptions3DPoints(wxWindow* parent, wxWindowID id)
220226
Bind(wxEVT_BUTTON, &Me::OnbtnApplyClick, this, ID_BUTTON1);
221227
Bind(wxEVT_CHECKBOX, &Me::OnbtnApplyClick, this, ID_CHECKBOX1);
222228
Bind(wxEVT_CHECKBOX, &Me::OnbtnApplyClick, this, ID_CHECKBOX2);
223-
Bind(wxEVT_RADIOBOX, &Me::OnbtnApplyClick, this, ID_RADIOBOX1);
229+
Bind(wxEVT_COMBOBOX, &Me::OnbtnApplyClick, this, ID_RADIOBOX1);
224230
Bind(wxEVT_RADIOBOX, &Me::OnbtnApplyClick, this, ID_RADIOBOX2);
225231
Bind(wxEVT_CHECKBOX, &Me::OnbtnApplyClick, this, ID_CHECKBOX3);
226232
Bind(wxEVT_SPINCTRL, &Me::OnbtnApplyClick, this, ID_SPINCTRL1);
@@ -250,7 +256,8 @@ void ParametersView3DPoints::to_UI(ViewOptions3DPoints& ui) const
250256
ui.edTickTextSize->SetValue(wxString::Format("%.03f", axisTickTextSize));
251257

252258
ui.cbColorFromRGB->SetValue(colorFromRGBimage);
253-
ui.rbColorByAxis->SetSelection(colorizeByAxis);
259+
ui.cbColorByAxis->SetValue(colorizeByField);
260+
254261
ui.cbInvertColormap->SetValue(invertColorMapping);
255262

256263
ui.RadioBox1->SetSelection(static_cast<int>(colorMap));
@@ -280,7 +287,7 @@ void ParametersView3DPoints::from_UI(const ViewOptions3DPoints& ui)
280287

281288
colorFromRGBimage = ui.cbColorFromRGB->IsChecked();
282289

283-
colorizeByAxis = ui.rbColorByAxis->GetSelection();
290+
colorizeByField = ui.cbColorByAxis->GetValue();
284291

285292
invertColorMapping = ui.cbInvertColormap->IsChecked();
286293

apps/RawLogViewer/ViewOptions3DPoints.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <wx/button.h>
2020
#include <wx/checkbox.h>
2121
#include <wx/clrpicker.h>
22+
#include <wx/combobox.h>
2223
#include <wx/panel.h>
2324
#include <wx/radiobox.h>
2425
#include <wx/sizer.h>
@@ -56,7 +57,7 @@ class ViewOptions3DPoints : public wxPanel
5657
wxCheckBox* cb2DShowPoints;
5758
wxRadioBox* RadioBox1;
5859
wxCheckBox* cbColorFromRGB;
59-
wxRadioBox* rbColorByAxis;
60+
wxComboBox* cbColorByAxis;
6061
wxTextCtrl* edTickTextSize;
6162
wxCheckBox* cbShowAxes;
6263
wxSpinCtrl* edPointSize;

modules/mrpt_containers/include/mrpt/containers/NonCopiableData.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ class NonCopiableData
3535

3636
T data;
3737

38+
NonCopiableData& operator=(const T& value)
39+
{
40+
data = value;
41+
return *this;
42+
}
43+
44+
NonCopiableData(T&& value) : data(std::move(value)) {}
45+
NonCopiableData(const T& value) : data(value) {}
46+
47+
T& operator*() { return data; }
48+
const T& operator*() const { return data; }
49+
T* operator->() { return &data; }
50+
const T* operator->() const { return &data; }
51+
3852
NonCopiableData(const NonCopiableData&) {}
3953
NonCopiableData& operator=(const NonCopiableData&) { return *this; }
4054

modules/mrpt_core/include/mrpt/core/WorkerThreadsPool.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ class WorkerThreadsPool
9393
* available. */
9494
template <class F, class... Args>
9595
[[nodiscard]] auto enqueue(F&& f, Args&&... args)
96-
-> std::future<typename std::result_of<F(Args...)>::type>;
96+
-> std::future<std::invoke_result_t<F, Args...>>;
9797

9898
/** Returns the number of enqueued tasks, currently waiting for a free
9999
* working thread to process them. */
100-
std::size_t pendingTasks() const noexcept;
100+
[[nodiscard]] std::size_t pendingTasks() const noexcept;
101101

102102
/** Sets the private thread names of threads in this pool.
103103
* Names can be seen from debuggers, profilers, etc. and will follow
@@ -107,7 +107,7 @@ class WorkerThreadsPool
107107
void name(const std::string& name);
108108

109109
/** Returns the base name of threads in this pool */
110-
std::string name() const { return name_; }
110+
[[nodiscard]] std::string name() const { return name_; }
111111

112112
private:
113113
std::vector<std::thread> threads_;
@@ -121,16 +121,16 @@ class WorkerThreadsPool
121121

122122
template <class F, class... Args>
123123
auto WorkerThreadsPool::enqueue(F&& f, Args&&... args)
124-
-> std::future<typename std::result_of<F(Args...)>::type>
124+
-> std::future<std::invoke_result_t<F, Args...>>
125125
{
126-
using return_type = typename std::result_of<F(Args...)>::type;
126+
using return_type = std::invoke_result_t<F, Args...>;
127127

128128
auto task = std::make_shared<std::packaged_task<return_type()>>(
129129
std::bind(std::forward<F>(f), std::forward<Args>(args)...));
130130

131131
std::future<return_type> res = task->get_future();
132132
{
133-
std::unique_lock<std::mutex> lock(queue_mutex_);
133+
const std::unique_lock<std::mutex> lock(queue_mutex_);
134134

135135
// don't allow enqueueing after stopping the pool
136136
if (do_stop_)

modules/mrpt_maps/include/mrpt/maps.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ MRPT_WARNING(
2525
#include <mrpt/maps/CColouredOctoMap.h>
2626
#include <mrpt/maps/CColouredPointsMap.h>
2727
#include <mrpt/maps/CGasConcentrationGridMap2D.h>
28+
#include <mrpt/maps/CGenericPointsMap.h>
2829
#include <mrpt/maps/CHeightGridMap2D.h>
2930
#include <mrpt/maps/CHeightGridMap2D_MRF.h>
3031
#include <mrpt/maps/CMultiMetricMap.h>

0 commit comments

Comments
 (0)