/*************************************************************************** glsurface.cpp W. Michael Brown ------------------- Store and manipulate surfaces as OpenGL primitives begin : Sun Jun 8 2003 copyright : (C) 2003 by W. Michael Brown email : wmbrown@sandia.gov ***************************************************************************/ #include "glsurface.h" GLSurface::GLSurface(){ } GLSurface::~GLSurface(){ } // Operations on GLline structure bool operator < (const GLline &one, const GLline &two) { unsigned minone, mintwo, maxone, maxtwo; if (one.points[0] &t) { triangles.swap(t); } // Add many lines (via swap) void GLSurface::addlinestrips(vector &l) { linestrips.swap(l); } // Add a mesh (via swap) void GLSurface::addxyzmesh(vector &x,vector &y, vector &z) { xmesh.swap(x); ymesh.swap(y); zmesh.swap(z); } // Preconditions: // Triangles all loaded with correct vertex ordering // Vertices all loaded // Vertices that need to be calculated are marked as invalid // Postconditions: // For any normals that are marked as invalid, calculate normals by // averaging normals for each triangle void GLSurface::calculatenormals() { unsigned i; // Set all invalid normals to zero for (i=0; inote[31] << "Calculated normals: " << flush; return; } // Normalize normals. void GLSurface::normalize() { unsigned i; for (i=0; inote[31] << "Normalized normals: " << flush; } // Flip normals void GLSurface::flipnormals() { unsigned i; for (i=0; inote[31] << "Flipped normals: " << flush; } // Calculate the Area of the Surface double GLSurface::surfacearea() { double sa=0; for (unsigned i=0; i &grid,const colorPt &neg, // const colorPt &mid, const colorPt &pos, double minv, // double midv, double maxv) { // Colors c; // for (unsigned i=0; i &l, ofstream &out, const string &objname) { unsigned i,j,k; int index; writepymolheader(out); //out << "LINEWIDTH, 2," << endl; out << "BEGIN, LINES," << endl; for (i=0; i