BYUWrite.hh 4.45 KB
Newer Older
Will Schroeder's avatar
Will Schroeder committed
1
2
/*=========================================================================

Ken Martin's avatar
Ken Martin committed
3
  Program:   Visualization Toolkit
Will Schroeder's avatar
Will Schroeder committed
4
5
6
7
8
  Module:    BYUWrite.hh
  Language:  C++
  Date:      $Date$
  Version:   $Revision$

Ken Martin's avatar
Ken Martin committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

Copyright (c) 1993-1995 Ken Martin, Will Schroeder, Bill Lorensen.

This software is copyrighted by Ken Martin, Will Schroeder and Bill Lorensen.
The following terms apply to all files associated with the software unless
explicitly disclaimed in individual files. This copyright specifically does
not apply to the related textbook "The Visualization Toolkit" ISBN
013199837-4 published by Prentice Hall which is covered by its own copyright.

The authors hereby grant permission to use, copy, and distribute this
software and its documentation for any purpose, provided that existing
copyright notices are retained in all copies and that this notice is included
verbatim in any distributions. Additionally, the authors grant permission to
modify this software and its documentation for any purpose, provided that
such modifications are not distributed without the explicit consent of the
authors and that existing copyright notices are retained in all copies. Some
of the algorithms implemented by this software are patented, observe all
applicable patent law.

IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE IS PROVIDED ON AN
"AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Will Schroeder's avatar
Will Schroeder committed
38
39
40
41
42
or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors.


=========================================================================*/
Ken Martin's avatar
Ken Martin committed
43
// .NAME vtkBYUWriter - write MOVIE.BYU files
Will Schroeder's avatar
Will Schroeder committed
44
// .SECTION Description
Ken Martin's avatar
Ken Martin committed
45
// vtkBYUWriter writes MOVIE.BYU polygonal files. These files consist 
Will Schroeder's avatar
Will Schroeder committed
46
47
48
49
50
51
// of a geometry file (.g), a scalar file (.s), a displacement or 
// vector file (.d), and a 2D texture coordinate file (.t). These files 
// must be specified to the object, the appropriate boolean 
// variables must be true, and data must be available from the input
// for the files to be written.

Ken Martin's avatar
Ken Martin committed
52
53
#ifndef __vtkBYUWriter_h
#define __vtkBYUWriter_h
Will Schroeder's avatar
Will Schroeder committed
54
55
56

#include <stdio.h>
#include "Writer.hh"
Will Schroeder's avatar
Will Schroeder committed
57
#include "PolyData.hh"
Will Schroeder's avatar
Will Schroeder committed
58

Ken Martin's avatar
Ken Martin committed
59
class vtkBYUWriter : public vtkWriter
Will Schroeder's avatar
Will Schroeder committed
60
61
{
public:
Ken Martin's avatar
Ken Martin committed
62
63
64
65
66
67
68
69
  vtkBYUWriter();
  ~vtkBYUWriter();
  char *GetClassName() {return "vtkBYUWriter";};
  void PrintSelf(ostream& os, vtkIndent indent);

  void SetInput(vtkPolyData *input);
  void SetInput(vtkPolyData &input) {this->SetInput(&input);};
  vtkPolyData *GetInput() {return (vtkPolyData *)this->Input;};
Will Schroeder's avatar
Will Schroeder committed
70
                               
Will Schroeder's avatar
Will Schroeder committed
71
72
  // Description:
  // Specify the name of the geometry file to write.
Ken Martin's avatar
Ken Martin committed
73
74
  vtkSetStringMacro(GeometryFilename);
  vtkGetStringMacro(GeometryFilename);
Will Schroeder's avatar
Will Schroeder committed
75

Will Schroeder's avatar
Will Schroeder committed
76
77
  // Description:
  // Specify the name of the displacement file to write.
Ken Martin's avatar
Ken Martin committed
78
79
  vtkSetStringMacro(DisplacementFilename);
  vtkGetStringMacro(DisplacementFilename);
Will Schroeder's avatar
Will Schroeder committed
80

Will Schroeder's avatar
Will Schroeder committed
81
82
  // Description:
  // Specify the name of the scalar file to write.
Ken Martin's avatar
Ken Martin committed
83
84
  vtkSetStringMacro(ScalarFilename);
  vtkGetStringMacro(ScalarFilename);
Will Schroeder's avatar
Will Schroeder committed
85

Will Schroeder's avatar
Will Schroeder committed
86
87
  // Description:
  // Specify the name of the texture file to write.
Ken Martin's avatar
Ken Martin committed
88
89
  vtkSetStringMacro(TextureFilename);
  vtkGetStringMacro(TextureFilename);
Will Schroeder's avatar
Will Schroeder committed
90

Will Schroeder's avatar
Will Schroeder committed
91
92
  // Description:
  // Turn on/off writing the displacement file.
Ken Martin's avatar
Ken Martin committed
93
94
95
  vtkSetMacro(WriteDisplacement,int);
  vtkGetMacro(WriteDisplacement,int);
  vtkBooleanMacro(WriteDisplacement,int);
Will Schroeder's avatar
Will Schroeder committed
96
  
Will Schroeder's avatar
Will Schroeder committed
97
98
  // Description:
  // Turn on/off writing the scalar file.
Ken Martin's avatar
Ken Martin committed
99
100
101
  vtkSetMacro(WriteScalar,int);
  vtkGetMacro(WriteScalar,int);
  vtkBooleanMacro(WriteScalar,int);
Will Schroeder's avatar
Will Schroeder committed
102
  
Will Schroeder's avatar
Will Schroeder committed
103
104
  // Description:
  // Turn on/off writing the texture file.
Ken Martin's avatar
Ken Martin committed
105
106
107
  vtkSetMacro(WriteTexture,int);
  vtkGetMacro(WriteTexture,int);
  vtkBooleanMacro(WriteTexture,int);
Will Schroeder's avatar
Will Schroeder committed
108
109

protected:
Will Schroeder's avatar
Will Schroeder committed
110
  void WriteData();
Will Schroeder's avatar
Will Schroeder committed
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127

  char *GeometryFilename;
  char *DisplacementFilename;
  char *ScalarFilename;
  char *TextureFilename;
  int WriteDisplacement;
  int WriteScalar;
  int WriteTexture;

  void WriteGeometryFile(FILE *fp, int numPts);
  void WriteDisplacementFile(int numPts);
  void WriteScalarFile(int numPts);
  void WriteTextureFile(int numPts);
};

#endif