/* this file has been autogenerated by vtkNodeJsWrap */
/* editing this might proof futile */

#define VTK_WRAPPING_CXX
#define VTK_STREAMS_FWD_ONLY
#include <nan.h>

#include "vtkObjectWrap.h"
#include "vtkContextSceneWrap.h"
#include "vtkObjectBaseWrap.h"
#include "vtkContext2DWrap.h"
#include "vtkAbstractContextItemWrap.h"
#include "vtkAnnotationLinkWrap.h"
#include "vtkRendererWrap.h"
#include "vtkAbstractContextBufferIdWrap.h"
#include "vtkTransform2DWrap.h"
#include "../../plus/plus.h"

using namespace v8;

extern Nan::Persistent<v8::Object> vtkNodeJsNoWrap;
Nan::Persistent<v8::FunctionTemplate> VtkContextSceneWrap::ptpl;

VtkContextSceneWrap::VtkContextSceneWrap()
{ }

VtkContextSceneWrap::VtkContextSceneWrap(vtkSmartPointer<vtkContextScene> _native)
{ native = _native; }

VtkContextSceneWrap::~VtkContextSceneWrap()
{ }

void VtkContextSceneWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkContextScene").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("ContextScene").ToLocalChecked(), ConstructorGetter);
}

void VtkContextSceneWrap::ConstructorGetter(
	v8::Local<v8::String> property,
	const Nan::PropertyCallbackInfo<v8::Value>& info)
{
	InitPtpl();
	info.GetReturnValue().Set(Nan::New(ptpl)->GetFunction());
}

void VtkContextSceneWrap::InitPtpl()
{
	if (!ptpl.IsEmpty()) return;
	v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);
	VtkObjectWrap::InitPtpl( );
	tpl->Inherit(Nan::New<FunctionTemplate>(VtkObjectWrap::ptpl));
	tpl->SetClassName(Nan::New("VtkContextSceneWrap").ToLocalChecked());
	tpl->InstanceTemplate()->SetInternalFieldCount(1);

	Nan::SetPrototypeMethod(tpl, "AddItem", AddItem);
	Nan::SetPrototypeMethod(tpl, "addItem", AddItem);

	Nan::SetPrototypeMethod(tpl, "ClearItems", ClearItems);
	Nan::SetPrototypeMethod(tpl, "clearItems", ClearItems);

	Nan::SetPrototypeMethod(tpl, "GetAnnotationLink", GetAnnotationLink);
	Nan::SetPrototypeMethod(tpl, "getAnnotationLink", GetAnnotationLink);

	Nan::SetPrototypeMethod(tpl, "GetBufferId", GetBufferId);
	Nan::SetPrototypeMethod(tpl, "getBufferId", GetBufferId);

	Nan::SetPrototypeMethod(tpl, "GetDirty", GetDirty);
	Nan::SetPrototypeMethod(tpl, "getDirty", GetDirty);

	Nan::SetPrototypeMethod(tpl, "GetGeometry", GetGeometry);
	Nan::SetPrototypeMethod(tpl, "getGeometry", GetGeometry);

	Nan::SetPrototypeMethod(tpl, "GetItem", GetItem);
	Nan::SetPrototypeMethod(tpl, "getItem", GetItem);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfItems", GetNumberOfItems);
	Nan::SetPrototypeMethod(tpl, "getNumberOfItems", GetNumberOfItems);

	Nan::SetPrototypeMethod(tpl, "GetRenderer", GetRenderer);
	Nan::SetPrototypeMethod(tpl, "getRenderer", GetRenderer);

	Nan::SetPrototypeMethod(tpl, "GetScaleTiles", GetScaleTiles);
	Nan::SetPrototypeMethod(tpl, "getScaleTiles", GetScaleTiles);

	Nan::SetPrototypeMethod(tpl, "GetSceneHeight", GetSceneHeight);
	Nan::SetPrototypeMethod(tpl, "getSceneHeight", GetSceneHeight);

	Nan::SetPrototypeMethod(tpl, "GetSceneWidth", GetSceneWidth);
	Nan::SetPrototypeMethod(tpl, "getSceneWidth", GetSceneWidth);

	Nan::SetPrototypeMethod(tpl, "GetTransform", GetTransform);
	Nan::SetPrototypeMethod(tpl, "getTransform", GetTransform);

	Nan::SetPrototypeMethod(tpl, "GetUseBufferId", GetUseBufferId);
	Nan::SetPrototypeMethod(tpl, "getUseBufferId", GetUseBufferId);

	Nan::SetPrototypeMethod(tpl, "GetViewHeight", GetViewHeight);
	Nan::SetPrototypeMethod(tpl, "getViewHeight", GetViewHeight);

	Nan::SetPrototypeMethod(tpl, "GetViewWidth", GetViewWidth);
	Nan::SetPrototypeMethod(tpl, "getViewWidth", GetViewWidth);

	Nan::SetPrototypeMethod(tpl, "HasTransform", HasTransform);
	Nan::SetPrototypeMethod(tpl, "hasTransform", HasTransform);

	Nan::SetPrototypeMethod(tpl, "NewInstance", NewInstance);
	Nan::SetPrototypeMethod(tpl, "newInstance", NewInstance);

	Nan::SetPrototypeMethod(tpl, "Paint", Paint);
	Nan::SetPrototypeMethod(tpl, "paint", Paint);

	Nan::SetPrototypeMethod(tpl, "ReleaseGraphicsResources", ReleaseGraphicsResources);
	Nan::SetPrototypeMethod(tpl, "releaseGraphicsResources", ReleaseGraphicsResources);

	Nan::SetPrototypeMethod(tpl, "RemoveItem", RemoveItem);
	Nan::SetPrototypeMethod(tpl, "removeItem", RemoveItem);

	Nan::SetPrototypeMethod(tpl, "SafeDownCast", SafeDownCast);
	Nan::SetPrototypeMethod(tpl, "safeDownCast", SafeDownCast);

	Nan::SetPrototypeMethod(tpl, "ScaleTilesOff", ScaleTilesOff);
	Nan::SetPrototypeMethod(tpl, "scaleTilesOff", ScaleTilesOff);

	Nan::SetPrototypeMethod(tpl, "ScaleTilesOn", ScaleTilesOn);
	Nan::SetPrototypeMethod(tpl, "scaleTilesOn", ScaleTilesOn);

	Nan::SetPrototypeMethod(tpl, "SetAnnotationLink", SetAnnotationLink);
	Nan::SetPrototypeMethod(tpl, "setAnnotationLink", SetAnnotationLink);

	Nan::SetPrototypeMethod(tpl, "SetDirty", SetDirty);
	Nan::SetPrototypeMethod(tpl, "setDirty", SetDirty);

	Nan::SetPrototypeMethod(tpl, "SetGeometry", SetGeometry);
	Nan::SetPrototypeMethod(tpl, "setGeometry", SetGeometry);

	Nan::SetPrototypeMethod(tpl, "SetRenderer", SetRenderer);
	Nan::SetPrototypeMethod(tpl, "setRenderer", SetRenderer);

	Nan::SetPrototypeMethod(tpl, "SetScaleTiles", SetScaleTiles);
	Nan::SetPrototypeMethod(tpl, "setScaleTiles", SetScaleTiles);

	Nan::SetPrototypeMethod(tpl, "SetTransform", SetTransform);
	Nan::SetPrototypeMethod(tpl, "setTransform", SetTransform);

	Nan::SetPrototypeMethod(tpl, "SetUseBufferId", SetUseBufferId);
	Nan::SetPrototypeMethod(tpl, "setUseBufferId", SetUseBufferId);

