本文整理汇总了C++中RenderView2D类的典型用法代码示例。如果您正苦于以下问题:C++ RenderView2D类的具体用法?C++ RenderView2D怎么用?C++ RenderView2D使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RenderView2D类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessMouseUpEvent
bool Interactor2D::ProcessMouseUpEvent( wxMouseEvent& event, RenderView* renderview )
{
RenderView2D* view = ( RenderView2D* )renderview;
if ( m_bSelecting )
{
view->StopSelection();
view->NeedRedraw();
}
m_nMousePosX = event.GetX();
m_nMousePosY = event.GetY();
m_bWindowLevel = false;
m_bChangeSlice = false;
m_bMovingCursor = false;
m_bSelecting = false;
view->UpdateAnnotation();
view->Update2DOverlay();
if ( event.LeftUp() )
{
return false;
}
else
{
return Interactor::ProcessMouseUpEvent( event, renderview );
}
}
示例2: ProcessMouseUpEvent
bool Interactor2D::ProcessMouseUpEvent( QMouseEvent* event, RenderView* renderview )
{
RenderView2D* view = ( RenderView2D* )renderview;
if ( m_bSelecting )
{
view->StopSelection();
view->RequestRedraw();
}
m_nMousePosX = event->x();
m_nMousePosY = event->y();
m_bWindowLevel = false;
m_bChangeSlice = false;
m_bMovingCursor = false;
m_bSelecting = false;
view->UpdateAnnotation();
view->Update2DOverlay();
if ( event->button() == Qt::LeftButton )
{
return false;
}
else
{
return Interactor::ProcessMouseUpEvent( event, renderview );
}
}
示例3: if
void Interactor2DMeasure::UpdateCursor( wxEvent& event, wxWindow* wnd )
{
RenderView2D* view = ( RenderView2D* )wnd;
if ( wnd->FindFocus() == wnd )
{
if ( event.IsKindOf( CLASSINFO( wxMouseEvent ) ) )
{
wxMouseEvent* e = ( wxMouseEvent* )&event;
if ( ( ( e->MiddleDown() || e->RightDown() ) && !m_bEditing ) ||
( e->CmdDown() && e->ShiftDown() ) )
{
Interactor2D::UpdateCursor( event, wnd );
return;
}
else if ( ( !m_bEditing && !m_bDrawing && view->GetRegion( e->GetX(), e->GetY() ) ) ||
( m_bEditing && m_nPointIndex < 0 ) )
{
wnd->SetCursor( CursorFactory::CursorGrab );
}
else
{
if ( m_nAction == MM_Line )
wnd->SetCursor( CursorFactory::CursorMeasureLine );
else if ( m_nAction == MM_Rectangle )
wnd->SetCursor( CursorFactory::CursorMeasureRectangle );
else if ( m_nAction == MM_Polyline || m_nAction == MM_Spline )
wnd->SetCursor( CursorFactory::CursorMeasurePolyline );
}
}
}
else
Interactor2D::UpdateCursor( event, wnd );
}
示例4: OnActionROIFreehandUpdateUI
void ToolWindowEdit::OnActionROIFreehandUpdateUI( wxUpdateUIEvent& event)
{
RenderView2D* view = ( RenderView2D* )MainWindow::GetMainWindowPointer()->GetRenderView( 0 );
event.Check( view->GetInteractionMode() == RenderView2D::IM_ROIEdit
&& view->GetAction() == Interactor2DROIEdit::EM_Freehand );
event.Enable( view->GetInteractionMode() == RenderView2D::IM_ROIEdit
&& !MainWindow::GetMainWindowPointer()->GetLayerCollection( "MRI" )->IsEmpty() );
}
示例5: Error
bool Interactor2DNavigate::ProcessMouseDownEvent( QMouseEvent* event, RenderView* renderview )
{
if (m_nCurrentLandmark < 0)
return Interactor2D::ProcessMouseDownEvent(event, renderview);
RenderView2D* view = ( RenderView2D* )renderview;
if ( event->button() == Qt::LeftButton )
{
if ( event->modifiers() & CONTROL_MODIFIER && event->modifiers() & Qt::ShiftModifier )
{
return Interactor2D::ProcessMouseDownEvent( event, renderview );
}
LayerLandmarks* landmarks = (LayerLandmarks*)MainWindow::GetMainWindow()->GetSupplementLayer("Landmarks");
if ( !landmarks )
{
emit Error( "Landmarks non-exist", landmarks );
}
else
{
m_bEditing = true;
double pos[3];
view->MousePositionToRAS( event->x(), event->y(), pos );
landmarks->SetLandmarkPosition(m_nCurrentLandmark, pos);
}
return false;
}
else
{
return Interactor2D::ProcessMouseDownEvent( event, renderview ); // pass down the event
}
}
示例6: UpdateCursor
bool Interactor2DVolumeEdit::ProcessKeyDownEvent( QKeyEvent* event, RenderView* renderview )
{
UpdateCursor( event, renderview );
RenderView2D* view = ( RenderView2D* )renderview;
if ( event->modifiers() & Qt::AltModifier && event->key() == Qt::Key_H )
{
Contour2D* c2d = view->GetContour2D();
c2d->SetVisible( !c2d->IsVisible() );
view->RequestRedraw();
return false;
}
else if (event->modifiers() & Qt::ShiftModifier && event->key() == Qt::Key_C)
{
m_bColorPicking = true;
return false;
}
else if (event->key() == Qt::Key_Escape)
{
m_bColorPicking = false;
return false;
}
if ( !m_bEditing )
{
return Interactor2D::ProcessKeyDownEvent( event, renderview );
}
else
{
return false;
}
}
示例7: OnActionVoxelColorPickerUpdateUI
void ToolWindowEdit::OnActionVoxelColorPickerUpdateUI( wxUpdateUIEvent& event)
{
RenderView2D* view = ( RenderView2D* )MainWindow::GetMainWindowPointer()->GetRenderView( 0 );
event.Check( view->GetInteractionMode() == RenderView2D::IM_VoxelEdit
&& view->GetAction() == Interactor2DVoxelEdit::EM_ColorPicker );
event.Enable( view->GetInteractionMode() == RenderView2D::IM_VoxelEdit
&& !MainWindow::GetMainWindowPointer()->GetLayerCollection( "MRI" )->IsEmpty() );
}
示例8:
void Interactor2D::ProcessPostMouseWheelEvent( wxMouseEvent& event, RenderView* renderview )
{
RenderView2D* view = ( RenderView2D* )renderview;
view->UpdateAnnotation();
view->Update2DOverlay();
view->NeedRedraw();
view->SendBroadcast( "Zooming", view );
Interactor::ProcessPostMouseWheelEvent( event, renderview );
}
示例9: OnActionVoxelContourUpdateUI
void ToolWindowEdit::OnActionVoxelContourUpdateUI( wxUpdateUIEvent& event)
{
RenderView2D* view = ( RenderView2D* )MainWindow::GetMainWindowPointer()->GetRenderView( 0 );
event.Check( view->GetInteractionMode() == RenderView2D::IM_VoxelEdit
&& view->GetAction() == Interactor2DVoxelEdit::EM_Contour );
LayerMRI* mri = (LayerMRI*)MainWindow::GetMainWindowPointer()->GetLayerCollection( "MRI" )->GetActiveLayer();
event.Enable( view->GetInteractionMode() == RenderView2D::IM_VoxelEdit
&& mri /*&& mri->GetProperties()->GetColorMap() == LayerPropertiesMRI::LUT*/ );
}
示例10: OnCheckSmooth
void ToolWindowEdit::OnCheckSmooth( wxCommandEvent& event )
{
for ( int i = 0; i < 3; i++ )
{
RenderView2D* view = ( RenderView2D* )MainWindow::GetMainWindowPointer()->GetRenderView( i );
Contour2D* c2d = view->GetContour2D();
c2d->SetSmooth( event.IsChecked() );
}
UpdateTools();
}
示例11:
void Interactor2D::ProcessPostMouseWheelEvent( QWheelEvent* event, RenderView* renderview )
{
RenderView2D* view = ( RenderView2D* )renderview;
view->UpdateAnnotation();
view->Update2DOverlay();
view->RequestRedraw();
view->EmitZooming();
Interactor::ProcessPostMouseWheelEvent( event, renderview );
}
示例12: OnColorContour
void ToolWindowEdit::OnColorContour( wxColourPickerEvent& event )
{
wxColour c = event.GetColour();
for ( int i = 0; i < 3; i++ )
{
RenderView2D* view = ( RenderView2D* )MainWindow::GetMainWindowPointer()->GetRenderView( i );
Contour2D* c2d = view->GetContour2D();
c2d->SetContourColor( c.Red()/255.0, c.Green()/255.0, c.Blue()/255.0 );
}
}
示例13: ProcessKeyDownEvent
bool Interactor2D::ProcessKeyDownEvent( QKeyEvent* event, RenderView* renderview )
{
RenderView2D* view = ( RenderView2D* )renderview;
if ( MainWindow::GetMainWindow()->IsEmpty() )
{
return Interactor::ProcessKeyDownEvent( event, renderview );
}
int nKeyCode = event->key();
if ( event->modifiers() & Qt::ShiftModifier )
{
if ( nKeyCode == Qt::Key_Up )
{
view->Zoom(1.05);
}
else if ( nKeyCode == Qt::Key_Down )
{
view->Zoom(0.95);
}
}
else if ( nKeyCode == Qt::Key_PageUp )
{
view->MoveSlice( 1 );
}
else if ( nKeyCode == Qt::Key_PageDown )
{
view->MoveSlice( -1 );
}
else if ( nKeyCode == Qt::Key_Up )
{
view->MoveUp();
}
else if ( nKeyCode == Qt::Key_Down )
{
view->MoveDown();
}
else if ( nKeyCode == Qt::Key_Left )
{
view->MoveLeft();
}
else if ( nKeyCode == Qt::Key_Right )
{
view->MoveRight();
}
else if ( nKeyCode == Qt::Key_3 /*|| nKeyCode == 'W' || nKeyCode == 'S'*/ || nKeyCode == Qt::Key_R || nKeyCode == Qt::Key_F )
{
// do nothing, just intercept these vtk default keycodes
}
else
{
return Interactor::ProcessKeyDownEvent( event, view );
}
return false;
}
示例14: UpdateCursor
bool Interactor2DMeasure::ProcessKeyDownEvent( wxKeyEvent& event, RenderView* renderview )
{
RenderView2D* view = ( RenderView2D* )renderview;
UpdateCursor( event, renderview );
if ( m_region && ( event.GetKeyCode() == WXK_DELETE || event.GetKeyCode() == WXK_NUMPAD_DELETE ) )
{
view->DeleteRegion( m_region );
m_region = NULL;
return false;
}
else
{
return Interactor2D::ProcessKeyDownEvent( event, renderview );
}
}
示例15: UpdateCursor
bool Interactor2DVolumeEdit::ProcessKeyDownEvent( wxKeyEvent& event, RenderView* renderview )
{
UpdateCursor( event, renderview );
RenderView2D* view = ( RenderView2D* )renderview;
if ( event.GetModifiers() == wxMOD_ALT && event.GetKeyCode() == 'H' )
{
Contour2D* c2d = view->GetContour2D();
c2d->SetVisible( !c2d->IsVisible() );
view->NeedRedraw();
return false;
}
if ( !m_bEditing )
return Interactor2D::ProcessKeyDownEvent( event, renderview );
else
return false;
}