Bounds[1] = Bounds[3] = Bounds[5] = -VTK_LARGE_FLOAT;
}
-float*
+/*!
+ \return bounding box
+*/
+vtkFloatingPointType*
VTKViewer_UnScaledActor
::GetBounds()
{
void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer)
{
if(theRenderer){
- float P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}};
+ vtkFloatingPointType P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}};
theRenderer->ViewToWorld(P[0][0],P[0][1],P[0][2]);
theRenderer->ViewToWorld(P[1][0],P[1][1],P[1][2]);
- float aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+
- (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+
- (P[1][2]-P[0][2])*(P[1][2]-P[0][2]));
+ vtkFloatingPointType aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+
+ (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+
+ (P[1][2]-P[0][2])*(P[1][2]-P[0][2]));
int* aSize = theRenderer->GetRenderWindow()->GetSize();
- float aWinDiag = sqrt(float(aSize[0]*aSize[0]+aSize[1]*aSize[1]));
+ vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1]));
vtkDataSet* aDataSet = GetMapper()->GetInput();
- float aLength = aDataSet->GetLength();
- float aPrecision = 1.0E-3;
- float anOldScale = GetScale()[0];
- float aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(float(aSize[0])/float(aSize[1]));
+ aDataSet->Update();
+ vtkFloatingPointType aLength = aDataSet->GetLength();
+ vtkFloatingPointType aPrecision = 1.0E-3;
+ vtkFloatingPointType anOldScale = GetScale()[0];
+ vtkFloatingPointType aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1]));
if(fabs(aScale - anOldScale)/aScale > aPrecision){
SetScale(aScale);
}
vtkFollower::Render(theRenderer);
}
+/*!
+ Constructor
+*/
VTKViewer_Axis::VTKViewer_Axis()
{
/*! \li Initialize the Line pipe-line representation*/
myVisibility = VTKViewer_Trihedron::eOn;
}
+/*!
+ Destructor
+*/
VTKViewer_Axis::~VTKViewer_Axis()
{
/*! \li Destroy of the Label pipe-line representation */
myLineSource->Delete();
}
+/*! Add to renderer
+ * \param theRenderer - vtkRenderer pointer
+ */
void VTKViewer_Axis::AddToRender(vtkRenderer* theRenderer){
/*! \li Order of the calls are important*/
theRenderer->AddActor(myLineActor);
theRenderer->AddActor(myArrowActor);
}
+/*! Remove actor of acis from \a theRenderer which are in myPresent.
+ * \param theRenderer - vtkRenderer pointer
+ */
void VTKViewer_Axis::RemoveFromRender(vtkRenderer* theRenderer){
/*! \li Order of the calls are important*/
theRenderer->RemoveActor(myLineActor);
theRenderer->RemoveActor(myArrowActor);
}
+/*! Sets visibility for all Axis to \a theVis*/
void VTKViewer_Axis::SetVisibility(VTKViewer_Trihedron::TVisibility theVis)
{
switch(theVis){
myVisibility = theVis;
}
-//****************************************************************
+/*! Set camera for myLabelActor
+ */
void VTKViewer_Axis::SetCamera(vtkCamera* theCamera){
myLabelActor->SetCamera(theCamera);
}
+/*! Sets \a theProperty for actors: myLineActor,myLabelActor,myArrowActor
+ */
void VTKViewer_Axis::SetProperty(vtkProperty* theProperty){
myLabelActor->SetProperty(theProperty);
myArrowActor->SetProperty(theProperty);
myLineActor->SetProperty(theProperty);
}
-void VTKViewer_Axis::SetSize(float theSize)
+/*! Set size of VTKViewer_Axis
+ */
+void VTKViewer_Axis::SetSize(vtkFloatingPointType theSize)
{
- float aPosition[3] = {myDir[0]*theSize, myDir[1]*theSize, myDir[2]*theSize};
+ vtkFloatingPointType aPosition[3] = {myDir[0]*theSize, myDir[1]*theSize, myDir[2]*theSize};
myLineSource->SetPoint2(aPosition);
myArrowActor->SetPosition(0.0,0.0,0.0);
vtkStandardNewMacro(VTKViewer_Trihedron);
+/*!
+ Constructor
+*/
VTKViewer_Trihedron::VTKViewer_Trihedron()
{
myPresent = vtkActorCollection::New();
myAxis[0] = VTKViewer_XAxis::New();
myAxis[1] = VTKViewer_YAxis::New();
myAxis[2] = VTKViewer_ZAxis::New();
- static float aSize = 100;
+ static vtkFloatingPointType aSize = 100;
SetSize(aSize);
}
+/*!
+ Destructor
+*/
VTKViewer_Trihedron::~VTKViewer_Trihedron()
{
myPresent->RemoveAllItems();
myAxis[i]->Delete();
}
-void VTKViewer_Trihedron::SetSize(float theSize)
+/*! Set size of axes
+ */
+void VTKViewer_Trihedron::SetSize(vtkFloatingPointType theSize)
{
mySize = theSize;
for(int i = 0; i < 3; i++)
myAxis[i]->SetSize(theSize);
}
+/*! Set visibility of axes
+ */
void VTKViewer_Trihedron::SetVisibility(TVisibility theVis)
{
for(int i = 0; i < 3; i++)
myAxis[i]->SetVisibility(theVis);
}
+/*!
+ \return visibility of first axis
+*/
VTKViewer_Trihedron::TVisibility VTKViewer_Trihedron::GetVisibility()
{
return myAxis[0]->GetVisibility();
}
+/*! Add to render all Axis
+ * \param theRenderer - vtkRenderer pointer
+ */
void VTKViewer_Trihedron::AddToRender(vtkRenderer* theRenderer)
{
vtkCamera* aCamera = theRenderer->GetActiveCamera();
}
}
+/*! Remove all actors from \a theRenderer which are in myPresent.
+ * \param theRenderer - vtkRenderer pointer
+ */
void VTKViewer_Trihedron::RemoveFromRender(vtkRenderer* theRenderer)
{
myPresent->InitTraversal();
myAxis[i]->RemoveFromRender(theRenderer);
}
+/*! Return count of visible actors.
+ * \param theRenderer - vtkRenderer pointer
+ */
int VTKViewer_Trihedron::GetVisibleActorCount(vtkRenderer* theRenderer)
{
//TVisibility aVis = GetVisibility();