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

  1. /*
  2.  * WireDevice.h - class definition wire frame 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 WireDevice_H
  20. # define WireDevice_H
  21.  
  22. #include "DeviceDriver.h"
  23. #include "BaseWindow.h"
  24. #include "ViewTransform.h"
  25.  
  26. /*___________________________________________________________ WireDevice
  27.  *
  28.  * Wire frame device driver. Supports macro definitions. 
  29.  */
  30.  
  31. class WireDevice : public DeviceDriver 
  32. {
  33. public:
  34.   WireDevice(BaseWindow*, Options*);
  35.   ~WireDevice();
  36.  
  37.   void begin();
  38.   void end(const BoundingBox&);
  39.   void cylinder(const Vector&, const Vector&, real);
  40.   void cone(const Vector&, real, const Vector&, real);
  41.   void polygon(Polygon*);
  42.   void sphere(const Vector&, real);
  43.   void beginMacro(const rcString&);
  44.   void endMacro();
  45.   void executeMacro(const rcString&, const TransMatrix&);
  46.  
  47. private:
  48.   rcString currentMacroName;
  49.   PolygonList* polys; // Collection of polygons from current macro 
  50.                       // definition.
  51.  
  52.   BaseWindow* w; 
  53.  
  54.   int coneResolution;
  55.   int sphereResolution;
  56.   real* sintable; // Precomputed sin, cos value for fast cone and
  57.   real* costable; //  cylinder generation.
  58.   Vector* top;
  59.   Vector* bottom;
  60.     
  61.   PolygonList* unitSphere; // Tesselation of a unit sphere. 
  62.                            // Origin (0,0,0), radius (1)
  63. };
  64.  
  65. #endif // WireDevice_H
  66.