/*****************************************************************************1*2* Elmer, A Finite Element Software for Multiphysical Problems3*4* Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland5*6* This program is free software; you can redistribute it and/or7* modify it under the terms of the GNU General Public License8* as published by the Free Software Foundation; either version 29* of the License, or (at your option) any later version.10*11* This program is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14* GNU General Public License for more details.15*16* You should have received a copy of the GNU General Public License17* along with this program (in file fem/GPL-2); if not, write to the18* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,19* Boston, MA 02110-1301, USA.20*21*****************************************************************************/2223/*******************************************************************************24*25* Misc graphics utilities.26*27*******************************************************************************28*29* Author: Juha Ruokolainen30*31* Address: CSC - IT Center for Science Ltd.32* Keilaranta 14, P.O. BOX 40533* 02101 Espoo, Finland34* Tel. +358 0 457 272335* Telefax: +358 0 457 230236* EMail: [email protected]37*38* Date: 6 Jun 199639*40* Modified by:41*42* Date of modification:43*44******************************************************************************/4546/*47* $Id: misc.c,v 1.3 1999/06/04 15:13:20 jim Exp $48*49* $Log: misc.c,v $50* Revision 1.3 1999/06/04 15:13:20 jim51* *** empty log message ***52*53* Revision 1.2 1998/08/01 12:35:00 jpr54*55* Added Id, started Log.56*57*58*/5960#include "../elmerpost.h"6162#include <tcl.h>63#include <tk.h>6465static int *LineSmooth(ClientData cl,Tcl_Interp *interp,int argc,char **argv)66{67if ( argc>1 )68{69if ( strcmp( argv[1], "on" ) == 0 )70{71glEnable( GL_LINE_SMOOTH );72glEnable( GL_BLEND );73} else {74glDisable( GL_LINE_SMOOTH );75glDisable( GL_BLEND );76}77} else {78glEnable( GL_LINE_SMOOTH );79glEnable( GL_BLEND );80}8182return TCL_OK;83}8485static int GraphicsClear( ClientData cl,Tcl_Interp *interp,int argc,char **argv )86{87extern double br,bg,bb;8889glClearColor( br,bg,bb,1.0 );90glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );9192return TCL_OK;93}9495int Misc_Init( Tcl_Interp *interp )96{97Tcl_CreateCommand( interp,"linesmooth",(void *)LineSmooth,(ClientData)NULL,(Tcl_CmdDeleteProc *)NULL);98Tcl_CreateCommand( interp,"gclear",(void *)GraphicsClear,(ClientData)NULL,(Tcl_CmdDeleteProc *)NULL);99100return TCL_OK;101}102103104