Skip to content

Commit 5b238c8

Browse files
Commit tutorials that math the webpage and modifications found with non working code
1 parent c7c7883 commit 5b238c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1972
-436
lines changed

libraries/userinterface/include/userinterface/widgets/Button.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Now the button waits with the red color in the following drawing operations
6262
6363
*/
6464

65-
class Button : public Drawable , public utilities::Lockable, public SignalProcessor<Button> {
65+
class Button final : public Drawable , public utilities::Lockable, public SignalProcessor<Button> {
6666

6767
public:
6868

libraries/userinterface/include/userinterface/widgets/Container.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ int main(){
105105
namespace curan {
106106
namespace ui {
107107

108-
class Container : public Drawable , utilities::Lockable{
108+
class Container final : public Drawable , utilities::Lockable{
109109
public:
110110

111111
enum class ContainerType{

libraries/userinterface/include/userinterface/widgets/ImageDisplay.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace ui {
1515

1616
using custom_step = std::function<void(SkCanvas*, SkRect, SkRect)>;
1717

18-
class ImageDisplay : public Drawable, public utilities::Lockable, public SignalProcessor<ImageDisplay>{
18+
class ImageDisplay final : public Drawable, public utilities::Lockable, public SignalProcessor<ImageDisplay>{
1919
int width = -1;
2020
int height = -1;
2121
bool compiled = false;

libraries/userinterface/include/userinterface/widgets/ImutableTextPanel.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef CURAN_MUTATING_TEXTPANEL_HEADER_FILE_
2-
#define CURAN_MUTATING_TEXTPANEL_HEADER_FILE_
1+
#ifndef CURAN_IMUTABLE_TEXTPANEL_HEADER_FILE_
2+
#define CURAN_IMUTABLE_TEXTPANEL_HEADER_FILE_
33

44
#include "userinterface/widgets/ConfigDraw.h"
55
#include "utils/Overloading.h"
@@ -19,7 +19,7 @@ namespace ui{
1919
2020
*/
2121

22-
class ImutableTextPanel : public curan::ui::Drawable, public curan::utilities::Lockable
22+
class ImutableTextPanel final : public curan::ui::Drawable, public curan::utilities::Lockable
2323
{
2424
public:
2525

libraries/userinterface/include/userinterface/widgets/ItemExplorer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct Item {
3434
explicit Item(size_t identifier, std::string text);
3535
};
3636

37-
class ItemExplorer : public Drawable , public utilities::Lockable, public SignalProcessor<ItemExplorer> {
37+
class ItemExplorer final : public Drawable , public utilities::Lockable, public SignalProcessor<ItemExplorer> {
3838
public:
3939

4040
static std::unique_ptr<ItemExplorer> make(const std::string& default_icon_name,IconResources& system_icons,bool is_exclusive = true);

libraries/userinterface/include/userinterface/widgets/MiniPage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace curan {
1313
namespace ui {
1414

15-
class MiniPage : public Drawable , public utilities::Lockable, public SignalProcessor<MiniPage> {
15+
class MiniPage final : public Drawable , public utilities::Lockable, public SignalProcessor<MiniPage> {
1616

1717
std::unique_ptr<LightWeightPage> main_page;
1818
std::unique_ptr<LightWeightPage> replacement_main_page;

libraries/userinterface/include/userinterface/widgets/MutatingTextPanel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace curan
2020
class MutatingTextPanel;
2121
using text_defined_callback = std::function<void(MutatingTextPanel* button, const std::string& ,ConfigDraw* config)>;
2222

23-
class MutatingTextPanel : public curan::ui::Drawable, public curan::utilities::Lockable, public curan::ui::SignalProcessor<MutatingTextPanel>
23+
class MutatingTextPanel final : public curan::ui::Drawable, public curan::utilities::Lockable, public curan::ui::SignalProcessor<MutatingTextPanel>
2424
{
2525
std::vector<text_defined_callback> panel_callback;
2626
const std::array<std::string, 3> kTypefaces = {"sans-serif", "serif", "monospace"};

libraries/userinterface/include/userinterface/widgets/OpenIGTLinkViewer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace curan {
4545
std::list<Message> received_messages;
4646
};
4747

48-
class OpenIGTLinkViewer : public Drawable, public utilities::Lockable, public SignalProcessor<OpenIGTLinkViewer>{
48+
class OpenIGTLinkViewer final : public Drawable, public utilities::Lockable, public SignalProcessor<OpenIGTLinkViewer>{
4949
MessageContainer container;
5050
Press last_pressed_position;
5151
SkRect widget_rect;

libraries/userinterface/include/userinterface/widgets/Panel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace curan{
1414
namespace ui{
1515

16-
class Panel : public curan::ui::Drawable, public curan::utilities::Lockable, public curan::ui::SignalProcessor<Panel>
16+
class Panel final : public curan::ui::Drawable, public curan::utilities::Lockable, public curan::ui::SignalProcessor<Panel>
1717
{
1818
private:
1919

libraries/userinterface/include/userinterface/widgets/Plotter.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313
namespace curan {
1414
namespace ui {
1515

16-
class Plotter : public curan::ui::Drawable , public curan::utilities::Lockable, public curan::ui::SignalProcessor<Plotter> {
17-
18-
std::vector<curan::utilities::CircularBuffer<SkPoint>> buffers;
16+
class Plotter final : public curan::ui::Drawable , public curan::utilities::Lockable, public curan::ui::SignalProcessor<Plotter> {
17+
std::vector<std::tuple<size_t,std::vector<SkPoint>>> buffers_with_counters;
1918
std::vector<uint8_t> verbs;
2019
SkPath path;
2120
SkColor background = SK_ColorWHITE;
22-
21+
2322

2423
public:
2524

@@ -42,8 +41,10 @@ void compile() override;
4241
~Plotter();
4342

4443
inline void append(const SkPoint& in,const size_t& index){
45-
assert(index < buffers.size());
46-
buffers[index].put(SkPoint{in});
44+
assert(index < buffers_with_counters.size());
45+
auto& [counter,array] = buffers_with_counters[index];
46+
++counter;
47+
array[counter % array.size()] = in;
4748
}
4849

4950
curan::ui::drawablefunction draw() override;

0 commit comments

Comments
 (0)