#include "meshing.hpp" // #define NETGEN_DEBUGGING_GUI #ifdef NETGEN_DEBUGGING_GUI #include "json.hpp" using json = nlohmann::json; #endif // NETGEN_DEBUGGING_GUI namespace netgen { unique_ptr GetOpenElements(const Mesh& m, int dom = 0); unique_ptr FilterMesh( const Mesh& m, FlatArray points, FlatArray sels = Array{}, FlatArray els = Array{}); #ifdef NETGEN_DEBUGGING_GUI class DebuggingGUI { public: DebuggingGUI(); ~DebuggingGUI(); void Start(); void Stop(); void DrawMesh(const Mesh& m); void DrawPoints(FlatArray> position, string name = "points", string color = "black"); void DrawLines(FlatArray> position, string name = "lines", string color = "black"); void DrawTrigs(FlatArray> position, string name = "trigs", string color = "black"); void DrawObject(FlatArray> position, string type, string name, string color); void ResetObjects() { data["objects"] = json::array_t(); } private: thread gui_thread; void *app, *loop, *token; std::set websockets; json data; shared_ptr mesh; void Send(const json& data) { Send(data.dump()); } void Send(const string& message); }; extern DebuggingGUI debug_gui; #endif // NETGEN_DEBUGGING_GUI } // namespace netgen