当前位置: 首页>>代码示例>>C++>>正文


C++ RenderView2D类代码示例

本文整理汇总了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 );
  }
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:29,代码来源:Interactor2D.cpp

示例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 );
  }
}
开发者ID:ewong718,项目名称:freesurfer,代码行数:29,代码来源:Interactor2D.cpp

示例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 );
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:33,代码来源:Interactor2DMeasure.cpp

示例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() );
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:8,代码来源:ToolWindowEdit.cpp

示例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
  }
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:34,代码来源:Interactor2DNavigate.cpp

示例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;
  }
}
开发者ID:ewong718,项目名称:freesurfer,代码行数:32,代码来源:Interactor2DVolumeEdit.cpp

示例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() );
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:9,代码来源:ToolWindowEdit.cpp

示例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 );
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:10,代码来源:Interactor2D.cpp

示例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*/ );
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:10,代码来源:ToolWindowEdit.cpp

示例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();
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:10,代码来源:ToolWindowEdit.cpp

示例11:

void Interactor2D::ProcessPostMouseWheelEvent( QWheelEvent* event, RenderView* renderview )
{
  RenderView2D* view = ( RenderView2D* )renderview;
  view->UpdateAnnotation();
  view->Update2DOverlay();
  view->RequestRedraw();
  view->EmitZooming();

  Interactor::ProcessPostMouseWheelEvent( event, renderview );
}
开发者ID:ewong718,项目名称:freesurfer,代码行数:10,代码来源:Interactor2D.cpp

示例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 );
  }
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:10,代码来源:ToolWindowEdit.cpp

示例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;
}
开发者ID:ewong718,项目名称:freesurfer,代码行数:56,代码来源:Interactor2D.cpp

示例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 );
  }
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:16,代码来源:Interactor2DMeasure.cpp

示例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;
}
开发者ID:CBoensel,项目名称:freesurfer,代码行数:18,代码来源:Interactor2DVolumeEdit.cpp


注:本文中的RenderView2D类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。