1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SALOME OBJECT : kernel of SALOME component
23 // File : SVTK_CubeAxesActor2D.cxx
24 // Author : Eugeny Nikolaev
28 #include "SVTK_CubeAxesActor2D.h"
29 #include "VTKViewer_Transform.h"
31 #include <vtkPolyDataMapper.h>
32 #include <vtkRectilinearGridGeometryFilter.h>
34 #include <vtkCubeAxesActor2D.h>
35 #include <vtkAxisActor2D.h>
36 #include <vtkCamera.h>
37 #include <vtkDataSet.h>
39 #include <vtkObjectFactory.h>
40 #include <vtkTextProperty.h>
41 #include <vtkViewport.h>
42 #include <vtkFloatArray.h>
43 #include <vtkRectilinearGrid.h>
44 #include <vtkProperty.h>
45 #include <vtkProperty2D.h>
47 vtkCxxRevisionMacro(SVTK_CubeAxesActor2D, "$Revision$");
48 vtkStandardNewMacro(SVTK_CubeAxesActor2D);
50 // Instantiate this object.
51 SVTK_CubeAxesActor2D::SVTK_CubeAxesActor2D()
53 this->wireActorXY = vtkActor::New();
54 this->wireActorYZ = vtkActor::New();
55 this->wireActorXZ = vtkActor::New();
57 this->planeXY = vtkRectilinearGridGeometryFilter::New();
58 this->planeYZ = vtkRectilinearGridGeometryFilter::New();
59 this->planeXZ = vtkRectilinearGridGeometryFilter::New();
61 this->rgridMapperXY = vtkPolyDataMapper::New();
62 this->rgridMapperYZ = vtkPolyDataMapper::New();
63 this->rgridMapperXZ = vtkPolyDataMapper::New();
65 this->rgridMapperXY->SetInput(this->planeXY->GetOutput());
66 this->rgridMapperYZ->SetInput(this->planeYZ->GetOutput());
67 this->rgridMapperXZ->SetInput(this->planeXZ->GetOutput());
69 this->wireActorXY->SetMapper(rgridMapperXY);
70 this->wireActorYZ->SetMapper(rgridMapperYZ);
71 this->wireActorXZ->SetMapper(rgridMapperXZ);
73 this->wireActorXY->GetProperty()->SetRepresentationToWireframe();
74 this->wireActorYZ->GetProperty()->SetRepresentationToWireframe();
75 this->wireActorXZ->GetProperty()->SetRepresentationToWireframe();
77 // setting ambient to 1 (if no - incorrect reaction on light)
78 this->wireActorXY->GetProperty()->SetAmbient(1);
79 this->wireActorYZ->GetProperty()->SetAmbient(1);
80 this->wireActorXZ->GetProperty()->SetAmbient(1);
82 this->XAxis->SetTitle(this->XLabel);
83 this->YAxis->SetTitle(this->YLabel);
84 this->ZAxis->SetTitle(this->ZLabel);
86 this->XAxis->SetNumberOfLabels(this->NumberOfLabels);
87 this->YAxis->SetNumberOfLabels(this->NumberOfLabels);
88 this->ZAxis->SetNumberOfLabels(this->NumberOfLabels);
90 this->XAxis->SetLabelFormat(this->LabelFormat);
91 this->YAxis->SetLabelFormat(this->LabelFormat);
92 this->ZAxis->SetLabelFormat(this->LabelFormat);
94 this->XAxis->SetFontFactor(this->FontFactor);
95 this->YAxis->SetFontFactor(this->FontFactor);
96 this->ZAxis->SetFontFactor(this->FontFactor);
98 this->XAxis->SetProperty(this->GetProperty());
99 this->YAxis->SetProperty(this->GetProperty());
100 this->ZAxis->SetProperty(this->GetProperty());
102 vtkTextProperty* aTLProp = vtkTextProperty::New();
104 aTLProp->SetItalic(0);
105 aTLProp->SetShadow(0);
106 aTLProp->SetFontFamilyToArial();
107 aTLProp->SetColor(1,0,0);
108 if (this->XAxis->GetLabelTextProperty())
109 this->XAxis->GetLabelTextProperty()->ShallowCopy(aTLProp);
110 aTLProp->SetColor(0,1,0);
111 if (this->YAxis->GetLabelTextProperty())
112 this->YAxis->GetLabelTextProperty()->ShallowCopy(aTLProp);
113 aTLProp->SetColor(0,0,1);
114 if (this->ZAxis->GetLabelTextProperty())
115 this->ZAxis->GetLabelTextProperty()->ShallowCopy(aTLProp);;
117 aTLProp->SetColor(1,0,0);
118 if (this->XAxis->GetLabelTextProperty())
119 this->XAxis->GetTitleTextProperty()->ShallowCopy(aTLProp);
120 aTLProp->SetColor(0,1,0);
121 if (this->YAxis->GetLabelTextProperty())
122 this->YAxis->GetTitleTextProperty()->ShallowCopy(aTLProp);
123 aTLProp->SetColor(0,0,1);
124 if (this->ZAxis->GetLabelTextProperty())
125 this->ZAxis->GetTitleTextProperty()->ShallowCopy(aTLProp);
131 SVTK_CubeAxesActor2D::~SVTK_CubeAxesActor2D()
133 this->wireActorXY->Delete();
134 this->wireActorYZ->Delete();
135 this->wireActorXZ->Delete();
137 this->planeXY->Delete();
138 this->planeYZ->Delete();
139 this->planeXZ->Delete();
141 this->rgridMapperXY->Delete();
142 this->rgridMapperYZ->Delete();
143 this->rgridMapperXZ->Delete();
146 // Static variable describes connections in cube.
147 static int Conn[8][3] = {{1,2,4}, {0,3,5}, {3,0,6}, {2,1,7},
148 {5,6,0}, {4,7,1}, {7,4,2}, {6,5,3}};
150 // Project the bounding box and compute edges on the border of the bounding
151 // cube. Determine which parts of the edges are visible via intersection
152 // with the boundary of the viewport (minus borders).
153 int SVTK_CubeAxesActor2D::RenderOverlay(vtkViewport *viewport)
155 int renderedSomething=0;
158 if ( ! this->RenderSomething )
164 if ( this->XAxisVisibility )
166 renderedSomething += this->XAxis->RenderOverlay(viewport);
168 if ( this->YAxisVisibility )
170 renderedSomething += this->YAxis->RenderOverlay(viewport);
172 if ( this->ZAxisVisibility )
174 renderedSomething += this->ZAxis->RenderOverlay(viewport);
177 bool RX=false,RY=false;
178 if (this->XAxisVisibility){
179 this->wireActorXY->RenderOverlay(viewport);
180 this->wireActorXZ->RenderOverlay(viewport);
183 if (this->YAxisVisibility){
184 if(!RX) this->wireActorXY->RenderOverlay(viewport);
185 this->wireActorYZ->RenderOverlay(viewport);
188 if (this->ZAxisVisibility){
189 if(!RX) this->wireActorXZ->RenderOverlay(viewport);
190 if(!RY) this->wireActorYZ->RenderOverlay(viewport);
193 return renderedSomething;
196 static void ChangeValues(vtkFloatingPointType* aArray1,
197 vtkFloatingPointType* aArray2,
198 vtkFloatingPointType *aRange1,
199 vtkFloatingPointType* aRange2,
202 vtkFloatingPointType tmp=-1000;
204 for (int i=0; i<4; i++){
205 tmp = aArray1[i]; aArray1[i] = aArray2[i]; aArray2[i] = tmp;
207 for(int i=0;i<2; i++){
208 tmp = aRange1[i]; aRange1[i] = aRange2[i]; aRange2[i] = tmp;
212 tmp = aArray1[2]; aArray1[2] = aArray2[0]; aArray2[0] = tmp;
213 tmp = aArray1[3]; aArray1[3] = aArray2[1]; aArray2[1] = tmp;
214 tmp = aArray1[0]; aArray1[0] = aArray2[2]; aArray2[2] = tmp;
215 tmp = aArray1[1]; aArray1[1] = aArray2[3]; aArray2[3] = tmp;
217 tmp = aRange1[0]; aRange1[0] = aRange2[1]; aRange2[1] = tmp;
218 tmp = aRange1[1]; aRange1[1] = aRange2[0]; aRange2[0] = tmp;
222 static void ChangeArrays(vtkFloatingPointType* xCoords,
223 vtkFloatingPointType* yCoords,
224 vtkFloatingPointType* zCoords,
225 vtkFloatingPointType* xRange,
226 vtkFloatingPointType* yRange,
227 vtkFloatingPointType* zRange,
232 if ( xAxes == 0 && yAxes == 2 && zAxes == 1)
233 ChangeValues(yCoords,zCoords,yRange,zRange,true);
234 else if (xAxes == 1 && yAxes == 0 && zAxes == 2)
235 ChangeValues(xCoords,yCoords,xRange,yRange,true);
236 else if (xAxes == 1 && yAxes == 2 && zAxes == 0){
237 ChangeValues(xCoords,zCoords,xRange,zRange,false);
238 // xAxes == 0 && yAxes == 2 && zAxes == 1
239 ChangeValues(yCoords,zCoords,yRange,zRange,true);
240 } else if (xAxes == 2 && yAxes == 0 && zAxes == 1){
241 ChangeValues(xCoords,yCoords,xRange,yRange,true);
242 // xAxes == 0 && yAxes == 2 && zAxes == 1
243 ChangeValues(zCoords,yCoords,zRange,yRange,true);
244 } else if (xAxes == 2 && yAxes == 1 && zAxes == 0)
245 ChangeValues(zCoords,xCoords,zRange,xRange,false);
248 // Project the bounding box and compute edges on the border of the bounding
249 // cube. Determine which parts of the edges are visible via intersection
250 // with the boundary of the viewport (minus borders).
251 int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport)
253 vtkFloatingPointType bounds[6], slope = 0.0, minSlope, num, den;
254 vtkFloatingPointType pts[8][3], d2, d2Min, min;
256 int xIdx, yIdx = 0, zIdx = 0, zIdx2, renderedSomething=0;
257 int xAxes = 0, yAxes, zAxes;
262 vtkErrorMacro(<<"No camera!");
263 this->RenderSomething = 0;
267 this->RenderSomething = 1;
269 // determine the bounds to use
270 this->GetBounds(bounds);
272 // Build the axes (almost always needed so we don't check mtime)
273 // Transform all points into display coordinates
274 this->TransformBounds(viewport, bounds, pts);
276 // Find the portion of the bounding box that fits within the viewport,
277 if ( this->ClipBounds(viewport, pts, bounds) == 0 )
279 this->RenderSomething = 0;
283 // Take into account the inertia. Process only so often.
284 if ( this->RenderCount++ == 0 || !(this->RenderCount % this->Inertia) )
286 // Okay, we have a bounding box, maybe clipped and scaled, that is visible.
287 // We setup the axes depending on the fly mode.
288 if ( this->FlyMode == VTK_FLY_CLOSEST_TRIAD )
290 // Loop over points and find the closest point to the camera
291 min = VTK_LARGE_FLOAT;
292 for (i=0; i < 8; i++)
294 if ( pts[i][2] < min )
301 // Setup the three axes to be drawn
308 zIdx2 = Conn[idx][2];
312 vtkFloatingPointType e1[2], e2[2], e3[2];
314 // Find distance to origin
315 d2Min = VTK_LARGE_FLOAT;
316 for (i=0; i < 8; i++)
318 d2 = pts[i][0]*pts[i][0] + pts[i][1]*pts[i][1];
326 // find minimum slope point connected to closest point and on
327 // right side (in projected coordinates). This is the first edge.
328 minSlope = VTK_LARGE_FLOAT;
329 for (xIdx=0, i=0; i<3; i++)
331 num = (pts[Conn[idx][i]][1] - pts[idx][1]);
332 den = (pts[Conn[idx][i]][0] - pts[idx][0]);
337 if ( slope < minSlope && den > 0 )
340 yIdx = Conn[idx][(i+1)%3];
341 zIdx = Conn[idx][(i+2)%3];
347 // find edge (connected to closest point) on opposite side
350 e1[i] = (pts[xIdx][i] - pts[idx][i]);
351 e2[i] = (pts[yIdx][i] - pts[idx][i]);
352 e3[i] = (pts[zIdx][i] - pts[idx][i]);
354 vtkMath::Normalize2D(e1);
355 vtkMath::Normalize2D(e2);
356 vtkMath::Normalize2D(e3);
358 if ( vtkMath::Dot2D(e1,e2) < vtkMath::Dot2D(e1,e3) )
360 yAxes = (xAxes + 1) % 3;
365 yAxes = (xAxes + 2) % 3;
368 // Find the final point by determining which global x-y-z axes have not
369 // been represented, and then determine the point closest to the viewer.
370 zAxes = (xAxes != 0 && yAxes != 0 ? 0 :
371 (xAxes != 1 && yAxes != 1 ? 1 : 2));
372 if ( pts[Conn[xIdx][zAxes]][2] < pts[Conn[yIdx][zAxes]][2] )
375 zIdx2 = Conn[xIdx][zAxes];
380 zIdx2 = Conn[yIdx][zAxes];
382 }//else boundary edges fly mode
383 this->InertiaAxes[0] = idx;
384 this->InertiaAxes[1] = xIdx;
385 this->InertiaAxes[2] = yIdx;
386 this->InertiaAxes[3] = zIdx;
387 this->InertiaAxes[4] = zIdx2;
388 this->InertiaAxes[5] = xAxes;
389 this->InertiaAxes[6] = yAxes;
390 this->InertiaAxes[7] = zAxes;
394 idx = this->InertiaAxes[0];
395 xIdx = this->InertiaAxes[1];
396 yIdx = this->InertiaAxes[2];
397 zIdx = this->InertiaAxes[3];
398 zIdx2 = this->InertiaAxes[4];
399 xAxes = this->InertiaAxes[5];
400 yAxes = this->InertiaAxes[6];
401 zAxes = this->InertiaAxes[7];
404 // Setup the axes for plotting
405 vtkFloatingPointType xCoords[4], yCoords[4], zCoords[4], xRange[2], yRange[2], zRange[2];
406 this->AdjustAxes(pts, bounds, idx, xIdx, yIdx, zIdx, zIdx2,
408 xCoords, yCoords, zCoords, xRange, yRange, zRange);
411 this->Labels[0] = this->XLabel;
412 this->Labels[1] = this->YLabel;
413 this->Labels[2] = this->ZLabel;
415 // correct XAxis, YAxis, ZAxis, which must be
416 // parallel OX, OY, OZ system coordinates
417 // if xAxes=0 yAxes=1 zAxes=2 - good situation
418 if (!(xAxes == 0 && yAxes == 1 && zAxes == 2))
419 ChangeArrays(xCoords,yCoords,zCoords,
420 xRange,yRange,zRange,
424 if(m_Transform.GetPointer() != NULL)
425 m_Transform->GetMatrixScale(aTScale);
427 this->XAxis->GetPositionCoordinate()->SetValue(xCoords[0], xCoords[1]);
428 this->XAxis->GetPosition2Coordinate()->SetValue(xCoords[2], xCoords[3]);
429 if(m_Transform.GetPointer() != NULL) this->XAxis->SetRange(xRange[0]/aTScale[0], xRange[1]/aTScale[0]);
430 else this->XAxis->SetRange(xRange[0], xRange[1]);
432 this->YAxis->GetPositionCoordinate()->SetValue(yCoords[2], yCoords[3]);
433 this->YAxis->GetPosition2Coordinate()->SetValue(yCoords[0], yCoords[1]);
434 if(m_Transform.GetPointer() != NULL) this->YAxis->SetRange(yRange[1]/aTScale[1], yRange[0]/aTScale[1]);
435 else this->YAxis->SetRange(yRange[1], yRange[0]);
437 this->ZAxis->GetPositionCoordinate()->SetValue(zCoords[0], zCoords[1]);
438 this->ZAxis->GetPosition2Coordinate()->SetValue(zCoords[2], zCoords[3]);
439 if(m_Transform.GetPointer() != NULL) this->ZAxis->SetRange(zRange[0]/aTScale[2], zRange[1]/aTScale[2]);
440 else this->ZAxis->SetRange(zRange[0], zRange[1]);
442 int numOfLabelsX = this->XAxis->GetNumberOfLabels();
443 int numOfLabelsY = this->YAxis->GetNumberOfLabels();
444 int numOfLabelsZ = this->ZAxis->GetNumberOfLabels();
446 // XCoords coordinates for X grid
447 vtkFloatArray *XCoords = vtkFloatArray::New();
448 for(int i=0;i<numOfLabelsX;i++){
449 vtkFloatingPointType val = bounds[0]+i*(bounds[1]-bounds[0])/(numOfLabelsX-1);
450 XCoords->InsertNextValue(val);
452 // YCoords coordinates for Y grid
453 vtkFloatArray *YCoords = vtkFloatArray::New();
454 for(int i=0;i<numOfLabelsX;i++){
455 vtkFloatingPointType val = bounds[2]+i*(bounds[3]-bounds[2])/(numOfLabelsY-1);
456 YCoords->InsertNextValue(val);
458 // ZCoords coordinates for Z grid
459 vtkFloatArray *ZCoords = vtkFloatArray::New();
460 for(int i=0;i<numOfLabelsZ;i++){
461 vtkFloatingPointType val = bounds[4]+i*(bounds[5]-bounds[4])/(numOfLabelsZ-1);
462 ZCoords->InsertNextValue(val);
465 vtkRectilinearGrid *rgrid = vtkRectilinearGrid::New();
466 rgrid->SetDimensions(numOfLabelsX,numOfLabelsY,numOfLabelsZ);
467 rgrid->SetXCoordinates(XCoords);
468 rgrid->SetYCoordinates(YCoords);
469 rgrid->SetZCoordinates(ZCoords);
471 this->planeXY->SetInput(rgrid);
472 this->planeYZ->SetInput(rgrid);
473 this->planeXZ->SetInput(rgrid);
477 vtkFloatingPointType aCPosition[3];
478 vtkFloatingPointType aCDirection[3];
479 this->Camera->GetPosition(aCPosition);
480 this->Camera->GetDirectionOfProjection(aCDirection);
482 // culculate placement of XY
483 bool replaceXY=false;
484 bool replaceYZ=false;
485 bool replaceXZ=false;
486 vtkFloatingPointType p[6][3]; // centers of planes
487 vtkFloatingPointType vecs[6][3]; // 6 vectors from camera position to centers
489 vtkFloatingPointType aMiddleX = (XCoords->GetValue(0) + XCoords->GetValue(numOfLabelsX-1))/2;
490 vtkFloatingPointType aMiddleY = (YCoords->GetValue(0) + YCoords->GetValue(numOfLabelsY-1))/2;
491 vtkFloatingPointType aMiddleZ = (ZCoords->GetValue(0) + ZCoords->GetValue(numOfLabelsZ-1))/2;
494 p[0][0] = aMiddleX; // plane X=0.5 Y=0.5 Z=0
496 p[0][2] = ZCoords->GetValue(0);
498 p[1][0] = aMiddleX; // plane X=0.5 Y=0.5 Z=1
500 p[1][2] = ZCoords->GetValue(numOfLabelsZ-1);
503 p[2][0] = XCoords->GetValue(0); // plane X=0 Y=0.5 Z=0.5
507 p[3][0] = XCoords->GetValue(numOfLabelsX-1);
512 p[4][0] = aMiddleX; // plane X=0.5 Y=0 Z=0.5
513 p[4][1] = YCoords->GetValue(0);
516 p[5][0] = aMiddleX; // plane X=0.5 Y=1 Z=0.5
517 p[5][1] = YCoords->GetValue(numOfLabelsY-1);
521 for(int j=0;j<6;j++) vecs[j][i] = p[j][i] - aCPosition[i];
523 if ( vtkMath::Dot(vecs[0],aCDirection) < vtkMath::Dot(vecs[1],aCDirection))
525 if ( vtkMath::Dot(vecs[2],aCDirection) < vtkMath::Dot(vecs[3],aCDirection))
527 if ( vtkMath::Dot(vecs[4],aCDirection) < vtkMath::Dot(vecs[5],aCDirection))
530 if(replaceXY) this->planeXY->SetExtent(0,numOfLabelsX, 0,numOfLabelsY, numOfLabelsZ,numOfLabelsZ);
531 else this->planeXY->SetExtent(0,numOfLabelsX, 0,numOfLabelsY, 0,0);
533 if(replaceYZ) this->planeYZ->SetExtent(numOfLabelsX,numOfLabelsX, 0,numOfLabelsY, 0,numOfLabelsZ);
534 else this->planeYZ->SetExtent(0,0, 0,numOfLabelsY, 0,numOfLabelsZ);
536 if(replaceXZ) this->planeXZ->SetExtent(0,numOfLabelsX, numOfLabelsY,numOfLabelsY, 0,numOfLabelsZ);
537 else this->planeXZ->SetExtent(0,numOfLabelsX, 0,0, 0,numOfLabelsZ);
543 vtkFloatingPointType color[3];
545 this->GetProperty()->GetColor(color);
546 this->wireActorXY->GetProperty()->SetColor(color);
547 this->wireActorYZ->GetProperty()->SetColor(color);
548 this->wireActorXZ->GetProperty()->SetColor(color);
552 // Perform shallow copy here since each individual axis can be
553 // accessed through the class API (i.e. each individual axis text prop
554 // can be changed). Therefore, we can not just assign pointers otherwise
555 // each individual axis text prop would point to the same text prop.
557 if (this->AxisLabelTextProperty &&
558 this->AxisLabelTextProperty->GetMTime() > this->BuildTime)
560 if (this->XAxis->GetLabelTextProperty())
562 this->XAxis->GetLabelTextProperty()->ShallowCopy(
563 this->AxisLabelTextProperty);
565 if (this->YAxis->GetLabelTextProperty())
567 this->YAxis->GetLabelTextProperty()->ShallowCopy(
568 this->AxisLabelTextProperty);
570 if (this->ZAxis->GetLabelTextProperty())
572 this->ZAxis->GetLabelTextProperty()->ShallowCopy(
573 this->AxisLabelTextProperty);
577 if (this->AxisTitleTextProperty &&
578 this->AxisTitleTextProperty->GetMTime() > this->BuildTime)
580 if (this->XAxis->GetLabelTextProperty())
582 this->XAxis->GetTitleTextProperty()->ShallowCopy(
583 this->AxisTitleTextProperty);
585 if (this->YAxis->GetLabelTextProperty())
587 this->YAxis->GetTitleTextProperty()->ShallowCopy(
588 this->AxisTitleTextProperty);
590 if (this->ZAxis->GetLabelTextProperty())
592 this->ZAxis->GetTitleTextProperty()->ShallowCopy(
593 this->AxisTitleTextProperty);
597 this->BuildTime.Modified();
600 if ( this->XAxisVisibility )
602 renderedSomething += this->XAxis->RenderOpaqueGeometry(viewport);
604 if ( this->YAxisVisibility )
606 renderedSomething += this->YAxis->RenderOpaqueGeometry(viewport);
608 if ( this->ZAxisVisibility )
610 renderedSomething += this->ZAxis->RenderOpaqueGeometry(viewport);
613 bool RX=false,RY=false;
614 if (this->XAxisVisibility){
615 this->wireActorXY->RenderOpaqueGeometry(viewport);
616 this->wireActorXZ->RenderOpaqueGeometry(viewport);
619 if (this->YAxisVisibility){
620 if(!RX) this->wireActorXY->RenderOpaqueGeometry(viewport);
621 this->wireActorYZ->RenderOpaqueGeometry(viewport);
624 if (this->ZAxisVisibility){
625 if(!RX) this->wireActorXZ->RenderOpaqueGeometry(viewport);
626 if(!RY) this->wireActorYZ->RenderOpaqueGeometry(viewport);
629 return renderedSomething;
632 // Release any graphics resources that are being consumed by this actor.
633 // The parameter window could be used to determine which graphic
634 // resources to release.
635 void SVTK_CubeAxesActor2D::ReleaseGraphicsResources(vtkWindow *win)
637 this->XAxis->ReleaseGraphicsResources(win);
638 this->YAxis->ReleaseGraphicsResources(win);
639 this->ZAxis->ReleaseGraphicsResources(win);
641 this->wireActorXY->ReleaseGraphicsResources(win);
642 this->wireActorYZ->ReleaseGraphicsResources(win);
643 this->wireActorXZ->ReleaseGraphicsResources(win);
646 void SVTK_CubeAxesActor2D::SetTransform(VTKViewer_Transform* theTransform){
647 this->m_Transform = theTransform;
650 VTKViewer_Transform* SVTK_CubeAxesActor2D::GetTransform(){
651 return (this->m_Transform.GetPointer());