TNMParallelCoordinates::TNMParallelCoordinates()
    : RenderProcessor()
    , _inport(Port::INPORT, "in.data")
    , _outport(Port::OUTPORT, "out.image")
    , _privatePort(Port::OUTPORT, "private.image", false, Processor::INVALID_RESULT, GL_RGBA32F)
    , _pickedHandle(-1)
	, _brushingIndices("brushingIndices", "Brushing Indices")
	, _linkingIndices("linkingIndices", "Linking Indices")
{
    addPort(_inport);
    addPort(_outport);
    addPrivateRenderPort(_privatePort);

	addProperty(_brushingIndices);
	addProperty(_linkingIndices);

    _mouseClickEvent = new EventProperty<TNMParallelCoordinates>(
        "mouse.click", "Mouse Click",
        this, &TNMParallelCoordinates::handleMouseClick,
        tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::CLICK, tgt::Event::MODIFIER_NONE);
    addEventProperty(_mouseClickEvent);
    
    _mouseClickEvent = new EventProperty<TNMParallelCoordinates>(
        "mouse.rightclick", "Mouse Right Click",
        this, &TNMParallelCoordinates::handleMouseClick,
        tgt::MouseEvent::MOUSE_BUTTON_RIGHT, tgt::MouseEvent::CLICK, tgt::Event::MODIFIER_NONE);
    addEventProperty(_mouseClickEvent);

    _mouseMoveEvent = new EventProperty<TNMParallelCoordinates>(
        "mouse.move", "Mouse Move",
        this, &TNMParallelCoordinates::handleMouseMove,
        tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::MOTION, tgt::Event::MODIFIER_NONE);
    addEventProperty(_mouseMoveEvent);

    _mouseReleaseEvent = new EventProperty<TNMParallelCoordinates>(
        "mouse.release", "Mouse Release",
        this, &TNMParallelCoordinates::handleMouseRelease,
        tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::RELEASED, tgt::Event::MODIFIER_NONE);
    addEventProperty(_mouseReleaseEvent);

    // Create AxisHandles here with a unique id
    _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionBottom, 0, tgt::vec2(-1.f, -1.0f)));
    _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionTop, 1, tgt::vec2(-1.f, 1.0f)));
    
     _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionBottom, 2, tgt::vec2(-1.0/3, -1.0f)));
    _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionTop, 3, tgt::vec2(-1.0/3, 1.0f)));
    
     _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionBottom, 4, tgt::vec2(1.0/3, -1.0f)));
    _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionTop, 5, tgt::vec2(1.0/3, 1.0f)));
    
     _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionBottom, 6, tgt::vec2(1.f, -1.0f)));
    _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionTop, 7, tgt::vec2(1.f, 1.0f)));
}
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
TNMParallelCoordinates::TNMParallelCoordinates()
    : RenderProcessor()
    , _inport(Port::INPORT, "in.data")
	, _outport(Port::OUTPORT, "out.image")
	, _privatePort(Port::OUTPORT, "private.image", false, Processor::INVALID_RESULT, GL_RGBA32F)
    , _pickedHandle(-1)
	, _font("font", "Font")
	, _colorMethod("colorMethod", "Coloring Method")
	, _brushingIndices("brushingIndices", "Brushing Indices")
	, _linkingIndices("linkingIndices", "Linking Indices")
{
  //----------------------------------------------------------------------------------------------------------------------------------------------------------------
    addPort(_inport);
    addPort(_outport);
    addPrivateRenderPort(_privatePort);

	addProperty(_font);
	addProperty(_colorMethod);	//
    // Create AxisHandles here with a unique id
    // _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionTop, 0, /* fix startposition */));
    // ...
	//

	addProperty(_brushingIndices);
	addProperty(_linkingIndices);

    _mouseClickEvent = new EventProperty<TNMParallelCoordinates>(
        "mouse.click", "Mouse Click",
        this, &TNMParallelCoordinates::handleMouseClick,
        tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::CLICK, tgt::Event::MODIFIER_NONE);
    addEventProperty(_mouseClickEvent);
    
    _mouseClickEventRight = new EventProperty<TNMParallelCoordinates>(
        "mouseright.click", "Mouse Right Click",
        this, &TNMParallelCoordinates::handleMouseClickRight,
        tgt::MouseEvent::MOUSE_BUTTON_RIGHT, tgt::MouseEvent::CLICK, tgt::Event::MODIFIER_NONE);
    addEventProperty(_mouseClickEventRight);

    _mouseMoveEvent = new EventProperty<TNMParallelCoordinates>(
        "mouse.move", "Mouse Move",
        this, &TNMParallelCoordinates::handleMouseMove,
        tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::MOTION, tgt::Event::MODIFIER_NONE);
    addEventProperty(_mouseMoveEvent);

    _mouseReleaseEvent = new EventProperty<TNMParallelCoordinates>(
        "mouse.release", "Mouse Release",
        this, &TNMParallelCoordinates::handleMouseRelease,
        tgt::MouseEvent::MOUSE_BUTTON_LEFT, tgt::MouseEvent::RELEASED, tgt::Event::MODIFIER_NONE);
    addEventProperty(_mouseReleaseEvent);

    // Create AxisHandles here with a unique id
     float x_width = 1.8f / (NUM_DATA_VALUES - 1);
     float x_pos = -0.9f;
    for( int i = 0; i < 6; i++)
    {
      _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionTop, i, tgt::vec2(x_pos, 0.9f)));
       x_pos += x_width;
    }
    
    x_pos = -0.9f;
    for( int i = 6; i < 12; i++)
    {
      _handles.push_back(AxisHandle(AxisHandle::AxisHandlePositionBottom, i, tgt::vec2(x_pos, -0.9f)));
       x_pos += x_width;
    }


}