diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 679944026e5022a2bccdda0ba14dad2474c3be5a..5b7716066cbb38d90db66f54458d22ed19a31e01 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -878,6 +878,8 @@ StringXNumber ViewOptions_Number[] = { { F|O, "PointSize" , opt_view_point_size , 2. , "Display size of points (in pixels)" }, + { F|O, "PointType" , opt_view_point_type , 0. , + "Display points as solid colors or 3D spheres" }, { F|O, "PositionX" , opt_view_position0 , 80. , "Horizontal position (in pixels) of the upper left corner of the scale or 2D graph" }, { F|O, "PositionY" , opt_view_position1 , 50. , diff --git a/Common/Options.cpp b/Common/Options.cpp index 742be391217fa3d34550c4ec194736f4baf8930c..531ed7ca7293c5a05ed5a8536725866f48286c65 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1,4 +1,4 @@ -// $Id: Options.cpp,v 1.80 2002-05-20 18:28:24 geuzaine Exp $ +// $Id: Options.cpp,v 1.81 2002-06-15 17:41:35 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -2746,6 +2746,14 @@ double opt_view_line_width(OPT_ARGS_NUM){ #endif return v->LineWidth; } +double opt_view_point_type(OPT_ARGS_NUM){ + GET_VIEW(0.) ; + if(action & GMSH_SET){ + v->PointType = (int)val; + v->Changed = 1; + } + return v->PointType; +} double opt_print_format(OPT_ARGS_NUM){ diff --git a/Common/Options.h b/Common/Options.h index 9d27677859b6a80e0f7d99e7be50d1d88df4b0d7..e4e36e2f31082b16e61e45a2c4454f206c9ddc94 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -433,6 +433,7 @@ double opt_view_arrow_type(OPT_ARGS_NUM); double opt_view_arrow_location(OPT_ARGS_NUM); double opt_view_point_size(OPT_ARGS_NUM); double opt_view_line_width(OPT_ARGS_NUM); +double opt_view_point_type(OPT_ARGS_NUM); double opt_print_format(OPT_ARGS_NUM); double opt_print_eps_quality(OPT_ARGS_NUM); double opt_print_eps_background(OPT_ARGS_NUM); diff --git a/Common/Views.cpp b/Common/Views.cpp index bc574e1b7fcc19896e563fc0be9122395b9c2ba4..b46dde6b177f7b698917cd1c05d8340b605125eb 100644 --- a/Common/Views.cpp +++ b/Common/Views.cpp @@ -1,4 +1,4 @@ -// $Id: Views.cpp,v 1.70 2002-05-20 18:28:24 geuzaine Exp $ +// $Id: Views.cpp,v 1.71 2002-06-15 17:41:35 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -499,6 +499,7 @@ void CopyViewOptions(Post_View *src, Post_View *dest){ dest->TimeStep = src->TimeStep; dest->PointSize = src->PointSize; dest->LineWidth = src->LineWidth; + dest->PointType = src->PointType; dest->Grid = src->Grid; ColorTable_Copy(&src->CT); ColorTable_Paste(&dest->CT); diff --git a/Common/Views.h b/Common/Views.h index 1cd517cfaaf7d26a15aff1f24045a1e93bdf2954..6f5c7c10614bf34804a86efb723b05876f60b2e3 100644 --- a/Common/Views.h +++ b/Common/Views.h @@ -61,7 +61,7 @@ class Post_View{ int DrawStrings; int DrawPoints, DrawLines, DrawTriangles, DrawTetrahedra; int DrawScalars, DrawVectors, DrawTensors; - int Boundary, Grid; + int Boundary, Grid, PointType; double PointSize, LineWidth; GmshColorTable CT; diff --git a/Graphics/Draw.h b/Graphics/Draw.h index 2b8dee9cf20c69d771434909f31d7850f5bae9f0..5e32ef85e82864a3268bf237aea1b1460a9e821f 100644 --- a/Graphics/Draw.h +++ b/Graphics/Draw.h @@ -71,7 +71,7 @@ void Draw_Text2D3D(int dim, int timestep, int nb, List_T *td, List_T *tc); void Draw_Scales(void); void Draw_Axes (double s); void Draw_SmallAxes(void); -void Draw_Point(double *x, double *y, double *z, double Raise[3][5]); +void Draw_Point(int size, int type, double *x, double *y, double *z, double Raise[3][5]); void Draw_Line (double *x, double *y, double *z, double Raise[3][5]); void Draw_Triangle (double *x, double *y, double *z,double *n, double Raise[3][5], int shade); diff --git a/Graphics/Entity.cpp b/Graphics/Entity.cpp index 2ed9ad6b628ae85815a1c7ef5cf6519f2460602c..f979295178538364384c3880e7efb6ed0919d2ee 100644 --- a/Graphics/Entity.cpp +++ b/Graphics/Entity.cpp @@ -1,4 +1,4 @@ -// $Id: Entity.cpp,v 1.15 2002-05-20 18:28:26 geuzaine Exp $ +// $Id: Entity.cpp,v 1.16 2002-06-15 17:41:35 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -28,10 +28,25 @@ extern Context_T CTX; -void Draw_Point (double *x, double *y, double *z, double Raise[3][5]){ - glBegin(GL_POINTS); - glVertex3d(x[0]+Raise[0][0], y[0]+Raise[1][0], z[0]+Raise[2][0]); - glEnd(); +void Draw_Point (int size, int type, double *x, double *y, double *z, double Raise[3][5]){ + static GLUquadricObj *qua; + static int first=1; + if(first){ + first=0; + qua = gluNewQuadric(); + } + + if(type){ + glPushMatrix(); + glTranslatef(x[0]+Raise[0][0], y[0]+Raise[1][0], z[0]+Raise[2][0]); + gluSphere(qua, size*CTX.pixel_equiv_x/CTX.s[0], 20,20); + glPopMatrix(); + } + else{ + glBegin(GL_POINTS); + glVertex3d(x[0]+Raise[0][0], y[0]+Raise[1][0], z[0]+Raise[2][0]); + glEnd(); + } } void Draw_Line (double *x, double *y, double *z, double Raise[3][5]){ diff --git a/Graphics/PostSimplex.cpp b/Graphics/PostSimplex.cpp index d8225742a79eb55f4ecd6922bcd846f994df3ce9..6646bd4cf3ab59cbcdabfa448080e58d32eaa24b 100644 --- a/Graphics/PostSimplex.cpp +++ b/Graphics/PostSimplex.cpp @@ -1,4 +1,4 @@ -// $Id: PostSimplex.cpp,v 1.36 2002-05-20 18:28:26 geuzaine Exp $ +// $Id: PostSimplex.cpp,v 1.37 2002-06-15 17:41:35 geuzaine Exp $ // // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // @@ -38,7 +38,7 @@ void Draw_Simplex(Post_View *View, int nbnod, double *X, double *Y, double *Z, glColor4ubv((GLubyte*)&CTX.color.fg); switch(nbnod){ case 1 : - Draw_Point(X,Y,Z,Raise); + Draw_Point(View->PointSize,View->PointType,X,Y,Z,Raise); break; case 2 : Draw_Line(X,Y,Z,Raise); @@ -99,7 +99,7 @@ void Draw_ScalarPoint(Post_View *View, Draw_String(Num); } else - Draw_Point(X,Y,Z,Raise); + Draw_Point(View->PointSize,View->PointType,X,Y,Z,Raise); } } @@ -194,7 +194,7 @@ void Draw_ScalarLine(Post_View *View, thev, ValMin,ValMax,Xp,Yp,Zp,&nb); if(nb){ RaiseFill(0,thev,ValMin,Raise); - Draw_Point(Xp,Yp,Zp,Raise); + Draw_Point(View->PointSize,View->PointType,Xp,Yp,Zp,Raise); } } }