// // Copyright Contributors to the MaterialX Project // SPDX-License-Identifier: Apache-2.0 // #ifndef MATERIALXVIEW_EDITOR_H #define MATERIALXVIEW_EDITOR_H #include #include #include #include #include #include namespace mx = MaterialX; namespace ng = nanogui; class Viewer; class PropertyEditor { public: PropertyEditor(); void updateContents(Viewer* viewer); bool visible() const { return _visible; } void setVisible(bool value) { if (value != _visible) { _visible = value; _window->set_visible(_visible); } } ng::Window* getWindow() { return _window; } protected: void create(Viewer& parent); void addItemToForm(const mx::UIPropertyItem& item, const std::string& group, ng::Widget* container, Viewer* viewer, bool editable); ng::Window* _window; ng::Widget* _container; ng::GridLayout* _gridLayout2; ng::GridLayout* _gridLayout3; bool _visible; bool _fileDialogsForImages; }; ng::FloatBox* createFloatWidget(ng::Widget* parent, const std::string& label, float value, const mx::UIProperties* ui, std::function callback = nullptr); ng::IntBox* createIntWidget(ng::Widget* parent, const std::string& label, int value, const mx::UIProperties* ui, std::function callback); #endif // MATERIALXVIEW_EDITOR_H