#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
+// -------------------------------------------------------------------------
+cpExtensions::QT::SimpleMPRWidget::_3DInteractorStyle*
+cpExtensions::QT::SimpleMPRWidget::_3DInteractorStyle::
+New( )
+{
+ return( new _3DInteractorStyle( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::_3DInteractorStyle::
+OnKeyPress( )
+{
+ vtkRenderWindowInteractor* i = this->Interactor;
+ std::string key = i->GetKeySym( );
+ if( key == "r" || key == "R" )
+ {
+ this->CurrentRenderer->ResetCamera( );
+ i->Render( );
+
+ } // fi
+}
+
// -------------------------------------------------------------------------
cpExtensions::QT::SimpleMPRWidget::
SimpleMPRWidget( QWidget* parent )
this->m_VTK[ 1 ] = this->m_UI->VTK_Y;
this->m_VTK[ 2 ] = this->m_UI->VTK_Z;
this->m_VTK[ 3 ] = this->m_UI->VTK_3D;
-
for( unsigned int i = 0; i < 4; ++i )
{
this->m_Renderers[ i ] = vtkSmartPointer< vtkRenderer >::New( );
AddRenderer( this->m_Renderers[ i ] );
} // rof
+ vtkSmartPointer< _3DInteractorStyle > style =
+ vtkSmartPointer< _3DInteractorStyle >::New( );
+ this->m_VTK[ 3 ]->GetRenderWindow( )->
+ GetInteractor( )->SetInteractorStyle( style );
+ style->SetCurrentRenderer( this->m_Renderers[ 3 ] );
// Connect slots
QObject::connect(
{
if( actor != NULL )
{
+ std::cout << name << " " << actor << std::endl;
+
this->m_Renderers[ 3 ]->AddViewProp( actor );
this->m_VTK[ 3 ]->GetRenderWindow( )->Render( );
this->m_NamedActors[ name ].insert( actor );
+ std::cout << "Size: " << this->m_NamedActors.size( ) << " " << this->m_NamedActors[ name ].size( ) << std::endl;
+
+
+ double bounds[ 6 ];
+ this->m_Renderers[ 3 ]->ComputeVisiblePropBounds( bounds );
+ std::cout
+ << bounds[ 0 ] << " " << bounds[ 1 ] << " "
+ << bounds[ 2 ] << " " << bounds[ 3 ] << " "
+ << bounds[ 4 ] << " " << bounds[ 5 ] << std::endl;
} // fi
}
auto ia = dynamic_cast< vtkImageActor* >( actor );
if( ia == NULL )
{
- auto ma = dynamic_cast< vtkActor* >( actor );
+ auto ma = dynamic_cast< vtkProp3D* >( actor );
if( ma != NULL )
this->AddMeshActor( ma, name );
}