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


C++ LayerMRI::GetRotate方法代码示例

本文整理汇总了C++中LayerMRI::GetRotate方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerMRI::GetRotate方法的具体用法?C++ LayerMRI::GetRotate怎么用?C++ LayerMRI::GetRotate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LayerMRI的用法示例。


在下文中一共展示了LayerMRI::GetRotate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: RespondTextRotate

void DialogTransformVolume::RespondTextRotate( int n )
{
  if ( isVisible() )
  {
    bool bOK;
    double dvalue = m_textAngle[n]->text().toDouble(&bOK);
    if ( bOK )
    {
      LayerMRI* layer = ( LayerMRI* )MainWindow::GetMainWindow()->GetActiveLayer( "MRI" );
      if ( layer )
      {
        double angle[3];
        layer->GetRotate( angle );
        angle[n] = dvalue;
        layer->SetRotate( angle, ui->radioButtonAroundCenter->isChecked() );
        MainWindow::GetMainWindow()->RequestRedraw();

        while (dvalue > 180)
          dvalue -= 360;
        while (dvalue < -180)
          dvalue += 360;

        m_sliderRotate[n]->blockSignals(true);
        m_sliderRotate[n]->setValue( (int)dvalue );
        m_sliderRotate[n]->blockSignals(false);
        UpdateUI( 1 );
      }
    }
  }
}
开发者ID:ewong718,项目名称:freesurfer,代码行数:30,代码来源:DialogTransformVolume.cpp

示例2: RespondSliderRotate

void DialogTransformVolume::RespondSliderRotate( int n )
{
  if ( isVisible() )
  {
    LayerMRI* layer = ( LayerMRI* )MainWindow::GetMainWindow()->GetActiveLayer( "MRI" );
    if ( layer )
    {
      double angle[3];
      layer->GetRotate( angle );
      angle[n] = m_sliderRotate[n]->value();
      layer->SetRotate( angle, ui->radioButtonAroundCenter->isChecked() );
      MainWindow::GetMainWindow()->RequestRedraw();
      ChangeLineEditNumber(m_textAngle[n], angle[n] );
      UpdateUI( 1 );
    }
  }
}
开发者ID:ewong718,项目名称:freesurfer,代码行数:17,代码来源:DialogTransformVolume.cpp

示例3: UpdateUI

// scope: 0 => translate related, 1 => scale related, 2 => both
void DialogTransformVolume::UpdateUI( int scope )
{
  LayerMRI* layer = (LayerMRI* )MainWindow::GetMainWindow()->GetActiveLayer( "MRI" );
  if ( layer )
  {
    QList<QWidget*> allwidgets = this->findChildren<QWidget*>();
    for ( int i = 0; i < allwidgets.size(); i++ )
    {
      allwidgets[i]->blockSignals( true );
    }
    if ( scope == 0 || scope == 2 )
    {
      double* vs = layer->GetWorldVoxelSize();
      double* ws = layer->GetWorldSize();
      double pos[3];
      layer->GetTranslate( pos );
      for ( int i = 0; i < 3; i++ )
      {
        int range = (int)( ws[i] / vs[i] + 0.5 ) * 2;
        int npos = (int)(pos[i] / vs[i]) + range/2;
        m_scrollTranslate[i]->setRange(0, range);
        m_scrollTranslate[i]->setValue(npos);
        ChangeLineEditNumber(m_textTranslate[i], pos[i]);
      }
    }
    if ( scope == 1 || scope == 2 )
    {
      double scale[3];
      layer->GetScale( scale );
      for ( int i = 0; i < 3; i++ )
      {
        if ( scale[i] >= 1 )
        {
          m_scrollScale[i]->setValue( 50 + (int)( (scale[i]-1.0)*50 ) );
        }
        else
        {
          m_scrollScale[i]->setValue( 50 - (int)( (1.0-scale[i])*100 ) );
        }

        ChangeLineEditNumber(m_textScale[i], scale[i]);
      }
    }

    ui->pushButtonRestore->setEnabled( layer->IsTransformed() );
    ui->pushButtonSaveReg->setEnabled( layer->IsTransformed() );
    ui->pushButtonSaveVolumeAs->setEnabled( layer->IsTransformed() );
    double angle[3];
    layer->GetRotate(angle);
    ui->groupBoxAxis->setDisabled(angle[0] != 0 || angle[1] != 0 || angle[2] != 0);
    for (int i = 0; i < 3; i++)
    {
      double val = angle[i];
      while (val > 180)
        val -= 360;
      while (angle[i] < -180)
        val += 360;
      m_sliderRotate[i]->setValue((int)val);
      ChangeLineEditNumber(m_textAngle[i], angle[i]);
    }

    for ( int i = 0; i < allwidgets.size(); i++ )
    {
      allwidgets[i]->blockSignals( false );
    }
  }
}
开发者ID:ewong718,项目名称:freesurfer,代码行数:68,代码来源:DialogTransformVolume.cpp


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