/* 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 "vtkDefaultPassWrap.h"
#include "vtkValuePassWrap.h"
#include "vtkObjectWrap.h"
#include "vtkInformationIntegerKeyWrap.h"
#include "vtkInformationStringKeyWrap.h"
#include "vtkInformationDoubleVectorKeyWrap.h"
#include "../../plus/plus.h"

using namespace v8;

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

VtkValuePassWrap::VtkValuePassWrap()
{ }

VtkValuePassWrap::VtkValuePassWrap(vtkSmartPointer<vtkValuePass> _native)
{ native = _native; }

VtkValuePassWrap::~VtkValuePassWrap()
{ }

void VtkValuePassWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkValuePass").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("ValuePass").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "ARRAY_COMPONENT", ARRAY_COMPONENT);

	Nan::SetPrototypeMethod(tpl, "ARRAY_ID", ARRAY_ID);

	Nan::SetPrototypeMethod(tpl, "ARRAY_MODE", ARRAY_MODE);

	Nan::SetPrototypeMethod(tpl, "ARRAY_NAME", ARRAY_NAME);

	Nan::SetPrototypeMethod(tpl, "GetClassName", GetClassName);
	Nan::SetPrototypeMethod(tpl, "getClassName", GetClassName);

	Nan::SetPrototypeMethod(tpl, "IsA", IsA);
	Nan::SetPrototypeMethod(tpl, "isA", IsA);

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

	Nan::SetPrototypeMethod(tpl, "RENDER_VALUES", RENDER_VALUES);

	Nan::SetPrototypeMethod(tpl, "SCALAR_MODE", SCALAR_MODE);

	Nan::SetPrototypeMethod(tpl, "SCALAR_RANGE", SCALAR_RANGE);

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

	Nan::SetPrototypeMethod(tpl, "SetInputArrayToProcess", SetInputArrayToProcess);
	Nan::SetPrototypeMethod(tpl, "setInputArrayToProcess", SetInputArrayToProcess);

	Nan::SetPrototypeMethod(tpl, "SetInputComponentToProcess", SetInputComponentToProcess);
	Nan::SetPrototypeMethod(tpl, "setInputComponentToProcess", SetInputComponentToProcess);

	Nan::SetPrototypeMethod(tpl, "SetScalarRange", SetScalarRange);
	Nan::SetPrototypeMethod(tpl, "setScalarRange", SetScalarRange);

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

void VtkValuePassWrap::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<vtkValuePass> native = vtkSmartPointer<vtkValuePass>::New();
		VtkValuePassWrap* obj = new VtkValuePassWrap(native);
		obj->Wrap(info.This());
	}
	else
	{
		if(info[0]->ToObject() != vtkNodeJsNoWrap )
		{
			Nan::ThrowError("Parameter Error");
			return;
		}
	}

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

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

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

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

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

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

void VtkValuePassWrap::IsA(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkValuePassWrap *wrapper = ObjectWrap::Unwrap<VtkValuePassWrap>(info.Holder());
	vtkValuePass *native = (vtkValuePass *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsString())
	{
		Nan::Utf8String a0(info[0]);
		int r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->IsA(
			*a0
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

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

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

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

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

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

void VtkValuePassWrap::SetInputArrayToProcess(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkValuePassWrap *wrapper = ObjectWrap::Unwrap<VtkValuePassWrap>(info.Holder());
	vtkValuePass *native = (vtkValuePass *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
		if(info.Length() > 1 && info[1]->IsString())
		{
			Nan::Utf8String a1(info[1]);
						if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			native->SetInputArrayToProcess(
				info[0]->Int32Value(),
				*a1
			);
			return;
		}
		else if(info.Length() > 1 && info[1]->IsInt32())
		{
						if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			native->SetInputArrayToProcess(
				info[0]->Int32Value(),
				info[1]->Int32Value()
			);
			return;
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

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

void VtkValuePassWrap::SetScalarRange(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkValuePassWrap *wrapper = ObjectWrap::Unwrap<VtkValuePassWrap>(info.Holder());
	vtkValuePass *native = (vtkValuePass *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsNumber())
		{
						if(info.Length() != 2)
			{
				Nan::ThrowError("Too many parameters.");
				return;
			}
			native->SetScalarRange(
				info[0]->NumberValue(),
				info[1]->NumberValue()
			);
			return;
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

