offobject.h.html
//***************************************************************************
#ifndef OFFOBJECT_H
#define OFFOBJECT_H
//***************************************************************************
#define DEFAULT_BOXRANGE (1.00)
#define DEFAULT_IMAGE_SIZE (256)
//***************************************************************************
class OFFobject
{
private:
int allocateFlag;
int nV; // number of Vertices
int nE; // number of Edges
double lambda; // Focal length of camera
double CameraOrigin[3]; // Origin of camera
double CameraAxis[3]; // Point towards which camera is facing
double (*v)[3]; // Co-ordinates of vertices
double (*vi)[2]; // Vertices mapped to image plane
int (*e)[2]; // Edge data
double boxRange;
int imageSize;
GrayImage image;
void allocateMem (int numV, int numE);
void deAllocateMem( );
void getTrange (int x1,int y1, int x2,int y2, double *t1,double *t2);
void getImageCoords (int edgeNum, int *x1,int *y1, int *x2,int *y2);
int getNumPoints (int x1, int y1, int x2, int y2, double tmin,
double tmax);
public:
OFFobject ( ); // Constructor
OFFobject (char *filename); // Constructor
~OFFobject ( ); // Destructor
void setBoxRange (double range);
void setImageSize (int size);
void setFocalLength (double f);
void ReadFromFile (char *FileName);
void mapToImagePlane ();
void drawEdge (int edgeNum);
void drawImage ( );
void printMappingData ( );
void WriteImageToFile (char *FileName);
int getNumVerts ( );
int getNumEdges ( );
};
//***************************************************************************
#endif // OFFOBJECT_H
//***************************************************************************