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 /**--------------------------------------------------------------------------------------------------
18 \brief Used with GeometryToSymbol dialog to store specific settings for tiling a model
19 **/
20 struct TileOption
21 {
22 TileOption(const String& id, const String& icon, const String& category, const String& model_file)
23 : id(id)
24 , icon(icon)
25 , category(category)
26 , model_file(model_file)
27 {}
28 TileOption(const String& id, const String& icon, const String& category, const Polyline<3, fltp08> extrusion_polyline)
29 : id(id)
30 , icon(icon)
31 , category(category)
32 , extrusion_polyline(extrusion_polyline)
33 {}
34 String id;
35 String icon;
36 String category;
37 String model_file;
38 Polyline<3, fltp08> extrusion_polyline;
39 Button* button;
40 };
41 /**--------------------------------------------------------------------------------------------------
42 \brief A popup Editor dialog for showing options or information related to tiling obects along linework
43 or surfaces. See ModelTileOptions and ModelTiler
44 **/
45 class NDEVR_API GeometryToSymbol : public Editor
46 {
47 Q_OBJECT
48 public:
49 GeometryToSymbol(DynamicPointer<QTDesignObject> object, QWidget* parent = nullptr);
50 GeometryToSymbol(QWidget* parent = nullptr);
51 void setTarget(const DynamicPointer<QTDesignObject>& object) override;
52 void updateValues() override;
53 static void CreateTileLibraryManager(QTModelManager* manager);
54 static void RegisterEditor();
55 protected:
56 void tileModel(const Model& model_to_tile, const ModelTileOptions& options);
57 void extrudeModel(const Polyline<3, fltp08> polyline_extrusion);
58 void init();
59 void loadDefaultSettings(const Model& model, bool reset_if_no_exist);
60 void saveDefaultSettings(const UUID& id);
61 void setSettings(const ModelTileOptions& options);
62 void setOptionsFromUI(ModelTileOptions& options) const;
63 void _updateFromUI();
64 public slots:
65 void updateFromUISlot();
66 void onModelChosen(const Buffer<UUID>& selected);
67 private:
68 Ui::GeometryToSymbolUI* ui;
69 Model m_tiled_object;
70 Model m_model_to_tile;
71 Dictionary<String, TileOption> m_tile_options;
72 Dictionary<String, QBoxLayout*> m_layouts;
73 static LibraryManager* s_tile_library_manager;
74 QTimer* m_update_timer;
75 ModelTileOptions m_last_options;
76 bool m_has_edited = false;
77 };
78}
79#endif
#define NDEVR_API
Definition DLLInfo.h:50
Definition ACIColor.h:37
Definition FontEditor.h:6