-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Visualiser: ImGui support for user-defined interfaces to view/update …
…environment properties. User's are provided the ability to add environment properties/environment array property elements to user interface panel(s) in the form of input boxes, sliders, drag things and checkboxes. Additionally, moved the debug menu to ImGui and added the initial random seed to it's items.
- Loading branch information
Showing
9 changed files
with
450 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include <utility> | ||
|
||
#include "flamegpu/visualiser/PanelVis.h" | ||
|
||
namespace flamegpu { | ||
namespace visualiser { | ||
|
||
PanelVis::PanelVis(std::shared_ptr<PanelConfig> _m, std::shared_ptr<EnvironmentDescription> _environment) | ||
: env_properties(_environment->getPropertiesMap()) // For some reason this method returns a copy, not a reference | ||
, m(std::move(_m)) { | ||
// Rebuild added_properties | ||
for (const auto &element : m->ui_elements) { | ||
if (const EnvPropertyElement* p = dynamic_cast<EnvPropertyElement*>(element.get())) { | ||
added_properties.insert({p->name, p->index}); | ||
} | ||
} | ||
} | ||
void PanelVis::newSection(const std::string& header_text, bool begin_open) { | ||
std::unique_ptr<PanelElement> ptr = std::make_unique<HeaderElement>(header_text, begin_open); | ||
m->ui_elements.push_back(std::move(ptr)); | ||
} | ||
void PanelVis::newEndSection() { | ||
std::unique_ptr<PanelElement> ptr = std::make_unique<EndSectionElement>(); | ||
m->ui_elements.push_back(std::move(ptr)); | ||
} | ||
void PanelVis::newStaticLabel(const std::string& label_text) { | ||
std::unique_ptr<PanelElement> ptr = std::make_unique<LabelElement>(label_text); | ||
m->ui_elements.push_back(std::move(ptr)); | ||
} | ||
void PanelVis::newSeparator() { | ||
std::unique_ptr<PanelElement> ptr = std::make_unique<SeparatorElement>(); | ||
m->ui_elements.push_back(std::move(ptr)); | ||
} | ||
|
||
} // namespace visualiser | ||
} // namespace flamegpu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters