forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkSimple3DCirclesStrategy.cxx
651 lines (558 loc) · 19.6 KB
/
vtkSimple3DCirclesStrategy.cxx
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
/*=========================================================================
Program: Visualization Toolkit
Module: vtkSimple3DCirclesStrategy.cxx
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.
=========================================================================*/
#include "vtkSimple3DCirclesStrategy.h"
#include "vtkAbstractArray.h"
#include "vtkCharArray.h" // For temporary store for point ordering
#include "vtkDirectedGraph.h" // For this->Graph type check
#include "vtkIdTypeArray.h" // For Ordered array
#include "vtkInEdgeIterator.h" // For in edge(s) checks
#include "vtkIntArray.h" // For hierarchy layers
#include "vtkMath.h" // For cross, outer, norm and dot
#include "vtkObjectFactory.h" // For VTK ::New() function
#include "vtkOutEdgeIterator.h" // For out edge(s) checks
#include "vtkPoints.h" // For output target
#include "vtkSmartPointer.h" // For good memory handling
#include <cmath> // For abs, sin, cos and tan
#include <algorithm> // For min, max, swap, etc.
#include <list> // For internal store
template <class T> bool IsZero( T value )
{
return ( ( value < VTK_DBL_EPSILON ) && ( value > ( -1.0 * VTK_DBL_EPSILON ) ) );
};
class vtkSimple3DCirclesStrategyInternal
{
public:
vtkSimple3DCirclesStrategyInternal( void )
{
};
vtkSimple3DCirclesStrategyInternal( const vtkSimple3DCirclesStrategyInternal &from )
{
if ( &from != this )
this->store = from.store;
};
vtkSimple3DCirclesStrategyInternal & operator = ( const vtkSimple3DCirclesStrategyInternal &from )
{
if ( &from != this )
this->store = from.store;
return *this;
};
vtkSimple3DCirclesStrategyInternal & operator = ( const std::list<vtkIdType> &from )
{
this->store = from;
return *this;
};
vtkIdType front( void )
{
return this->store.front();
};
void pop_front( void )
{
this->store.pop_front();
};
std::size_t size( void )
{
return this->store.size();
};
void push_back( const vtkIdType &value )
{
this->store.push_back( value );
};
~vtkSimple3DCirclesStrategyInternal( void )
{
this->store.clear();
};
private:
std::list<vtkIdType> store;
};
vtkStandardNewMacro(vtkSimple3DCirclesStrategy);
void vtkSimple3DCirclesStrategy::PrintSelf( ostream &os, vtkIndent indent )
{
this->Superclass::PrintSelf( os, indent );
os << indent << "Radius : " << this->Radius << endl;
os << indent << "Height : " << this->Height << endl;
os << indent << "Origin : (" << this->Origin[0] << "," << this->Origin[1] << "," << this->Origin[2] << ")" << endl;
os << indent << "Direction : (" << this->Direction[0] << "," << this->Direction[1] << "," << this->Direction[2] << ")" << endl;
os << indent << "Rotate matrix : [[" << this->T[0][0] << ";" << this->T[1][0] << ";" << this->T[2][0] << "]";
os << "[" << this->T[0][1] << ";" << this->T[1][1] << ";" << this->T[2][1] << "]";
os << "[" << this->T[0][2] << ";" << this->T[1][2] << ";" << this->T[2][2] << "]]" << endl;
os << indent << "Method : ";
if ( this->Method == FixedRadiusMethod )
os << "fixed radius method" << endl;
else if ( this->Method == FixedDistanceMethod )
os << "fixed distance method" << endl;
os << indent << "MarkValue : " << this->MarkedValue << endl;
os << indent << "Auto height : ";
if ( this->AutoHeight == 1 )
os << "On" << endl;
else
os << "Off" << endl;
os << indent << "Minimum degree for autoheight : " << this->MinimumRadian << " rad [" << vtkMath::DegreesFromRadians( this->MinimumRadian ) << " deg]" << endl;
os << indent << "Registered MarkedStartPoints :";
if ( this->MarkedStartVertices == 0 )
os << " (none)" << endl;
else
{
os << endl;
this->MarkedStartVertices->PrintSelf( os, indent.GetNextIndent() );
}
os << indent << "Registered HierarchicalLayers :";
if ( this->HierarchicalLayers == 0 )
os << " (none)" << endl;
else
{
os << endl;
this->HierarchicalLayers->PrintSelf( os, indent.GetNextIndent() );
}
os << indent << "Registered HierarchicalOrder :";
if ( this->HierarchicalOrder == 0 )
os << " (none)" << endl;
else
{
os << endl;
this->HierarchicalOrder->PrintSelf( os, indent.GetNextIndent() );
}
os << indent << "ForceToUseUniversalStartPointsFinder :"
<< this->ForceToUseUniversalStartPointsFinder << endl;
}
void vtkSimple3DCirclesStrategy::SetDirection( double dx, double dy, double dz )
{
vtkDebugMacro( << this->GetClassName() << " (" << this << "): setting Direction to (" << dx << "," << dy << "," << dz << ")" );
if ( ( this->Direction[0] != dx ) || ( this->Direction[1] != dy ) || ( this->Direction[2] != dz ) )
{
double global[3], local[3];
global[0] = dx;
global[1] = dy;
global[2] = dz;
local[0] = 0.0;
local[1] = 1.0;
local[2] = 0.0;
double length_global = vtkMath::Norm( global );
if ( IsZero( length_global ) )
{
vtkWarningMacro( << "The length of direction vector is zero! Direction has not been changed!" );
return;
}
double cosfi, n[3], E[3][3], U[3][3], u[3][3], number;
global[0] = global[0] / length_global;
global[1] = global[1] / length_global;
global[2] = global[2] / length_global;
// http://en.citizendium.org/wiki/Rotation_matrix
// we are going from local to global.
// cos(fi) = local.global -> cosfi, because |local|=1 and |global|=1
cosfi = vtkMath::Dot( local, global );
// if fi == 2*Pi -> cosfi = -1
if ( IsZero( cosfi + 1.0 ) )
{
// if "local" is on "z" axes
if ( IsZero( local[2] + 1.0 ) || IsZero( local[2] - 1.0 ) )
{
this->T[0][0] = this->T[2][2] = -1.0;
this->T[1][1] = 1.0;
this->T[0][1] = this->T[1][0] = this->T[0][2] = this->T[2][0] = this->T[1][2] = this->T[2][1] = 0.0;
}
// if local != ( (0,0,1) or (0,0,-1) )
else
{
// n vector
n[0] = 1.0 / (1.0 - local[2]*local[2] ) * local[1];
n[1] = -1.0 / (1.0 - local[2]*local[2] ) * local[0];
n[2] = 0.0;
// u = n X n
vtkMath::Outer( n, n, u );
// -E
E[0][0] = E[1][1] = E[2][2] = -1.0;
E[0][1] = E[1][0] = E[0][2] = E[2][0] = E[1][2] = E[2][1] = 0.0;
// T = -E + 2*u
int i,j;
for ( i = 0; i < 3; ++i )
for ( j = 0; j < 3; ++j )
this->T[i][j] = E[i][j] + ( u[i][j] * 2.0 );
}
}
// fi < 2*Pi
else
{
// n = local x global -> n(nx,ny,nz)
vtkMath::Cross( local, global, n );
//
// cos(fi)*E
//
E[0][0] = E[1][1] = E[2][2] = cosfi;
E[0][1] = E[1][0] = E[0][2] = E[2][0] = E[1][2] = E[2][1] = 0.0;
// | 0 -nz ny |
// U = sin(fi)*N = | nz 0 -nx |
// | -ny nx 0 |
U[0][0] = U[1][1] = U[2][2] = 0.0;
U[0][1] = -1.0 * n[2]; U[1][0] = n[2];
U[0][2] = n[1]; U[2][0] = -1.0 * n[1];
U[1][2] = -1.0 * n[0]; U[2][1] = n[0];
// u = n X n
vtkMath::Outer( n, n, u );
int i,j;
// T = cos(fi)*E + U + 1/(1+cos(fi))*[n X n]
// [ number = 1/(1+cos(fi)) ]
number = 1.0 / ( 1.0 + cosfi );
for ( i = 0; i < 3; ++i )
for ( j = 0; j < 3; ++j )
this->T[i][j] = E[i][j] + U[i][j] + ( u[i][j] * number );
}
this->Direction[0] = dx;
this->Direction[1] = dy;
this->Direction[2] = dz;
vtkDebugMacro( << "Transformation matrix : [[" << this->T[0][0] << "," << this->T[1][0] << "," << this->T[2][0] << "][" << this->T[0][1] << "," << this->T[1][1] << "," << this->T[2][1] << "][" << this->T[0][2] << "," << this->T[1][2] << "," << this->T[2][2] << "]]" );
this->Modified();
}
}
void vtkSimple3DCirclesStrategy::SetDirection( double d[3] )
{
this->SetDirection( d[0], d[1], d[2] );
}
vtkCxxSetObjectMacro(vtkSimple3DCirclesStrategy,MarkedStartVertices,vtkAbstractArray);
void vtkSimple3DCirclesStrategy::SetMarkedValue( vtkVariant val )
{
if ( !this->MarkedValue.IsEqual(val) )
{
this->MarkedValue = val;
vtkDebugMacro( << "Setting MarkedValue : " << this->MarkedValue );
this->Modified();
}
}
vtkVariant vtkSimple3DCirclesStrategy::GetMarkedValue( void )
{
return this->MarkedValue;
}
void vtkSimple3DCirclesStrategy::SetMinimumDegree( double degree )
{
this->SetMinimumRadian( vtkMath::RadiansFromDegrees( degree ) );
}
double vtkSimple3DCirclesStrategy::GetMinimumDegree( void )
{
return vtkMath::DegreesFromRadians( this->GetMinimumRadian() );
}
vtkCxxSetObjectMacro(vtkSimple3DCirclesStrategy,HierarchicalLayers,vtkIntArray);
vtkCxxSetObjectMacro(vtkSimple3DCirclesStrategy,HierarchicalOrder,vtkIdTypeArray);
vtkSimple3DCirclesStrategy::vtkSimple3DCirclesStrategy( void )
: Radius(1), Height(1), Method(FixedRadiusMethod), MarkedStartVertices(0), ForceToUseUniversalStartPointsFinder(0), AutoHeight(0), MinimumRadian(vtkMath::Pi()/6.0), HierarchicalLayers(0), HierarchicalOrder(0)
{
this->Direction[0] = this->Direction[1] = 0.0; this->Direction[2] = 1.0;
this->T[0][1] = this->T[0][2] = this->T[1][2] = 0.0;
this->T[1][0] = this->T[2][0] = this->T[2][1] = 0.0;
this->T[0][0] = this->T[1][1] = this->T[2][2] = 1.0;
this->Origin[0] = this->Origin[1] = this->Origin[2] = 0.0;
}
vtkSimple3DCirclesStrategy::~vtkSimple3DCirclesStrategy( void )
{
this->SetMarkedStartVertices(0);
this->SetHierarchicalLayers(0);
this->SetHierarchicalOrder(0);
}
void vtkSimple3DCirclesStrategy::Layout( void )
{
if ( this->Graph == 0 )
{
vtkErrorMacro( << "Graph is null!" );
return;
}
if ( this->Graph->GetNumberOfVertices() == 0 )
{
vtkDebugMacro( << "Graph is empty (no no vertices)!" );
return;
}
vtkSmartPointer<vtkDirectedGraph> target = vtkSmartPointer<vtkDirectedGraph>::New();
if ( ! target->CheckedShallowCopy( this->Graph ) )
{
vtkErrorMacro( << "Graph must be directed graph!" );
return;
}
vtkSimple3DCirclesStrategyInternal start_points, order_points, stand_alones;
// Layers begin
vtkSmartPointer<vtkIntArray> layers = 0;
if ( this->HierarchicalLayers != 0 )
{
if ( ( this->HierarchicalLayers->GetMaxId() + 1 ) == target->GetNumberOfVertices() )
{
layers = this->HierarchicalLayers;
}
}
if ( layers == 0 )
{
layers = vtkSmartPointer<vtkIntArray>::New();
if ( this->HierarchicalLayers != 0 )
this->HierarchicalLayers->UnRegister(this);
this->HierarchicalLayers = layers;
this->HierarchicalLayers->Register(this);
layers->SetNumberOfValues( target->GetNumberOfVertices() );
for ( vtkIdType i = 0; i <= layers->GetMaxId(); ++i )
layers->SetValue(i,-1);
if ( this->UniversalStartPoints( target, &start_points, &stand_alones, layers ) == -1 )
{
vtkErrorMacro( << "There is no start point!" );
return;
}
order_points = start_points;
this->BuildLayers( target, &start_points, layers );
}
else
{
for ( vtkIdType i = 0; i <= layers->GetMaxId(); ++i )
{
if ( layers->GetValue(i) == 0 )
order_points.push_back(i);
else if ( layers->GetValue(i) == -2 )
stand_alones.push_back(i);
}
}
// Layers end
// Order begin
vtkSmartPointer<vtkIdTypeArray> order = 0;
if ( this->HierarchicalOrder != 0 )
{
if ( ( this->HierarchicalOrder->GetMaxId() + 1 ) == target->GetNumberOfVertices() )
{
order = this->HierarchicalOrder;
}
}
if ( order == 0 )
{
order = vtkSmartPointer<vtkIdTypeArray>::New();
if ( this->HierarchicalOrder != 0 )
this->HierarchicalOrder->UnRegister(this);
this->HierarchicalOrder = order;
this->HierarchicalOrder->Register(this);
order->SetNumberOfValues( target->GetNumberOfVertices() );
for ( vtkIdType i = 0; i <= order->GetMaxId(); ++i )
order->SetValue(i,-1);
this->BuildPointOrder( target, &order_points, &stand_alones, layers, order );
}
// Order end
if ( order->GetValue( order->GetMaxId() ) == -1 )
{
vtkErrorMacro( << "Not all parts of the graph is accessible. There may be a loop." );
return;
}
int index = 0;
int layer = 0;
int start = 0;
double R = this->Radius;
double Rprev = 0.0;
double localXYZ[3], globalXYZ[3], localHeight = this->Height;
double alfa = 0.0;
double tangent = tan( vtkMath::Pi() / 2 - this->MinimumRadian );
int ind = 0;
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
points->SetNumberOfPoints( target->GetNumberOfVertices() );
while ( index <= order->GetMaxId() )
{
start = index;
R = this->Radius;
layer = layers->GetValue( order->GetValue(index) );
while ( index <= order->GetMaxId() )
{
if ( layers->GetValue( order->GetValue(index) ) == layer )
++index;
else
break;
}
alfa = 2.0 * vtkMath::Pi() / double( index - start );
if ( this->Method == FixedDistanceMethod )
{
R = double( index - start - 1 ) * this->Radius / vtkMath::Pi();
}
else if ( this->Method == FixedRadiusMethod )
{
if ( ( index - start ) == 1 )
R = 0.0;
}
else
{
vtkErrorMacro( << "Method must be FixedRadiusMethod or FixedDistanceMethod!" );
return;
}
if ( ( this->AutoHeight == 1 ) && ( this->Method == FixedDistanceMethod ) )
{
if ( fabs( tangent * ( R - Rprev ) ) > this->Height )
localHeight = fabs( tangent * ( R - Rprev ) );
else
localHeight = this->Height;
}
if ( layer != 0 )
localXYZ[2] = localXYZ[2] + localHeight;
else
localXYZ[2] = 0.0;
for ( ind = start; ind < index; ++ind )
{
localXYZ[0] = R * cos( double(ind - start) * alfa );
localXYZ[1] = R * sin( double(ind - start) * alfa );
this->Transform( localXYZ, globalXYZ );
points->SetPoint( order->GetValue(ind), globalXYZ );
}
Rprev = R;
}
this->Graph->SetPoints( points );
vtkDebugMacro( << "vtkPoints is added to the graph. Vertex layout is ready." );
return;
}
void vtkSimple3DCirclesStrategy::SetGraph( vtkGraph * graph )
{
if ( this->Graph != graph )
{
this->Superclass::SetGraph( graph );
if ( this->HierarchicalLayers != 0 )
{
this->HierarchicalLayers->UnRegister(this);
this->HierarchicalLayers = 0;
}
if ( this->HierarchicalOrder != 0 )
{
this->HierarchicalOrder->UnRegister(this);
this->HierarchicalOrder = 0;
}
}
}
int vtkSimple3DCirclesStrategy::UniversalStartPoints( vtkDirectedGraph * input, vtkSimple3DCirclesStrategyInternal *target, vtkSimple3DCirclesStrategyInternal *StandAlones, vtkIntArray * layers )
{
if ( ( this->MarkedStartVertices != 0 ) && ( this->ForceToUseUniversalStartPointsFinder == 0 ) )
{
if ( this->MarkedStartVertices->GetMaxId() == layers->GetMaxId() )
{
for ( vtkIdType i = 0; i < input->GetNumberOfVertices(); ++i )
{
if ( ( input->GetInDegree(i) == 0 ) && ( input->GetOutDegree(i) > 0 ) )
{
target->push_back(i);
layers->SetValue( i, 0 );
}
else if ( ( input->GetInDegree(i) == 0 ) && ( input->GetOutDegree(i) == 0 ) )
{
layers->SetValue( i, -2 );
StandAlones->push_back(i);
}
else if ( ( this->MarkedStartVertices->GetVariantValue(i) == this->MarkedValue ) && ( input->GetOutDegree(i) > 0 ) )
{
target->push_back(i);
layers->SetValue( i, 0 );
}
}
vtkDebugMacro( << "StartPoint finder: Universal start point finder was used. Number of start point(s): " << target->size() << "; Number of stand alone point(s): " << StandAlones->size() );
return static_cast<int>(target->size());
}
else
{
vtkErrorMacro( << "MarkedStartPoints number is NOT equal number of vertices!" );
return -1;
}
}
for ( vtkIdType i = 0; i < input->GetNumberOfVertices(); ++i )
{
if ( ( input->GetInDegree(i) == 0 ) && ( input->GetOutDegree(i) > 0 ) )
{
target->push_back(i);
layers->SetValue( i, 0 );
}
else if ( ( input->GetInDegree(i) == 0 ) && ( input->GetOutDegree(i) == 0 ) )
{
layers->SetValue( i, -2 );
StandAlones->push_back(i);
}
}
vtkDebugMacro( << "StartPoint finder: Universal start point finder was used. Number of start points: " << target->size() << "; Number of stand alone point(s): " << StandAlones->size() );
return static_cast<int>(target->size());
}
int vtkSimple3DCirclesStrategy::BuildLayers( vtkDirectedGraph * input, vtkSimple3DCirclesStrategyInternal *source, vtkIntArray * layers )
{
vtkSmartPointer<vtkOutEdgeIterator> edge_out_iterator = vtkSmartPointer<vtkOutEdgeIterator>::New();
vtkSmartPointer<vtkInEdgeIterator> edge_in_iterator = vtkSmartPointer<vtkInEdgeIterator>::New();
int layer = 0, flayer = 0;
vtkInEdgeType in_edge;
vtkOutEdgeType out_edge;
bool HasAllInput = true;
vtkIdType ID = 0;
int max_layer_id = -1;
while ( source->size() > 0 )
{
ID = source->front();
source->pop_front();
input->GetOutEdges( ID, edge_out_iterator );
while ( edge_out_iterator->HasNext() )
{
out_edge = edge_out_iterator->Next();
if ( layers->GetValue( out_edge.Target ) == -1 )
{
input->GetInEdges( out_edge.Target, edge_in_iterator );
layer = layers->GetValue( ID );
HasAllInput = true;
while ( edge_in_iterator->HasNext() && HasAllInput )
{
in_edge = edge_in_iterator->Next();
flayer = layers->GetValue( in_edge.Source );
if ( flayer == -1 )
HasAllInput = false;
layer = std::max( layer, flayer );
}
if ( HasAllInput )
{
source->push_back( out_edge.Target );
layers->SetValue( out_edge.Target, layer + 1 );
max_layer_id = std::max( max_layer_id, layer + 1 );
}
}
}
}
vtkDebugMacro( << "Layer building is successful." );
return max_layer_id;
}
void vtkSimple3DCirclesStrategy::BuildPointOrder( vtkDirectedGraph * input, vtkSimple3DCirclesStrategyInternal *source, vtkSimple3DCirclesStrategyInternal *StandAlones, vtkIntArray * layers, vtkIdTypeArray * order )
{
vtkSmartPointer<vtkOutEdgeIterator> edge_out_iterator = vtkSmartPointer<vtkOutEdgeIterator>::New();
vtkSmartPointer<vtkCharArray> mark = vtkSmartPointer<vtkCharArray>::New();
vtkOutEdgeType out_edge;
int step = 0;
int layer = 0;
vtkIdType ID = 0;
mark->SetNumberOfValues( input->GetNumberOfVertices() );
for ( vtkIdType i = 0; i <= mark->GetMaxId(); ++i )
mark->SetValue(i,0);
while ( source->size() > 0 )
{
ID = source->front();
source->pop_front();
order->SetValue( step, ID );
input->GetOutEdges( ID, edge_out_iterator );
layer = layers->GetValue( ID ) + 1;
while ( edge_out_iterator->HasNext() )
{
out_edge = edge_out_iterator->Next();
if ( mark->GetValue( out_edge.Target ) == 0 )
{
if ( layers->GetValue( out_edge.Target ) == layer )
{
mark->SetValue( out_edge.Target, 1 );
source->push_back( out_edge.Target );
}
}
}
++step;
}
while ( StandAlones->size() > 0 )
{
order->SetValue( step, StandAlones->front() );
StandAlones->pop_front();
++step;
}
vtkDebugMacro( << "Vertex order building is successful." );
}
void vtkSimple3DCirclesStrategy::Transform( double Local[], double Global[] )
{
vtkMath::Multiply3x3( this->T, Local, Global );
Global[0] = this->Origin[0] + Global[0];
Global[1] = this->Origin[1] + Global[1];
Global[2] = this->Origin[2] + Global[2];
}