VTK
dox/IO/Geometry/vtkSTLWriter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkSTLWriter.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00031 #ifndef __vtkSTLWriter_h
00032 #define __vtkSTLWriter_h
00033 
00034 #include "vtkIOGeometryModule.h" // For export macro
00035 #include "vtkWriter.h"
00036 
00037 class vtkCellArray;
00038 class vtkPoints;
00039 class vtkPolyData;
00040 
00041 class VTKIOGEOMETRY_EXPORT vtkSTLWriter : public vtkWriter
00042 {
00043 public:
00044   static vtkSTLWriter *New();
00045   vtkTypeMacro(vtkSTLWriter,vtkWriter);
00046   virtual void PrintSelf(ostream& os, vtkIndent indent);
00047 
00049 
00050   vtkPolyData* GetInput();
00051   vtkPolyData* GetInput(int port);
00053 
00055 
00056   vtkSetStringMacro(FileName);
00057   vtkGetStringMacro(FileName);
00059 
00061 
00062   vtkSetClampMacro(FileType,int,VTK_ASCII,VTK_BINARY);
00063   vtkGetMacro(FileType,int);
00064   void SetFileTypeToASCII() {this->SetFileType(VTK_ASCII);};
00065   void SetFileTypeToBinary() {this->SetFileType(VTK_BINARY);};
00067 
00068 protected:
00069   vtkSTLWriter();
00070   ~vtkSTLWriter()
00071     {
00072     delete[] this->FileName;
00073     delete[] this->Header;
00074     }
00075 
00076   void WriteData();
00077 
00078   void WriteBinarySTL(vtkPoints *pts, vtkCellArray *polys);
00079   void WriteAsciiSTL(vtkPoints *pts, vtkCellArray *polys);
00080 
00081   char* FileName;
00082   char *Header;
00083   int FileType;
00084 
00085   virtual int FillInputPortInformation(int port, vtkInformation *info);
00086 
00087 private:
00088   vtkSTLWriter(const vtkSTLWriter&);  // Not implemented.
00089   void operator=(const vtkSTLWriter&);  // Not implemented.
00090 };
00091 
00092 #endif
00093