ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkQuadEdgeMeshScalarDataVTKPolyDataWriter.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 __itkQuadEdgeMeshScalarDataVTKPolyDataWriter_h
00019 #define __itkQuadEdgeMeshScalarDataVTKPolyDataWriter_h
00020 
00021 #include "itkVTKPolyDataWriter.h"
00022 #include <fstream>
00023 
00024 namespace itk
00025 {
00036 template< class TMesh >
00037 class QuadEdgeMeshScalarDataVTKPolyDataWriter:public VTKPolyDataWriter< TMesh >
00038 {
00039 public:
00040   typedef QuadEdgeMeshScalarDataVTKPolyDataWriter Self;
00041   typedef SmartPointer< Self >                    Pointer;
00042   typedef SmartPointer< const Self >              ConstPointer;
00043   typedef VTKPolyDataWriter< TMesh >              Superclass;
00044 
00046   itkTypeMacro(QuadEdgeMeshScalarDataVTKPolyDataWriter, VTKPolyDataWriter);
00047 
00049   itkNewMacro(Self);
00050 
00051   typedef TMesh                       MeshType;
00052   typedef typename MeshType::Pointer  MeshPointer;
00053   typedef typename MeshType::CellType CellType;
00054 
00055   typedef typename MeshType::PointsContainerPointer  PointsContainerPointer;
00056   typedef typename MeshType::PointsContainerIterator PointsContainerIterator;
00057 
00058   typedef typename MeshType::PointDataContainerPointer      PointDataContainerPointer;
00059   typedef typename MeshType::PointDataContainerConstPointer PointDataContainerConstPointer;
00060   typedef typename MeshType::PointDataContainerIterator     PointDataContainerIterator;
00061 
00062   typedef typename MeshType::CellsContainer      CellsContainer;
00063   typedef typename CellsContainer::Pointer       CellsContainerPointer;
00064   typedef typename CellsContainer::ConstPointer  CellsContainerConstPointer;
00065   typedef typename CellsContainer::Iterator      CellsContainerIterator;
00066   typedef typename CellsContainer::ConstIterator CellsContainerConstIterator;
00067 
00068   typedef typename MeshType::CellDataContainer      CellDataContainer;
00069   typedef typename CellDataContainer::Iterator      CellDataContainerIterator;
00070   typedef typename CellDataContainer::ConstIterator CellDataContainerConstIterator;
00071   typedef typename CellDataContainer::Pointer       CellDataContainerPointer;
00072   typedef typename CellDataContainer::ConstPointer  CellDataContainerConstPointer;
00073 
00075   itkSetStringMacro(CellDataName);
00076   itkGetStringMacro(CellDataName);
00078 
00080   itkSetStringMacro(PointDataName);
00081   itkGetStringMacro(PointDataName);
00082 protected:
00083   QuadEdgeMeshScalarDataVTKPolyDataWriter();
00084   ~QuadEdgeMeshScalarDataVTKPolyDataWriter();
00086 
00087   std::string m_CellDataName;
00088   std::string m_PointDataName;
00089 
00090   void GenerateData();
00091 
00092   void WriteCellData();
00093 
00094   void WritePointData();
00095 
00096 private:
00097   QuadEdgeMeshScalarDataVTKPolyDataWriter(const Self &);
00098   void operator=(const Self &);
00099 };
00100 }
00101 
00102 #ifndef ITK_MANUAL_INSTANTIATION
00103 #include "itkQuadEdgeMeshScalarDataVTKPolyDataWriter.hxx"
00104 #endif
00105 
00106 #endif
00107