ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkVTKPolyDataWriter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkVTKPolyDataWriter_h
00019 #define __itkVTKPolyDataWriter_h
00020 
00021 #include "itkIntTypes.h"
00022 #include "itkMesh.h"
00023 #include "itkTriangleCell.h"
00024 
00025 namespace itk
00026 {
00035 template< class TInputMesh >
00036 class VTKPolyDataWriter:public Object
00037 {
00038 public:
00040   typedef VTKPolyDataWriter          Self;
00041   typedef Object                     Superclass;
00042   typedef SmartPointer< Self >       Pointer;
00043   typedef SmartPointer< const Self > ConstPointer;
00044 
00046   itkNewMacro(Self);
00047 
00049   itkTypeMacro(VTKPolyDataWriter, Object);
00050 
00053   void Update(void);
00054 
00055   void Write(void);
00056 
00059   typedef TInputMesh                              InputMeshType;
00060   typedef typename InputMeshType::PixelType       PixelType;
00061   typedef typename InputMeshType::PointType       PointType;
00062   typedef typename InputMeshType::CellType        CellType;
00063   typedef typename InputMeshType::PointIdentifier PointIdentifier;
00064 
00066   typedef typename InputMeshType::ConstPointer InputMeshPointer;
00067   typedef typename InputMeshType::CellTraits   CellTraits;
00068 
00070   typedef CellInterface< PixelType, CellTraits > CellInterfaceType;
00071   typedef TriangleCell< CellInterfaceType >      TriangleCellType;
00072 
00073   typedef typename InputMeshType::PointsContainer PointsContainer;
00074   typedef typename InputMeshType::CellsContainer  CellsContainer;
00075 
00076   typedef typename PointsContainer::ConstIterator PointIterator;
00077   typedef typename CellsContainer::ConstIterator  CellIterator;
00078 
00079   typedef typename CellType::PointIdIterator PointIdIterator;
00080 
00082   void SetInput(const InputMeshType *input);
00083 
00085   itkSetStringMacro(FileName);
00086   itkGetStringMacro(FileName);
00087 protected:
00088   VTKPolyDataWriter();
00089   virtual ~VTKPolyDataWriter();
00091 
00092   virtual void GenerateData();
00093 
00094   std::string m_FileName;
00095 
00096   InputMeshPointer m_Input;
00097 
00098   void PrintSelf(std::ostream & os, Indent indent) const;
00099 
00100 private:
00101   VTKPolyDataWriter(const Self &); //purposely not implemented
00102   void operator=(const Self &);    //purposely not implemented
00103 };
00104 } // namespace itk
00105 
00106 #ifndef ITK_MANUAL_INSTANTIATION
00107 #include "itkVTKPolyDataWriter.hxx"
00108 #endif
00109 
00110 #endif
00111