<commit_before>#include "BaseRenderer.h"
#include "PlaneGeometry.h"
#include "EventMapper.h"
#include "mitkSmartPointerProperty.h"
#include <vtkTransform.h>

//##ModelId=3D6A1791038B
void mitk::BaseRenderer::SetData(mitk::DataTreeIterator* iterator)
{
    if(m_DataTreeIterator != iterator)
    {
        delete m_DataTreeIterator;
        m_DataTreeIterator = iterator->clone();
        Modified();
    }
}

//##ModelId=3E3314720003
void mitk::BaseRenderer::SetWindowId(void *id)
{
}

//##ModelId=3E330C4D0395
const MapperSlotId mitk::BaseRenderer::defaultMapper = 1;

//##ModelId=3E33162C00D0
void mitk::BaseRenderer::Paint()
{
}

//##ModelId=3E331632031E
void mitk::BaseRenderer::Initialize()
{
}

//##ModelId=3E33163703D9
void mitk::BaseRenderer::Resize(int w, int h)
{
    m_Size[0] = w;
    m_Size[1] = h;

    if(m_CameraController)

        m_CameraController->Resize(w, h);
}

//##ModelId=3E33163A0261
void mitk::BaseRenderer::InitRenderer(mitk::RenderWindow* renderwindow)
{
    m_RenderWindow = renderwindow;
}

//##ModelId=3E3799250397
void mitk::BaseRenderer::InitSize(int w, int h)
{
}

//##ModelId=3E3D2F120050
mitk::BaseRenderer::BaseRenderer() : m_DataTreeIterator(NULL), m_RenderWindow(NULL), m_LastUpdateTime(0), m_MapperID(defaultMapper), m_CameraController(NULL), m_Focused(false)
{
	SmartPointerProperty::Pointer rendererProp = new SmartPointerProperty(); rendererProp->SetSmartPointer((itk::Object*)this);

    m_WorldGeometry = mitk::PlaneGeometry::New();

    m_WorldGeometryData = mitk::Geometry2DData::New();
    m_WorldGeometryData->SetGeometry2D(m_WorldGeometry);
	m_WorldGeometryNode = mitk::DataTreeNode::New();
	m_WorldGeometryNode->SetData(m_WorldGeometryData);
	m_WorldGeometryNode->GetPropertyList()->SetProperty("renderer", rendererProp);
	m_WorldGeometryTransformTime = m_WorldGeometryNode->GetVtkTransform()->GetMTime();

    m_DisplayGeometry = mitk::DisplayGeometry::New();
	m_DisplayGeometry->SetWorldGeometry(m_WorldGeometry);
    m_DisplayGeometryData = mitk::Geometry2DData::New();
    m_DisplayGeometryData->SetGeometry2D(m_DisplayGeometry);
	m_DisplayGeometryNode = mitk::DataTreeNode::New();
	m_DisplayGeometryNode->SetData(m_DisplayGeometryData);
	m_DisplayGeometryNode->GetPropertyList()->SetProperty("renderer", rendererProp);
	m_DisplayGeometryTransformTime = m_DisplayGeometryNode->GetVtkTransform()->GetMTime();
}


//##ModelId=3E3D2F12008C
mitk::BaseRenderer::~BaseRenderer()
{
    delete m_DataTreeIterator;
}

//##ModelId=3E66CC590379
void mitk::BaseRenderer::SetWorldGeometry(const mitk::Geometry2D* geometry2d)
{
    itkDebugMacro("setting WorldGeometry to " << geometry2d);
    if (m_WorldGeometry != geometry2d)
    {
        m_WorldGeometry = geometry2d;
        m_WorldGeometryData->SetGeometry2D(m_WorldGeometry);
        m_DisplayGeometry->SetWorldGeometry(m_WorldGeometry);
        Modified();
    }
}

