-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improved compilation performance according to PIMPL idiom
- Loading branch information
1 parent
95ddd5d
commit 39674f7
Showing
40 changed files
with
733 additions
and
535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
#pragma once | ||
|
||
namespace ImOsm { | ||
class IRichItem | ||
{ | ||
namespace Rich { | ||
class IRichItem { | ||
public: | ||
virtual ~IRichItem() = default; | ||
|
||
virtual bool inBounds(float minLat, | ||
float maxLat, | ||
float minLon, | ||
float maxLon) const | ||
= 0; | ||
virtual bool inBounds(float minLat, float maxLat, float minLon, | ||
float maxLon) const = 0; | ||
virtual void setEnabled(bool enabled) = 0; | ||
virtual bool enabled() const = 0; | ||
virtual void paint() = 0; | ||
}; | ||
} // namespace Rich | ||
} // namespace ImOsm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,21 @@ | ||
#pragma once | ||
#include "ImOsmRichMarkStorage.h" | ||
#include <memory> | ||
#include <misc/cpp/imgui_stdlib.h> | ||
|
||
namespace ImOsm { | ||
namespace Rich { | ||
class DestinationCalcWidget | ||
{ | ||
class MarkStorage; | ||
|
||
class DestinationCalcWidget { | ||
public: | ||
DestinationCalcWidget(std::shared_ptr<MarkStorage> storage) | ||
: _storage{storage} {} | ||
DestinationCalcWidget(std::shared_ptr<MarkStorage> storage); | ||
~DestinationCalcWidget(); | ||
|
||
void paint() { | ||
ImGui::PushID(this); | ||
ImGui::TextUnformatted("Destination Calculator"); | ||
ImGui::SetNextItemWidth(100.f); | ||
ImGui::InputText("Mark A", &_markNameA); | ||
ImGui::SetNextItemWidth(100.f); | ||
ImGui::InputFloat("Distance [m]##", &_distance, {}, {}, "%.2f"); | ||
ImGui::SameLine(); | ||
ImGui::SetNextItemWidth(100.f); | ||
ImGui::InputFloat("Bearing [deg]##", &_bearing, {}, {}, "%.2f"); | ||
ImGui::SameLine(); | ||
if (ImGui::Button("Calculate##")) { | ||
bool foundA{false}; | ||
_markA = _storage->findMark(_markNameA, foundA); | ||
if (foundA) { | ||
_markB = _markA.destination(_distance, _bearing); | ||
} | ||
} | ||
ImGui::Text("Destination [deg] Lat: %.6f Lon: %.6f", _markB.lat, _markB.lon); | ||
ImGui::SameLine(); | ||
if (ImGui::Button("Pick##")) { | ||
_storage->setPickCoords(_markB); | ||
} | ||
ImGui::PopID(); | ||
} | ||
void paint(); | ||
|
||
private: | ||
struct Ui; | ||
std::unique_ptr<Ui> _ui; | ||
std::shared_ptr<MarkStorage> _storage; | ||
std::string _markNameA; | ||
GeoCoords _markA, _markB; | ||
float _distance{}, _bearing{}; | ||
}; | ||
} // namespace Rich | ||
} // namespace ImOsm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,22 @@ | ||
#pragma once | ||
#include "ImOsmRichMarkStorage.h" | ||
#include <imgui.h> | ||
#include <memory> | ||
#include <misc/cpp/imgui_stdlib.h> | ||
#include <string> | ||
|
||
namespace ImOsm { | ||
namespace Rich { | ||
class DistanceCalcWidget | ||
{ | ||
class MarkStorage; | ||
|
||
class DistanceCalcWidget { | ||
public: | ||
DistanceCalcWidget(std::shared_ptr<MarkStorage> storage) | ||
: _storage{storage} {} | ||
DistanceCalcWidget(std::shared_ptr<MarkStorage> storage); | ||
~DistanceCalcWidget(); | ||
|
||
void paint() { | ||
ImGui::PushID(this); | ||
ImGui::TextUnformatted("D/B/M Calculator"); | ||
ImGui::SetNextItemWidth(100.f); | ||
ImGui::InputText("Mark A##", &_markNameA); | ||
ImGui::SameLine(); | ||
ImGui::SetNextItemWidth(100.f); | ||
ImGui::InputText("Mark B##", &_markNameB); | ||
ImGui::SameLine(); | ||
if (ImGui::Button("Calculate##")) { | ||
bool foundA{false}, foundB{false}; | ||
_markA = _storage->findMark(_markNameA, foundA); | ||
_markB = _storage->findMark(_markNameB, foundB); | ||
if (foundA && foundB) { | ||
_distance = _markA.distance(_markB); | ||
_bearing = _markA.bearing(_markB); | ||
_markC = _markA.midpoint(_markB); | ||
} | ||
} | ||
if (_distance < 1e3) { | ||
ImGui::Text("Distance [m] %.2f", _distance); | ||
} else { | ||
ImGui::Text("Distance [km] %.2f", _distance * 1e-3); | ||
} | ||
ImGui::Text("Bearing [deg] %.2f", _bearing); | ||
ImGui::Text("Midpoint [deg] Lat: %.6f Lon: %.6f", _markC.lat, _markC.lon); | ||
ImGui::SameLine(); | ||
if (ImGui::Button("Pick##")) { | ||
_storage->setPickCoords(_markC); | ||
} | ||
ImGui::PopID(); | ||
} | ||
void paint(); | ||
|
||
private: | ||
std::string _markNameA, _markNameB; | ||
GeoCoords _markA, _markB, _markC; | ||
std::shared_ptr<MarkStorage> _storage; | ||
double _distance{}, _bearing{}; | ||
|
||
struct Ui; | ||
std::unique_ptr<Ui> _ui; | ||
}; | ||
} // namespace Rich | ||
} // namespace ImOsm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.