/* -*- C++ -*-
* shape.h
* $Id: shape.h,v 1.2 2000/07/21 22:31:45 ghali Exp $
*/
#ifndef SHAPE_H
#define SHAPE_H
#include <iostream.h>
#include <GL/glut.h>
#include <string>
#include <vector>
#include "node.h"
namespace MSG {
class Shape : public Node {
// A Shape node is an indexed face set
protected:
bool solids; // is this shape a true solid?
int numV; // number of vertices in shape
GLfloat *coords; // array 0.. 3*(numV-1) of vertex coordinates
// cannot use std::vector or Point3d since
// coords will be passed to glVertexPointer
int numP; // number of polygons in shape
int *vertsPerPoly; // vertsPerPoly has size numP and each entry
// stores the number of vertices for
// the corresponding poly
GLfloat *normals; // numP normals
int indexxSize; // convenience variable:
// sum of elements in vertsPerPoly
GLuint *indexx; // sequence of indices (not separated by -1)
// of vertex coordinates in coords
// cannot use std::vector since
// indexx will be passed to glDrawElements
public:
Shape(char* inputFile);
virtual ~Shape();
void performTransformations(std::vector<TransformGroup*> transforms);
void draw();
virtual void render(std::vector<ActiveLight*>* &activelights,
std::vector<TransformGroup*> transforms);
virtual bool handleEvent(Event* event);
friend ostream& operator<<( ostream& out, const Shape& shape );
};
}
#endif