//##ModelId=3E66CC59026B
void mitk::BaseRenderer::SetDisplayGeometry(mitk::DisplayGeometry* geometry2d)
{
    itkDebugMacro("setting DisplayGeometry to " << geometry2d);
    if (m_DisplayGeometry != geometry2d)
    {
        m_DisplayGeometry = geometry2d;
        m_DisplayGeometryData->SetGeometry2D(m_DisplayGeometry);
        Modified();
    }
}

//##ModelId=3E6D5DD30322
void mitk::BaseRenderer::MousePressEvent(mitk::MouseEvent *me)
{
  if (m_CameraController)
    m_CameraController->MousePressEvent(me);
  mitk::Event event(me->type(), me->button(), me->state(), Qt::Key_unknown);
  mitk::EventMapper::MapEvent(&event);
}

//##ModelId=3E6D5DD30372
void mitk::BaseRenderer::MouseReleaseEvent(mitk::MouseEvent *me)
{
  if (m_CameraController)
    m_CameraController->MouseReleaseEvent(me);
  mitk::Event event(me->type(), me->button(), me->state(), Qt::Key_unknown);
  mitk::EventMapper::MapEvent(&event);
}

//##ModelId=3E6D5DD303C2
void mitk::BaseRenderer::MouseMoveEvent(mitk::MouseEvent *me)
{
  if (m_CameraController)
    m_CameraController->MouseMoveEvent(me);
  mitk::Event event(me->type(), me->button(), me->state(), Qt::Key_unknown);
  mitk::EventMapper::MapEvent(&event);
}

//##ModelId=3E6D5DD4002A
void mitk::BaseRenderer::KeyPressEvent(mitk::KeyEvent *ke)
{
  if (m_CameraController)
    m_CameraController->KeyPressEvent(ke);
  mitk::Event event(ke->type(), Qt::NoButton, Qt::NoButton, ke->key());
  mitk::EventMapper::MapEvent(&event);
}
<commit_msg>*** empty log message ***<commit_after>#include "BaseRenderer.h"
#include "PlaneGeometry.h"
#include "EventMapper.h"
#include "mitkSmartPointerProperty.h"
#include <vtkTransform.h>

//##ModelId=3D6A1791038B
void mitk::BaseRenderer::SetData(mitk::DataTreeIterator* iterator)
{
    if(m_DataTreeIterator != iterator)
    {
        delete m_DataTreeIterator;
				m_DataTreeIterator = NULL;
			
				if (iterator != NULL) {
					m_DataTreeIterator = iterator->clone();
				}
        Modified();
    }
}

//##ModelId=3E3314720003
void mitk::BaseRenderer::SetWindowId(void *id)
{
}

//##ModelId=3E330C4D0395
const MapperSlotId mitk::BaseRenderer::defaultMapper = 1;

//##ModelId=3E33162C00D0
void mitk::BaseRenderer::Paint()
{
}

//##ModelId=3E331632031E
void mitk::BaseRenderer::Initialize()
{
}

//##ModelId=3E33163703D9
void mitk::BaseRenderer::Resize(int w, int h)
{
    m_Size[0] = w;
    m_Size[1] = h;

    if(m_CameraController)

        m_CameraController->Resize(w, h);
}

//##ModelId=3E33163A0261
void mitk::BaseRenderer::InitRenderer(mitk::RenderWindow* renderwindow)
{
    m_RenderWindow = renderwindow;
}

//##ModelId=3E3799250397
void mitk::BaseRenderer::InitSize(int w, int h)
{
}

