home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / oct93 / graphics / graphtal.lha / Graphtal / RayshadeDevice.h < prev    next >
C/C++ Source or Header  |  1992-11-17  |  2KB  |  79 lines

  1. /*
  2.  * RayshadeDevice.h - class definition for rayshade device driver.
  3.  *
  4.  * Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
  5.  *                     University of Berne, Switzerland
  6.  * All rights reserved.
  7.  *
  8.  * This software may be freely copied, modified, and redistributed
  9.  * provided that this copyright notice is preserved on all copies.
  10.  *
  11.  * You may not distribute this software, in whole or in part, as part of
  12.  * any commercial product without the express consent of the authors.
  13.  *
  14.  * There is no warranty or other guarantee of fitness of this software
  15.  * for any purpose.  It is provided solely "as is".
  16.  *
  17.  */
  18.  
  19. #ifndef RayshadeDevice_H
  20. # define RayshadeDevice_H
  21.  
  22. #include <iostream.h>
  23. #include <stdio.h>
  24. #include "DeviceDriver.h"
  25.  
  26. /*___________________________________________________________ RayshadeDevice
  27.  *
  28.  * Rayshade device driver generates rayshade definition files. Each
  29.  * rayshade definition consists of two files: 
  30.  *  - name.ray:     viewing parameter, macro definition, includes
  31.  *  - name.ray.def: geometric primitives
  32.  *
  33.  * For each macro definition RayshadeDevice generates a file with
  34.  * the primitives of the macro.
  35.  */
  36.  
  37. class RayshadeDevice : public DeviceDriver 
  38. {
  39. public:
  40.   RayshadeDevice(Options*);
  41.   ~RayshadeDevice();
  42.  
  43.   void begin();
  44.   void end(const BoundingBox&);
  45.   void cylinder(const Vector&, const Vector&, real);
  46.   void cone(const Vector&, real, const Vector&, real);
  47.   void polygon(Polygon*);
  48.   void sphere(const Vector&, real);
  49.   void color(const Color&);
  50.   void texture(const rcString&);
  51.   void beginMacro(const rcString&);
  52.   void endMacro();
  53.   void executeMacro(const rcString&, const TransMatrix&);
  54.   void libraryObject(const rcString&, const TransMatrix&);
  55.  
  56. private:
  57. //  ofstream* defFile;  // stream for name.ray.def
  58. //  ofstream  rayFile;  // stream for name.ray
  59.   FILE* defFile;
  60.   FILE* rayFile;
  61.   rcString  currentColor;
  62.   int applyTexture;
  63.   rcString  currentTexture;
  64.  
  65.   /*
  66.    * Temporary variables for macro execution.
  67.    */
  68. //  ofstream* saveDefFile;
  69.   FILE* saveDefFile;
  70.   long savePrimitives;
  71.   rcString currentMacroName;
  72.  
  73. private:
  74.   void object(const rcString&, const TransMatrix&);
  75. };
  76.  
  77. #endif // RayshadeDevice_H
  78.  
  79.