Skip to content
Snippets Groups Projects
Commit 95925e56 authored by David Colignon's avatar David Colignon
Browse files

clip planes

parent 132352d9
Branches
Tags
No related merge requests found
/* $Id: Context.cpp,v 1.7 2000-11-26 18:43:48 geuzaine Exp $ */ /* $Id: Context.cpp,v 1.8 2000-12-04 09:29:38 colignon Exp $ */
#include "Gmsh.h" #include "Gmsh.h"
#include "Const.h" #include "Const.h"
...@@ -163,10 +163,12 @@ void InitContext(Context_T *ctx){ ...@@ -163,10 +163,12 @@ void InitContext(Context_T *ctx){
ctx->render_mode = GMSH_RENDER ; ctx->render_mode = GMSH_RENDER ;
ctx->pixel_equiv_x = 0. ; ctx->pixel_equiv_x = 0. ;
ctx->pixel_equiv_y = 0. ; ctx->pixel_equiv_y = 0. ;
ctx->clip_plane0[0] = 0. ; ctx->clip[0] = 0;
ctx->clip_plane0[1] = 0. ; ctx->clip[1] = 0;
ctx->clip_plane0[2] = 0. ; ctx->clip[2] = 0;
ctx->clip_plane0[3] = 0. ; ctx->clip[3] = 0;
ctx->clip[4] = 0;
ctx->clip[5] = 0;
ctx->font_string = "-*-helvetica-medium-r-*-*-*-*-*-*-*-*-*-*"; ctx->font_string = "-*-helvetica-medium-r-*-*-*-*-*-*-*-*-*-*";
ctx->colorbar_font_string = "fixed"; ctx->colorbar_font_string = "fixed";
......
/* $Id: Context.h,v 1.8 2000-11-27 08:24:55 geuzaine Exp $ */ /* $Id: Context.h,v 1.9 2000-12-04 09:29:38 colignon Exp $ */
#ifndef _CONTEXT_H_ #ifndef _CONTEXT_H_
#define _CONTEXT_H_ #define _CONTEXT_H_
...@@ -89,12 +89,7 @@ typedef struct { ...@@ -89,12 +89,7 @@ typedef struct {
float shine; /* specular value */ float shine; /* specular value */
int render_mode; /* GMSH_RENDER, GMSH_SELECT, GMSH_FEEDBACK */ int render_mode; /* GMSH_RENDER, GMSH_SELECT, GMSH_FEEDBACK */
int clip[6]; /* status of clip planes */ int clip[6]; /* status of clip planes */
double clip_plane0[4]; /* clip plane 0 */ double clip_plane[6][4]; /* clip planes */
double clip_plane1[4]; /* clip plane 1 */
double clip_plane2[4]; /* clip plane 2 */
double clip_plane3[4]; /* clip plane 3 */
double clip_plane4[4]; /* clip plane 4 */
double clip_plane5[4]; /* clip plane 5 */
double pixel_equiv_x, pixel_equiv_y ; double pixel_equiv_x, pixel_equiv_y ;
/* approximative equivalent model length of a pixel */ /* approximative equivalent model length of a pixel */
......
/* $Id: Mesh.cpp,v 1.8 2000-12-01 13:56:10 geuzaine Exp $ */ /* $Id: Mesh.cpp,v 1.9 2000-12-04 09:29:38 colignon Exp $ */
#include "Gmsh.h" #include "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -50,6 +50,7 @@ void ColorSwitch(int i){ ...@@ -50,6 +50,7 @@ void ColorSwitch(int i){
static int DrawVertexSupp ; static int DrawVertexSupp ;
void Draw_Mesh (Mesh *M) { void Draw_Mesh (Mesh *M) {
int i;
if(CTX.mesh.shade) if(CTX.mesh.shade)
InitShading(); InitShading();
...@@ -58,12 +59,8 @@ void Draw_Mesh (Mesh *M) { ...@@ -58,12 +59,8 @@ void Draw_Mesh (Mesh *M) {
InitPosition(); InitPosition();
if(CTX.clip[0]) glClipPlane(GL_CLIP_PLANE0, CTX.clip_plane0); for(i = 0 ; i < 6 ; i++)
if(CTX.clip[1]) glClipPlane(GL_CLIP_PLANE1, CTX.clip_plane1); if(CTX.clip[i]) glClipPlane(GL_CLIP_PLANE0 + i, CTX.clip_plane[i]);
if(CTX.clip[2]) glClipPlane(GL_CLIP_PLANE2, CTX.clip_plane2);
if(CTX.clip[3]) glClipPlane(GL_CLIP_PLANE3, CTX.clip_plane3);
if(CTX.clip[4]) glClipPlane(GL_CLIP_PLANE4, CTX.clip_plane4);
if(CTX.clip[5]) glClipPlane(GL_CLIP_PLANE5, CTX.clip_plane5);
glPointSize(2); glPointSize(2);
glLineWidth(1); glLineWidth(1);
......
%{ /* $Id: Gmsh.l,v 1.5 2000-11-28 11:28:35 geuzaine Exp $ */ %{ /* $Id: Gmsh.l,v 1.6 2000-12-04 09:29:38 colignon Exp $ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -96,6 +96,7 @@ Coherence return tCoherence; ...@@ -96,6 +96,7 @@ Coherence return tCoherence;
Complex return tComplex; Complex return tComplex;
Color return tColor; Color return tColor;
CatmullRom return tSpline; CatmullRom return tSpline;
Clip return tClip;
Delete return tDelete; Delete return tDelete;
Dilate return tDilate; Dilate return tDilate;
......
This diff is collapsed.
...@@ -91,60 +91,61 @@ typedef union { ...@@ -91,60 +91,61 @@ typedef union {
#define tGeneral 340 #define tGeneral 340
#define tGeometry 341 #define tGeometry 341
#define tMesh 342 #define tMesh 342
#define tB_SPLINE_SURFACE_WITH_KNOTS 343 #define tClip 343
#define tB_SPLINE_CURVE_WITH_KNOTS 344 #define tB_SPLINE_SURFACE_WITH_KNOTS 344
#define tCARTESIAN_POINT 345 #define tB_SPLINE_CURVE_WITH_KNOTS 345
#define tTRUE 346 #define tCARTESIAN_POINT 346
#define tFALSE 347 #define tTRUE 347
#define tUNSPECIFIED 348 #define tFALSE 348
#define tU 349 #define tUNSPECIFIED 349
#define tV 350 #define tU 350
#define tEDGE_CURVE 351 #define tV 351
#define tVERTEX_POINT 352 #define tEDGE_CURVE 352
#define tORIENTED_EDGE 353 #define tVERTEX_POINT 353
#define tPLANE 354 #define tORIENTED_EDGE 354
#define tFACE_OUTER_BOUND 355 #define tPLANE 355
#define tEDGE_LOOP 356 #define tFACE_OUTER_BOUND 356
#define tADVANCED_FACE 357 #define tEDGE_LOOP 357
#define tVECTOR 358 #define tADVANCED_FACE 358
#define tDIRECTION 359 #define tVECTOR 359
#define tAXIS2_PLACEMENT_3D 360 #define tDIRECTION 360
#define tISO 361 #define tAXIS2_PLACEMENT_3D 361
#define tENDISO 362 #define tISO 362
#define tENDSEC 363 #define tENDISO 363
#define tDATA 364 #define tENDSEC 364
#define tHEADER 365 #define tDATA 365
#define tFILE_DESCRIPTION 366 #define tHEADER 366
#define tFILE_SCHEMA 367 #define tFILE_DESCRIPTION 367
#define tFILE_NAME 368 #define tFILE_SCHEMA 368
#define tMANIFOLD_SOLID_BREP 369 #define tFILE_NAME 369
#define tCLOSED_SHELL 370 #define tMANIFOLD_SOLID_BREP 370
#define tADVANCED_BREP_SHAPE_REPRESENTATION 371 #define tCLOSED_SHELL 371
#define tFACE_BOUND 372 #define tADVANCED_BREP_SHAPE_REPRESENTATION 372
#define tCYLINDRICAL_SURFACE 373 #define tFACE_BOUND 373
#define tCONICAL_SURFACE 374 #define tCYLINDRICAL_SURFACE 374
#define tCIRCLE 375 #define tCONICAL_SURFACE 375
#define tTRIMMED_CURVE 376 #define tCIRCLE 376
#define tGEOMETRIC_SET 377 #define tTRIMMED_CURVE 377
#define tCOMPOSITE_CURVE_SEGMENT 378 #define tGEOMETRIC_SET 378
#define tCONTINUOUS 379 #define tCOMPOSITE_CURVE_SEGMENT 379
#define tCOMPOSITE_CURVE 380 #define tCONTINUOUS 380
#define tTOROIDAL_SURFACE 381 #define tCOMPOSITE_CURVE 381
#define tPRODUCT_DEFINITION 382 #define tTOROIDAL_SURFACE 382
#define tPRODUCT_DEFINITION_SHAPE 383 #define tPRODUCT_DEFINITION 383
#define tSHAPE_DEFINITION_REPRESENTATION 384 #define tPRODUCT_DEFINITION_SHAPE 384
#define tELLIPSE 385 #define tSHAPE_DEFINITION_REPRESENTATION 385
#define tTrimmed 386 #define tELLIPSE 386
#define tSolid 387 #define tTrimmed 387
#define tEndSolid 388 #define tSolid 388
#define tVertex 389 #define tEndSolid 389
#define tFacet 390 #define tVertex 390
#define tNormal 391 #define tFacet 391
#define tOuter 392 #define tNormal 392
#define tLoopSTL 393 #define tOuter 393
#define tEndLoop 394 #define tLoopSTL 394
#define tEndFacet 395 #define tEndLoop 395
#define UMINUS 396 #define tEndFacet 396
#define UMINUS 397
extern YYSTYPE yylval; extern YYSTYPE yylval;
%{ /* $Id: Gmsh.y,v 1.9 2000-11-28 14:42:44 geuzaine Exp $ */ %{ /* $Id: Gmsh.y,v 1.10 2000-12-04 09:29:38 colignon Exp $ */
#include <stdarg.h> #include <stdarg.h>
...@@ -78,7 +78,7 @@ void Get_ColorPointerForString(StringXPointer SXP[], char * string, ...@@ -78,7 +78,7 @@ void Get_ColorPointerForString(StringXPointer SXP[], char * string,
%token tScalarLine tVectorLine tTensorLine %token tScalarLine tVectorLine tTensorLine
%token tScalarPoint tVectorPoint tTensorPoint %token tScalarPoint tVectorPoint tTensorPoint
%token tBSpline tNurbs tOrder tWith tBounds tKnots %token tBSpline tNurbs tOrder tWith tBounds tKnots
%token tColor tGeneral tGeometry tMesh %token tColor tGeneral tGeometry tMesh tClip
%token tB_SPLINE_SURFACE_WITH_KNOTS %token tB_SPLINE_SURFACE_WITH_KNOTS
%token tB_SPLINE_CURVE_WITH_KNOTS %token tB_SPLINE_CURVE_WITH_KNOTS
...@@ -349,7 +349,7 @@ GeomFormat : ...@@ -349,7 +349,7 @@ GeomFormat :
| Transfini { return 1; } | Transfini { return 1; }
| Coherence { return 1; } | Coherence { return 1; }
| Macro { return 1; } | Macro { return 1; }
| Colors { return 1; } | Options { return 1; }
| error tEND { yyerrok; return 1;} | error tEND { yyerrok; return 1;}
; ;
...@@ -1309,8 +1309,21 @@ Coherence : ...@@ -1309,8 +1309,21 @@ Coherence :
C O L O R S C O L O R S
------------- */ ------------- */
Colors : Options :
tColor '{' ColorSections '}' tColor '{' ColorSections '}'
| tClip tPlane '(' FExpr ')' tAFFECT '{' FExpr ',' FExpr ',' FExpr ',' FExpr '}'
{
i = (int)$4 ;
if(i < 0 || i > 5)
vyyerror("Wrong Clip Plane Number %d", i);
else{
CTX.clip[i] = 1;
CTX.clip_plane[i][0] = $8;
CTX.clip_plane[i][0] = $10;
CTX.clip_plane[i][0] = $12;
CTX.clip_plane[i][0] = $14;
}
}
; ;
ColorSections : ColorSections :
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment