Commit f79f5795 authored by hrchilds's avatar hrchilds

Update from December 29, 2006

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@787 18c085ea-50e0-402c-830e-de6fd14e8384
parent 3f95355b
......@@ -57,6 +57,7 @@ pengra_icc=true
thunder=true
prism=true
yana=true
davinci=true
dist=undefined
......@@ -79,6 +80,7 @@ do
thunder=false
prism=false
yana=false
davinci=false
shift
;;
-hoth)
......@@ -161,6 +163,14 @@ do
yana=true
shift
;;
-davinci)
davinci=false
shift
;;
+davinci)
davinci=true
shift
;;
-d)
dist=$2
shift 2
......@@ -690,10 +700,51 @@ then
fi
fi
#
# Build on davinci.
#
rm -f davinci
cat <<EOF > davinci
#!/bin/sh
mv davinci_$dist.tar.gz $dist.tar.gz
gunzip -c $dist.tar.gz | tar xvf - > buildlog 2>&1
cd $dist
ver=\`cat VERSION\`
ver2=\`echo \$ver | tr "." "_"\`
env CXXFLAGS=-O2 ./configure --enable-parallel >> ../buildlog 2>&1
make -j 4 >> ../buildlog 2>&1
clearcase_bin/visit-bin-dist >> ../buildlog 2>&1
mv visit\$ver2.linux-ia64.tar.gz ..
cd ..
rm -f resultlog
echo " build of visit on davinci" > resultlog 2>&1
echo " ---------------------------" >> resultlog 2>&1
echo "" >> resultlog 2>&1
ls -l >> resultlog 2>&1
echo "" >> resultlog 2>&1
echo "number of database plugins = "\`ls $dist/plugins/databases/libI* | wc -l\` >> resultlog 2>&1
echo "number of operator plugins = "\`ls $dist/plugins/operators/libI* | wc -l\` >> resultlog 2>&1
echo "number of plot plugins = "\`ls $dist/plugins/plots/libI* | wc -l\` >> resultlog 2>&1
echo "" >> resultlog 2>&1
echo "The database plugins:" >> resultlog 2>&1
ls $dist/plugins/databases/libI* | sed "s/$dist\/plugins\/databases\/libI//" | sed "s/Database.so//" >> resultlog 2>&1
mail $emailName < resultlog
EOF
if [ $davinci = true ]
then
if [ $test = no ]
then
scp davinci davinci.nersc.gov:davinci_buildit
scp $dist.tar.gz davinci.nersc.gov:davinci_$dist.tar.gz
ssh davinci.nersc.gov "chmod 750 davinci_buildit;./davinci_buildit" &
fi
fi
#
# Clean up.
#
if [ $test = no ]
then
rm -f hoth sunspot quad berg up pengra pengra_icc thunder prism yana
rm -f hoth sunspot quad berg up pengra pengra_icc thunder prism yana davinci
fi
......@@ -188,7 +188,7 @@ if [ $crier = true ]
then
if [ $test = no ]
then
scp -P 22 crier:/gscratch/$user/crier/visitbuild/visit$ver2.linux.tar.gz visit$ver2.linux_rhel3.tar.gz
scp -P 22 crier:/export/scratch/$user/crier/visitbuild/visit$ver2.linux.tar.gz visit$ver2.linux_rhel3.tar.gz
scp -P 22 visit$ver2.linux_rhel3.tar.gz crier:
scp -P 22 visit-install crier:
scp -P 22 crier crier:crier_install
......@@ -460,5 +460,5 @@ fi
#
if [ $test = no ]
then
rm -f hitit sunset sc ice purple lilac gauss
rm -f crier hitit sunset sc ice purple lilac gauss
fi
......@@ -62,6 +62,7 @@ pengra_icc=true
thunder=true
prism=true
yana=true
davinci=true
ver=undefined
verflag=-private
......@@ -85,6 +86,7 @@ do
thunder=false
prism=false
yana=false
davinci=false
shift
;;
-hoth)
......@@ -167,6 +169,14 @@ do
yana=true
shift
;;
-davinci)
davinci=false
shift
;;
+davinci)
davinci=true
shift
;;
-v)
ver=$2
shift 2
......@@ -568,10 +578,46 @@ then
fi
fi
#
# Install on davinci.
#
rm -f davinci
cat <<EOF > davinci
#!/bin/sh
./visit-install -r -private -c nersc -b bdivp $ver linux-altix visit > installlog 2>&1
rm -f resultlog
echo " install of visit on davinci" > resultlog 2>&1
echo " -----------------------------" >> resultlog 2>&1
echo "" >> resultlog 2>&1
df -k visit >> resultlog 2>&1
echo "" >> resultlog 2>&1
ls -l visit/$ver/linux-ia64/bin >> resultlog 2>&1
echo "" >> resultlog 2>&1
echo "number of database plugins = "\`ls visit/$ver/linux-ia64/plugins/databases/libI* | wc -l\` >> resultlog 2>&1
echo "number of operator plugins = "\`ls visit/$ver/linux-ia64/plugins/operators/libI* | wc -l\` >> resultlog 2>&1
echo "number of plot plugins = "\`ls visit/$ver/linux-ia64/plugins/plots/libI* | wc -l\` >> resultlog 2>&1
echo "" >> resultlog 2>&1
echo "The database plugins:" >> resultlog 2>&1
ls visit/$ver/linux-ia64/plugins/databases/libI* | sed "s/visit\/$ver\/linux-ia64\/plugins\/databases\/libI//" | sed "s/Database.so//" >> resultlog 2>&1
mail $emailName < resultlog
EOF
if [ $davinci = true ]
then
if [ $test = no ]
then
scp davinci.nersc.gov:visit$ver2.linux-ia64.tar.gz visit$ver2.linux-altix.tar.gz
scp visit$ver2.linux-altix.tar.gz davinci.nersc.gov:
scp visit-install davinci.nersc.gov:
scp davinci davinci.nersc.gov:davinci_install
ssh davinci.nersc.gov "chmod 750 davinci_install;./davinci_install"
fi
fi
#
# Clean up.
#
if [ $test = no ]
then
rm -f hoth sunspot quad berg up pengra pengra_icc thunder prism yana
rm -f hoth sunspot quad berg up pengra pengra_icc thunder prism yana davinci
fi
This diff is collapsed.
......@@ -44,7 +44,7 @@
#include <filters_exports.h>
#include <avtStreamer.h>
#include <avtDataTreeStreamer.h>
class vtkRectilinearGridFacelistFilter;
......@@ -104,9 +104,13 @@ class avtMultiFacelist;
// Hank Childs, Wed Dec 20 09:25:42 PST 2006
// Add a flag that forces poly data construction.
//
// Hank Childs, Thu Dec 28 09:08:34 PST 2006
// Re-inherit from data tree streamer (a single input may now produce
// multiple outputs ... 3D structured grid gives 6 2D structured grids).
//
// ****************************************************************************
class AVTFILTERS_API avtFacelistFilter : public avtStreamer
class AVTFILTERS_API avtFacelistFilter : public avtDataTreeStreamer
{
public:
avtFacelistFilter();
......@@ -131,13 +135,12 @@ class AVTFILTERS_API avtFacelistFilter : public avtStreamer
bool mustCreatePolyData;
int forceFaceConsolidation;
virtual vtkDataSet *ExecuteData(vtkDataSet *, int,
virtual avtDataTree_p ExecuteDataTree(vtkDataSet *, int,
std::string);
vtkDataSet *Take2DFaces(vtkDataSet *);
vtkDataSet *FindEdges(vtkDataSet *);
vtkDataSet *Take3DFaces(vtkDataSet *, int);
vtkDataSet *TakeFacesForDisjointElementMesh(
vtkDataSet *, int);
avtDataTree_p Take3DFaces(vtkDataSet *, int,
std::string);
vtkDataSet *ConvertToPolys(vtkDataSet *, int);
virtual void InitializeFilter(void);
......
......@@ -42,10 +42,14 @@
#include <avtVertexNormalsFilter.h>
#include <vtkPolyData.h>
#include <vtkStructuredGrid.h>
#include <vtkVisItPolyDataNormals.h>
#include <vtkVisItStructuredGridNormals.h>
#include <avtDataset.h>
#include <DebugStream.h>
// ****************************************************************************
// Method: avtVertexNormalsFilter constructor
......@@ -150,6 +154,9 @@ avtVertexNormalsFilter::~avtVertexNormalsFilter()
// Removed call to SetSource(NULL), with new vtk pipeline, it also removes
// necessary information from the dataset.
//
// Hank Childs, Thu Dec 28 15:25:50 PST 2006
// Add support for direct normals calculation of structured grids.
//
// ****************************************************************************
vtkDataSet *
......@@ -172,38 +179,66 @@ avtVertexNormalsFilter::ExecuteData(vtkDataSet *in_ds, int, std::string)
return in_ds;
}
if (in_ds->GetDataObjectType() != VTK_POLY_DATA)
if (in_ds->GetDataObjectType() == VTK_POLY_DATA)
{
return in_ds;
vtkPolyData *pd = (vtkPolyData *)in_ds;
bool pointNormals = true;
if (atts.ValidActiveVariable())
{
avtCentering cent = atts.GetCentering();
if (cent == AVT_ZONECENT)
pointNormals = false;
}
vtkVisItPolyDataNormals *normals = vtkVisItPolyDataNormals::New();
normals->SetInput(pd);
normals->SetFeatureAngle(45.);
if (pointNormals)
normals->SetNormalTypeToPoint();
else
normals->SetNormalTypeToCell();
normals->SetSplitting(true);
normals->Update();
vtkPolyData *out_ds = normals->GetOutput();
//out_ds->SetSource(NULL);
ManageMemory(out_ds);
normals->Delete();
return out_ds;
}
vtkPolyData *pd = (vtkPolyData *)in_ds;
bool pointNormals = true;
if (atts.ValidActiveVariable())
else if (in_ds->GetDataObjectType() == VTK_STRUCTURED_GRID)
{
avtCentering cent = atts.GetCentering();
if (cent == AVT_ZONECENT)
pointNormals = false;
vtkStructuredGrid *sgrid = (vtkStructuredGrid *)in_ds;
bool pointNormals = true;
if (atts.ValidActiveVariable())
{
avtCentering cent = atts.GetCentering();
if (cent == AVT_ZONECENT)
pointNormals = false;
}
vtkVisItStructuredGridNormals *normals =
vtkVisItStructuredGridNormals::New();
normals->SetInput(sgrid);
if (pointNormals)
normals->SetNormalTypeToPoint();
else
normals->SetNormalTypeToCell();
normals->Update();
vtkStructuredGrid *out_ds = normals->GetOutput();
//out_ds->SetSource(NULL);
ManageMemory(out_ds);
normals->Delete();
return out_ds;
}
vtkVisItPolyDataNormals *normals = vtkVisItPolyDataNormals::New();
normals->SetInput(pd);
normals->SetFeatureAngle(45.);
if (pointNormals)
normals->SetNormalTypeToPoint();
else
normals->SetNormalTypeToCell();
normals->SetSplitting(true);
normals->Update();
vtkPolyData *out_ds = normals->GetOutput();
out_ds->Register(NULL);
//out_ds->SetSource(NULL);
ManageMemory(out_ds);
out_ds->Delete();
normals->Delete();
return out_ds;
// Don't know what to do with other grid types.
debug1 << "Sent unsupported grid type into normals filter" << endl;
return in_ds;
}
......@@ -53,6 +53,8 @@
#include <avtDatasetExaminer.h>
#include <avtTransparencyActor.h>
#include <vtkVisItDataSetMapper.h>
#include <BadIndexException.h>
#include <DebugStream.h>
......@@ -182,6 +184,9 @@ avtLevelsMapper::~avtLevelsMapper()
// clobbers the specular light color, which in turn greatly diminishes
// the specular effect. ['5636] ['5580]
//
// Hank Childs, Fri Dec 29 14:42:42 PST 2006
// Tell the mapper whether or not we have a 3D scene.
//
// ****************************************************************************
void
......@@ -194,6 +199,12 @@ avtLevelsMapper::CustomizeMappers(void)
{
mappers[i]->ScalarVisibilityOff();
if (strcmp(mappers[i]->GetClassName(), "vtkVisItDataSetMapper")==0)
{
vtkVisItDataSetMapper *m = (vtkVisItDataSetMapper *)mappers[i];
m->SetSceneIs3D(GetInput()->GetInfo().GetAttributes(). GetSpatialDimension() == 3);
}
//
// Use labels for mapping to a color.
//
......
......@@ -51,6 +51,7 @@
#include <vtkCellData.h>
#include <vtkDataSet.h>
#include <vtkDataSetMapper.h>
#include <vtkDataSetRemoveGhostCells.h>
#include <vtkDepthSortPolyData.h>
#include <vtkFloatArray.h>
#include <vtkGeometryFilter.h>
......@@ -61,6 +62,7 @@
#include <vtkProperty.h>
#include <vtkRenderer.h>
#include <vtkParallelImageSpaceRedistributor.h>
#include <vtkVisItPolyDataNormals.h>
#include <DebugStream.h>
#include <BadIndexException.h>
......@@ -928,6 +930,11 @@ avtTransparencyActor::SetUpActor(void)
// Do a better job of handling normals for cell-based normals. This is more
// important because the poly data mapper no longer calculates them for us.
//
// Hank Childs, Fri Dec 29 09:53:13 PST 2006
// Accomodate situations where rectilinear and curvilinear grids are
// getting shipped down as is (i.e. not poly data). This means we must
// add normals and remove ghost data.
//
// ****************************************************************************
void
......@@ -1002,11 +1009,32 @@ avtTransparencyActor::PrepareDataset(int input, int subinput)
// that we are actually dealing with polydata.
//
vtkGeometryFilter *gf = vtkGeometryFilter::New();
vtkDataSetRemoveGhostCells *ghost_filter=vtkDataSetRemoveGhostCells::New();
vtkVisItPolyDataNormals *normals = vtkVisItPolyDataNormals::New();
vtkPolyData *pd = NULL;
if (in_ds->GetDataObjectType() == VTK_POLY_DATA)
{
pd = (vtkPolyData *) in_ds;
}
else if (in_ds->GetDataObjectType() == VTK_STRUCTURED_GRID)
{
gf->SetInput(in_ds);
ghost_filter->SetInput(gf->GetOutput());
ghost_filter->Update();
pd = (vtkPolyData *) ghost_filter->GetOutput();
}
else if (in_ds->GetDataObjectType() == VTK_RECTILINEAR_GRID)
{
gf->SetInput(in_ds);
if (mapper->GetScalarVisibility() != 0 &&
in_ds->GetPointData()->GetScalars() == NULL &&
in_ds->GetCellData()->GetScalars() != NULL)
normals->SetNormalTypeToCell();
normals->SetInput(gf->GetOutput());
ghost_filter->SetInput(normals->GetOutput());
ghost_filter->Update();
pd = (vtkPolyData *) ghost_filter->GetOutput();
}
else
{
gf->SetInput(in_ds);
......@@ -1202,6 +1230,8 @@ avtTransparencyActor::PrepareDataset(int input, int subinput)
//
gf->Delete();
prepDS->Delete();
ghost_filter->Delete();
normals->Delete();
}
......
......@@ -146,6 +146,10 @@ avtVariableMapper::~avtVariableMapper()
// Brad Whitlock, Fri Aug 25 10:41:25 PDT 2006
// Added code to enable color texturing in the mapper.
//
// Hank Childs, Thu Dec 28 11:08:51 PST 2006
// Tell our mapper whether or not the scene is 3D. (This is needed so
// the rectilinear grid mapper can decide whether or not to do lighting.)
//
// ****************************************************************************
void
......@@ -197,6 +201,8 @@ avtVariableMapper::CustomizeMappers(void)
{
vtkVisItDataSetMapper *m = (vtkVisItDataSetMapper *)mappers[i];
m->SetEnableColorTexturing(colorTexturingFlag);
m->SetSceneIs3D(GetInput()->GetInfo().GetAttributes().
GetSpatialDimension() == 3);
}
}
if (actors[i] != NULL)
......
......@@ -303,6 +303,9 @@
# Hank Childs, Wed Dec 27 09:59:14 PST 2006
# Added curvilinear mapper modules.
#
# Hank Childs, Thu Dec 28 15:25:50 PST 2006
# Added vtkVisItStructuredGridNormals.
#
##############################################################################
##
......@@ -375,6 +378,7 @@ SRC=InitVTK.C \
vtkVisItSTLWriter.C \
vtkVisItScalarTree.C \
vtkVisItStreamLine.C \
vtkVisItStructuredGridNormals.C \
vtkVisItTensorGlyph.C \
vtkVisItTIFFWriter.C \
vtkVolumeFromVolume.C
......
......@@ -399,6 +399,9 @@ void vtkOpenGLRectilinearGridMapper::Render(vtkRenderer *ren, vtkActor *act)
// Hank Childs, Wed Dec 27 10:27:48 PST 2006
// Fix indexing bug for ghost data.
//
// Hank Childs, Thu Dec 28 10:24:53 PST 2006
// Add support for grids in three dimensional space.
//
// ****************************************************************************
int vtkOpenGLRectilinearGridMapper::Draw(vtkRenderer *ren, vtkActor *act)
......@@ -408,9 +411,13 @@ int vtkOpenGLRectilinearGridMapper::Draw(vtkRenderer *ren, vtkActor *act)
vtkRectilinearGrid *input = this->GetInput();
int dims[3];
input->GetDimensions(dims);
if (dims[2] != 1)
bool flatI = (dims[0] <= 1);
bool flatJ = (dims[1] <= 1);
bool flatK = (dims[2] <= 1);
if (!flatI && !flatJ && !flatK)
{
cerr << "3D grid ... aborting!" << endl;
vtkErrorMacro("One of the dimensions must be flat!!\n"
"Rectilinear grid mapper unable to render");
return 0;
}
......@@ -420,7 +427,10 @@ int vtkOpenGLRectilinearGridMapper::Draw(vtkRenderer *ren, vtkActor *act)
this->primsInCurrentList = 0;
}
glDisable(GL_LIGHTING);
if (SceneIs3D)
glEnable(GL_LIGHTING);
else
glDisable(GL_LIGHTING);
const unsigned char *colors = NULL;
if (this->Colors != NULL)
colors = this->Colors->GetPointer(0);
......@@ -488,28 +498,51 @@ int vtkOpenGLRectilinearGridMapper::Draw(vtkRenderer *ren, vtkActor *act)
for (i = 0 ; i < dims[2] ; i++)
Z[i] = input->GetZCoordinates()->GetTuple1(i);
bool normalQuadOrder = true;
bool normalQuadOrder = !flatJ;
if (dims[0] > 1 && X[1] < X[0])
normalQuadOrder = !normalQuadOrder;
if (dims[1] > 1 && Y[1] < Y[0])
normalQuadOrder = !normalQuadOrder;
if (dims[2] > 1 && Z[1] < Z[0])
normalQuadOrder = !normalQuadOrder;
int normalquadorder[4] = { 0, 1, 3, 2 };
int otherquadorder[4] = { 0, 2, 3, 1 };
int *quadorder = (normalQuadOrder ? normalquadorder : otherquadorder);
int slowDim = 0;
int fastDim = 0;
if (flatI)
{
glNormal3f(1., 0., 0.);
fastDim = dims[1];
slowDim = dims[2];
}
if (flatJ)
{
glNormal3f(0., 1., 0.);
fastDim = dims[0];
slowDim = dims[2];
}
if (flatK)
{
glNormal3f(0., 0., 1.);
fastDim = dims[0];
slowDim = dims[1];
}
glBegin(GL_QUADS);
for (int j = 0 ; j < dims[1]-1 ; j++)
for (int i = 0 ; i < dims[0]-1 ; i++)
for (int j = 0 ; j < slowDim-1 ; j++)
for (int i = 0 ; i < fastDim-1 ; i++)
{
if (ghost_zones != NULL)
if (*(ghost_zones++) != '\0')
continue;
if (ghost_nodes != NULL)
{
int p0 = j*dims[0]+i;
int p1 = j*dims[0]+i+1;
int p2 = (j+1)*dims[0]+i;
int p3 = (j+1)*dims[0]+i+1;
int p0 = j*fastDim+i;
int p1 = j*fastDim+i+1;
int p2 = (j+1)*fastDim+i;
int p3 = (j+1)*fastDim+i+1;
if (ghost_nodes[p0] && ghost_nodes[p1] && ghost_nodes[p2]
&& ghost_nodes[p3])
continue;
......@@ -519,37 +552,58 @@ int vtkOpenGLRectilinearGridMapper::Draw(vtkRenderer *ren, vtkActor *act)
{
for (int k = 0 ; k < 4 ; k++)
{
glVertex3f(X[i + quadorder[k] % 2], Y[j + quadorder[k]/2],
Z[0]);
if (flatI)
glVertex3f(X[0], Y[i + quadorder[k] % 2],
Z[j + quadorder[k]/2]);
else if (flatJ)
glVertex3f(X[i + quadorder[k] % 2], Y[0],
Z[j + quadorder[k]/2]);
else if (flatK)
glVertex3f(X[i + quadorder[k] % 2],
Y[j + quadorder[k]/2], Z[0]);
}
}
else
{
if (!nodeData)
{
int idx = j*(dims[0]-1) + i;
int idx = j*(fastDim-1) + i;
if (!this->ColorTexturingAllowed)
glColor4ubv(colors + 4*idx);
else
glTexCoord1f(vtk1Over255[(colors + 4*idx)[0]]);
for (int k = 0 ; k < 4 ; k++)
{
glVertex3f(X[i + quadorder[k] % 2],
Y[j + quadorder[k]/2], Z[0]);
if (flatI)
glVertex3f(X[0], Y[i + quadorder[k] % 2],
Z[j + quadorder[k]/2]);
else if (flatJ)
glVertex3f(X[i + quadorder[k] % 2], Y[0],
Z[j + quadorder[k]/2]);
else if (flatK)
glVertex3f(X[i + quadorder[k] % 2],
Y[j + quadorder[k]/2], Z[0]);
}
}
else
{
for (int k = 0 ; k < 4 ; k++)
{
int idx = (j + quadorder[k]/2)*dims[0] +
int idx = (j + quadorder[k]/2)*fastDim +
(i+(quadorder[k]%2));
if (!this->ColorTexturingAllowed)
glColor4ubv(colors + 4*idx);
else
glTexCoord1f(vtk1Over255[colors[4*idx]]);
glVertex3f(X[i + quadorder[k] % 2],
Y[j + quadorder[k]/2], Z[0]);
if (flatI)
glVertex3f(X[0], Y[i + quadorder[k] % 2],
Z[j + quadorder[k]/2]);
else if (flatJ)
glVertex3f(X[i + quadorder[k] % 2], Y[0],
Z[j + quadorder[k]/2]);
else if (flatK)
glVertex3f(X[i + quadorder[k] % 2],
Y[j + quadorder[k]/2], Z[0]);
}
}
}
......
......@@ -400,9 +400,13 @@ int vtkOpenGLStructuredGridMapper::Draw(vtkRenderer *ren, vtkActor *act)
vtkStructuredGrid *input = this->GetInput();
int dims[3];
input->GetDimensions(dims);
if (dims[2] != 1)
bool flatI = (dims[0] <= 1);
bool flatJ = (dims[1] <= 1);
bool flatK = (dims[2] <= 1);
if (!flatI && !flatJ && !flatK)
{
cerr << "3D grid ... aborting!" << endl;
vtkErrorMacro("One of the dimensions must be flat!!\n"
"Rectilinear grid mapper unable to render");
return 0;
}
......@@ -412,7 +416,11 @@ int vtkOpenGLStructuredGridMapper::Draw(vtkRenderer *ren, vtkActor *act)
this->primsInCurrentList = 0;
}
glDisable(GL_LIGHTING);
if (SceneIs3D)
glEnable(GL_LIGHTING);
else
glDisable(GL_LIGHTING);
const unsigned char *colors = NULL;
if (this->Colors != NULL)
colors = this->Colors->GetPointer(0);
......@@ -475,19 +483,49 @@ int vtkOpenGLStructuredGridMapper::Draw(vtkRenderer *ren, vtkActor *act)
int Iorder[4] = { 0, 1, 1, 0 };
int Jorder[4] = { 0, 0, 1, 1 };
int slowDim = 0;
int fastDim = 0;
if (flatI)
{
fastDim = dims[1];
slowDim = dims[2];
}
if (flatJ)
{
fastDim = dims[0];
slowDim = dims[2];
}
if (flatK)
{
fastDim = dims[0];
slowDim = dims[1];
}
bool cellNormals = false;
vtkDataArray *normals = input->GetPointData()->GetNormals();
if (normals == NULL)
{
normals = input->GetCellData()->GetNormals();
if (normals != NULL)
cellNormals = true;
}
float *n = NULL;
if (normals != NULL)
n = (float *) normals->GetVoidPointer(0);
glBegin(GL_QUADS);
for (int j = 0 ; j < dims[1]-1 ; j++)