2011-02-18 22:50:58 +00:00
|
|
|
#include <meshing.hpp>
|
|
|
|
#include <geometry2d.hpp>
|
|
|
|
#include <visual.hpp>
|
2014-10-08 12:46:25 +00:00
|
|
|
#include <inctcl.hpp>
|
2011-01-10 20:18:01 +00:00
|
|
|
|
2011-02-28 14:17:25 +00:00
|
|
|
#include "vsgeom2d.hpp"
|
2011-01-10 20:18:01 +00:00
|
|
|
|
2011-02-28 12:59:27 +00:00
|
|
|
// extern "C" int Ng_CSG_Init (Tcl_Interp * interp);
|
2011-01-10 20:18:01 +00:00
|
|
|
|
|
|
|
namespace netgen
|
|
|
|
{
|
2011-03-03 21:42:20 +00:00
|
|
|
|
|
|
|
|
2013-01-17 12:41:57 +00:00
|
|
|
// extern DLL_HEADER NetgenGeometry * ng_geometry;
|
2011-01-10 20:18:01 +00:00
|
|
|
static VisualSceneGeometry2d vsgeom2d;
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-17 12:41:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
class SplineGeometryVisRegister : public GeometryRegister
|
2011-01-10 20:18:01 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-01-17 12:41:57 +00:00
|
|
|
virtual NetgenGeometry * Load (string filename) const { return NULL; }
|
2011-01-10 20:18:01 +00:00
|
|
|
virtual VisualScene * GetVisualScene (const NetgenGeometry * geom) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-01-17 12:41:57 +00:00
|
|
|
VisualScene * SplineGeometryVisRegister :: GetVisualScene (const NetgenGeometry * geom) const
|
2011-01-10 20:18:01 +00:00
|
|
|
{
|
2013-01-17 12:41:57 +00:00
|
|
|
const SplineGeometry2d * geometry = dynamic_cast<const SplineGeometry2d*> (geom);
|
2011-01-10 20:18:01 +00:00
|
|
|
if (geometry)
|
|
|
|
{
|
|
|
|
vsgeom2d.SetGeometry (geometry);
|
|
|
|
return &vsgeom2d;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-03-03 22:03:01 +00:00
|
|
|
using namespace netgen;
|
|
|
|
#ifdef WIN32
|
|
|
|
extern "C" __declspec(dllexport) int Ng_geom2d_Init (Tcl_Interp * interp);
|
|
|
|
#else
|
2011-02-28 12:59:27 +00:00
|
|
|
extern "C" int Ng_geom2d_Init (Tcl_Interp * interp);
|
2011-03-03 22:03:01 +00:00
|
|
|
#endif
|
2011-01-10 20:18:01 +00:00
|
|
|
|
2011-02-28 12:59:27 +00:00
|
|
|
int Ng_geom2d_Init (Tcl_Interp * interp)
|
2011-01-10 20:18:01 +00:00
|
|
|
{
|
2013-01-17 12:41:57 +00:00
|
|
|
geometryregister.Append (new SplineGeometryVisRegister);
|
2011-02-28 13:34:54 +00:00
|
|
|
return TCL_OK;
|
2011-01-10 20:18:01 +00:00
|
|
|
}
|