VTK
vtkGeoTreeNode.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGeoTreeNode.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
16 /*-------------------------------------------------------------------------
17  Copyright 2008 Sandia Corporation.
18  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
19  the U.S. Government retains certain rights in this software.
20 -------------------------------------------------------------------------*/
21 
37 #ifndef vtkGeoTreeNode_h
38 #define vtkGeoTreeNode_h
39 
40 #include "vtkGeovisCoreModule.h" // For export macro
41 #include "vtkObject.h"
42 #include "vtkSmartPointer.h" // for SP
43 
44 class vtkPolyData;
45 
46 #if !defined(VTK_LEGACY_REMOVE)
47 class VTKGEOVISCORE_EXPORT vtkGeoTreeNode : public vtkObject
48 {
49 public:
50  static vtkGeoTreeNode *New();
51  vtkTypeMacro(vtkGeoTreeNode, vtkObject);
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
55 
60  vtkSetMacro(Id,unsigned long);
61  vtkGetMacro(Id,unsigned long);
63 
65 
68  vtkSetMacro(Level, int);
69  vtkGetMacro(Level, int);
71 
73 
76  vtkSetVector2Macro(LongitudeRange,double);
77  vtkGetVector2Macro(LongitudeRange,double);
78  vtkSetVector2Macro(LatitudeRange,double);
79  vtkGetVector2Macro(LatitudeRange,double);
81 
86  void SetChild(vtkGeoTreeNode* node, int idx);
87 
94  { this->Parent = node; }
95 
101  { this->Older = node; }
103  { return this->Older; }
105  { this->Newer = node; }
107  { return this->Newer; }
108 
113  virtual bool HasData()
114  { return false; }
115 
121  virtual void DeleteData()
122  { }
123 
127  int GetWhichChildAreYou();
128 
134  bool IsDescendantOf(vtkGeoTreeNode* elder);
135 
141  int CreateChildren();
142 
149  { return this->Children[idx]; }
150 
157  { return this->Parent; }
158 
160  {
162  PROCESSING
163  };
164 
165  NodeStatus GetStatus();
166  void SetStatus(NodeStatus status);
167 
169 
173  virtual void ShallowCopy(vtkGeoTreeNode *src);
174  virtual void DeepCopy(vtkGeoTreeNode *src);
176 
177 protected:
178  vtkGeoTreeNode();
179  ~vtkGeoTreeNode() override;
180 
181  int Level;
182  unsigned long Id;
183 
184  double LongitudeRange[2];
185  double LatitudeRange[2];
186 
192 
193 private:
194  vtkGeoTreeNode(const vtkGeoTreeNode&) = delete;
195  void operator=(const vtkGeoTreeNode&) = delete;
196 };
197 
198 #endif //VTK_LEGACY_REMOVE
199 #endif
void SetNewer(vtkGeoTreeNode *node)
virtual bool HasData()
Returns whether this node has valid data associated with it, or if it is an "empty" node...
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkGeoTreeNode * GetNewer()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetParent(vtkGeoTreeNode *node)
When we merge children to a lower resolution parent, we need this reference.
vtkGeoTreeNode * GetOlder()
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkGeoTreeNode * GetParentTreeNode()
Get the parent as a vtkGeoTreeNode.
NodeStatus Status
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkGeoTreeNode * Parent
vtkGeoTreeNode * Newer
Stores data for a patch of the globe.
unsigned long Id
virtual void DeleteData()
Deletes the data associated with the node to make this an "empty" node.
void SetOlder(vtkGeoTreeNode *node)
Manage links to older and newer tree nodes.
vtkGeoTreeNode * GetChildTreeNode(int idx)
Get the child as a vtkGeoTreeNode.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkGeoTreeNode * Older