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

Program:   Medical Imaging & Interaction Toolkit
Language:  C++
Date:      $Date$
Version:   $Revision$

Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.

This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.  See the above copyright notices for more information.

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


#include <mitkGlobalInteraction.h>
#include <mitkPointSetInteractor.h>

#include <fstream>
int mitkGlobalInteractionTest(int /*argc*/, char* /*argv*/[])
{
  //get static instance of globalInteraction
  mitk::GlobalInteraction::Pointer globalInteraction = mitk::GlobalInteraction::GetInstance();

  //create Interactors
  mitk::PointSetInteractor::Pointer firstInteractor = mitk::PointSetInteractor::New("pointsetinteractor", NULL, 1);
  mitk::PointSetInteractor::Pointer secondInteractor = mitk::PointSetInteractor::New("pointsetinteractor", NULL, 10);

  globalInteraction->AddInteractor(firstInteractor);
  globalInteraction->AddInteractor(secondInteractor);
  std::cout << "Add two interactors to globalInteraction and check if they were registered: ";
  if ( !globalInteraction->InteractorRegistered(firstInteractor) ||
       !globalInteraction->InteractorRegistered(secondInteractor) )
  {
    std::cout<<"[FAILED]"<<std::endl;
    return EXIT_FAILURE;
  }
  std::cout<<"[PASSED]"<<std::endl;

  //remove Interactor
  std::cout << "Remove the first Interactor: ";
  if ( !globalInteraction->RemoveInteractor(firstInteractor) )
  {
    std::cout<<"[FAILED]"<<std::endl;
    return EXIT_FAILURE;<commit_msg>FIX (#2413): Initialize GlobalInteraction with default values for testing<commit_after>/*=========================================================================

Program:   Medical Imaging & Interaction Toolkit
Language:  C++
Date:      $Date$
Version:   $Revision$

Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.

This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.  See the above copyright notices for more information.

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


#include <mitkGlobalInteraction.h>
#include <mitkPointSetInteractor.h>

#include <fstream>
int mitkGlobalInteractionTest(int /*argc*/, char* /*argv*/[])
{
  //get static instance of globalInteraction
  mitk::GlobalInteraction::Pointer globalInteraction = mitk::GlobalInteraction::GetInstance();

  // Initialize with default values
  globalInteraction->Initialize("global", NULL);

  //create Interactors
  mitk::PointSetInteractor::Pointer firstInteractor = mitk::PointSetInteractor::New("pointsetinteractor", NULL, 1);
  mitk::PointSetInteractor::Pointer secondInteractor = mitk::PointSetInteractor::New("pointsetinteractor", NULL, 10);

  globalInteraction->AddInteractor(firstInteractor);
  globalInteraction->AddInteractor(secondInteractor);
  std::cout << "Add two interactors to globalInteraction and check if they were registered: ";
  if ( !globalInteraction->InteractorRegistered(firstInteractor) ||
       !globalInteraction->InteractorRegistered(secondInteractor) )
  {
    std::cout<<"[FAILED]"<<std::endl;
    return EXIT_FAILURE;
  }
  std::cout<<"[PASSED]"<<std::endl;

  //remove Interactor
  std::cout << "Remove the first Interactor: ";
  if ( !globalInteraction->RemoveInteractor(firstInteractor) )
  {
    std::cout<<"[FAILED]"<<std::endl;
    return EXIT_FAILURE;
{'fraction_non_alphanumeric': 0.18261316872427982, 'fraction_numerical': 0.00257201646090535, 'mean_word_length': 6.450191570881226, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 20, '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': '4547028', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1022, 'n_words': 263}