// $Header: /cvs/gled-1.2/TADemo/Glasses/TA_Unit.cxx,v 1.1.1.1 2005/05/19 14:15:27 matevz Exp $
#include "TA_Unit.h"
#include "TA_Unit.c7"
#include <FL/gl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
ClassImp(TA_Unit)
/**************************************************************************/
void TA_Unit::_init()
{
mFile = "t1hpi/objects3d";
mTexCont = 0;
mS = 1; mJ = 0;
}
/**************************************************************************/
TA_Unit::~TA_Unit() {}
void
TA_Unit::Load() {
if(mFile.Length()==0) return;
struct stat fs;
if(stat(mFile, &fs) ) {
perror("stat failed"); return;
}
int size = fs.st_size;
char* raw_data = new char[size];
printf("loading %s (%6.2fK)\n", mFile.Data(), ((float)size)/1024);
FILE* fp = fopen(mFile.Data(), "r");
fread(raw_data, size, 1, fp);
fclose(fp);
build(this, (o3dInfo*)raw_data, raw_data);
{ // rename self from base->model name
char *beg = rindex(mFile.Data(), '/')+1, xx[256];
int i=0; while(beg[i]!='.') xx[i++] = beg[i]; xx[i] = 0;
mName = xx;
}
Stamp();
delete [] raw_data;
}
ROOT page - Home page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.