File: vtkHierarchicalDataSetInternal.h

package info (click to toggle)
vtk 5.0.4-1.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 51,084 kB
  • ctags: 70,426
  • sloc: cpp: 524,166; ansic: 220,276; tcl: 43,377; python: 14,037; perl: 3,102; java: 1,436; yacc: 1,033; sh: 339; lex: 248; makefile: 197; asm: 154
file content (171 lines) | stat: -rw-r--r-- 5,247 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    $RCSfile: vtkHierarchicalDataSetInternal.h,v $

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
// .NAME vtkHierarchicalDataSetInternal - internal structure for vtkHierarchicalDataSet
// .SECTION Description
// vtkHierarchicalDataSetInternal is

#ifndef __vtkHierarchicalDataSetInternal_h
#define __vtkHierarchicalDataSetInternal_h

#include <vtkstd/vector>
#include <vtkstd/algorithm>

#include "vtkDataObject.h"
#include "vtkSmartPointer.h"

class vtkHDSNode;

struct vtkHierarchicalDataSetInternal
{
  typedef vtkstd::vector<vtkSmartPointer<vtkDataObject> > LevelDataSetsType;
  typedef LevelDataSetsType::iterator LevelDataSetsIterator;
  typedef vtkstd::vector<LevelDataSetsType> DataSetsType;
  typedef DataSetsType::iterator DataSetsIterator;

  DataSetsType DataSets;
};

struct vtkHDSNodeRef
{
  vtkHDSNodeRef(int level, int index) : Level(level), Index(index) {}

  vtkstd_bool operator==(const vtkHDSNodeRef& rhs)
    {
      return (this->Level == rhs.Level) && (this->Index == rhs.Index);
    }
  vtkstd_bool operator!=(const vtkHDSNodeRef& rhs)
    {
      return (this->Level != rhs.Level) || (this->Index != rhs.Index);
    }
  
  int Level;
  int Index;
};

class vtkHDSNode
{
public:

//   void AddParent(const vtkHDSNodeRef& parent);
//   void AddChild (const vtkHDSNodeRef& child );

//   void RemoveParent(const vtkHDSNodeRef& parent);
//   void RemoveChild (const vtkHDSNodeRef& child );

//   void DisconnectFromParent(const vtkHDSNodeRef& self,
//                             const vtkHDSNodeRef& parent,
//                             vtkHierarchicalDataSetInternal::DataSetsType& ds);
//   void DisconnectFromChild (const vtkHDSNodeRef& self,
//                             const vtkHDSNodeRef& child,
//                             vtkHierarchicalDataSetInternal::DataSetsType& ds);
//   void ConnectToParent(const vtkHDSNodeRef& self,
//                        const vtkHDSNodeRef& parent,
//                        vtkHierarchicalDataSetInternal::DataSetsType& ds);
//   void ConnectToChild (const vtkHDSNodeRef& self,
//                        const vtkHDSNodeRef& child,
//                        vtkHierarchicalDataSetInternal::DataSetsType& ds);

//   void DisconnectAll(const vtkHDSNodeRef& self,
//                      vtkHierarchicalDataSetInternal::DataSetsType& ds);

protected:
  vtkstd::vector<vtkHDSNodeRef> Parents;
  vtkstd::vector<vtkHDSNodeRef> Children;
};

// inline void vtkHDSNode::AddParent(const vtkHDSNodeRef& parent)
// {
//   this->Parents.push_back(parent);
// }

// inline void vtkHDSNode::AddChild(const vtkHDSNodeRef& child)
// {
//   this->Children.push_back(child);
// }

// inline void vtkHDSNode::RemoveParent(const vtkHDSNodeRef& parent)
// {
//   vtkstd::vector<vtkHDSNodeRef>::iterator it = 
//     vtkstd::find(this->Parents.begin(), this->Parents.end(), parent);
//   if (it != this->Parents.end())
//     {
//     this->Parents.erase(it);
//     }
// }

// inline void vtkHDSNode::RemoveChild (const vtkHDSNodeRef& child)
// {
//   vtkstd::vector<vtkHDSNodeRef>::iterator it = 
//     vtkstd::find(this->Children.begin(), this->Children.end(), child);
//   if (it != this->Children.end())
//     {
//     this->Children.erase(it);
//     }
// }

// inline void vtkHDSNode::ConnectToParent(
//   const vtkHDSNodeRef& self,
//   const vtkHDSNodeRef& parent,
//   vtkHierarchicalDataSetInternal::DataSetsType& ds)
// {
//   this->AddParent(parent);
//   ds[parent.Level][parent.Index]->AddChild(self);
// }

// inline void vtkHDSNode::ConnectToChild(
//   const vtkHDSNodeRef& self,
//   const vtkHDSNodeRef& child,
//   vtkHierarchicalDataSetInternal::DataSetsType& ds)
// {
//   this->AddChild(child);
//   ds[child.Level][child.Index]->AddParent(self);
// }

// inline void vtkHDSNode::DisconnectFromParent(
//   const vtkHDSNodeRef& self,
//   const vtkHDSNodeRef& parent, 
//   vtkHierarchicalDataSetInternal::DataSetsType& ds)
// {
//   this->RemoveParent(parent);
//   ds[parent.Level][parent.Index]->RemoveChild(self);
// }

// inline void vtkHDSNode::DisconnectFromChild(
//   const vtkHDSNodeRef& self,
//   const vtkHDSNodeRef& child, 
//   vtkHierarchicalDataSetInternal::DataSetsType& ds)
// {
//   this->RemoveChild(child);
//   ds[child.Level][child.Index]->RemoveParent(self);
// }

// inline void vtkHDSNode::DisconnectAll(
//   const vtkHDSNodeRef& self, vtkHierarchicalDataSetInternal::DataSetsType& ds)
// {
//   vtkstd::vector<vtkHDSNodeRef>::iterator it;

//   for(it=this->Parents.begin(); it!=this->Parents.end(); ++it)
//     {
//     this->DisconnectFromParent(self, *it, ds);
//     }

//   for(it=this->Children.begin(); it!=this->Children.end(); ++it)
//     {
//     this->DisconnectFromChild(self, *it, ds);
//     }

// }

#endif