geom2d fixes

This commit is contained in:
Joachim Schoeberl 2011-02-28 13:34:54 +00:00
parent e16ddbc83b
commit 6e5e049905
8 changed files with 23 additions and 31 deletions

View File

@ -67,6 +67,9 @@
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME #undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */ /* Define to the version of this package. */
#undef PACKAGE_VERSION #undef PACKAGE_VERSION

View File

@ -6,7 +6,7 @@ METASOURCES = AUTO
lib_LTLIBRARIES = libgeom2d.la libgeom2dvis.la lib_LTLIBRARIES = libgeom2d.la libgeom2dvis.la
libgeom2d_la_SOURCES = genmesh2d.cpp geom2dmesh.cpp geometry2d.cpp libgeom2d_la_SOURCES = genmesh2d.cpp geom2dmesh.cpp geometry2d.cpp
libgeom2d_la_LIBADD = ../gprim/libgprim.la ../meshing/libmesh.la
libgeom2dvis_la_SOURCES = geom2dpkg.cpp vsgeom2d.cpp libgeom2dvis_la_SOURCES = geom2dpkg.cpp vsgeom2d.cpp
libgeom2dvis_la_LIBADD = libgeom2d.la libgeom2dvis_la_LIBADD = libgeom2d.la

View File

@ -69,4 +69,5 @@ extern "C" int Ng_geom2d_Init (Tcl_Interp * interp);
int Ng_geom2d_Init (Tcl_Interp * interp) int Ng_geom2d_Init (Tcl_Interp * interp)
{ {
geometryregister.Append (new SplineGeometryRegister); geometryregister.Append (new SplineGeometryRegister);
return TCL_OK;
} }

View File