//##ModelId=3E3D2F120050
mitk::BaseRenderer::BaseRenderer() : m_DataTreeIterator(NULL), m_RenderWindow(NULL), m_LastUpdateTime(0), m_MapperID(defaultMapper), m_CameraController(NULL), m_Focused(false)
{
	SmartPointerProperty::Pointer rendererProp = new SmartPointerProperty(); rendererProp->SetSmartPointer((itk::Object*)this);

    m_WorldGeometry = mitk::PlaneGeometry::New();

    m_WorldGeometryData = mitk::Geometry2DData::New();
    m_WorldGeometryData->SetGeometry2D(m_WorldGeometry);
	m_WorldGeometryNode = mitk::DataTreeNode::New();
	m_WorldGeometryNode->SetData(m_WorldGeometryData);
	m_WorldGeometryNode->GetPropertyList()->SetProperty("renderer", rendererProp);
	m_WorldGeometryTransformTime = m_WorldGeometryNode->GetVtkTransform()->GetMTime();

    m_DisplayGeometry = mitk::DisplayGeometry::New();
	m_DisplayGeometry->SetWorldGeometry(m_WorldGeometry);
    m_DisplayGeometryData = mitk::Geometry2DData::New();
    m_DisplayGeometryData->SetGeometry2D(m_DisplayGeometry);
	m_DisplayGeometryNode = mitk::DataTreeNode::New();
	m_DisplayGeometryNode->SetData(m_DisplayGeometryData);
	m_DisplayGeometryNode->GetPropertyList()->SetProperty("renderer", rendererProp);
	m_DisplayGeometryTransformTime = m_DisplayGeometryNode->GetVtkTransform()->GetMTime();
}


//##ModelId=3E3D2F12008C
mitk::BaseRenderer::~BaseRenderer()
{
    delete m_DataTreeIterator;
}

//##ModelId=3E66CC590379
void mitk::BaseRenderer::SetWorldGeometry(const mitk::Geometry2D* geometry2d)
{
    itkDebugMacro("setting WorldGeometry to " << geometry2d);
    if (m_WorldGeometry != geometry2d)
    {
        m_WorldGeometry = geometry2d;
        m_WorldGeometryData->SetGeometry2D(m_WorldGeometry);
        m_DisplayGeometry->SetWorldGeometry(m_WorldGeometry);
        Modified();
    }
}

//##ModelId=3E66CC59026B
void mitk::BaseRenderer::SetDisplayGeometry(mitk::DisplayGeometry* geometry2d)
{
    itkDebugMacro("setting DisplayGeometry to " << geometry2d);
    if (m_DisplayGeometry != geometry2d)
    {
        m_DisplayGeometry = geometry2d;
        m_DisplayGeometryData->SetGeometry2D(m_DisplayGeometry);
        Modified();
    }
}

//##ModelId=3E6D5DD30322
void mitk::BaseRenderer::MousePressEvent(mitk::MouseEvent *me)
{
  if (m_CameraController)
    m_CameraController->MousePressEvent(me);
  mitk::Event event(me->type(), me->button(), me->state(), Qt::Key_unknown);
  mitk::EventMapper::MapEvent(&event);
}

//##ModelId=3E6D5DD30372
void mitk::BaseRenderer::MouseReleaseEvent(mitk::MouseEvent *me)
{
  if (m_CameraController)
    m_CameraController->MouseReleaseEvent(me);
  mitk::Event event(me->type(), me->button(), me->state(), Qt::Key_unknown);
  mitk::EventMapper::MapEvent(&event);
}

//##ModelId=3E6D5DD303C2
void mitk::BaseRenderer::MouseMoveEvent(mitk::MouseEvent *me)
{
  if (m_CameraController)
    m_CameraController->MouseMoveEvent(me);
  mitk::Event event(me->type(), me->button(), me->state(), Qt::Key_unknown);
  mitk::EventMapper::MapEvent(&event);
}

//##ModelId=3E6D5DD4002A
void mitk::BaseRenderer::KeyPressEvent(mitk::KeyEvent *ke)
{
  if (m_CameraController)
    m_CameraController->KeyPressEvent(ke);
  mitk::Event event(ke->type(), Qt::NoButton, Qt::NoButton, ke->key());
  mitk::EventMapper::MapEvent(&event);
}

{'fraction_non_alphanumeric': 0.14771689497716894, 'fraction_numerical': 0.036986301369863014, 'mean_word_length': 6.559102674719586, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 73, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3292428', 'n_tokens_mistral': 3166, 'n_tokens_neox': 3005, 'n_words': 383}