#ifdef VTK_NODE_PLUS_VTKCONTEXTSCENEWRAP_INITPTPL
	VTK_NODE_PLUS_VTKCONTEXTSCENEWRAP_INITPTPL
#endif
	ptpl.Reset( tpl );
}

void VtkContextSceneWrap::New(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	if(!info.IsConstructCall())
	{
		Nan::ThrowError("Constructor not called in a construct call.");
		return;
	}

	if(info.Length() == 0)
	{
		vtkSmartPointer<vtkContextScene> native = vtkSmartPointer<vtkContextScene>::New();
		VtkContextSceneWrap* obj = new VtkContextSceneWrap(native);
		obj->Wrap(info.This());
	}
	else
	{
		if(info[0]->ToObject() != vtkNodeJsNoWrap )
		{
			Nan::ThrowError("Parameter Error");
			return;
		}
	}

	info.GetReturnValue().Set(info.This());
}

void VtkContextSceneWrap::AddItem(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkAbstractContextItemWrap::ptpl))->HasInstance(info[0]))
	{
		VtkAbstractContextItemWrap *a0 = ObjectWrap::Unwrap<VtkAbstractContextItemWrap>(info[0]->ToObject());
		unsigned int r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->AddItem(
			(vtkAbstractContextItem *) a0->native.GetPointer()
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkContextSceneWrap::ClearItems(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->ClearItems();
}

void VtkContextSceneWrap::GetAnnotationLink(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	vtkAnnotationLink * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetAnnotationLink();
	VtkAnnotationLinkWrap::InitPtpl();
	v8::Local<v8::Value> argv[1] =
		{ Nan::New(vtkNodeJsNoWrap) };
	v8::Local<v8::Function> cons =
		Nan::New<v8::FunctionTemplate>(VtkAnnotationLinkWrap::ptpl)->GetFunction();
	v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
	VtkAnnotationLinkWrap *w = new VtkAnnotationLinkWrap();
	w->native = r;
	w->Wrap(wo);
	info.GetReturnValue().Set(wo);
}

void VtkContextSceneWrap::GetBufferId(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	vtkAbstractContextBufferId * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetBufferId();
	VtkAbstractContextBufferIdWrap::InitPtpl();
	v8::Local<v8::Value> argv[1] =
		{ Nan::New(vtkNodeJsNoWrap) };
	v8::Local<v8::Function> cons =
		Nan::New<v8::FunctionTemplate>(VtkAbstractContextBufferIdWrap::ptpl)->GetFunction();
	v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
	VtkAbstractContextBufferIdWrap *w = new VtkAbstractContextBufferIdWrap();
	w->native = r;
	w->Wrap(wo);
	info.GetReturnValue().Set(wo);
}

void VtkContextSceneWrap::GetDirty(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	bool r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetDirty();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkContextSceneWrap::GetGeometry(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	int const * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetGeometry();
	Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), 2 * sizeof(int));
	Local<v8::Int32Array> at = v8::Int32Array::New(ab, 0, 2);
	memcpy(ab->GetContents().Data(), r, 2 * sizeof(int));
	info.GetReturnValue().Set(at);
}

void VtkContextSceneWrap::GetItem(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsUint32())
	{
		vtkAbstractContextItem * r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->GetItem(
			info[0]->Uint32Value()
		);
		VtkAbstractContextItemWrap::InitPtpl();
		v8::Local<v8::Value> argv[1] =
			{ Nan::New(vtkNodeJsNoWrap) };
		v8::Local<v8::Function> cons =
			Nan::New<v8::FunctionTemplate>(VtkAbstractContextItemWrap::ptpl)->GetFunction();
		v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
		VtkAbstractContextItemWrap *w = new VtkAbstractContextItemWrap();
		w->native = r;
		w->Wrap(wo);
		info.GetReturnValue().Set(wo);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkContextSceneWrap::GetNumberOfItems(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	unsigned int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetNumberOfItems();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkContextSceneWrap::GetRenderer(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	vtkRenderer * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetRenderer();
	VtkRendererWrap::InitPtpl();
	v8::Local<v8::Value> argv[1] =
		{ Nan::New(vtkNodeJsNoWrap) };
	v8::Local<v8::Function> cons =
		Nan::New<v8::FunctionTemplate>(VtkRendererWrap::ptpl)->GetFunction();
	v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
	VtkRendererWrap *w = new VtkRendererWrap();
	w->native = r;
	w->Wrap(wo);
	info.GetReturnValue().Set(wo);
}

void VtkContextSceneWrap::GetScaleTiles(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	bool r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetScaleTiles();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkContextSceneWrap::GetSceneHeight(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetSceneHeight();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkContextSceneWrap::GetSceneWidth(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetSceneWidth();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkContextSceneWrap::GetTransform(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	vtkTransform2D * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetTransform();
	VtkTransform2DWrap::InitPtpl();
	v8::Local<v8::Value> argv[1] =
		{ Nan::New(vtkNodeJsNoWrap) };
	v8::Local<v8::Function> cons =
		Nan::New<v8::FunctionTemplate>(VtkTransform2DWrap::ptpl)->GetFunction();
	v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
	VtkTransform2DWrap *w = new VtkTransform2DWrap();
	w->native = r;
	w->Wrap(wo);
	info.GetReturnValue().Set(wo);
}

void VtkContextSceneWrap::GetUseBufferId(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	bool r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetUseBufferId();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkContextSceneWrap::GetViewHeight(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetViewHeight();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkContextSceneWrap::GetViewWidth(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetViewWidth();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkContextSceneWrap::HasTransform(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	bool r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->HasTransform();
	info.GetReturnValue().Set(Nan::New(r));
}

void VtkContextSceneWrap::NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	vtkContextScene * r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->NewInstance();
	VtkContextSceneWrap::InitPtpl();
	v8::Local<v8::Value> argv[1] =
		{ Nan::New(vtkNodeJsNoWrap) };
	v8::Local<v8::Function> cons =
		Nan::New<v8::FunctionTemplate>(VtkContextSceneWrap::ptpl)->GetFunction();
	v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
	VtkContextSceneWrap *w = new VtkContextSceneWrap();
	w->native = r;
	w->Wrap(wo);
	info.GetReturnValue().Set(wo);
}

void VtkContextSceneWrap::Paint(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkContext2DWrap::ptpl))->HasInstance(info[0]))
	{
		VtkContext2DWrap *a0 = ObjectWrap::Unwrap<VtkContext2DWrap>(info[0]->ToObject());
		bool r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->Paint(
			(vtkContext2D *) a0->native.GetPointer()
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkContextSceneWrap::ReleaseGraphicsResources(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->ReleaseGraphicsResources();
}

void VtkContextSceneWrap::RemoveItem(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkAbstractContextItemWrap::ptpl))->HasInstance(info[0]))
	{
		VtkAbstractContextItemWrap *a0 = ObjectWrap::Unwrap<VtkAbstractContextItemWrap>(info[0]->ToObject());
		bool r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->RemoveItem(
			(vtkAbstractContextItem *) a0->native.GetPointer()
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	else if(info.Length() > 0 && info[0]->IsUint32())
	{
		bool r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->RemoveItem(
			info[0]->Uint32Value()
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkContextSceneWrap::SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkObjectBaseWrap::ptpl))->HasInstance(info[0]))
	{
		VtkObjectBaseWrap *a0 = ObjectWrap::Unwrap<VtkObjectBaseWrap>(info[0]->ToObject());
		vtkContextScene * r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->SafeDownCast(
			(vtkObjectBase *) a0->native.GetPointer()
		);
		VtkContextSceneWrap::InitPtpl();
		v8::Local<v8::Value> argv[1] =
			{ Nan::New(vtkNodeJsNoWrap) };
		v8::Local<v8::Function> cons =
			Nan::New<v8::FunctionTemplate>(VtkContextSceneWrap::ptpl)->GetFunction();
		v8::Local<v8::Object> wo = cons->NewInstance(1, argv);
		VtkContextSceneWrap *w = new VtkContextSceneWrap();
		w->native = r;
		w->Wrap(wo);
		info.GetReturnValue().Set(wo);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkContextSceneWrap::ScaleTilesOff(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->ScaleTilesOff();
}

void VtkContextSceneWrap::ScaleTilesOn(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->ScaleTilesOn();
}

void VtkContextSceneWrap::SetAnnotationLink(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkAnnotationLinkWrap::ptpl))->HasInstance(info[0]))
	{
		VtkAnnotationLinkWrap *a0 = ObjectWrap::Unwrap<VtkAnnotationLinkWrap>(info[0]->ToObject());
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetAnnotationLink(
			(vtkAnnotationLink *) a0->native.GetPointer()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkContextSceneWrap::SetDirty(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsBoolean())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetDirty(
			info[0]->BooleanValue()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkContextSceneWrap::SetGeometry(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	size_t i;
	if(info.Length() > 0 && info[0]->IsInt32Array())
	{
		v8::Local<v8::Int32Array>a0(v8::Local<v8::Int32Array>::Cast(info[0]->ToObject()));
		if( a0->Length() < 2 )
		{
			Nan::ThrowError("Array too short.");
			return;
		}

				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetGeometry(
			(int *)(a0->Buffer()->GetContents().Data())
		);
		return;
	}
	else if(info.Length() > 0 && info[0]->IsArray())
	{
		v8::Local<v8::Array>a0(v8::Local<v8::Array>::Cast(info[0]->ToObject()));
		int b0[2];
		if( a0->Length() < 2 )
		{
			Nan::ThrowError("Array too short.");
			return;
		}

		for( i = 0; i < 2; i++ )
		{
			if( !a0->Get(i)->IsInt32() )
			{
				Nan::ThrowError("Array contents invalid.");
				return;
			}
			b0[i] = a0->Get(i)->Int32Value();
		}
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetGeometry(
			b0
		);
		return;
	}
	else if(info.Length() > 0 && info[0]->IsInt32())
	{
		if(info.Length() > 1 && info[1]->IsInt32())
		{
						if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			native->SetGeometry(
				info[0]->Int32Value(),
				info[1]->Int32Value()
			);
			return;
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkContextSceneWrap::SetRenderer(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkRendererWrap::ptpl))->HasInstance(info[0]))
	{
		VtkRendererWrap *a0 = ObjectWrap::Unwrap<VtkRendererWrap>(info[0]->ToObject());
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetRenderer(
			(vtkRenderer *) a0->native.GetPointer()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkContextSceneWrap::SetScaleTiles(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsBoolean())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetScaleTiles(
			info[0]->BooleanValue()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkContextSceneWrap::SetTransform(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkTransform2DWrap::ptpl))->HasInstance(info[0]))
	{
		VtkTransform2DWrap *a0 = ObjectWrap::Unwrap<VtkTransform2DWrap>(info[0]->ToObject());
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetTransform(
			(vtkTransform2D *) a0->native.GetPointer()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkContextSceneWrap::SetUseBufferId(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkContextSceneWrap *wrapper = ObjectWrap::Unwrap<VtkContextSceneWrap>(info.Holder());
	vtkContextScene *native = (vtkContextScene *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsBoolean())
	{
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetUseBufferId(
			info[0]->BooleanValue()
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

