API Documentation
Loading...
Searching...
No Matches
GeometryToSymbol.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#if NDEVR_MODEL_TILE_CONTAINER
4#include <NDEVR/Editor.h>
5#include <NDEVR/QTModelManager.h>
6#include <NDEVR/QTDesignObject.h>
7#include <NDEVR/ModelTileContainer.h>
8namespace Ui {
9 class GeometryToSymbolUI;
10
11}
12class QBoxLayout;
13namespace NDEVR
14{
15 class Button;
16 class LibraryManager;
17 struct TileOption
18 {
19 TileOption(const String& id, const String& icon, const String& category, const String& model_file)
20 : id(id)
21 , icon(icon)
22 , category(category)
23 , model_file(model_file)
24 {}
25 TileOption(const String& id, const String& icon, const String& category, const Polyline<3, fltp08> extrusion_polyline)
26 : id(id)
27 , icon(icon)
28 , category(category)
29 , extrusion_polyline(extrusion_polyline)
30 {}
31 String id;
32 String icon;
33 String category;
34 String model_file;
35 Polyline<3, fltp08> extrusion_polyline;
36 Button* button;
37 };
38 class NDEVR_API GeometryToSymbol : public Editor
39 {
40 Q_OBJECT
41 public:
42 GeometryToSymbol(DynamicPointer<QTDesignObject> object, QWidget* parent = nullptr);
43 GeometryToSymbol(QWidget* parent = nullptr);
44 void setTarget(const DynamicPointer<QTDesignObject>& object) override;
45 void updateValues() override;
46 static void CreateTileLibraryManager(QTModelManager* manager);
47 static void RegisterEditor();
48 protected:
49 void tileModel(const Model& model_to_tile, const ModelTileOptions& options);
50 void extrudeModel(const Polyline<3, fltp08> polyline_extrusion);
51 void init();
52 void loadDefaultSettings(const Model& model, bool reset_if_no_exist);
53 void saveDefaultSettings(const UUID& id);
54 void setSettings(const ModelTileOptions& options);
55 void setOptionsFromUI(ModelTileOptions& options) const;
56 void _updateFromUI();
57 public slots:
58 void updateFromUISlot();
59 void onModelChosen(const Buffer<UUID>& selected);
60 private:
61 Ui::GeometryToSymbolUI* ui;
62 Model m_tiled_object;
63 Model m_model_to_tile;
64 Dictionary<String, TileOption> m_tile_options;
65 Dictionary<String, QBoxLayout*> m_layouts;
66 static LibraryManager* s_tile_library_manager;
67 QTimer* m_update_timer;
68 ModelTileOptions m_last_options;
69 bool m_has_edited = false;
70 };
71}
72#endif
#define NDEVR_API
Definition DLLInfo.h:67
Definition ACIColor.h:37
Definition FontEditor.h:6