2022-04-27 16:42:04 +05:00
|
|
|
#ifndef VISUAL_INTERFACE_HPP_INCLUDED
|
|
|
|
#define VISUAL_INTERFACE_HPP_INCLUDED
|
|
|
|
|
|
|
|
#include <mystdlib.h>
|
|
|
|
#include <meshing.hpp>
|
2022-05-06 15:02:28 +05:00
|
|
|
#include <myadt.hpp>
|
2022-04-27 16:42:04 +05:00
|
|
|
|
|
|
|
class Ng_SolutionData;
|
|
|
|
|
|
|
|
// Function pointers for visualization purposed, all set to nullptr by default and initialized correctly when the GUI library is loaded
|
|
|
|
|
|
|
|
DLL_HEADER extern void (*Ptr_Ng_ClearSolutionData) ();
|
|
|
|
DLL_HEADER extern void (*Ptr_Ng_InitSolutionData) (Ng_SolutionData * soldata);
|
|
|
|
DLL_HEADER extern void (*Ptr_Ng_SetSolutionData) (Ng_SolutionData * soldata);
|
|
|
|
DLL_HEADER extern void (*Ptr_Ng_Redraw) (bool blocking);
|
|
|
|
|
2022-05-06 15:02:28 +05:00
|
|
|
// Tcl wrapper functions
|
|
|
|
class Tcl_Interp;
|
|
|
|
typedef int (Tcl_CmdProc) (void * clientData, Tcl_Interp *interp,
|
|
|
|
int argc, const char *argv[]);
|
2022-04-27 16:42:04 +05:00
|
|
|
namespace netgen {
|
2022-05-06 15:02:28 +05:00
|
|
|
|
|
|
|
inline constexpr int NG_TCL_VOLATILE = 1;
|
|
|
|
inline constexpr int NG_TCL_STATIC = 0;
|
|
|
|
inline constexpr int NG_TCL_DYNAMIC = 3;
|
|
|
|
|
|
|
|
inline constexpr int NG_TCL_OK = 0;
|
|
|
|
inline constexpr int NG_TCL_ERROR = 1;
|
|
|
|
inline constexpr int NG_TCL_RETURN = 2;
|
|
|
|
inline constexpr int NG_TCL_BREAK = 3;
|
|
|
|
inline constexpr int NG_TCL_CONTINUE = 4;
|
|
|
|
DLL_HEADER extern void (*Ptr_Ng_Tcl_SetResult)(Tcl_Interp *interp, char *result, const int freeProc);
|
|
|
|
DLL_HEADER extern void (*Ptr_Ng_Tcl_CreateCommand)(Tcl_Interp *interp,
|
|
|
|
const char *cmdName, Tcl_CmdProc *proc);
|
|
|
|
|
2022-04-27 16:42:04 +05:00
|
|
|
DLL_HEADER extern void (*Ptr_Render)(bool);
|
|
|
|
DLL_HEADER extern void (*Ptr_UpdateVisSurfaceMeshData)(int,
|
|
|
|
shared_ptr<NgArray<Point<3>>>,
|
|
|
|
shared_ptr<NgArray<INDEX_2>>,
|
|
|
|
shared_ptr<NgArray<Point<2>>>
|
|
|
|
);
|
|
|
|
|
|
|
|
inline void Render(bool blocking = false) { if(Ptr_Render) Ptr_Render(blocking); }
|
|
|
|
inline void UpdateVisSurfaceMeshData(int oldnl,
|
|
|
|
shared_ptr<NgArray<Point<3>>> locpointsptr = nullptr,
|
|
|
|
shared_ptr<NgArray<INDEX_2>> loclinesptr = nullptr,
|
|
|
|
shared_ptr<NgArray<Point<2>>> plainpointsptr = nullptr
|
|
|
|
) {
|
|
|
|
if(Ptr_UpdateVisSurfaceMeshData) Ptr_UpdateVisSurfaceMeshData(oldnl, locpointsptr, loclinesptr, plainpointsptr);
|
|
|
|
}
|
2022-05-06 15:02:28 +05:00
|
|
|
|
|
|
|
inline void Ng_Tcl_SetResult(Tcl_Interp *interp, char *result, const int freeProc)
|
|
|
|
{
|
|
|
|
if(Ptr_Ng_Tcl_SetResult)
|
|
|
|
Ptr_Ng_Tcl_SetResult(interp, result, freeProc);
|
|
|
|
}
|
|
|
|
inline void Ng_Tcl_CreateCommand(Tcl_Interp *interp, const char *cmdName, Tcl_CmdProc *proc)
|
|
|
|
{
|
|
|
|
if(Ptr_Ng_Tcl_CreateCommand)
|
|
|
|
Ptr_Ng_Tcl_CreateCommand(interp, cmdName, proc);
|
|
|
|
}
|
2022-04-27 16:42:04 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // VISUAL_INTERFACE_HPP_INCLUDED
|