1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkAnnotatedCubeActor.cxx
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 #include "vtkAnnotatedCubeActor.h"
16 
17 #include "vtkActor.h"
18 #include "vtkAppendPolyData.h"
19 #include "vtkAssembly.h"
20 #include "vtkCubeSource.h"
21 #include "vtkFeatureEdges.h"
22 #include "vtkObject.h"
23 #include "vtkObjectFactory.h"
24 #include "vtkPropCollection.h"
25 #include "vtkProperty.h"
26 #include "vtkRenderWindow.h"
27 #include "vtkPolyDataMapper.h"
28 #include "vtkPolyData.h"
29 #include "vtkRenderer.h"
30 #include "vtkTransform.h"
31 #include "vtkTransformFilter.h"
32 #include "vtkVectorText.h"
33 
34 vtkStandardNewMacro(vtkAnnotatedCubeActor);
35 
36 //-------------------------------------------------------------------------
vtkAnnotatedCubeActor()37 vtkAnnotatedCubeActor::vtkAnnotatedCubeActor()
38 {
39   this->FaceTextScale  = 0.5;
40   this->XPlusFaceText  = nullptr;
41   this->XMinusFaceText = nullptr;
42   this->YPlusFaceText  = nullptr;
43   this->YMinusFaceText = nullptr;
44   this->ZPlusFaceText  = nullptr;
45   this->ZMinusFaceText = nullptr;
46 
47   this->Assembly = vtkAssembly::New();
48 
49   this->CubeSource = vtkCubeSource::New();
50   this->CubeSource->SetBounds(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5);
51   this->CubeSource->SetCenter(0, 0, 0);
52 
53   vtkPolyDataMapper *cubeMapper = vtkPolyDataMapper::New();
54   this->CubeActor = vtkActor::New();
55   cubeMapper->SetInputConnection( this->CubeSource->GetOutputPort() );
56   this->CubeActor->SetMapper( cubeMapper );
57   cubeMapper->Delete();
58 
59   this->Assembly->AddPart( this->CubeActor );
60 
61   vtkProperty* prop = this->CubeActor->GetProperty();
62   prop->SetRepresentationToSurface();
63   prop->SetColor(1, 1, 1);
64   prop->SetLineWidth(1);
65 
66   this->SetXPlusFaceText ( "X+" );
67   this->SetXMinusFaceText( "X-" );
68   this->SetYPlusFaceText ( "Y+" );
69   this->SetYMinusFaceText( "Y-" );
70   this->SetZPlusFaceText ( "Z+" );
71   this->SetZMinusFaceText( "Z-" );
72 
73   this->XPlusFaceVectorText  = vtkVectorText::New();
74   this->XMinusFaceVectorText = vtkVectorText::New();
75   this->YPlusFaceVectorText  = vtkVectorText::New();
76   this->YMinusFaceVectorText = vtkVectorText::New();
77   this->ZPlusFaceVectorText  = vtkVectorText::New();
78   this->ZMinusFaceVectorText = vtkVectorText::New();
79 
80   vtkPolyDataMapper *xplusMapper  = vtkPolyDataMapper::New();
81   vtkPolyDataMapper *xminusMapper = vtkPolyDataMapper::New();
82   vtkPolyDataMapper *yplusMapper  = vtkPolyDataMapper::New();
83   vtkPolyDataMapper *yminusMapper = vtkPolyDataMapper::New();
84   vtkPolyDataMapper *zplusMapper  = vtkPolyDataMapper::New();
85   vtkPolyDataMapper *zminusMapper = vtkPolyDataMapper::New();
86 
87   xplusMapper->SetInputConnection ( this->XPlusFaceVectorText->GetOutputPort() );
88   xminusMapper->SetInputConnection( this->XMinusFaceVectorText->GetOutputPort() );
89   yplusMapper->SetInputConnection ( this->YPlusFaceVectorText->GetOutputPort() );
90   yminusMapper->SetInputConnection( this->YMinusFaceVectorText->GetOutputPort() );
91   zplusMapper->SetInputConnection ( this->ZPlusFaceVectorText->GetOutputPort() );
92   zminusMapper->SetInputConnection( this->ZMinusFaceVectorText->GetOutputPort() );
93 
94   this->XPlusFaceActor  = vtkActor::New();
95   this->XMinusFaceActor = vtkActor::New();
96   this->YPlusFaceActor  = vtkActor::New();
97   this->YMinusFaceActor = vtkActor::New();
98   this->ZPlusFaceActor  = vtkActor::New();
99   this->ZMinusFaceActor = vtkActor::New();
100 
101   this->XPlusFaceActor-> SetMapper( xplusMapper );
102   this->XMinusFaceActor->SetMapper( xminusMapper );
103   this->YPlusFaceActor-> SetMapper( yplusMapper );
104   this->YMinusFaceActor->SetMapper( yminusMapper );
105   this->ZPlusFaceActor-> SetMapper( zplusMapper );
106   this->ZMinusFaceActor->SetMapper( zminusMapper );
107 
108   xplusMapper->Delete();
109   xminusMapper->Delete();
110   yplusMapper->Delete();
111   yminusMapper->Delete();
112   zplusMapper->Delete();
113   zminusMapper->Delete();
114 
115   this->Assembly->AddPart( this->XPlusFaceActor );
116   this->Assembly->AddPart( this->XMinusFaceActor );
117   this->Assembly->AddPart( this->YPlusFaceActor );
118   this->Assembly->AddPart( this->YMinusFaceActor );
119   this->Assembly->AddPart( this->ZPlusFaceActor );
120   this->Assembly->AddPart( this->ZMinusFaceActor );
121 
122   prop = this->XPlusFaceActor->GetProperty();
123   prop->SetColor(1, 1, 1);
124   prop->SetDiffuse(0);
125   prop->SetAmbient(1);
126   prop->BackfaceCullingOn();
127   this->XMinusFaceActor->GetProperty()->DeepCopy( prop );
128   this->YPlusFaceActor-> GetProperty()->DeepCopy( prop );
129   this->YMinusFaceActor->GetProperty()->DeepCopy( prop );
130   this->ZPlusFaceActor-> GetProperty()->DeepCopy( prop );
131   this->ZMinusFaceActor->GetProperty()->DeepCopy( prop );
132 
133   this->AppendTextEdges = vtkAppendPolyData::New();
134   this->AppendTextEdges->UserManagedInputsOn();
135   this->AppendTextEdges->SetNumberOfInputs(6);
136 
137   for (int i = 0; i < 6; i++)
138   {
139     vtkPolyData *edges = vtkPolyData::New();
140     this->AppendTextEdges->SetInputDataByNumber(i,edges);
141     edges->Delete();
142   }
143 
144   this->ExtractTextEdges = vtkFeatureEdges::New();
145   this->ExtractTextEdges->BoundaryEdgesOn();
146   this->ExtractTextEdges->ColoringOff();
147   this->ExtractTextEdges->SetInputConnection( this->AppendTextEdges->GetOutputPort() );
148 
149   vtkPolyDataMapper* edgesMapper = vtkPolyDataMapper::New();
150   edgesMapper->SetInputConnection( this->ExtractTextEdges->GetOutputPort() );
151 
152   this->TextEdgesActor = vtkActor::New();
153   this->TextEdgesActor->SetMapper( edgesMapper );
154   edgesMapper->Delete();
155 
156   this->Assembly->AddPart( this->TextEdgesActor );
157 
158   prop = this->TextEdgesActor->GetProperty();
159   prop->SetRepresentationToWireframe();
160   prop->SetColor(1,0.5,0);
161   prop->SetDiffuse(0);
162   prop->SetAmbient(1);
163   prop->SetLineWidth(1);
164 
165   this->InternalTransformFilter = vtkTransformFilter::New();
166   this->InternalTransform = vtkTransform::New();
167   this->InternalTransformFilter->SetTransform( this->InternalTransform );
168 
169   this->XFaceTextRotation = 0.0;
170   this->YFaceTextRotation = 0.0;
171   this->ZFaceTextRotation = 0.0;
172 
173   this->UpdateProps();
174 }
175 
176 //-------------------------------------------------------------------------
~vtkAnnotatedCubeActor()177 vtkAnnotatedCubeActor::~vtkAnnotatedCubeActor()
178 {
179   this->CubeSource->Delete();
180   this->CubeActor->Delete();
181 
182   this->SetXPlusFaceText ( nullptr );
183   this->SetXMinusFaceText( nullptr );
184   this->SetYPlusFaceText ( nullptr );
185   this->SetYMinusFaceText( nullptr );
186   this->SetZPlusFaceText ( nullptr );
187   this->SetZMinusFaceText( nullptr );
188 
189   this->XPlusFaceVectorText->Delete();
190   this->XMinusFaceVectorText->Delete();
191   this->YPlusFaceVectorText->Delete();
192   this->YMinusFaceVectorText->Delete();
193   this->ZPlusFaceVectorText->Delete();
194   this->ZMinusFaceVectorText->Delete();
195 
196   this->XPlusFaceActor->Delete();
197   this->XMinusFaceActor->Delete();
198   this->YPlusFaceActor->Delete();
199   this->YMinusFaceActor->Delete();
200   this->ZPlusFaceActor->Delete();
201   this->ZMinusFaceActor->Delete();
202 
203   this->AppendTextEdges->Delete();
204   this->ExtractTextEdges->Delete();
205   this->TextEdgesActor->Delete();
206 
207   this->InternalTransformFilter->Delete();
208   this->InternalTransform->Delete();
209 
210   this->Assembly->Delete();
211 }
212 
213 //-------------------------------------------------------------------------
SetTextEdgesVisibility(int vis)214 void vtkAnnotatedCubeActor::SetTextEdgesVisibility(int vis)
215 {
216   this->TextEdgesActor->SetVisibility(vis);
217   this->Assembly->Modified();
218 }
219 
220 //-------------------------------------------------------------------------
SetCubeVisibility(int vis)221 void vtkAnnotatedCubeActor::SetCubeVisibility(int vis)
222 {
223   this->CubeActor->SetVisibility(vis);
224   this->Assembly->Modified();
225 }
226 
227 //-------------------------------------------------------------------------
SetFaceTextVisibility(int vis)228 void vtkAnnotatedCubeActor::SetFaceTextVisibility(int vis)
229 {
230   this->XPlusFaceActor->SetVisibility(vis);
231   this->XMinusFaceActor->SetVisibility(vis);
232   this->YPlusFaceActor->SetVisibility(vis);
233   this->YMinusFaceActor->SetVisibility(vis);
234   this->ZPlusFaceActor->SetVisibility(vis);
235   this->ZMinusFaceActor->SetVisibility(vis);
236   this->Assembly->Modified();
237 }
238 
239 //-------------------------------------------------------------------------
GetTextEdgesVisibility()240 int vtkAnnotatedCubeActor::GetTextEdgesVisibility()
241 {
242   return this->TextEdgesActor->GetVisibility();
243 }
244 
245 //-------------------------------------------------------------------------
GetCubeVisibility()246 int vtkAnnotatedCubeActor::GetCubeVisibility()
247 {
248   return this->CubeActor->GetVisibility();
249 }
250 
251 //-------------------------------------------------------------------------
GetFaceTextVisibility()252 int vtkAnnotatedCubeActor::GetFaceTextVisibility()
253 {
254  // either they are all visible or not, so one response will do
255   return this->XPlusFaceActor->GetVisibility();
256 }
257 
258 //-------------------------------------------------------------------------
259 // Shallow copy of a vtkAnnotatedCubeActor.
ShallowCopy(vtkProp * prop)260 void vtkAnnotatedCubeActor::ShallowCopy(vtkProp *prop)
261 {
262   vtkAnnotatedCubeActor *a = vtkAnnotatedCubeActor::SafeDownCast(prop);
263   if ( a != nullptr )
264   {
265     this->SetXPlusFaceText( a->GetXPlusFaceText() );
266     this->SetXMinusFaceText( a->GetXMinusFaceText() );
267     this->SetYPlusFaceText( a->GetYPlusFaceText() );
268     this->SetYMinusFaceText( a->GetYMinusFaceText() );
269     this->SetZPlusFaceText( a->GetZPlusFaceText() );
270     this->SetZMinusFaceText( a->GetZMinusFaceText() );
271     this->SetFaceTextScale( a->GetFaceTextScale() );
272   }
273 
274   // Now do superclass
275   this->vtkProp3D::ShallowCopy(prop);
276 }
277 
278 //-------------------------------------------------------------------------
GetActors(vtkPropCollection * ac)279 void vtkAnnotatedCubeActor::GetActors(vtkPropCollection *ac)
280 {
281   this->Assembly->GetActors( ac );
282 }
283 
284 //-------------------------------------------------------------------------
RenderOpaqueGeometry(vtkViewport * vp)285 int vtkAnnotatedCubeActor::RenderOpaqueGeometry(vtkViewport *vp)
286 {
287   this->UpdateProps();
288 
289   return this->Assembly->RenderOpaqueGeometry(vp);
290 }
291 
292 //-----------------------------------------------------------------------------
RenderTranslucentPolygonalGeometry(vtkViewport * vp)293 int vtkAnnotatedCubeActor::RenderTranslucentPolygonalGeometry(vtkViewport *vp)
294 {
295   this->UpdateProps();
296 
297   return this->Assembly->RenderTranslucentPolygonalGeometry( vp );
298 }
299 
300 //-----------------------------------------------------------------------------
301 // Description:
302 // Does this prop have some translucent polygonal geometry?
HasTranslucentPolygonalGeometry()303 vtkTypeBool vtkAnnotatedCubeActor::HasTranslucentPolygonalGeometry()
304 {
305   this->UpdateProps();
306 
307   return this->Assembly->HasTranslucentPolygonalGeometry();
308 }
309 
310 //-----------------------------------------------------------------------------
ReleaseGraphicsResources(vtkWindow * win)311 void vtkAnnotatedCubeActor::ReleaseGraphicsResources(vtkWindow *win)
312 {
313   this->Assembly->ReleaseGraphicsResources( win );
314 }
315 
316 //-------------------------------------------------------------------------
GetBounds(double bounds[6])317 void vtkAnnotatedCubeActor::GetBounds(double bounds[6])
318 {
319   this->Assembly->GetBounds( bounds );
320 }
321 
322 //-------------------------------------------------------------------------
323 // Get the bounds for this Actor as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
GetBounds()324 double *vtkAnnotatedCubeActor::GetBounds()
325 {
326   return this->Assembly->GetBounds( );
327 }
328 
329 //-------------------------------------------------------------------------
GetMTime()330 vtkMTimeType vtkAnnotatedCubeActor::GetMTime()
331 {
332   return this->Assembly->GetMTime();
333 }
334 
335 //-------------------------------------------------------------------------
GetXPlusFaceProperty()336 vtkProperty *vtkAnnotatedCubeActor::GetXPlusFaceProperty()
337 {
338   return this->XPlusFaceActor->GetProperty();
339 }
340 
341 //-------------------------------------------------------------------------
GetXMinusFaceProperty()342 vtkProperty *vtkAnnotatedCubeActor::GetXMinusFaceProperty()
343 {
344   return this->XMinusFaceActor->GetProperty();
345 }
346 
347 //-------------------------------------------------------------------------
GetYPlusFaceProperty()348 vtkProperty *vtkAnnotatedCubeActor::GetYPlusFaceProperty()
349 {
350   return this->YPlusFaceActor->GetProperty();
351 }
352 
353 //-------------------------------------------------------------------------
GetYMinusFaceProperty()354 vtkProperty *vtkAnnotatedCubeActor::GetYMinusFaceProperty()
355 {
356   return this->YMinusFaceActor->GetProperty();
357 }
358 
359 //-------------------------------------------------------------------------
GetZPlusFaceProperty()360 vtkProperty *vtkAnnotatedCubeActor::GetZPlusFaceProperty()
361 {
362   return this->ZPlusFaceActor->GetProperty();
363 }
364 
365 //-------------------------------------------------------------------------
GetZMinusFaceProperty()366 vtkProperty *vtkAnnotatedCubeActor::GetZMinusFaceProperty()
367 {
368   return this->ZMinusFaceActor->GetProperty();
369 }
370 
371 //-------------------------------------------------------------------------
GetCubeProperty()372 vtkProperty *vtkAnnotatedCubeActor::GetCubeProperty()
373 {
374   return this->CubeActor->GetProperty();
375 }
376 
377 //-------------------------------------------------------------------------
GetTextEdgesProperty()378 vtkProperty *vtkAnnotatedCubeActor::GetTextEdgesProperty()
379 {
380   return this->TextEdgesActor->GetProperty();
381 }
382 
383 //-------------------------------------------------------------------------
SetFaceTextScale(double scale)384 void vtkAnnotatedCubeActor::SetFaceTextScale(double scale)
385 {
386   if ( this->FaceTextScale == scale )
387   {
388     return;
389   }
390   this->FaceTextScale = scale;
391   this->UpdateProps();
392 }
393 
394 //-------------------------------------------------------------------------
UpdateProps()395 void vtkAnnotatedCubeActor::UpdateProps()
396 {
397   this->XPlusFaceVectorText-> SetText( this->XPlusFaceText );
398   this->XMinusFaceVectorText->SetText( this->XMinusFaceText );
399   this->YPlusFaceVectorText-> SetText( this->YPlusFaceText );
400   this->YMinusFaceVectorText->SetText( this->YMinusFaceText );
401   this->ZPlusFaceVectorText-> SetText( this->ZPlusFaceText );
402   this->ZMinusFaceVectorText->SetText( this->ZMinusFaceText );
403 
404   vtkProperty* prop = this->CubeActor->GetProperty();
405 
406   // Place the text slightly offset from the cube face to prevent
407   // rendering problems when the cube is in surface render mode.
408   double offset = (prop->GetRepresentation() == VTK_SURFACE)? (0.501) : (0.5);
409 
410   this->XPlusFaceVectorText->Update();
411   const double* bounds = this->XPlusFaceVectorText->GetOutput()->GetBounds();
412   double cu = -this->FaceTextScale*fabs(0.5*(bounds[0] + bounds[1]));
413   double cv = -this->FaceTextScale*fabs(0.5*(bounds[2] + bounds[3]));
414 
415   this->XPlusFaceActor->SetScale( this->FaceTextScale );
416   this->XPlusFaceActor->SetPosition( offset, cu, cv );
417   this->XPlusFaceActor->SetOrientation( 90 , 0, 90 );
418 
419   this->XMinusFaceVectorText->Update();
420   bounds = this->XMinusFaceVectorText->GetOutput()->GetBounds();
421   cu = this->FaceTextScale*fabs(0.5*(bounds[0] + bounds[1]));
422   cv = -this->FaceTextScale*fabs(0.5*(bounds[2] + bounds[3]));
423 
424   this->XMinusFaceActor->SetScale( this->FaceTextScale );
425   this->XMinusFaceActor->SetPosition( -offset, cu, cv );
426   this->XMinusFaceActor->SetOrientation( 90 , 0, -90 );
427 
428   if ( this->XFaceTextRotation != 0.0 )
429   {
430     vtkTransform* transform = vtkTransform::New();
431     transform->Identity();
432     transform->RotateX( this->XFaceTextRotation );
433     this->XPlusFaceActor->SetUserTransform( transform );
434     this->XMinusFaceActor->SetUserTransform( transform );
435     transform->Delete();
436   }
437 
438   this->YPlusFaceVectorText->Update();
439   bounds = this->YPlusFaceVectorText->GetOutput()->GetBounds();
440   cu = this->FaceTextScale*0.5*(bounds[0] + bounds[1]);
441   cv = -this->FaceTextScale*0.5*(bounds[2] + bounds[3]);
442 
443   this->YPlusFaceActor->SetScale( this->FaceTextScale );
444   this->YPlusFaceActor->SetPosition( cu, offset, cv );
445   this->YPlusFaceActor->SetOrientation( 90, 0, 180 );
446 
447   this->YMinusFaceVectorText->Update();
448   bounds = this->YMinusFaceVectorText->GetOutput()->GetBounds();
449   cu = -this->FaceTextScale*0.5*(bounds[0] + bounds[1]);
450   cv = -this->FaceTextScale*0.5*(bounds[2] + bounds[3]);
451 
452   this->YMinusFaceActor->SetScale( this->FaceTextScale );
453   this->YMinusFaceActor->SetPosition( cu, -offset, cv );
454   this->YMinusFaceActor->SetOrientation( 90, 0, 0 );
455 
456   if ( this->YFaceTextRotation != 0.0 )
457   {
458     vtkTransform* transform = vtkTransform::New();
459     transform->Identity();
460     transform->RotateY( this->YFaceTextRotation );
461     this->YPlusFaceActor->SetUserTransform( transform );
462     this->YMinusFaceActor->SetUserTransform( transform );
463     transform->Delete();
464   }
465 
466   this->ZPlusFaceVectorText->Update();
467   bounds = this->ZPlusFaceVectorText->GetOutput()->GetBounds();
468   cu = this->FaceTextScale*0.5*(bounds[0] + bounds[1]);
469   cv = -this->FaceTextScale*0.5*(bounds[2] + bounds[3]);
470 
471   this->ZPlusFaceActor->SetScale( this->FaceTextScale );
472   this->ZPlusFaceActor->SetPosition( cv, cu, offset );
473   this->ZPlusFaceActor->SetOrientation( 0, 0, -90 );
474 
475   this->ZMinusFaceVectorText->Update();
476   bounds = this->ZMinusFaceVectorText->GetOutput()->GetBounds();
477   cu = -this->FaceTextScale*0.5*(bounds[0] + bounds[1]);
478   cv = -this->FaceTextScale*0.5*(bounds[2] + bounds[3]);
479 
480   this->ZMinusFaceActor->SetScale( this->FaceTextScale );
481   this->ZMinusFaceActor->SetPosition( cv, cu, -offset );
482   this->ZMinusFaceActor->SetOrientation( 180, 0, 90 );
483 
484   if ( this->ZFaceTextRotation != 0.0 )
485   {
486     vtkTransform* transform = vtkTransform::New();
487     transform->Identity();
488     transform->RotateZ( this->ZFaceTextRotation );
489     this->ZPlusFaceActor->SetUserTransform( transform );
490     this->ZMinusFaceActor->SetUserTransform( transform );
491     transform->Delete();
492   }
493 
494   this->XPlusFaceActor->ComputeMatrix();
495   this->InternalTransformFilter->SetInputConnection( this->XPlusFaceVectorText->GetOutputPort() );
496   this->InternalTransform->SetMatrix( this->XPlusFaceActor->GetMatrix() );
497   this->InternalTransformFilter->Update();
498   vtkPolyData* edges = this->AppendTextEdges->GetInput( 0 );
499   edges->CopyStructure( this->InternalTransformFilter->GetOutput() );
500 
501   this->XMinusFaceActor->ComputeMatrix();
502   this->InternalTransformFilter->SetInputConnection( this->XMinusFaceVectorText->GetOutputPort() );
503   this->InternalTransform->SetMatrix( this->XMinusFaceActor->GetMatrix() );
504   this->InternalTransformFilter->Update();
505   edges = this->AppendTextEdges->GetInput( 1 );
506   edges->CopyStructure( this->InternalTransformFilter->GetOutput() );
507 
508   this->YPlusFaceActor->ComputeMatrix();
509   this->InternalTransformFilter->SetInputConnection( this->YPlusFaceVectorText->GetOutputPort() );
510   this->InternalTransform->SetMatrix( this->YPlusFaceActor->GetMatrix() );
511   this->InternalTransformFilter->Update();
512   edges = this->AppendTextEdges->GetInput( 2 );
513   edges->CopyStructure( this->InternalTransformFilter->GetOutput() );
514 
515   this->YMinusFaceActor->ComputeMatrix();
516   this->InternalTransformFilter->SetInputConnection( this->YMinusFaceVectorText->GetOutputPort() );
517   this->InternalTransform->SetMatrix( this->YMinusFaceActor->GetMatrix() );
518   this->InternalTransformFilter->Update();
519   edges = this->AppendTextEdges->GetInput( 3 );
520   edges->CopyStructure( this->InternalTransformFilter->GetOutput() );
521 
522   this->ZPlusFaceActor->ComputeMatrix();
523   this->InternalTransformFilter->SetInputConnection( this->ZPlusFaceVectorText->GetOutputPort() );
524   this->InternalTransform->SetMatrix( this->ZPlusFaceActor->GetMatrix() );
525   this->InternalTransformFilter->Update();
526   edges = this->AppendTextEdges->GetInput( 4 );
527   edges->CopyStructure(this->InternalTransformFilter->GetOutput());
528 
529   this->ZMinusFaceActor->ComputeMatrix();
530   this->InternalTransformFilter->SetInputConnection( this->ZMinusFaceVectorText->GetOutputPort() );
531   this->InternalTransform->SetMatrix( this->ZMinusFaceActor->GetMatrix() );
532   this->InternalTransformFilter->Update();
533   edges = this->AppendTextEdges->GetInput( 5 );
534   edges->CopyStructure( this->InternalTransformFilter->GetOutput() );
535 }
536 
537 //-------------------------------------------------------------------------
PrintSelf(ostream & os,vtkIndent indent)538 void vtkAnnotatedCubeActor::PrintSelf(ostream& os, vtkIndent indent)
539 {
540   this->Superclass::PrintSelf(os,indent);
541 
542   os << indent << "XPlusFaceText: " << (this->XPlusFaceText ?
543                                          this->XPlusFaceText : "(none)")
544      << endl;
545 
546   os << indent << "XMinusFaceText: " << (this->XMinusFaceText ?
547                                          this->XMinusFaceText : "(none)")
548      << endl;
549 
550   os << indent << "YPlusFaceText: " << (this->YPlusFaceText ?
551                                          this->YPlusFaceText : "(none)")
552      << endl;
553 
554   os << indent << "YMinusFaceText: " << (this->YMinusFaceText ?
555                                          this->YMinusFaceText : "(none)")
556      << endl;
557 
558   os << indent << "ZPlusFaceText: " << (this->ZPlusFaceText ?
559                                          this->ZPlusFaceText : "(none)")
560      << endl;
561 
562   os << indent << "ZMinusFaceText: " << (this->ZMinusFaceText ?
563                                          this->ZMinusFaceText : "(none)")
564      << endl;
565 
566   os << indent << "FaceTextScale: " << this->FaceTextScale << endl;
567 
568   os << indent << "XFaceTextRotation: " << this->XFaceTextRotation << endl;
569 
570   os << indent << "YFaceTextRotation: " << this->YFaceTextRotation << endl;
571 
572   os << indent << "ZFaceTextRotation: " << this->ZFaceTextRotation << endl;
573 }
574 
575