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

  Program:   Visualization Toolkit
  Module:    vtkDataRepresentation.cxx

  Copyright (c) <NAME>, <NAME>, <NAME>
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 notice for more information.

=========================================================================*/
/*-------------------------------------------------------------------------
  Copyright 2008 Sandia Corporation.
  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
  the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------*/

#include "vtkDataRepresentation.h"

#include "vtkAnnotationLink.h"
#include "vtkCommand.h"
#include "vtkConvertSelectionDomain.h"
#include "vtkDataObject.h"
#include "vtkDataSet.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include "vtkSelection.h"
#include "vtkSelectionLink.h"
#include "vtkSmartPointer.h"

#include <vtkstd/vector>

//---------------------------------------------------------------------------
// vtkDataRepresentationInput
//---------------------------------------------------------------------------

class vtkDataRepresentationInput : public vtkObject
{
public:
  static vtkDataRepresentationInput* New();
  vtkTypeRevisionMacro(vtkDataRepresentationInput, vtkObject);
  void PrintSelf(ostream& os, vtkIndent indent)
    {
    this->Superclass::PrintSelf(os, indent);
    }

  vtkDataRepresentationInput()
    {
    this->ConvertDomain = vtkSmartPointer<vtkConvertSelectionDomain>::New();
    }

  ~vtkDataRepresentationInput()
    {
    }

  void SetInput(vtkDataObject* input, vtkDataRepresentation* rep)
    {
    this->ConvertDomain->SetInputConnection(0,
      rep->GetSelectionLink()->GetOutputPort(0));
    this->ConvertDomain->SetInputConnection(1,
      rep->GetSelectionLink()->GetOutputPort(1));
    this->ConvertDomain->SetInput(2, input);
    }

  vtkAlgorithmOutput* GetSelectionConnection()
    {
    return this->ConvertDomain->GetOutputPort();
    }

  vtkDataObject* GetInput()
    {
    return this->ConvertDomain->GetInputDataObject(2, 0);
    }

protected:
  vtkSmartPointer<vtkConvertSelectionDomain> ConvertDomain;
};
vtkCxxRevisionMacro(vtkDataRepresentationInput, "1.7");
vtkStandardNewMacro(vtkDataRepresentationInput);

//---------------------------------------------------------------------------
// vtkDataRepresentation::Internals
//---------------------------------------------------------------------------

class vtkDataRepresentation::Internals {
public:
  vtkstd::vector<vtkstd::vector<
    vtkSmartPointer<vtkDataRepresentationInput> > > Inputs;
};

//----------------------------------------------------------------------------
// vtkDataRepresentation
//----------------------------------------------------------------------------

vtkCxxRevisionMacro(vtkDataRepresentation, "1.7");
vtkStandardNewMacro(vtkDataRepresentation);
vtkCxxSetObjectMacro(vtkDataRepresentation,
  SelectionLinkInternal, vtkSelectionLink);
vtkCxxSetObjectMacro(vtkDataRepresentation,
  AnnotationLinkInternal, vtkAnnotationLink);

//----------------------------------------------------------------------------
vtkDataRepresentation::vtkDataRepresentation() :
  Implementation(new Internals())
{
  this->Selectable = true;
  this->SelectionLinkInternal = vtkSelectionLink::New();
  this->AnnotationLinkInternal = vtkAnnotationLink::New();
  this->SetNumberOfOutputPorts(0);
}

//----------------------------------------------------------------------------
vtkDataRepresentation::~vtkDataRepresentation()
{
  delete this->Implementation;
  this->SetSelectionLinkInternal(0);
  this->SetAnnotationLinkInternal(0);
}

//----------------------------------------------------------------------------
void vtkDataRepresentation::SetSelectionLink(vtkSelectionLink* link)
{<commit_msg>BUG: Two PrintSelf methods confused test<commit_after>/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkDataRepresentation.cxx

  Copyright (c) <NAME>, <NAME>, <NAME>
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 notice for more information.

=========================================================================*/
/*-------------------------------------------------------------------------
  Copyright 2008 Sandia Corporation.
  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
  the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------*/

#include "vtkDataRepresentation.h"

#include "vtkAnnotationLink.h"
#include "vtkCommand.h"
#include "vtkConvertSelectionDomain.h"
#include "vtkDataObject.h"
#include "vtkDataSet.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include "vtkSelection.h"
#include "vtkSelectionLink.h"
#include "vtkSmartPointer.h"

#include <vtkstd/vector>

//---------------------------------------------------------------------------
// vtkDataRepresentationInput
//---------------------------------------------------------------------------

class vtkDataRepresentationInput : public vtkObject
{
public:
  static vtkDataRepresentationInput* New();
  vtkTypeRevisionMacro(vtkDataRepresentationInput, vtkObject);

  vtkDataRepresentationInput()
    {
    this->ConvertDomain = vtkSmartPointer<vtkConvertSelectionDomain>::New();
    }

  ~vtkDataRepresentationInput()
    {
    }

  void SetInput(vtkDataObject* input, vtkDataRepresentation* rep)
    {
    this->ConvertDomain->SetInputConnection(0,
      rep->GetSelectionLink()->GetOutputPort(0));
    this->ConvertDomain->SetInputConnection(1,
      rep->GetSelectionLink()->GetOutputPort(1));
    this->ConvertDomain->SetInput(2, input);
    }

  vtkAlgorithmOutput* GetSelectionConnection()
    {
    return this->ConvertDomain->GetOutputPort();
    }

  vtkDataObject* GetInput()
    {
    return this->ConvertDomain->GetInputDataObject(2, 0);
    }

protected:
  vtkSmartPointer<vtkConvertSelectionDomain> ConvertDomain;
};
vtkCxxRevisionMacro(vtkDataRepresentationInput, "1.8");
vtkStandardNewMacro(vtkDataRepresentationInput);

//---------------------------------------------------------------------------
// vtkDataRepresentation::Internals
//---------------------------------------------------------------------------

class vtkDataRepresentation::Internals {
public:
  vtkstd::vector<vtkstd::vector<
    vtkSmartPointer<vtkDataRepresentationInput> > > Inputs;
};

//----------------------------------------------------------------------------
// vtkDataRepresentation
//----------------------------------------------------------------------------

vtkCxxRevisionMacro(vtkDataRepresentation, "1.8");
vtkStandardNewMacro(vtkDataRepresentation);
vtkCxxSetObjectMacro(vtkDataRepresentation,
  SelectionLinkInternal, vtkSelectionLink);
vtkCxxSetObjectMacro(vtkDataRepresentation,
  AnnotationLinkInternal, vtkAnnotationLink);

//----------------------------------------------------------------------------
vtkDataRepresentation::vtkDataRepresentation() :
  Implementation(new Internals())
{
  this->Selectable = true;
  this->SelectionLinkInternal = vtkSelectionLink::New();
  this->AnnotationLinkInternal = vtkAnnotationLink::New();
  this->SetNumberOfOutputPorts(0);
}

//----------------------------------------------------------------------------
vtkDataRepresentation::~vtkDataRepresentation()
{
  delete this->Implementation;
  this->SetSelectionLinkInternal(0);
  this->SetAnnotationLinkInternal(0);
}

//----------------------------------------------------------------------------
void vtkDataRepresentation::SetSelectionLink(vtkSelectionLink* link)
{
{'fraction_non_alphanumeric': 0.31870920957215376, 'fraction_numerical': 0.006526468455402465, 'mean_word_length': 2.1487823439878233, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 66, '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': '7197046', 'n_tokens_mistral': 2060, 'n_tokens_neox': 1997, 'n_words': 356}