Shapeworks Studio  2.1
Shape analysis software suite
itkParticlePositionWriter.h
1 /*=========================================================================
2  Program: ShapeWorks: Particle-based Shape Correspondence & Visualization
3  Module: $RCSfile: itkParticlePositionWriter.h,v $
4  Date: $Date: 2011/03/24 01:17:33 $
5  Version: $Revision: 1.2 $
6  Author: $Author: wmartin $
7 
8  Copyright (c) 2009 Scientific Computing and Imaging Institute.
9  See ShapeWorksLicense.txt for details.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notices for more information.
14  =========================================================================*/
15 #ifndef __itkParticlePositionWriter_h
16 #define __itkParticlePositionWriter_h
17 
18 #include "itkDataObject.h"
19 #include "itkPoint.h"
20 #include "itkWeakPointer.h"
21 #include "itkObjectFactory.h"
22 #include <vector>
23 #include <string>
24 
25 namespace itk
26 {
41 template <unsigned int VDimension>
42 class ITK_EXPORT ParticlePositionWriter : public DataObject
43 {
44 public:
47  typedef DataObject Superclass;
48  typedef SmartPointer<Self> Pointer;
49  typedef SmartPointer<const Self> ConstPointer;
50  typedef WeakPointer<const Self> ConstWeakPointer;
51 
54 
56  itkNewMacro( Self );
57 
59  itkTypeMacro( ParticlePositionWriter, DataObject );
60 
62  void SetInput( const std::vector<PointType> &p )
63  {
64  m_Input = p;
65  }
66 
68  itkSetStringMacro( FileName );
69  itkGetStringMacro( FileName );
70 
72  inline void Write()
73  { this->Update(); }
74  void Update();
75 
76 protected:
78  void PrintSelf( std::ostream& os, Indent indent ) const
79  {
80  Superclass::PrintSelf( os, indent );
81 
82  os << indent << "ParticlePositionWriter: " << std::endl;
83  }
84  virtual ~ParticlePositionWriter() {}
85 
86 private:
87  ParticlePositionWriter( const Self& ); //purposely not implemented
88  void operator=( const Self& ); //purposely not implemented
89 
90  std::vector<PointType> m_Input;
91  std::string m_FileName;
92 };
93 } // end namespace itk
94 
95 #if ITK_TEMPLATE_EXPLICIT
96 # include "Templates/itkParticlePositionWriter+-.h"
97 #endif
98 
99 #if ITK_TEMPLATE_TXX
100 # include "itkParticlePositionWriter.txx"
101 #endif
102 
103 #endif // ifndef __itkParticlePositionWriter_h
void SetInput(const std::vector< PointType > &p)
Point< double, VDimension > PointType