// // 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::ref getWindow() { return _window; } protected: void create(Viewer& parent); void addItemToForm(const mx::UIPropertyItem& item, const std::string& group, ng::ref container, Viewer* viewer, bool editable); ng::ref _window; ng::ref _container; ng::ref _gridLayout2; ng::ref _gridLayout3; bool _visible; bool _fileDialogsForImages; }; ng::ref> createFloatWidget(ng::ref parent, const std::string& label, float value, const mx::UIProperties* ui, std::function callback = nullptr); ng::ref> createIntWidget(ng::ref parent, const std::string& label, int value, const mx::UIProperties* ui, std::function callback); #endif // MATERIALXVIEW_EDITOR_H