// $Header$
#include "SALOME_CubeAxesActor2D.h"
+#include "SALOME_Transform.h"
#include <vtkPolyDataMapper.h>
#include <vtkRectilinearGridGeometryFilter.h>
xAxes,yAxes,zAxes);
+ double aTScale[3];
+ if(m_Transform.GetPointer() != NULL)
+ m_Transform->GetScale(aTScale);
+
this->XAxis->GetPositionCoordinate()->SetValue(xCoords[0], xCoords[1]);
this->XAxis->GetPosition2Coordinate()->SetValue(xCoords[2], xCoords[3]);
- this->XAxis->SetRange(xRange[0], xRange[1]);
+ if(m_Transform.GetPointer() != NULL) this->XAxis->SetRange(xRange[0]/aTScale[0], xRange[1]/aTScale[0]);
+ else this->XAxis->SetRange(xRange[0], xRange[1]);
this->YAxis->GetPositionCoordinate()->SetValue(yCoords[2], yCoords[3]);
this->YAxis->GetPosition2Coordinate()->SetValue(yCoords[0], yCoords[1]);
- this->YAxis->SetRange(yRange[1], yRange[0]);
+ if(m_Transform.GetPointer() != NULL) this->YAxis->SetRange(yRange[1]/aTScale[1], yRange[0]/aTScale[1]);
+ else this->YAxis->SetRange(yRange[1], yRange[0]);
this->ZAxis->GetPositionCoordinate()->SetValue(zCoords[0], zCoords[1]);
this->ZAxis->GetPosition2Coordinate()->SetValue(zCoords[2], zCoords[3]);
- this->ZAxis->SetRange(zRange[0], zRange[1]);
+ if(m_Transform.GetPointer() != NULL) this->ZAxis->SetRange(zRange[0]/aTScale[2], zRange[1]/aTScale[2]);
+ else this->ZAxis->SetRange(zRange[0], zRange[1]);
int numOfLabelsX = this->XAxis->GetNumberOfLabels();
int numOfLabelsY = this->YAxis->GetNumberOfLabels();
this->wireActorXZ->ReleaseGraphicsResources(win);
}
+
+void SALOME_CubeAxesActor2D::SetTransform(SALOME_Transform* theTransform){
+ this->m_Transform = theTransform;
+}
+
+SALOME_Transform* SALOME_CubeAxesActor2D::GetTransform(){
+ return (this->m_Transform.GetPointer());
+}
#ifndef __SALOME_CubeAxesActor2D_h
#define __SALOME_CubeAxesActor2D_h
-#include "vtkCubeAxesActor2D.h"
+#include <vtkCubeAxesActor2D.h>
+#include <vtkSmartPointer.h>
class vtkActor;
class vtkAxisActor2D;
class vtkTextProperty;
class vtkPolyDataMapper;
class vtkRectilinearGridGeometryFilter;
+class SALOME_Transform;
class VTK_HYBRID_EXPORT SALOME_CubeAxesActor2D : public vtkCubeAxesActor2D
{
vtkActor* GetWireActorXY(){return this->wireActorXY;}
vtkActor* GetWireActorYZ(){return this->wireActorYZ;}
vtkActor* GetWireActorXZ(){return this->wireActorXZ;}
+
+ void SetTransform(SALOME_Transform* theTransform);
+ SALOME_Transform* GetTransform();
protected:
SALOME_CubeAxesActor2D();
vtkRectilinearGridGeometryFilter *planeXZ; // rectilinear grid XZ
vtkPolyDataMapper *rgridMapperXZ;
+ vtkSmartPointer<SALOME_Transform> m_Transform;
private:
SALOME_CubeAxesActor2D(const SALOME_CubeAxesActor2D&); // Not implemented.
void operator=(const SALOME_CubeAxesActor2D&); // Not implemented.
m_CubeAxes->SetScaling(0);
m_CubeAxes->SetNumberOfLabels(5);
m_CubeAxes->VisibilityOff();
+ m_CubeAxes->SetTransform(m_Transform);
tprop->Delete();
setCentralWidget( m_RW );
if ( !aSetting.isEmpty() )
aSizeInPercents = aSetting.toFloat();
bool isComputeTrihedronSize = ::ComputeTrihedronSize(m_Renderer, aNewSize, anOldSize, aSizeInPercents);
- if(aTDisplayed) m_Triedron->VisibilityOn();
- if(aCDisplayed) m_CubeAxes->VisibilityOn();
m_Triedron->SetSize( aNewSize );
// itearte throuh displayed objects and set size if necessary
}
}
}
+ if(aTDisplayed) m_Triedron->VisibilityOn();
+ if(aCDisplayed) m_CubeAxes->VisibilityOn();
+
+ } else {
+ double aSize = m_Triedron->GetSize();
+ newbnd[0] = newbnd[2] = newbnd[4] = 0;
+ newbnd[1] = newbnd[3] = newbnd[5] = aSize;
}
+
if( newbnd[0]<VTK_LARGE_FLOAT && newbnd[2]<VTK_LARGE_FLOAT && newbnd[4]<VTK_LARGE_FLOAT &&
newbnd[1]>-VTK_LARGE_FLOAT && newbnd[3]>-VTK_LARGE_FLOAT && newbnd[5]>-VTK_LARGE_FLOAT){
for(int i=0;i<6;i++) bnd[i] = newbnd[i];