<commit_before>/*===================================================================

The Medical Imaging Interaction Toolkit (MITK)

Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.

This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.

See LICENSE.txt or http://www.mitk.org for details.

===================================================================*/

#include "QmitkToolTrackingStatusWidget.h"





QmitkToolTrackingStatusWidget::QmitkToolTrackingStatusWidget(QWidget* parent)
: QWidget(parent), m_Controls(NULL), m_StatusLabels (NULL), m_NavigationDatas(NULL)
{
  m_ShowPositions = false;
  m_ShowQuaternions = false;
  m_Alignment = Qt::AlignHCenter;
  m_Style = QmitkToolTrackingStatusWidget::VerticalUpperStyle;

  CreateQtPartControl( this );

}


void QmitkToolTrackingStatusWidget::SetStyle(QmitkToolTrackingStatusWidget::Style newStyle)
  {
  //set new style
  m_Style = newStyle;

  //update current labels to show them in the new style
  Refresh();
  }

void QmitkToolTrackingStatusWidget::SetShowPositions(bool enable)
{
  m_ShowPositions = enable;

  //update current labels
  Refresh();
}

void QmitkToolTrackingStatusWidget::SetShowQuaternions(bool enable)
{
  m_ShowQuaternions = enable;

  //update current labels
  Refresh();
}

void QmitkToolTrackingStatusWidget::SetTextAlignment(Qt::AlignmentFlag alignment)
{
  m_Alignment = alignment;

  //update current labels
  Refresh();
}

QmitkToolTrackingStatusWidget::~QmitkToolTrackingStatusWidget()
{
  //m_Controls = NULL;
  delete m_StatusLabels;
  delete m_NavigationDatas;
}

void QmitkToolTrackingStatusWidget::CreateQtPartControl(QWidget *parent)
{
  if (!m_Controls)
  {
    // create GUI widgets
    m_Controls = new Ui::QmitkToolTrackingStatusWidgetControls;
    m_Controls->setupUi(parent);

    this->CreateConnections();

    //add empty label
    AddEmptyLabel();
  }
}

void QmitkToolTrackingStatusWidget::CreateConnections()
{
<commit_msg>fixed a small bug in tracking tool status widget which caused a crash at closing mitk in some cases<commit_after>/*===================================================================

The Medical Imaging Interaction Toolkit (MITK)

Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.

This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.

See LICENSE.txt or http://www.mitk.org for details.

===================================================================*/

#include "QmitkToolTrackingStatusWidget.h"





QmitkToolTrackingStatusWidget::QmitkToolTrackingStatusWidget(QWidget* parent)
: QWidget(parent), m_Controls(NULL), m_StatusLabels (NULL), m_NavigationDatas(NULL)
{
  m_ShowPositions = false;
  m_ShowQuaternions = false;
  m_Alignment = Qt::AlignHCenter;
  m_Style = QmitkToolTrackingStatusWidget::VerticalUpperStyle;

  CreateQtPartControl( this );

}


void QmitkToolTrackingStatusWidget::SetStyle(QmitkToolTrackingStatusWidget::Style newStyle)
  {
  //set new style
  m_Style = newStyle;

  //update current labels to show them in the new style
  Refresh();
  }

void QmitkToolTrackingStatusWidget::SetShowPositions(bool enable)
{
  m_ShowPositions = enable;

  //update current labels
  Refresh();
}

void QmitkToolTrackingStatusWidget::SetShowQuaternions(bool enable)
{
  m_ShowQuaternions = enable;

  //update current labels
  Refresh();
}

void QmitkToolTrackingStatusWidget::SetTextAlignment(Qt::AlignmentFlag alignment)
{
  m_Alignment = alignment;

  //update current labels
  Refresh();
}

QmitkToolTrackingStatusWidget::~QmitkToolTrackingStatusWidget()
{
  //m_Controls = NULL;
  if (m_StatusLabels!=NULL) {delete m_StatusLabels;}
  if (m_NavigationDatas!=NULL) {delete m_NavigationDatas;}
}

void QmitkToolTrackingStatusWidget::CreateQtPartControl(QWidget *parent)
{
  if (!m_Controls)
  {
    // create GUI widgets
    m_Controls = new Ui::QmitkToolTrackingStatusWidgetControls;
    m_Controls->setupUi(parent);

    this->CreateConnections();

    //add empty label
    AddEmptyLabel();
  }
}

void QmitkToolTrackingStatusWidget::CreateConnections()
{

{'fraction_non_alphanumeric': 0.1438181396427743, 'fraction_numerical': 0.0, 'mean_word_length': 5.855325914149444, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4436415', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1242, 'n_words': 300}