Commit 5074d4f9 authored by Edward Vigmond's avatar Edward Vigmond
Browse files

Fixed crash when reading in state when no auxiliary grid

parent 256901ee
This diff is collapsed.
......@@ -186,6 +186,7 @@ void VolElement::add( int *n, int r )
MultiPoint::add( n );
if ( _n>1 ) {
int *newreg = new int[_n*_ptsPerObj];
/** GD: indexing out of range on the _region happens alot in this file, should be _n-1 I think. **/
memcpy( newreg, _region, _n*_ptsPerObj*sizeof(int) );
delete[] _region;
_region = newreg;
......
......@@ -3,7 +3,7 @@ HOSTMACHINE := $(shell uname)
FLTK_INC := $(shell fltk-config --use-gl --cxxflags)
FLTK_LD_FLAGS := $(shell fltk-config --use-gl --ldflags)
COMMON_LIBS = -lpng -lpthread -lm -lz
COMMON_INC = -I. -O3 -g -DOBJ_CLASS -pg -D_REENTRANT -MMD -DNOMINMAX
COMMON_INC = -I. -O0 -g -DOBJ_CLASS -pg -D_REENTRANT -MMD -DNOMINMAX
ifeq ($(HOSTMACHINE),Darwin)
LIBS = -L/sw/lib $(FLTK_LD_FLAGS) $(COMMON_LIBS)
......
......@@ -8,6 +8,7 @@
#include "VecData.h"
#include <sstream>
#include <FL/filename.H>
#include "gzFileBuffer.h"
struct Face {
int nsort[MAX_NUM_SURF_NODES]; //!< sorted nodes
......@@ -80,7 +81,7 @@ int Model::new_region_label()
Model::Model():
_base1(false), _surface(NULL), _vertnrml(NULL),
_base1(false), _surface(NULL), _vertnrml(NULL),_cable(NULL),
_numReg(0), _region(NULL), _numVol(0), _vol(NULL), _cnnx(NULL)
{
for ( int i=0; i<maxobject; i++ ) {
......@@ -99,6 +100,11 @@ Model::Model():
const int bufsize=1024;
bool Model::read( const char* fnt, bool base1, bool no_elems )
{
ofstream logger("logger.txt");
clock_t timer = clock();
logger << "starting to monitor" << std::endl;
logger.flush();
_file = fnt;
char fn[bufsize];
strcpy( fn, fnt );
......@@ -115,6 +121,10 @@ bool Model::read( const char* fnt, bool base1, bool no_elems )
allvis.resize(pt.num());
allvis.assign(pt.num(), true );
logger << "time1: " << (clock() - timer) / (double) CLOCKS_PER_SEC << std::endl; timer = clock();
logger.flush();
if ( !strcmp( ".gz", fn+strlen(fn)-3 ) ) // temporary
fn[strlen(fn)-3] = '\0';
if ( !strcmp( ".pts", fn+strlen(fn)-4 ) ) // temporary
......@@ -126,16 +136,44 @@ bool Model::read( const char* fnt, bool base1, bool no_elems )
_cnnx = new Connection( &pt );
_cnnx->read( fn );
logger << "time2: " << (clock() - timer) / (double) CLOCKS_PER_SEC << std::endl; timer = clock();
logger.flush();
_cable = new ContCable( &pt );
_cable->read( fn );
logger << "time3: " << (clock() - timer) / (double) CLOCKS_PER_SEC << std::endl; timer = clock();
logger.flush();
if( !no_elems ) read_elem_file( fn );
logger << "time4: " << (clock() - timer) / (double) CLOCKS_PER_SEC << std::endl; timer = clock();
logger.flush();
read_region_file( in, fn );
logger << "time5: " << (clock() - timer) / (double) CLOCKS_PER_SEC << std::endl; timer = clock();
logger.flush();
determine_regions();
logger << "time6: " << (clock() - timer) / (double) CLOCKS_PER_SEC << std::endl; timer = clock();
logger.flush();
add_surface_from_tri( fn );
logger << "time7: " << (clock() - timer) / (double) CLOCKS_PER_SEC << std::endl; timer = clock();
logger.flush();
add_surface_from_surf( fn );
logger << "time8: " << (clock() - timer) / (double) CLOCKS_PER_SEC << std::endl; timer = clock();
logger.flush();
add_surface_from_elem( fn );
logger << "time9: " << (clock() - timer) / (double) CLOCKS_PER_SEC << std::endl; timer = clock();
logger.flush();
// find maximum dimension and bounding box
const GLfloat *p = pt.pt();
......@@ -145,6 +183,10 @@ bool Model::read( const char* fnt, bool base1, bool no_elems )
_vertnrml= new GLfloat[3*pt.num()];
logger << "time10: " << (clock() - timer) / (double) CLOCKS_PER_SEC << std::endl; timer = clock();
logger.flush();
return true;
}
......@@ -250,7 +292,6 @@ void Model::determine_regions()
}
}
/** add surface by selecting 2D elements from .elem file
*
* A surface will be created for each different region specified.
......@@ -272,18 +313,30 @@ int Model::add_surface_from_elem( const char *fn )
char buff[bufsize];
gzgets(in,buff,bufsize); // throw away first line
map<string,int> surfs; // number of elements in each surface
while ( gzgets(in,buff,bufsize) !=Z_NULL ) {
gzFileBuffer file(in);
while ( file.gets(buff,bufsize) != Z_NULL )
//while ( gzgets(in,buff,bufsize) != Z_NULL )
{
char surfnum[10]="";
if ( !strncmp(buff,"Tr",2) ) {
if ( !strncmp(buff,"Tr",2) )
{
if ( sscanf(buff, "%*s %*d %*d %*d %s", surfnum )<1 )
strcpy( surfnum, "EMPTY" );
} else if ( !strncmp(buff,"Qd",2) ) {
strcpy(surfnum, "EMPTY");
}
else if ( !strncmp(buff,"Qd",2) )
{
if ( sscanf(buff, "%*s %*d %*d %*d %*d %s", &surfnum )<1 )
strcpy( surfnum, "EMPTY" );
strcpy(surfnum, "EMPTY");
}
else
continue;
if ( strlen(surfnum) )
surfs[surfnum]++;
}
if ( !surfs.size() ) return numSurf();
// allocate new surfaces
......@@ -299,8 +352,12 @@ int Model::add_surface_from_elem( const char *fn )
surfs.clear(); // now use for current element in each surface
gzrewind(in);
gzFileBuffer file2(in);
gzgets(in,buff,bufsize); //throw away first line
while( gzgets(in,buff,bufsize) !=Z_NULL ) {
while( file2.gets(buff,bufsize) !=Z_NULL ) {
//while( gzgets(in,buff,bufsize) !=Z_NULL ) {
char etype[10],reg[10];
int idat[4];
if( !strncmp(buff,"Tr",2) ) {
......@@ -987,17 +1044,33 @@ bool Model :: read_elem_file( const char *fname )
_vol = new VolElement*[_numVol];
gzFileBuffer file(in);
int nele = _numVol;
int ne = 0;
int surfe = 0;
for( int i=0; i<nele; i++ ) {
if( gzgets(in, buf, bufsize)==Z_NULL || !strlen(buf) ) break;
//if( gzgets(in, buf, bufsize)==Z_NULL || !strlen(buf) ) break;
if( file.gets(buf, bufsize)==Z_NULL || !strlen(buf) ) break;
int n[9];
if( tets )
sscanf( buf, "%d %d %d %d %d", n, n+1, n+2, n+3, n+4 );
//sscanf( buf, "%d %d %d %d %d", n, n+1, n+2, n+3, n+4 );
{
char * p = buf;
for (size_t i=0; i<5; i++)
n[i] = strtol(p, &p, 10);
}
else
sscanf( buf, "%2s %d %d %d %d %d %d %d %d %d", eletype,
n, n+1, n+2, n+3, n+4, n+5, n+6, n+7, n+8 );
//sscanf( buf, "%2s %d %d %d %d %d %d %d %d %d", eletype,
// n, n+1, n+2, n+3, n+4, n+5, n+6, n+7, n+8 );
{
eletype[0]=buf[0];
eletype[1]=buf[1];
char * p = buf+3;
for (size_t i=0; i<9; i++)
n[i] = strtol(p, &p, 10);
}
if( !strcmp( eletype, "Tt" ) ) {
_vol[ne] = new Tetrahedral( &pt );
_vol[ne]->add( n, n[4] );
......
#include "DrawingObjects.h"
#include "VecData.h"
#include "gzFileBuffer.h"
/** draw a nice 3D sphere
*
......@@ -130,6 +130,8 @@ bool Point :: read( const char *fname )
if ( gzgets(in, buff, bufsize) == Z_NULL ) throw 1;
if ( sscanf( buff, "%d", &_n ) != 1 ) throw 2;
gzFileBuffer file(in);
if ( _base1 ) _n++; // add initial bogus point
_pts = (GLfloat *)malloc(_n*3*sizeof(GLfloat));
float min[3], max[3];
......@@ -140,7 +142,8 @@ bool Point :: read( const char *fname )
_pts[i+j] = _pts[i+j-3];
continue;
}
if ( gzgets(in, buff, bufsize) == Z_NULL ) throw 2;
//if ( gzgets(in, buff, bufsize) == Z_NULL ) throw 2;
if ( file.gets(buff, bufsize) == Z_NULL ) throw 2;
if ( sscanf( buff, "%f %f %f", _pts+i, _pts+i+1, _pts+i+2 ) < 3 )
throw 3;
for ( int ti=0; ti<3; ti++ ) {
......
// generated by Fast Light User Interface Designer (fluid) version 1.0300
#include "Sequence.h"
void Sequence::cb_Start_i(Fl_Return_Button*, void*) {
mwtb->output_png( fname->value(), this );
}
void Sequence::cb_Start(Fl_Return_Button* o, void* v) {
((Sequence*)(o->parent()->user_data()))->cb_Start_i(o,v);
}
void Sequence::cb_browse_i(Fl_Button*, void*) {
const char* fn=fl_file_chooser("Choose output file name base", "*.png",fname->value() );
if( fn != NULL ) fname->value(fn);
}
void Sequence::cb_browse(Fl_Button* o, void* v) {
((Sequence*)(o->parent()->user_data()))->cb_browse_i(o,v);
}
Sequence::Sequence( TBmeshWin *tb ) {
{ window = new Fl_Double_Window(295, 190, "Write PNG Sequence");
window->user_data((void*)(this));
{ movieprog = new Fl_Progress(15, 10, 265, 35);
movieprog->selection_color((Fl_Color)91);
} // Fl_Progress* movieprog
{ Fl_Return_Button* o = new Fl_Return_Button(15, 145, 265, 35, "Start sequence");
o->callback((Fl_Callback*)cb_Start);
} // Fl_Return_Button* o
{ fname = new Fl_File_Input(15, 65, 215, 35, "output file base name:");
fname->align(Fl_Align(FL_ALIGN_TOP));
} // Fl_File_Input* fname
{ Fl_Button* o = new Fl_Button(240, 65, 40, 35, "browse");
o->labelsize(10);
o->callback((Fl_Callback*)cb_browse);
} // Fl_Button* o
{ lastFrameNum = new Fl_Value_Input(160, 110, 55, 25, "End Frame:");
lastFrameNum->step(1);
} // Fl_Value_Input* lastFrameNum
window->end();
} // Fl_Double_Window* window
mwtb = tb;
fname->value("image.png");
lastFrameNum->value( mwtb->numframes-1 );
lastFrameNum->maximum( mwtb->numframes-1 );
}
......@@ -636,6 +636,9 @@ int TBmeshWin::handle( int event )
return Fl_Gl_Tb_Window::handle(event);
}
#include <iostream>
#include <fstream>
#include <ctime>
/** read in the geometrical description
*
......
#include "DrawingObjects.h"
#include "gzFileBuffer.h"
static const int tri_iso_table[][6] = {
{0,0,0,0,0,0},{1,2,0,1,0,2},{1,2,1,0,1,2},{1,2,1,2,0,2},
......@@ -114,13 +115,16 @@ bool Triangle :: read( const char *fname )
char buff[bufsize];
int nold=_n, nele;
while ( gzgets(in, buff, bufsize) != Z_NULL ) {
gzFileBuffer file(in);
while ( file.gets(buff, bufsize) != Z_NULL ) {
//while ( gzgets(in, buff, bufsize) != Z_NULL ) {
sscanf( buff, "%d", &nele );
_n += nele;
_node = (int *)realloc( _node, _n*3*sizeof(int) );
_nrml = (GLfloat*)realloc( _nrml, _n*sizeof(GLfloat)*3 );
for ( int i=_n-nele; i<_n; i++ ) {
gzgets(in, buff, bufsize);
file.gets(buff, bufsize);
//gzgets(in, buff, bufsize);
sscanf( buff, "%d %d %d %*d", _node+3*i, _node+3*i+1, _node+3*i+2 );
}
}
......
// generated by Fast Light User Interface Designer (fluid) version 1.0300
#include "colourchoice.h"
#include "AuxGrid.h"
#include <string>
void colourChoice::cb_Done_i(Fl_Return_Button*, void*) {
col[0] = rgb_choice->r();
col[1] = rgb_choice->g();
col[2] = rgb_choice->b();
col[3] = opacity->value();
for( int r=0; r<numreg; r++ )
if( sc[r] )
tbmw->set_color( obj, r, col[0], col[1], col[2], col[3] );
tbmw->redraw();
window->~Fl_Window();
}
void colourChoice::cb_Done(Fl_Return_Button* o, void* v) {
((colourChoice*)(o->parent()->user_data()))->cb_Done_i(o,v);
}
void colourChoice::cb_apbut_i(Fl_Button*, void*) {
col[0] = rgb_choice->r();
col[1] = rgb_choice->g();
col[2] = rgb_choice->b();
col[3] = opacity->value();
for( int r=0; r<numreg; r++ )
if( sc[r] )
tbmw->set_color( obj, r, col[0], col[1], col[2], col[3] );
tbmw->redraw();
}
void colourChoice::cb_apbut(Fl_Button* o, void* v) {
((colourChoice*)(o->parent()->user_data()))->cb_apbut_i(o,v);
}
colourChoice::colourChoice( GLfloat *c, bool *b, int nb, Object_t o, TBmeshWin *t ) {
{ window = new Fl_Double_Window(225, 260, "Choose colour");
window->user_data((void*)(this));
{ rgb_choice = new Fl_Color_Chooser(0, 0, 225, 175);
rgb_choice->box(FL_NO_BOX);
rgb_choice->color(FL_BACKGROUND_COLOR);
rgb_choice->selection_color(FL_BACKGROUND_COLOR);
rgb_choice->labeltype(FL_NORMAL_LABEL);
rgb_choice->labelfont(0);
rgb_choice->labelsize(14);
rgb_choice->labelcolor(FL_FOREGROUND_COLOR);
rgb_choice->align(Fl_Align(FL_ALIGN_CENTER));
rgb_choice->when(FL_WHEN_RELEASE);
} // Fl_Color_Chooser* rgb_choice
{ opacity = new Fl_Slider(10, 190, 205, 25, "Opacity");
opacity->type(3);
opacity->selection_color(FL_FOREGROUND_COLOR);
opacity->step(0.01);
opacity->value(1);
opacity->align(Fl_Align(FL_ALIGN_TOP));
} // Fl_Slider* opacity
{ Fl_Return_Button* o = new Fl_Return_Button(125, 225, 90, 30, "Done");
o->callback((Fl_Callback*)cb_Done);
} // Fl_Return_Button* o
{ apbut = new Fl_Button(15, 225, 95, 30, "Apply");
apbut->callback((Fl_Callback*)cb_apbut);
} // Fl_Button* apbut
window->end();
} // Fl_Double_Window* window
col = c;
obj = o;
tbmw = t;
sc = b;
numreg = nb;
rgb_choice->rgb(col[0], col[1], col[2] );
opacity->value( col[3] );
}
colourChoice::~colourChoice() {
delete[] sc;
}
void AuxColourChoice::cb_Done1_i(Fl_Return_Button*, void*) {
col[0] = rgb_choice->r();
col[1] = rgb_choice->g();
col[2] = rgb_choice->b();
col[3] = opacity->value();
tbmw->auxGrid->color( obj, col );
tbmw->redraw();
window->~Fl_Window();
}
void AuxColourChoice::cb_Done1(Fl_Return_Button* o, void* v) {
((AuxColourChoice*)(o->parent()->user_data()))->cb_Done1_i(o,v);
}
void AuxColourChoice::cb_apbut1_i(Fl_Button*, void*) {
col[0] = rgb_choice->r();
col[1] = rgb_choice->g();
col[2] = rgb_choice->b();
col[3] = opacity->value();
tbmw->auxGrid->color( obj, col );
tbmw->redraw();
}
void AuxColourChoice::cb_apbut1(Fl_Button* o, void* v) {
((AuxColourChoice*)(o->parent()->user_data()))->cb_apbut1_i(o,v);
}
AuxColourChoice::AuxColourChoice( GLfloat *c, Object_t o, TBmeshWin *tb) {
{ window = new Fl_Double_Window(225, 260, "Choose colour");
window->user_data((void*)(this));
{ rgb_choice = new Fl_Color_Chooser(0, 0, 225, 175);
rgb_choice->box(FL_NO_BOX);
rgb_choice->color(FL_BACKGROUND_COLOR);
rgb_choice->selection_color(FL_BACKGROUND_COLOR);
rgb_choice->labeltype(FL_NORMAL_LABEL);
rgb_choice->labelfont(0);
rgb_choice->labelsize(14);
rgb_choice->labelcolor(FL_FOREGROUND_COLOR);
rgb_choice->align(Fl_Align(FL_ALIGN_CENTER));
rgb_choice->when(FL_WHEN_RELEASE);
} // Fl_Color_Chooser* rgb_choice
{ opacity = new Fl_Slider(10, 190, 205, 25, "Opacity");
opacity->type(3);
opacity->selection_color(FL_FOREGROUND_COLOR);
opacity->step(0.01);
opacity->value(1);
opacity->align(Fl_Align(FL_ALIGN_TOP));
} // Fl_Slider* opacity
{ Fl_Return_Button* o = new Fl_Return_Button(125, 225, 90, 30, "Done");
o->callback((Fl_Callback*)cb_Done1);
} // Fl_Return_Button* o
{ apbut = new Fl_Button(15, 225, 95, 30, "Apply");
apbut->callback((Fl_Callback*)cb_apbut1);
} // Fl_Button* apbut
window->end();
} // Fl_Double_Window* window
col = c;
obj = o;
tbmw = tb;
rgb_choice->rgb(col[0], col[1], col[2] );
opacity->value( col[3] );
string title=objnames[obj];
title += " color";
window->label( title.c_str() );
window->show();
}
// generated by Fast Light User Interface Designer (fluid) version 1.0300
#include "plottingwin.h"
#include "Graph.h"
using namespace std;
void PlotWin::cb_window_i(Fl_Double_Window*, void*) {
this->window->hide();
}
void PlotWin::cb_window(Fl_Double_Window* o, void* v) {
((PlotWin*)(o->user_data()))->cb_window_i(o,v);
}
void PlotWin::cb_Close_i(Fl_Return_Button*, void*) {
this->window->hide();
}
void PlotWin::cb_Close(Fl_Return_Button* o, void* v) {
((PlotWin*)(o->parent()->parent()->user_data()))->cb_Close_i(o,v);
}
void PlotWin::cb_Write_i(Fl_Button*, void*) {
writedata();
}
void PlotWin::cb_Write(Fl_Button* o, void* v) {
((PlotWin*)(o->parent()->parent()->user_data()))->cb_Write_i(o,v);
}
void PlotWin::cb_rotbut_i(Fl_Light_Button* o, void*) {
rotate(o->value());
}
void PlotWin::cb_rotbut(Fl_Light_Button* o, void* v) {
((PlotWin*)(o->parent()->parent()->user_data()))->cb_rotbut_i(o,v);
}
void PlotWin::cb_autoscalebut_i(Fl_Light_Button* o, void*) {
autoscale(o->value());
}
void PlotWin::cb_autoscalebut(Fl_Light_Button* o, void* v) {
((PlotWin*)(o->parent()->parent()->user_data()))->cb_autoscalebut_i(o,v);
}
void PlotWin::cb_Hold_i(Fl_Button*, void*) {
graph->copy_curve(0);
}
void PlotWin::cb_Hold(Fl_Button* o, void* v) {
((PlotWin*)(o->parent()->parent()->user_data()))->cb_Hold_i(o,v);
}
PlotWin::PlotWin( string title ) {
{ window = new Fl_Double_Window(525, 195, "Time plot");
window->box(FL_UP_BOX);
window->callback((Fl_Callback*)cb_window, (void*)(this));
{ graph = new Graph(5, 5, 515, 165);
graph->box(FL_NO_BOX);
graph->color(FL_BACKGROUND_COLOR);
graph->selection_color(FL_BACKGROUND_COLOR);
graph->labeltype(FL_NORMAL_LABEL);
graph->labelfont(0);
graph->labelsize(14);
graph->labelcolor(FL_FOREGROUND_COLOR);
graph->align(Fl_Align(FL_ALIGN_CENTER));
graph->when(FL_WHEN_RELEASE);
Fl_Group::current()->resizable(graph);
} // Graph* graph
{ button_grp = new Fl_Group(5, 170, 515, 30);
button_grp->box(FL_ENGRAVED_BOX);
button_grp->color(FL_LIGHT2);
{ Fl_Return_Button* o = new Fl_Return_Button(15, 175, 75, 15, "Close");
o->labelsize(10);
o->callback((Fl_Callback*)cb_Close);
} // Fl_Return_Button* o
{ Fl_Button* o = new Fl_Button(275, 175, 70, 15, "Write");
o->labelsize(10);
o->callback((Fl_Callback*)cb_Write);
} // Fl_Button* o
{ rotbut = new Fl_Light_Button(105, 175, 70, 15, "Rotate");
rotbut->labelsize(10);
rotbut->callback((Fl_Callback*)cb_rotbut);
} // Fl_Light_Button* rotbut
{ Fl_Button* o = new Fl_Button(190, 175, 70, 15, "Pop");
o->labelsize(10);
} // Fl_Button* o
{ autoscalebut = new Fl_Light_Button(440, 175, 70, 15, "Autoscale");
autoscalebut->value(1);
autoscalebut->labelsize(10);
autoscalebut->callback((Fl_Callback*)cb_autoscalebut);
} // Fl_Light_Button* autoscalebut
{ Fl_Button* o = new Fl_Button(360, 175, 70, 15, "Hold");
o->labelsize(10);
o->callback((Fl_Callback*)cb_Hold);
} // Fl_Button* o
button_grp->end();
} // Fl_Group* button_grp
window->end();
} // Fl_Double_Window* window
xv = new double[1];
data = new double[1];
tm = 0;
datasize = -1;
rotated = false;
window->label(strdup(title.c_str()));
window->user_data(this);
}
void PlotWin::autoscale(int a) {
graph->autoscale(a);
}
......@@ -1699,7 +1699,8 @@ mshzf << endl;} {}
code {for( int c=0; c<3; c++ ) ofs << col[c] << " ";
ofs << col[3];} {}
}
Function {pick_surf_color(Object_t ot, const char *winlab)} {} {
Function {pick_surf_color(Object_t ot, const char *winlab)} {open
} {
code {int msz = surflist->nitems();
if( !msz ) return;
......@@ -1716,7 +1717,8 @@ for( int mi=0; mi<surflist->nitems(); mi++ )
colourChoice *cc = new colourChoice( col, cs, msz, ot, mwtb );
cc->window->label(winlab);
cc->window->show();} {}
cc->window->show();} {selected
}
}
Function {restore_state(const char* fname=NULL)} {open
} {
......@@ -1875,24 +1877,45 @@ while( mshzf.getline( buf, BUFLEN ) ) {
TEST_VAR( tmslider, var, int(val) )
TEST_VAR( frameskip, var, int(val) )
TEST_VAR( animdelay, var, int(val) )
TEST_VAR( auxgriddispbut, var, int(val) );
TEST_CHOICE( auxcstype, var, int(val) );
TEST_VAR( auxmincolval, var, val );
TEST_VAR( auxmaxcolval, var, val );
TEST_VAR( auxnumcolev, var, int(val) );
TEST_VAR( auxautocalibratebut, var, int(val) );
TEST_VAR( auxptdat, var, int(val) );
TEST_VAR( auxptsize, var, val );
TEST_CHOICE( auxptstyle, var, int(val) );
TEST_VAR( auxlinedat, var, int(val) );
TEST_VAR( auxlinewidth, var, val );
TEST_CHOICE( auxlinestyle, var, int(val) );
TEST_VAR( auxsurfdat, var, int(val) );
TEST_VAR( auxsurfline, var, val );
TEST_CHOICE( auxsurfstyle, var, int(val) );
TEST_VAR( auxvoldat, var, int(val) );
TEST_VAR( auxvolline, var, val );
TEST_CHOICE( auxvolstyle, var, int(val) );