Skip to content
Snippets Groups Projects
Commit d63da07e authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

*** empty log message ***

parent 8d9db3e1
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,6 @@ class Opengl_Window : public Fl_Gl_Window { ...@@ -50,7 +50,6 @@ class Opengl_Window : public Fl_Gl_Window {
public: public:
bool AddPointMode, LassoMode, SelectionMode; bool AddPointMode, LassoMode, SelectionMode;
private: private:
int hits;
MousePosition click, curr, prev, lasso; MousePosition click, curr, prev, lasso;
double point[3]; double point[3];
void draw(); void draw();
...@@ -59,7 +58,6 @@ class Opengl_Window : public Fl_Gl_Window { ...@@ -59,7 +58,6 @@ class Opengl_Window : public Fl_Gl_Window {
Opengl_Window(int x,int y,int w,int h,const char *l=0) Opengl_Window(int x,int y,int w,int h,const char *l=0)
: Fl_Gl_Window(x, y, w, h, l) { : Fl_Gl_Window(x, y, w, h, l) {
AddPointMode = LassoMode = SelectionMode = false; AddPointMode = LassoMode = SelectionMode = false;
hits = 0;
point[0] = point[1] = point[2] = 0.; point[0] = point[1] = point[2] = 0.;
} }
}; };
......
# $Id: Makefile,v 1.68 2006-01-06 00:34:24 geuzaine Exp $ # $Id: Makefile,v 1.69 2006-01-10 15:13:25 geuzaine Exp $
# #
# Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle # Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
# #
...@@ -137,4 +137,4 @@ Print_Geo.o: Print_Geo.cpp ../Common/Gmsh.h ../Common/Message.h \ ...@@ -137,4 +137,4 @@ Print_Geo.o: Print_Geo.cpp ../Common/Gmsh.h ../Common/Message.h \
../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \ ../Mesh/Vertex.h ../Mesh/Simplex.h ../Geo/ExtrudeParams.h \
../Common/VertexArray.h ../Common/SmoothNormals.h ../Mesh/Metric.h \ ../Common/VertexArray.h ../Common/SmoothNormals.h ../Mesh/Metric.h \
../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \ ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h \
CAD.h ExtrudeParams.h ../Numeric/Numeric.h ../Common/Context.h CAD.h ExtrudeParams.h
// $Id: Print_Geo.cpp,v 1.42 2006-01-06 00:34:24 geuzaine Exp $ // $Id: Print_Geo.cpp,v 1.43 2006-01-10 15:13:25 geuzaine Exp $
// //
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
// //
...@@ -22,31 +22,22 @@ ...@@ -22,31 +22,22 @@
#include "Gmsh.h" #include "Gmsh.h"
#include "Geo.h" #include "Geo.h"
#include "Mesh.h" #include "Mesh.h"
#include "Vertex.h"
#include "CAD.h" #include "CAD.h"
#include "SmoothNormals.h"
#include "Numeric.h"
#include "Context.h"
#include <map>
FILE *FOUT; FILE *FOUT;
void Print_Point(void *a, void *b) void Print_Point(void *a, void *b)
{ {
Vertex *v; Vertex *v = *(Vertex **) a;
v = *(Vertex **) a;
fprintf(FOUT, "Point(%d) = {%.16g, %.16g, %.16g, %.16g};\n", fprintf(FOUT, "Point(%d) = {%.16g, %.16g, %.16g, %.16g};\n",
v->Num, v->Pos.X, v->Pos.Y, v->Pos.Z, v->lc); v->Num, v->Pos.X, v->Pos.Y, v->Pos.Z, v->lc);
} }
void Print_Nurbs(Curve *c, FILE *f) void Print_Nurbs(Curve *c, FILE *f)
{ {
int i, j;
Vertex *v;
fprintf(f, "Nurbs (%d) = {", c->Num); fprintf(f, "Nurbs (%d) = {", c->Num);
for(i = 0; i < List_Nbr(c->Control_Points); i++) { for(int i = 0; i < List_Nbr(c->Control_Points); i++) {
Vertex *v;
List_Read(c->Control_Points, i, &v); List_Read(c->Control_Points, i, &v);
if(!i) if(!i)
fprintf(FOUT, "%d", v->Num); fprintf(FOUT, "%d", v->Num);
...@@ -57,7 +48,7 @@ void Print_Nurbs(Curve * c, FILE * f) ...@@ -57,7 +48,7 @@ void Print_Nurbs(Curve * c, FILE * f)
} }
fprintf(f, "}\n"); fprintf(f, "}\n");
fprintf(f, " Knots {"); fprintf(f, " Knots {");
for(j = 0; j < List_Nbr(c->Control_Points) + c->degre + 1; j++) { for(int j = 0; j < List_Nbr(c->Control_Points) + c->degre + 1; j++) {
if(!j) if(!j)
fprintf(f, "%.16g", c->k[j]); fprintf(f, "%.16g", c->k[j]);
else else
...@@ -71,10 +62,7 @@ void Print_Nurbs(Curve * c, FILE * f) ...@@ -71,10 +62,7 @@ void Print_Nurbs(Curve * c, FILE * f)
void Print_Curve(void *a, void *b) void Print_Curve(void *a, void *b)
{ {
Curve *c; Curve *c = *(Curve **) a;
Vertex *v;
int i;
c = *(Curve **) a;
if(c->Num < 0 || c->Typ == MSH_SEGM_DISCRETE) if(c->Num < 0 || c->Typ == MSH_SEGM_DISCRETE)
return; return;
...@@ -108,7 +96,8 @@ void Print_Curve(void *a, void *b) ...@@ -108,7 +96,8 @@ void Print_Curve(void *a, void *b)
return; return;
} }
for(i = 0; i < List_Nbr(c->Control_Points); i++) { for(int i = 0; i < List_Nbr(c->Control_Points); i++) {
Vertex *v;
List_Read(c->Control_Points, i, &v); List_Read(c->Control_Points, i, &v);
if(i) if(i)
fprintf(FOUT, ", %d", v->Num); fprintf(FOUT, ", %d", v->Num);
...@@ -118,38 +107,22 @@ void Print_Curve(void *a, void *b) ...@@ -118,38 +107,22 @@ void Print_Curve(void *a, void *b)
fprintf(FOUT, "\n"); fprintf(FOUT, "\n");
} }
switch (c->Typ) {
case MSH_SEGM_CIRC:
case MSH_SEGM_CIRC_INV:
case MSH_SEGM_ELLI:
case MSH_SEGM_ELLI_INV:
fprintf(FOUT, "} Plane{%.16g, %.16g, %.16g};\n",
c->Circle.n[0], c->Circle.n[1], c->Circle.n[2]);
break;
default:
fprintf(FOUT, "};\n"); fprintf(FOUT, "};\n");
break;
}
} }
void Print_Surface(void *a, void *b) void Print_Surface(void *a, void *b)
{ {
Curve *c; Surface *s = *(Surface **) a;
Surface *s;
Vertex *v;
int i, j;
s = *(Surface **) a;
if(s->Typ == MSH_SURF_DISCRETE) if(s->Typ == MSH_SURF_DISCRETE)
return; return;
int NUMLOOP = s->Num + 1000000; int NUMLOOP = s->Num + 1000000;
if(s->Typ != MSH_SURF_NURBS) { if(s->Typ != MSH_SURF_NURBS) {
if(List_Nbr(s->Generatrices)){ if(List_Nbr(s->Generatrices)){
fprintf(FOUT, "Line Loop (%d) = ", NUMLOOP); fprintf(FOUT, "Line Loop (%d) = ", NUMLOOP);
for(i = 0; i < List_Nbr(s->Generatrices); i++) { for(int i = 0; i < List_Nbr(s->Generatrices); i++) {
Curve *c;
List_Read(s->Generatrices, i, &c); List_Read(s->Generatrices, i, &c);
if(i) if(i)
fprintf(FOUT, ", %d", c->Num); fprintf(FOUT, ", %d", c->Num);
...@@ -174,9 +147,10 @@ void Print_Surface(void *a, void *b) ...@@ -174,9 +147,10 @@ void Print_Surface(void *a, void *b)
break; break;
case MSH_SURF_NURBS: case MSH_SURF_NURBS:
fprintf(FOUT, "Nurbs Surface (%d) = {\n", s->Num); fprintf(FOUT, "Nurbs Surface (%d) = {\n", s->Num);
for(i = 0; i < s->Nv; i++) { for(int i = 0; i < s->Nv; i++) {
fprintf(FOUT, " {"); fprintf(FOUT, " {");
for(j = 0; j < s->Nu; j++) { for(int j = 0; j < s->Nu; j++) {
Vertex *v;
List_Read(s->Control_Points, j + s->Nu * i, &v); List_Read(s->Control_Points, j + s->Nu * i, &v);
if(!j) if(!j)
fprintf(FOUT, "%d", v->Num); fprintf(FOUT, "%d", v->Num);
...@@ -189,7 +163,7 @@ void Print_Surface(void *a, void *b) ...@@ -189,7 +163,7 @@ void Print_Surface(void *a, void *b)
fprintf(FOUT, "}}\n"); fprintf(FOUT, "}}\n");
} }
fprintf(FOUT, " Knots\n {"); fprintf(FOUT, " Knots\n {");
for(j = 0; j < s->Nu + s->OrderU + 1; j++) { for(int j = 0; j < s->Nu + s->OrderU + 1; j++) {
if(!j) if(!j)
fprintf(FOUT, "%.16g", s->ku[j]); fprintf(FOUT, "%.16g", s->ku[j]);
else else
...@@ -198,7 +172,7 @@ void Print_Surface(void *a, void *b) ...@@ -198,7 +172,7 @@ void Print_Surface(void *a, void *b)
fprintf(FOUT, "\n "); fprintf(FOUT, "\n ");
} }
fprintf(FOUT, "}\n {"); fprintf(FOUT, "}\n {");
for(j = 0; j < s->Nv + s->OrderV + 1; j++) { for(int j = 0; j < s->Nv + s->OrderV + 1; j++) {
if(!j) if(!j)
fprintf(FOUT, "%.16g", s->kv[j]); fprintf(FOUT, "%.16g", s->kv[j]);
else else
...@@ -213,10 +187,7 @@ void Print_Surface(void *a, void *b) ...@@ -213,10 +187,7 @@ void Print_Surface(void *a, void *b)
void Print_Volume(void *a, void *b) void Print_Volume(void *a, void *b)
{ {
Surface *s; Volume *vol = *(Volume **) a;
Volume *vol;
int i;
vol = *(Volume **) a;
if(vol->Typ == MSH_VOLUME_DISCRETE) if(vol->Typ == MSH_VOLUME_DISCRETE)
return; return;
...@@ -225,7 +196,8 @@ void Print_Volume(void *a, void *b) ...@@ -225,7 +196,8 @@ void Print_Volume(void *a, void *b)
fprintf(FOUT, "Surface Loop (%d) = ", NUMLOOP); fprintf(FOUT, "Surface Loop (%d) = ", NUMLOOP);
for(i = 0; i < List_Nbr(vol->Surfaces); i++) { for(int i = 0; i < List_Nbr(vol->Surfaces); i++) {
Surface *s;
List_Read(vol->Surfaces, i, &s); List_Read(vol->Surfaces, i, &s);
if(i) if(i)
fprintf(FOUT, ", %d", s->Num); fprintf(FOUT, ", %d", s->Num);
...@@ -243,10 +215,7 @@ void Print_Volume(void *a, void *b) ...@@ -243,10 +215,7 @@ void Print_Volume(void *a, void *b)
void Print_PhysicalGroups(void *a, void *b) void Print_PhysicalGroups(void *a, void *b)
{ {
PhysicalGroup *pg; PhysicalGroup *pg = *(PhysicalGroup **) a;
int i, j;
pg = *(PhysicalGroup **) a;
switch (pg->Typ) { switch (pg->Typ) {
case MSH_PHYSICAL_POINT: case MSH_PHYSICAL_POINT:
...@@ -263,7 +232,8 @@ void Print_PhysicalGroups(void *a, void *b) ...@@ -263,7 +232,8 @@ void Print_PhysicalGroups(void *a, void *b)
break; break;
} }
for(i = 0; i < List_Nbr(pg->Entities); i++) { for(int i = 0; i < List_Nbr(pg->Entities); i++) {
int j;
List_Read(pg->Entities, i, &j); List_Read(pg->Entities, i, &j);
if(i) if(i)
fprintf(FOUT, ", %d", j); fprintf(FOUT, ", %d", j);
...@@ -271,7 +241,6 @@ void Print_PhysicalGroups(void *a, void *b) ...@@ -271,7 +241,6 @@ void Print_PhysicalGroups(void *a, void *b)
fprintf(FOUT, "{%d", j); fprintf(FOUT, "{%d", j);
} }
fprintf(FOUT, "};\n"); fprintf(FOUT, "};\n");
} }
void Print_Geo(Mesh *M, char *filename) void Print_Geo(Mesh *M, char *filename)
...@@ -298,5 +267,4 @@ void Print_Geo(Mesh * M, char *filename) ...@@ -298,5 +267,4 @@ void Print_Geo(Mesh * M, char *filename)
Msg(STATUS2N, "Wrote '%s'", filename); Msg(STATUS2N, "Wrote '%s'", filename);
fclose(FOUT); fclose(FOUT);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment