geometry format modularization

This commit is contained in:
Joachim Schoeberl 2011-02-18 22:50:58 +00:00
parent b0f637862b
commit 55282bac84
25 changed files with 2116 additions and 2267 deletions

View File

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

View File

@ -8,7 +8,7 @@ revolution.hpp spline3d.hpp vscsg.hpp
AM_CPPFLAGS = -I$(top_srcdir)/libsrc/include $(TCL_INCLUDES)
METASOURCES = AUTO
noinst_LTLIBRARIES = libcsg.la libcsgvis.la
lib_LTLIBRARIES = libcsg.la libcsgvis.la
libcsg_la_SOURCES = algprim.cpp brick.cpp \
@ -18,6 +18,8 @@ manifold.cpp meshsurf.cpp polyhedra.cpp revolution.cpp singularref.cpp \
solid.cpp specpoin.cpp spline3d.cpp surface.cpp triapprox.cpp
libcsgvis_la_SOURCES = vscsg.cpp csgpkg.cpp
libcsgvis_la_LIBADD = libcsg.la $(top_builddir)/libsrc/geom2d/libgeom2d.la

View File

@ -7,9 +7,6 @@
namespace netgen
{
//using namespace netgen;
static kwstruct defkw[] =
{
{ TOK_RECO, "algebraic3d" },
@ -695,6 +692,65 @@ namespace netgen
}
template <int D>
void LoadSpline (SplineGeometry<D> & spline, CSGScanner & scan)
{
double hd;
Point<D> x;
int nump, numseg;
//scan.ReadNext();
scan >> nump >> ';';
hd = 1;
spline.geompoints.SetSize(nump);
for(int i = 0; i<nump; i++)
{
if(D==2)
scan >> x(0) >> ',' >> x(1) >> ';';
else if(D==3)
scan >> x(0) >> ',' >> x(1) >> ',' >> x(2) >> ';';
spline.geompoints[i] = GeomPoint<D>(x,hd);
}
scan >> numseg;// >> ';';
spline.splines.SetSize(numseg);
int pnums,pnum1,pnum2,pnum3;
for(int i = 0; i<numseg; i++)
{
scan >> ';' >> pnums >> ',';
if (pnums == 2)
{
scan >> pnum1 >> ',' >> pnum2;// >> ';';
spline.splines[i] = new LineSeg<D>(spline.geompoints[pnum1-1],
spline.geompoints[pnum2-1]);
}
else if (pnums == 3)
{
scan >> pnum1 >> ',' >> pnum2 >> ','
>> pnum3;// >> ';';
spline.splines[i] = new SplineSeg3<D>(spline.geompoints[pnum1-1],
spline.geompoints[pnum2-1],
spline.geompoints[pnum3-1]);
}
else if (pnums == 4)
{
scan >> pnum1 >> ',' >> pnum2 >> ','
>> pnum3;// >> ';';
spline.splines[i] = new CircleSeg<D>(spline.geompoints[pnum1-1],
spline.geompoints[pnum2-1],
spline.geompoints[pnum3-1]);
}
}
}
void ParseFlags (CSGScanner & scan, Flags & flags)
{
@ -1118,7 +1174,8 @@ namespace netgen
ParseChar (scan, '(');
SplineGeometry<2> * newspline = new SplineGeometry<2>;
newspline->CSGLoad(scan);
// newspline->CSGLoad(scan);
LoadSpline (*newspline, scan);
ParseChar (scan, ')');
ParseChar (scan, ';');
@ -1143,7 +1200,8 @@ namespace netgen
ParseChar (scan, '(');
SplineGeometry<3> * newspline = new SplineGeometry<3>;
newspline->CSGLoad(scan);
// newspline->CSGLoad(scan);
LoadSpline (*newspline, scan);
ParseChar (scan, ')');
ParseChar (scan, ';');

View File

@ -10,4 +10,6 @@ libgeom2d_la_SOURCES = genmesh2d.cpp geom2dmesh.cpp spline.cpp \
libgeom2dvis_la_SOURCES = geom2dpkg.cpp vsgeom2d.cpp
libgeom2dvis_la_LIBADD = libgeom2d.la

View File

@ -1,7 +1,7 @@
#include <mystdlib.h>
#include <csg.hpp>
#include <meshing.hpp>
#include <geometry2d.hpp>
#include "meshing.hpp"
namespace netgen
{

View File

@ -1,9 +1,8 @@
#include <mystdlib.h>
#include <csg.hpp>
#include <geometry2d.hpp>
#include <meshing.hpp>
#include <geometry2d.hpp>
namespace netgen
{

View File

@ -1,12 +1,13 @@
#include <mystdlib.h>
#include <myadt.hpp>
#include <linalg.hpp>
#include <csg.hpp>
#include <incvis.hpp>
#include <visual.hpp>
#include <meshing.hpp>
#include <geometry2d.hpp>
#include <visual.hpp>
#include "vsgeom2d.hpp"

View File

@ -5,9 +5,9 @@ Spline curve for Mesh generator
*/
#include <mystdlib.h>
#include <csg.hpp>
#include <linalg.hpp>
#include <meshing.hpp>
#include <geometry2d.hpp>
namespace netgen
{

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@ in geom2d only 2D - Geometry classes (with material properties etc.)
#ifndef _FILE_SPLINEGEOMETRY
#define _FILE_SPLINEGEOMETRY
#include "../csg/csgparser.hpp"
// #include "../csg/csgparser.hpp"
namespace netgen
@ -38,7 +38,8 @@ namespace netgen
template < int D >
class SplineGeometry
{
protected:
// protected:
public:
Array < GeomPoint<D> > geompoints;
Array < SplineSeg<D>* > splines;
double elto0;
@ -59,7 +60,7 @@ namespace netgen
int Load (const Array<double> & raw_data, const int startpos = 0);
void Load (const char * filename);
void CSGLoad (CSGScanner & scan);
// void CSGLoad (CSGScanner & scan);
void LoadData( ifstream & infile );
void LoadDataNew ( ifstream & infile );

View File

@ -3,9 +3,8 @@
#include <myadt.hpp>
#include <meshing.hpp>
#include <csg.hpp>
#include <stlgeom.hpp>
#include <geometry2d.hpp>
#include <visual.hpp>
#include "vsgeom2d.hpp"
@ -14,9 +13,6 @@ namespace netgen
{
/* *********************** Draw 2D Geometry **************** */

View File

@ -20,5 +20,9 @@ libocc_la_SOURCES = Partition_Inter2d.cxx Partition_Inter3d.cxx \
Partition_Loop.cxx Partition_Loop2d.cxx Partition_Loop3d.cxx Partition_Spliter.cxx \
occconstruction.cpp occgenmesh.cpp occgeom.cpp occmeshsurf.cpp
liboccvis_la_SOURCES = occpkg.cpp vsocc.cpp
libocc_la_LIBADD = $(OCCLIBS)
liboccvis_la_SOURCES = occpkg.cpp vsocc.cpp
liboccvis_la_LIBADD = libocc.la

View File

@ -4,12 +4,12 @@ stltool.hpp stltopology.hpp vsstl.hpp
AM_CPPFLAGS = -I$(top_srcdir)/libsrc/include $(TCL_INCLUDES)
METASOURCES = AUTO
noinst_LTLIBRARIES = libstl.la libstlvis.la
lib_LTLIBRARIES = libstl.la libstlvis.la
libstl_la_SOURCES = meshstlsurface.cpp stlgeom.cpp stlgeomchart.cpp \
stlgeommesh.cpp stlline.cpp stltool.cpp stltopology.cpp
libstlvis_la_SOURCES = stlpkg.cpp vsstl.cpp
libstlvis_la_LIBADD = libstl.la $(top_builddir)/libsrc/linalg/libla.la

View File

@ -595,8 +595,8 @@ namespace netgen
using namespace netgen;
extern "C" int Ng_STL_Init (Tcl_Interp * interp);
int Ng_STL_Init (Tcl_Interp * interp)
extern "C" int Ng_stl_Init (Tcl_Interp * interp);
int Ng_stl_Init (Tcl_Interp * interp)
{
geometryregister.Append (new STLGeometryRegister);

View File

@ -1,6 +1,6 @@
include_HEADERS =
AM_CPPFLAGS = -I$(top_srcdir)/libsrc/include -I$(top_srcdir)/libsrc/interface -DOPENGL -D$(TOGL_WINDOWINGSYSTEM) $(OCCFLAGS) $(TCL_INCLUDES) $(MPI_INCLUDES) $(FFMPEG_INCLUDES) $(JPEGLIB_INCLUDES)
AM_CPPFLAGS = -I$(top_srcdir)/libsrc/include -I$(top_srcdir)/libsrc/interface -DOPENGL -D$(TOGL_WINDOWINGSYSTEM) $(TCL_INCLUDES) $(MPI_INCLUDES) $(FFMPEG_INCLUDES) $(JPEGLIB_INCLUDES)
bin_PROGRAMS = netgen
netgen_SOURCES = demoview.cpp ngappinit.cpp ngpkg.cpp onetcl.cpp nginterface.cpp nginterface_v2.cpp parallelfunc.cpp parallelinterface.cpp demoview.hpp parallelfunc.hpp togl_1_7.h
@ -8,20 +8,19 @@ netgen_SOURCES = demoview.cpp ngappinit.cpp ngpkg.cpp onetcl.cpp nginterface.cpp
netgen_LDADD = $(top_builddir)/libsrc/visualization/libvisual.a \
$(top_builddir)/libsrc/csg/libcsgvis.la \
$(top_builddir)/libsrc/csg/libcsg.la \
$(top_builddir)/libsrc/geom2d/libgeom2dvis.la \
$(top_builddir)/libsrc/geom2d/libgeom2d.la \
$(top_builddir)/libsrc/interface/libinterface.la \
$(top_builddir)/libsrc/stlgeom/libstlvis.la \
$(top_builddir)/libsrc/stlgeom/libstl.la \
$(top_builddir)/libsrc/meshing/libmesh.la \
$(top_builddir)/libsrc/gprim/libgprim.la \
$(top_builddir)/libsrc/linalg/libla.la \
$(top_builddir)/libsrc/general/libgen.la \
$(OCCLIBS) -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)/Togl1.7 $(TOGLLIBDIR) -lTogl1.7 $(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/libocc.la
# $(top_builddir)/libsrc/stlgeom/libstlvis.la
# $(top_builddir)/libsrc/stlgeom/libstl.la
# $(top_builddir)/libsrc/geom2d/libgeom2d.la
# add for static linkage of ngsolve:

View File

@ -2494,50 +2494,6 @@ proc printlatestwarning { } {
}
# for parallel visualization, overlapping meshes...
proc paralleldialog { } {
set w .parallel_dlg
if {[winfo exists .parallel_dlg] == 1} {
wm withdraw $w
wm deiconify $w
wm geometry $w =270x100
focus $w
} {
toplevel $w
wm geometry $w =270x100
# frame $w.buttons -relief groove -borderwidth 3 -width 300
# pack $w.buttons
set ww $w
button $ww.visallb -text "View All" -width 20 -command\
{ Ng_VisualizeAll; }
pack $ww.visallb
button $ww.visoneb -text "View One" -width 20 -command \
{ Ng_VisualizeOne; }
pack $ww.visoneb
button $ww.overlap -text "overlap++" -width 20 -command \
{ Ng_IncrOverlap; }
pack $ww.overlap
wm withdraw $w
wm geom $w +100+100
wm deiconify $w
wm title $w "Parallel Netgen"
focus .parallel_dlg
}
}
# paralleldialog
#wm withdraw $w
proc runtestdialog { } {
source $::ngdir/ngshell.tcl

View File

@ -5,15 +5,16 @@ set oldmousex 0
set oldmousey 0
#
# if { 1 } {
# use this one for Togl 2.0
# 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 }] } {
# changed -indirect true/false !!!
if {[catch {togl .ndraw -width 400 -height 300 -rgba true -double true -depth true -privatecmap false -stereo false -indirect true }] } {
puts "no OpenGL"
} {
#

View File

@ -833,17 +833,6 @@ pack .bubar.exitb .bubar.surfm .bubar.stopm -side left
#button .bubar.scan -text "Scan" \
# -command { Ng_ParseGeometry; set selectvisual geometry; Ng_SetVisParameters; redraw }
# fuer parallel - buttons :)
Ng_IsParallel;
if { $parallel_netgen } {
# catch{
# source ${ngdir}/ngtcltk/parallel_dialog.tcl
# }
button .bubar.visallb -text "Parallel" -command \
{ paralleldialog; redraw }
pack .bubar.visallb -side left
}
button .bubar.zoomall -text "Zoom All" \
-command { Ng_ZoomAll; redraw }

View File

@ -1,6 +1,6 @@
if {[catch {package require Tix } result ]} {
puts "cannot find package Tix"
puts "error : $result"
puts "cannot find package Tix"
puts "error : $result"
}
# if {[catch {package require Togl 2.0 } result ]} {

View File

@ -101,7 +101,7 @@ int main(int argc, char ** argv)
cout << "NETGEN-" << PACKAGE_VERSION << endl;
cout << "Developed by Joachim Schoeberl at" << endl
<< "2010-xxxx Vienna UT" << endl
<< "2010-xxxx Vienna University of Technology" << endl
<< "2006-2010 RWTH Aachen University" << endl
<< "1996-2006 Johannes Kepler University Linz" << endl;

View File

@ -1,20 +1,7 @@
#include <mystdlib.h>
#include <meshing.hpp>
#include <csg.hpp>
#include <geometry2d.hpp>
#include <stlgeom.hpp>
#ifdef OCCGEOMETRY
#include <occgeom.hpp>
#endif
#ifdef ACIS
#include <acisgeom.hpp>
#endif
#ifdef SOCKETS
#include "../sockets/sockets.hpp"
#endif
@ -27,11 +14,6 @@
#include "nginterface.h"
#include "nginterface_v2.hpp"
// #include <FlexLexer.h>
// #include <mystdlib.h>
namespace netgen
{
@ -43,16 +25,6 @@ namespace netgen
extern Tcl_Interp * tcl_interp;
#endif
extern AutoPtr<SplineGeometry2d> geometry2d;
extern AutoPtr<CSGeometry> geometry;
extern STLGeometry * stlgeometry;
#ifdef OCCGEOMETRY
extern OCCGeometry * occgeometry;
#endif
#ifdef ACIS
extern ACISGeometry * acisgeometry;
#endif
#ifdef OPENGL
extern VisualSceneSolution vssolution;
@ -217,23 +189,6 @@ namespace netgen
double * dxdxi, size_t sdxdxi)
{
mesh->GetCurvedElements().CalcMultiPointSegmentTransformation<2> (elnr, npts, xi, sxi, x, sx, dxdxi, sdxdxi);
/*
for (int ip = 0; ip < npts; ip++)
{
Point<3> xg;
Vec<3> dx;
mesh->GetCurvedElements().CalcSegmentTransformation (xi[ip*sxi], elnr, xg, dx);
if (x)
for (int i = 0; i < 2; i++)
x[ip*sx+i] = xg(i);
if (dxdxi)
for (int i=0; i<2; i++)
dxdxi[ip*sdxdxi+i] = dx(i);
}
*/
}
template <>
@ -257,7 +212,6 @@ namespace netgen
return mesh->GetTopology().GetNFaces();
}
template <> DLL_HEADER Ng_Node<1> Ng_GetNode<1> (int nr)
{
Ng_Node<1> node;
@ -265,8 +219,6 @@ namespace netgen
return node;
}
template <> DLL_HEADER Ng_Node<2> Ng_GetNode<2> (int nr)
{
Ng_Node<2> node;

View File

@ -24,7 +24,6 @@ The interface between the GUI and the netgen library
#include "../libsrc/sockets/socketmanager.hpp"
#endif
// #include <parallel.hpp>
// to be sure to include the 'right' togl-version
#include "togl_1_7.h"
@ -2012,10 +2011,10 @@ namespace netgen
return TCL_ERROR;
cout << "call Togl - load font (crash on my Linux64)" << endl;
// togl_font = Togl_LoadBitmapFont( togl, "Times"); // TOGL_BITMAP_8_BY_13 );
togl_font = Togl_LoadBitmapFont( togl, "Times"); // TOGL_BITMAP_8_BY_13 );
// togl_font = Togl_LoadBitmapFont( togl, TOGL_BITMAP_8_BY_13 );
// togl_font = Togl_LoadBitmapFont( togl, NULL );
// cout << "success" << endl;
cout << "success" << endl;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
@ -2882,91 +2881,7 @@ namespace netgen
return TCL_OK;
}
#ifdef PARALLEL
int Ng_VisualizeAll (ClientData clientData,
Tcl_Interp * interp,
int argc, tcl_const char *argv[])
{
int id, rc, ntasks;
MPI_Comm_size(MPI_COMM_WORLD, &ntasks);
MPI_Comm_rank(MPI_COMM_WORLD, &id);
string visualizationmode = Tcl_GetVar (interp, "::selectvisual", 0);
string scalfun = Tcl_GetVar (interp, "::visoptions.scalfunction", 0);
for ( int dest = 1; dest < ntasks; dest++)
{
MyMPI_Send ( "visualize", dest );
MyMPI_Send ( visualizationmode, dest);
if ( visualizationmode == "solution" )
MyMPI_Send ( scalfun, dest);
}
return TCL_OK;
}
int Ng_VisualizeOne (ClientData clientData,
Tcl_Interp * interp,
int argc, tcl_const char *argv[])
{
int id, rc, ntasks;
MPI_Comm_size(MPI_COMM_WORLD, &ntasks);
MPI_Comm_rank(MPI_COMM_WORLD, &id);
string visualizationmode = Tcl_GetVar (interp, "::selectvisual", 0);
string scalfun = Tcl_GetVar (interp, "::visoptions.scalfunction", 0);
MyMPI_Send ( "visualize", 1 );
MyMPI_Send ( visualizationmode, 1);
if ( visualizationmode == "solution" )
MyMPI_Send ( scalfun, 1);
return TCL_OK;
}
int Ng_IncrOverlap ( ClientData clientDate,
Tcl_Interp * interp,
int argc, tcl_const char * argv[] )
{
int id, rc, ntasks;
MPI_Comm_size(MPI_COMM_WORLD, &ntasks);
MPI_Comm_rank(MPI_COMM_WORLD, &id);
for ( int dest = 1; dest < ntasks; dest++)
{
MyMPI_Send ( "overlap++", dest );
}
mesh->UpdateOverlap();
return TCL_OK;
}
int Ng_SetSelectVisual ( ClientData clientDate,
Tcl_Interp * interp,
int argc, tcl_const char * argv[] )
{
string visualizationmode;
MyMPI_Recv ( visualizationmode, 0);
Tcl_SetVar (interp, "::selectvisual", visualizationmode.c_str(), 0);
return TCL_OK;
}
int Ng_SetScalarFunction ( ClientData clientDate,
Tcl_Interp * interp,
int argc, tcl_const char * argv[] )
{
string visualizationmode;
string scalarfun;
visualizationmode = Tcl_GetVar (interp, "::selectvisual", 0);
if ( visualizationmode == "solution" )
{
MyMPI_Recv ( scalarfun, 0);
Tcl_SetVar (interp, "::visoptions.scalfunction", scalarfun.c_str(), 0);
}
return TCL_OK;
}
#endif
int Ng_IsParallel (ClientData clientData,
Tcl_Interp * interp,
@ -3073,7 +2988,7 @@ namespace netgen
extern "C" int Ng_Init (Tcl_Interp * interp);
extern "C" int Ng_CSG_Init (Tcl_Interp * interp);
extern "C" int Ng_STL_Init (Tcl_Interp * interp);
// extern "C" int Ng_stl_Init (Tcl_Interp * interp);
#ifdef OCCGEOMETRY
// extern "C" int Ng_occ_Init (Tcl_Interp * interp);
@ -3094,11 +3009,8 @@ namespace netgen
#endif
Ng_CSG_Init(interp);
Ng_STL_Init(interp);
// Ng_stl_Init(interp);
#ifdef OCCGEOMETRY
// Ng_occ_Init(interp);
#endif
Ng_Geom2d_Init(interp);
@ -3358,29 +3270,6 @@ namespace netgen
(ClientData)NULL,
(Tcl_CmdDeleteProc*) NULL);
#ifdef PARALLEL
Tcl_CreateCommand (interp, "Ng_VisualizeAll", Ng_VisualizeAll,
(ClientData)NULL,
(Tcl_CmdDeleteProc*) NULL);
Tcl_CreateCommand (interp, "Ng_VisualizeOne", Ng_VisualizeOne,
(ClientData)NULL,
(Tcl_CmdDeleteProc*) NULL);
Tcl_CreateCommand (interp, "Ng_IncrOverlap", Ng_IncrOverlap,
(ClientData)NULL,
(Tcl_CmdDeleteProc*) NULL);
Tcl_CreateCommand (interp, "Ng_SetSelectVisual", Ng_SetSelectVisual,
(ClientData)NULL,
(Tcl_CmdDeleteProc*) NULL);
Tcl_CreateCommand (interp, "Ng_SetScalarFunction", Ng_SetScalarFunction,
(ClientData)NULL,
(Tcl_CmdDeleteProc*) NULL);
#endif
Tcl_CreateCommand (interp, "Ng_IsParallel", Ng_IsParallel,
(ClientData)NULL,
(Tcl_CmdDeleteProc*) NULL);

View File

@ -1,6 +1,6 @@
if { [catch { load liboccvis[info sharedlibextension] Ng_OCC } result ] } {
# puts "cannot load occ"
# puts "error: $result"
puts "cannot load occ"
puts "error: $result"
# dummy
proc rebuildoccdialog { } { }

View File

@ -1,3 +1,9 @@
if { [catch { load libstlvis[info sharedlibextension] Ng_STL } result ] } {
puts "cannot load stl"
puts "error: $result"
}
.ngmenu.geometry add separator
.ngmenu.geometry add command -label "STL Doctor..." \