@ -11,7 +11,7 @@
#include <gprim.hpp> #include <gprim.hpp>
#include "../gprim/spline.hpp" // #include "../gprim/spline.hpp"
#include "../gprim/splinegeometry.hpp" #include "../gprim/splinegeometry.hpp"
#include "geom2dmesh.hpp" #include "geom2dmesh.hpp"
@ -22,7 +22,7 @@ namespace netgen
class SplineSegExt : public SplineSeg<2> class SplineSegExt : public SplineSeg<2>
{ {
public: public:
const SplineSeg & seg; const SplineSeg<2> & seg;
/// left domain /// left domain
int leftdom; int leftdom;
@ -43,7 +43,7 @@ namespace netgen
/// ///
int layer; int layer;
SplineSegExt (const SplineSeg & hseg) SplineSegExt (const SplineSeg<2> & hseg)
: seg(hseg) : seg(hseg)
{ {
layer = 1; layer = 1;

View File

@ -13,7 +13,7 @@ netgen_LDADD = $(top_builddir)/libsrc/visualization/libvisual.a \
$(top_builddir)/libsrc/gprim/libgprim.la \ $(top_builddir)/libsrc/gprim/libgprim.la \
$(top_builddir)/libsrc/linalg/libla.la \ $(top_builddir)/libsrc/linalg/libla.la \
$(top_builddir)/libsrc/general/libgen.la \ $(top_builddir)/libsrc/general/libgen.la \
-L$(TK_BIN_DIR)/Togl1.7 $(TOGLLIBDIR) -lTogl1.7 $(LIBGLU) $(TK_LIB_SPEC) $(TCL_LIB_SPEC) $(MPI_LIBS) $(FFMPEG_LIBS) $(JPEGLIB_LIBS) $(PKG_LIBS) -L$(TK_BIN_DIR)/Togl2.0 $(TOGLLIBDIR) -lTogl2.0 $(LIBGLU) $(TK_LIB_SPEC) $(TCL_LIB_SPEC) $(MPI_LIBS) $(FFMPEG_LIBS) $(JPEGLIB_LIBS) $(PKG_LIBS)
# #
# $(top_builddir)/libsrc/occ/liboccvis.la # $(top_builddir)/libsrc/occ/liboccvis.la
# $(top_builddir)/libsrc/occ/libocc.la # $(top_builddir)/libsrc/occ/libocc.la

View File

@ -11,8 +11,7 @@ set oldmousey 0
# if { 1 } { # if { 1 } {
# if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true -create init -display draw -reshape reshape }] } { # if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true -create init -display draw -reshape reshape }] } {
if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true }] } { if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true -create init -display draw -reshape reshape }] } { puts "no OpenGL"
puts "no OpenGL"
} { } {
# #
pack .ndraw -expand true -fill both -padx 10 -pady 10 pack .ndraw -expand true -fill both -padx 10 -pady 10

View File

@ -85,7 +85,7 @@ catch {
if { [catch { load libgeom2dvis[info sharedlibextension] Ng_Geom2d } result ] } { if { [catch { load libgeom2dvis[info sharedlibextension] Ng_Geom2d } result ] } {
puts "cannot load 2d meshing mordule" puts "cannot load 2d meshing module"
puts "error: $result" puts "error: $result"
} }

View File

@ -26,8 +26,8 @@ The interface between the GUI and the netgen library
// to be sure to include the 'right' togl-version // to be sure to include the 'right' togl-version
#include "togl_1_7.h" // #include "togl_1_7.h"
// #include "Togl2/togl.h" #include "togl_2_0.h"
extern bool nodisplay; extern bool nodisplay;
@ -1921,27 +1921,27 @@ namespace netgen
// Sorry, Togl 2.0 not supported // Sorry, Togl 2.0 not supported
Tcl_Obj * togl_font; Tcl_Obj * togl_font;
Togl * togl = NULL;
void MyOpenGLText (const char * text) void MyOpenGLText (const char * text)
{ {
cout << "togl - text" << endl; // cout << "togl - text: " << text << endl;
Togl_WriteChars (togl, togl_font, text, strlen(text));
} }
static int static int
init(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) init(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
{ {
cout << "call init" << endl; cout << "call init" << endl;
Togl * togl = NULL;
if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK) if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK)
return TCL_ERROR; return TCL_ERROR;
cout << "call Togl - load font (crash on my Linux64)" << endl; cout << "call Togl - load font (crashes on my OpenSuse Linux64)" << endl;
// togl_font = Togl_LoadBitmapFont( togl, "Times"); // TOGL_BITMAP_8_BY_13 ); // togl_font = Togl_LoadBitmapFont( togl, "Helvetica");
// togl_font = Togl_LoadBitmapFont( togl, TOGL_BITMAP_8_BY_13 ); // togl_font = Togl_LoadBitmapFont( togl, "Times");
togl_font = Togl_LoadBitmapFont( togl, TOGL_BITMAP_8_BY_13 );
// togl_font = Togl_LoadBitmapFont( togl, NULL ); // togl_font = Togl_LoadBitmapFont( togl, NULL );
cout << "success" << endl; cout << "success" << endl;
@ -1964,19 +1964,14 @@ namespace netgen
static int static int
draw(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) draw(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
{ {
Togl * togl;
if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK)
return TCL_ERROR;
SetVisualScene (interp); SetVisualScene (interp);
glPushMatrix(); glPushMatrix();
glLoadIdentity();
// gluLookAt (0, 0, 6, 0, 0, 0, 0, 1, 0);
vs->DrawScene();
glLoadIdentity();
vs->DrawScene();
Togl_SwapBuffers(togl); Togl_SwapBuffers(togl);
glPopMatrix(); glPopMatrix();
return TCL_OK; return TCL_OK;
@ -1985,10 +1980,6 @@ namespace netgen
static int static int
reshape(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv) reshape(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
{ {
Togl * togl;
if (Togl_GetToglFromObj(interp, objv[1], &togl) != TCL_OK)
return TCL_ERROR;
int w = Togl_Width (togl); int w = Togl_Width (togl);
int h = Togl_Height (togl); int h = Togl_Height (togl);
@ -2004,8 +1995,6 @@ namespace netgen
gluPerspective(20.0f, double(w) / h, pnear, pfar); gluPerspective(20.0f, double(w) / h, pnear, pfar);
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
// draw (togl);
return TCL_OK; return TCL_OK;
} }