home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics 16,000
/
graphics-16000.iso
/
msdos
/
utils
/
graphtal.lzh
/
Graphtal.Amiga
/
RayshadeDevice.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-17
|
2KB
|
79 lines
/*
* RayshadeDevice.h - class definition for rayshade device driver.
*
* Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
* University of Berne, Switzerland
* All rights reserved.
*
* This software may be freely copied, modified, and redistributed
* provided that this copyright notice is preserved on all copies.
*
* You may not distribute this software, in whole or in part, as part of
* any commercial product without the express consent of the authors.
*
* There is no warranty or other guarantee of fitness of this software
* for any purpose. It is provided solely "as is".
*
*/
#ifndef RayshadeDevice_H
# define RayshadeDevice_H
#include <iostream.h>
#include <stdio.h>
#include "DeviceDriver.h"
/*___________________________________________________________ RayshadeDevice
*
* Rayshade device driver generates rayshade definition files. Each
* rayshade definition consists of two files:
* - name.ray: viewing parameter, macro definition, includes
* - name.ray.def: geometric primitives
*
* For each macro definition RayshadeDevice generates a file with
* the primitives of the macro.
*/
class RayshadeDevice : public DeviceDriver
{
public:
RayshadeDevice(Options*);
~RayshadeDevice();
void begin();
void end(const BoundingBox&);
void cylinder(const Vector&, const Vector&, real);
void cone(const Vector&, real, const Vector&, real);
void polygon(Polygon*);
void sphere(const Vector&, real);
void color(const Color&);
void texture(const rcString&);
void beginMacro(const rcString&);
void endMacro();
void executeMacro(const rcString&, const TransMatrix&);
void libraryObject(const rcString&, const TransMatrix&);
private:
// ofstream* defFile; // stream for name.ray.def
// ofstream rayFile; // stream for name.ray
FILE* defFile;
FILE* rayFile;
rcString currentColor;
int applyTexture;
rcString currentTexture;
/*
* Temporary variables for macro execution.
*/
// ofstream* saveDefFile;
FILE* saveDefFile;
long savePrimitives;
rcString currentMacroName;
private:
void object(const rcString&, const TransMatrix&);
};
#endif // RayshadeDevice_H