Orfeo Toolbox  3.16
itkDataObject.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkDataObject.h,v $
5  Language: C++
6  Date: $Date: 2009-02-20 19:59:26 $
7  Version: $Revision: 1.72 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  Portions of this code are covered under the VTK copyright.
13  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
14 
15  This software is distributed WITHOUT ANY WARRANTY; without even
16  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
17  PURPOSE. See the above copyright notices for more information.
18 
19 =========================================================================*/
20 #ifndef __itkDataObject_h
21 #define __itkDataObject_h
22 
23 #include "itkObject.h"
25 #include "itkWeakPointer.h"
26 #include "itkExceptionObject.h"
27 
28 namespace itk
29 {
30 
31 class ProcessObject;
32 class DataObject;
33 
34 /*--------------------Data Object Exceptions---------------------------*/
35 
39 {
40 public:
44 
46  virtual ~DataObjectError() throw() {}
47 
49  DataObjectError(const char *file, unsigned int lineNumber);
50 
52  DataObjectError(const std::string& file, unsigned int lineNumber);
53 
55  DataObjectError(const DataObjectError &orig);
56 
58  DataObjectError& operator=( const DataObjectError& orig);
59 
61  itkTypeMacro(DataObjectError, ExceptionObject);
62 
64  void SetDataObject(DataObject *dobj);
65 
67  DataObject* GetDataObject();
68 
69 protected:
74  virtual void PrintSelf(std::ostream& os, Indent indent) const;
75 
76 private:
78 };
79 
80 
85 {
86 public:
89 
91  virtual ~InvalidRequestedRegionError() throw() {}
92 
94  InvalidRequestedRegionError(const char *file, unsigned int lineNumber);
95 
97  InvalidRequestedRegionError(const std::string& file, unsigned int lineNumber);
98 
101 
104 
107 
108 protected:
113  virtual void PrintSelf(std::ostream& os, Indent indent) const;
114 
115 };
116 
117 
118 /*----------------------------Data Object--------------------------------*/
119 
263 {
264 public:
266  typedef DataObject Self;
270 
272  itkTypeMacro(DataObject,Object);
273 
279  void DisconnectPipeline();
280 
294 
296  unsigned int GetSourceOutputIndex() const;
297 
300  virtual void Initialize();
301 
304  void SetReleaseDataFlag(bool flag)
305  {
306  m_ReleaseDataFlag = flag;
307  }
308  itkGetConstReferenceMacro(ReleaseDataFlag,bool);
309  itkBooleanMacro(ReleaseDataFlag);
310 
314  static void SetGlobalReleaseDataFlag(bool val);
315  static bool GetGlobalReleaseDataFlag();
316  static void GlobalReleaseDataFlagOn()
317  {Self::SetGlobalReleaseDataFlag(true);}
318  static void GlobalReleaseDataFlagOff()
319  {Self::SetGlobalReleaseDataFlag(false);}
320 
325  void ReleaseData();
326 
329  bool ShouldIReleaseData() const;
330 
332  bool GetDataReleased() const
333  {return m_DataReleased;}
334 
345  virtual void Update();
346 
356  virtual void UpdateOutputInformation();
357 
360  virtual void PropagateRequestedRegion();
361  virtual void UpdateOutputData();
362 
366  virtual void ResetPipeline();
367 
370  void SetPipelineMTime(unsigned long time)
371  {m_PipelineMTime = time;}
372  itkGetConstReferenceMacro(PipelineMTime,unsigned long);
373 
375  virtual unsigned long GetUpdateMTime() const;
376 
385  virtual void PrepareForNewData()
386  {this->Initialize();}
387 
392  void DataHasBeenGenerated();
393 
394 
399 
409  virtual bool RequestedRegionIsOutsideOfTheBufferedRegion()
410  { return false; }
411 
424  virtual bool VerifyRequestedRegion() { return true; };
425 
435  virtual void CopyInformation(const DataObject*) {};
436 
442  virtual void SetRequestedRegion(DataObject *) {};
443 
449  virtual void Graft( const DataObject *) {};
450 
451 protected:
452  DataObject();
453  ~DataObject();
454  void PrintSelf(std::ostream& os, Indent indent) const;
455 
457  virtual void PropagateResetPipeline();
458 
459 private:
460  DataObject(const Self&); //purposely not implemented
461  void operator=(const Self&); //purposely not implemented
462 
465  mutable unsigned int m_SourceOutputIndex;
466 
469 
470  bool m_ReleaseDataFlag; //Data will release after use by a filter if on
471  bool m_DataReleased; //Keep track of data release during pipeline execution
472 
475  unsigned long m_PipelineMTime;
476 
479 
484  bool ConnectSource(ProcessObject *s, unsigned long idx) const;
485 
494  bool DisconnectSource(ProcessObject *s, unsigned long idx) const;
495 
497  friend class ProcessObject;
498  friend class DataObjectError;
499 };
500 
501 } // end namespace itk
502 
503 #endif

Generated at Sat May 18 2013 23:35:51 for Orfeo Toolbox with doxygen 1.8.3.1