Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/post/src/modules/misc.c
3203 views
1
/*****************************************************************************
2
*
3
* Elmer, A Finite Element Software for Multiphysical Problems
4
*
5
* Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program (in file fem/GPL-2); if not, write to the
19
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20
* Boston, MA 02110-1301, USA.
21
*
22
*****************************************************************************/
23
24
/*******************************************************************************
25
*
26
* Misc graphics utilities.
27
*
28
*******************************************************************************
29
*
30
* Author: Juha Ruokolainen
31
*
32
* Address: CSC - IT Center for Science Ltd.
33
* Keilaranta 14, P.O. BOX 405
34
* 02101 Espoo, Finland
35
* Tel. +358 0 457 2723
36
* Telefax: +358 0 457 2302
37
* EMail: [email protected]
38
*
39
* Date: 6 Jun 1996
40
*
41
* Modified by:
42
*
43
* Date of modification:
44
*
45
******************************************************************************/
46
47
/*
48
* $Id: misc.c,v 1.3 1999/06/04 15:13:20 jim Exp $
49
*
50
* $Log: misc.c,v $
51
* Revision 1.3 1999/06/04 15:13:20 jim
52
* *** empty log message ***
53
*
54
* Revision 1.2 1998/08/01 12:35:00 jpr
55
*
56
* Added Id, started Log.
57
*
58
*
59
*/
60
61
#include "../elmerpost.h"
62
63
#include <tcl.h>
64
#include <tk.h>
65
66
static int *LineSmooth(ClientData cl,Tcl_Interp *interp,int argc,char **argv)
67
{
68
if ( argc>1 )
69
{
70
if ( strcmp( argv[1], "on" ) == 0 )
71
{
72
glEnable( GL_LINE_SMOOTH );
73
glEnable( GL_BLEND );
74
} else {
75
glDisable( GL_LINE_SMOOTH );
76
glDisable( GL_BLEND );
77
}
78
} else {
79
glEnable( GL_LINE_SMOOTH );
80
glEnable( GL_BLEND );
81
}
82
83
return TCL_OK;
84
}
85
86
static int GraphicsClear( ClientData cl,Tcl_Interp *interp,int argc,char **argv )
87
{
88
extern double br,bg,bb;
89
90
glClearColor( br,bg,bb,1.0 );
91
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
92
93
return TCL_OK;
94
}
95
96
int Misc_Init( Tcl_Interp *interp )
97
{
98
Tcl_CreateCommand( interp,"linesmooth",(void *)LineSmooth,(ClientData)NULL,(Tcl_CmdDeleteProc *)NULL);
99
Tcl_CreateCommand( interp,"gclear",(void *)GraphicsClear,(ClientData)NULL,(Tcl_CmdDeleteProc *)NULL);
100
101
return TCL_OK;
102
}
103
104