VTK
dox/Geovis/Core/vtkGeoTreeNode.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkGeoTreeNode.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 =========================================================================*/
00015 
00016 /*-------------------------------------------------------------------------
00017   Copyright 2008 Sandia Corporation.
00018   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00019   the U.S. Government retains certain rights in this software.
00020 -------------------------------------------------------------------------*/
00021 
00036 #ifndef __vtkGeoTreeNode_h
00037 #define __vtkGeoTreeNode_h
00038 
00039 #include "vtkGeovisCoreModule.h" // For export macro
00040 #include "vtkObject.h"
00041 #include "vtkSmartPointer.h" // for SP
00042 
00043 class vtkPolyData;
00044 
00045 class VTKGEOVISCORE_EXPORT vtkGeoTreeNode : public vtkObject
00046 {
00047 public:
00048   static vtkGeoTreeNode *New();
00049   vtkTypeMacro(vtkGeoTreeNode, vtkObject);
00050   void PrintSelf(ostream& os, vtkIndent indent);
00051 
00053 
00055   vtkSetMacro(Id,unsigned long);
00056   vtkGetMacro(Id,unsigned long);
00058 
00060 
00061   vtkSetMacro(Level, int);
00062   vtkGetMacro(Level, int);
00064 
00066 
00067   vtkSetVector2Macro(LongitudeRange,double);
00068   vtkGetVector2Macro(LongitudeRange,double);
00069   vtkSetVector2Macro(LatitudeRange,double);
00070   vtkGetVector2Macro(LatitudeRange,double);
00072 
00075   void SetChild(vtkGeoTreeNode* node, int idx);
00076 
00078 
00081   void SetParent(vtkGeoTreeNode* node)
00082     { this->Parent = node; }
00084 
00086 
00088   void SetOlder(vtkGeoTreeNode* node)
00089     { this->Older = node; }
00090   vtkGeoTreeNode* GetOlder()
00091     { return this->Older; }
00092   void SetNewer(vtkGeoTreeNode* node)
00093     { this->Newer = node; }
00094   vtkGeoTreeNode* GetNewer()
00095     { return this->Newer; }
00097 
00099 
00101   virtual bool HasData()
00102     { return false; }
00104 
00106 
00109   virtual void DeleteData()
00110     { }
00112 
00114   int GetWhichChildAreYou();
00115 
00119   bool IsDescendantOf(vtkGeoTreeNode* elder);
00120 
00124   int CreateChildren();
00125 
00127 
00129   vtkGeoTreeNode* GetChildTreeNode(int idx)
00130     { return this->Children[idx]; }
00132 
00134 
00137   vtkGeoTreeNode* GetParentTreeNode()
00138     { return this->Parent; }
00140 
00141 //BTX
00142   enum NodeStatus
00143     {
00144     NONE,
00145     PROCESSING
00146     };
00147 
00148   NodeStatus GetStatus();
00149   void SetStatus(NodeStatus status);
00150 //ETX
00151 
00153 
00155   virtual void ShallowCopy(vtkGeoTreeNode *src);
00156   virtual void DeepCopy(vtkGeoTreeNode *src);
00158 
00159 protected:
00160   vtkGeoTreeNode();
00161   ~vtkGeoTreeNode();
00162 
00163   int Level;
00164   unsigned long Id;
00165 
00166   double LongitudeRange[2];
00167   double LatitudeRange[2];
00168 
00169   //BTX
00170   vtkSmartPointer<vtkGeoTreeNode> Children[4];
00171   vtkGeoTreeNode * Parent;
00172   NodeStatus Status;
00173   vtkGeoTreeNode* Older;
00174   vtkGeoTreeNode* Newer;
00175   //ETX
00176 
00177 private:
00178   vtkGeoTreeNode(const vtkGeoTreeNode&);  // Not implemented.
00179   void operator=(const vtkGeoTreeNode&);  // Not implemented.
00180 };
00181 
00182 #endif