home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / pstoedit.zip / source.zip / pstoedit.2.50 / src / drvlwo.h < prev    next >
C/C++ Source or Header  |  1996-10-04  |  2KB  |  82 lines

  1. #ifndef __drvLWO_h
  2. #define __drvLWO_h
  3.  
  4. /* 
  5.    drvlwo.h - header for LightWave 3D Object (LWO) polygon driver
  6.             - written by Glenn M. Lewis (glewis@c2.net) - 6/18/96
  7.           http://www.c2.net/~glewis/
  8.           Based on...
  9.  
  10.    drvsampl.h : This file is part of pstoedit
  11.    Class declaration for a sample output driver with no additional attributes
  12.    and methods (minimal interface)
  13.  
  14.    Copyright (C) 1993,1994,1995,1996 Wolfgang Glunz, Wolfgang.Glunz@zfe.siemens.de
  15.  
  16.     This program is free software; you can redistribute it and/or modify
  17.     it under the terms of the GNU General Public License as published by
  18.     the Free Software Foundation; either version 2 of the License, or
  19.     (at your option) any later version.
  20.  
  21.     This program is distributed in the hope that it will be useful,
  22.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.     GNU General Public License for more details.
  25.  
  26.     You should have received a copy of the GNU General Public License
  27.     along with this program; if not, write to the Free Software
  28.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  29.  
  30. */
  31.  
  32. #include "drvbase.h"
  33.  
  34. class LWO_POLY {
  35. public:
  36.   LWO_POLY *next;
  37.   unsigned char r, g, b;
  38.   unsigned long num;  // Number of vertices in poly
  39.   double *x, *y;
  40. };
  41.  
  42. class drvLWO : public drvbase {
  43.   unsigned long total_vertices;
  44.   unsigned long total_polys;
  45.   LWO_POLY *polys;
  46.  
  47. public:
  48.  
  49.   void out_ulong(ostream &outs, unsigned long val)
  50.   {
  51.     outs.put((char)((val>>24L)&0x00FFL));
  52.     outs.put((char)((val>>16L)&0x00FFL));
  53.     outs.put((char)((val>> 8L)&0x00FFL));
  54.     outs.put((char)((val     )&0x00FFL));
  55.   }
  56.  
  57.   void out_ushort(ostream &outs, unsigned long val)
  58.   {
  59.     outs.put((char)((val>> 8L)&0x00FFL));
  60.     outs.put((char)((val     )&0x00FFL));
  61.   }
  62.  
  63.   void out_float(ostream &outs, float val)
  64.   {
  65.     union {
  66.       float f;
  67.       unsigned long u;
  68.     } num;
  69.     num.f = val;
  70.     out_ulong(outs, num.u);
  71.   }
  72.  
  73.     drvLWO(const char * driveroptions_P,ostream & theoutStream,ostream & theerrStream ); // Constructor
  74.  
  75.     ~drvLWO(); // Destructor
  76.  
  77. #include "drvfuncs.h"
  78.  
  79. };
  80.  
  81. #endif
  82.