VTK
|
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 "vtkObject.h" 00040 #include "vtkSmartPointer.h" // for SP 00041 00042 class vtkPolyData; 00043 00044 class VTK_GEOVIS_EXPORT vtkGeoTreeNode : public vtkObject 00045 { 00046 public: 00047 static vtkGeoTreeNode *New(); 00048 vtkTypeMacro(vtkGeoTreeNode, vtkObject); 00049 void PrintSelf(ostream& os, vtkIndent indent); 00050 00052 00054 vtkSetMacro(Id,unsigned long); 00055 vtkGetMacro(Id,unsigned long); 00057 00059 00060 vtkSetMacro(Level, int); 00061 vtkGetMacro(Level, int); 00063 00065 00066 vtkSetVector2Macro(LongitudeRange,double); 00067 vtkGetVector2Macro(LongitudeRange,double); 00068 vtkSetVector2Macro(LatitudeRange,double); 00069 vtkGetVector2Macro(LatitudeRange,double); 00071 00074 void SetChild(vtkGeoTreeNode* node, int idx); 00075 00077 00080 void SetParent(vtkGeoTreeNode* node) 00081 { this->Parent = node; } 00083 00085 00087 void SetOlder(vtkGeoTreeNode* node) 00088 { this->Older = node; } 00089 vtkGeoTreeNode* GetOlder() 00090 { return this->Older; } 00091 void SetNewer(vtkGeoTreeNode* node) 00092 { this->Newer = node; } 00093 vtkGeoTreeNode* GetNewer() 00094 { return this->Newer; } 00096 00098 00100 virtual bool HasData() 00101 { return false; } 00103 00105 00108 virtual void DeleteData() 00109 { } 00111 00113 int GetWhichChildAreYou(); 00114 00118 bool IsDescendantOf(vtkGeoTreeNode* elder); 00119 00123 int CreateChildren(); 00124 00126 00128 vtkGeoTreeNode* GetChildTreeNode(int idx) 00129 { return this->Children[idx]; } 00131 00133 00136 vtkGeoTreeNode* GetParentTreeNode() 00137 { return this->Parent; } 00139 00140 //BTX 00141 enum NodeStatus 00142 { 00143 NONE, 00144 PROCESSING 00145 }; 00146 00147 NodeStatus GetStatus(); 00148 void SetStatus(NodeStatus status); 00149 //ETX 00150 00152 00154 virtual void ShallowCopy(vtkGeoTreeNode *src); 00155 virtual void DeepCopy(vtkGeoTreeNode *src); 00157 00158 protected: 00159 vtkGeoTreeNode(); 00160 ~vtkGeoTreeNode(); 00161 00162 int Level; 00163 unsigned long Id; 00164 00165 double LongitudeRange[2]; 00166 double LatitudeRange[2]; 00167 00168 //BTX 00169 vtkSmartPointer<vtkGeoTreeNode> Children[4]; 00170 vtkGeoTreeNode * Parent; 00171 NodeStatus Status; 00172 vtkGeoTreeNode* Older; 00173 vtkGeoTreeNode* Newer; 00174 //ETX 00175 00176 private: 00177 vtkGeoTreeNode(const vtkGeoTreeNode&); // Not implemented. 00178 void operator=(const vtkGeoTreeNode&); // Not implemented. 00179 }; 00180 00181 #endif