/* 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 "vtkMultiBlockDataSetAlgorithmWrap.h"
#include "vtkMultiThresholdWrap.h"
#include "vtkObjectWrap.h"
#include "../../plus/plus.h"

using namespace v8;

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

VtkMultiThresholdWrap::VtkMultiThresholdWrap()
{ }

VtkMultiThresholdWrap::VtkMultiThresholdWrap(vtkSmartPointer<vtkMultiThreshold> _native)
{ native = _native; }

VtkMultiThresholdWrap::~VtkMultiThresholdWrap()
{ }

void VtkMultiThresholdWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkMultiThreshold").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("MultiThreshold").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "AddBandpassIntervalSet", AddBandpassIntervalSet);
	Nan::SetPrototypeMethod(tpl, "addBandpassIntervalSet", AddBandpassIntervalSet);

	Nan::SetPrototypeMethod(tpl, "AddHighpassIntervalSet", AddHighpassIntervalSet);
	Nan::SetPrototypeMethod(tpl, "addHighpassIntervalSet", AddHighpassIntervalSet);

	Nan::SetPrototypeMethod(tpl, "AddIntervalSet", AddIntervalSet);
	Nan::SetPrototypeMethod(tpl, "addIntervalSet", AddIntervalSet);

	Nan::SetPrototypeMethod(tpl, "AddLowpassIntervalSet", AddLowpassIntervalSet);
	Nan::SetPrototypeMethod(tpl, "addLowpassIntervalSet", AddLowpassIntervalSet);

	Nan::SetPrototypeMethod(tpl, "AddNotchIntervalSet", AddNotchIntervalSet);
	Nan::SetPrototypeMethod(tpl, "addNotchIntervalSet", AddNotchIntervalSet);

	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, "OutputSet", OutputSet);
	Nan::SetPrototypeMethod(tpl, "outputSet", OutputSet);

	Nan::SetPrototypeMethod(tpl, "Reset", Reset);
	Nan::SetPrototypeMethod(tpl, "reset", Reset);

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

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

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

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

void VtkMultiThresholdWrap::AddBandpassIntervalSet(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkMultiThresholdWrap *wrapper = ObjectWrap::Unwrap<VtkMultiThresholdWrap>(info.Holder());
	vtkMultiThreshold *native = (vtkMultiThreshold *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsNumber())
		{
			if(info.Length() > 2 && info[2]->IsInt32())
			{
				if(info.Length() > 3 && info[3]->IsString())
				{
					Nan::Utf8String a3(info[3]);
					if(info.Length() > 4 && info[4]->IsInt32())
					{
						if(info.Length() > 5 && info[5]->IsInt32())
						{
							int r;
							if(info.Length() != 6)
							{
								Nan::ThrowError("Too many parameters.");
								return;
							}
							r = native->AddBandpassIntervalSet(
								info[0]->NumberValue(),
								info[1]->NumberValue(),
								info[2]->Int32Value(),
								*a3,
								info[4]->Int32Value(),
								info[5]->Int32Value()
							);
							info.GetReturnValue().Set(Nan::New(r));
							return;
						}
					}
				}
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkMultiThresholdWrap::AddHighpassIntervalSet(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkMultiThresholdWrap *wrapper = ObjectWrap::Unwrap<VtkMultiThresholdWrap>(info.Holder());
	vtkMultiThreshold *native = (vtkMultiThreshold *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsInt32())
		{
			if(info.Length() > 2 && info[2]->IsString())
			{
				Nan::Utf8String a2(info[2]);
				if(info.Length() > 3 && info[3]->IsInt32())
				{
					if(info.Length() > 4 && info[4]->IsInt32())
					{
						int r;
						if(info.Length() != 5)
						{
							Nan::ThrowError("Too many parameters.");
							return;
						}
						r = native->AddHighpassIntervalSet(
							info[0]->NumberValue(),
							info[1]->Int32Value(),
							*a2,
							info[3]->Int32Value(),
							info[4]->Int32Value()
						);
						info.GetReturnValue().Set(Nan::New(r));
						return;
					}
				}
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkMultiThresholdWrap::AddIntervalSet(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkMultiThresholdWrap *wrapper = ObjectWrap::Unwrap<VtkMultiThresholdWrap>(info.Holder());
	vtkMultiThreshold *native = (vtkMultiThreshold *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsNumber())
		{
			if(info.Length() > 2 && info[2]->IsInt32())
			{
				if(info.Length() > 3 && info[3]->IsInt32())
				{
					if(info.Length() > 4 && info[4]->IsInt32())
					{
						if(info.Length() > 5 && info[5]->IsString())
						{
							Nan::Utf8String a5(info[5]);
							if(info.Length() > 6 && info[6]->IsInt32())
							{
								if(info.Length() > 7 && info[7]->IsInt32())
								{
									int r;
									if(info.Length() != 8)
									{
										Nan::ThrowError("Too many parameters.");
										return;
									}
									r = native->AddIntervalSet(
										info[0]->NumberValue(),
										info[1]->NumberValue(),
										info[2]->Int32Value(),
										info[3]->Int32Value(),
										info[4]->Int32Value(),
										*a5,
										info[6]->Int32Value(),
										info[7]->Int32Value()
									);
									info.GetReturnValue().Set(Nan::New(r));
									return;
								}
							}
						}
						else if(info.Length() > 5 && info[5]->IsInt32())
						{
							if(info.Length() > 6 && info[6]->IsInt32())
							{
								if(info.Length() > 7 && info[7]->IsInt32())
								{
									int r;
									if(info.Length() != 8)
									{
										Nan::ThrowError("Too many parameters.");
										return;
									}
									r = native->AddIntervalSet(
										info[0]->NumberValue(),
										info[1]->NumberValue(),
										info[2]->Int32Value(),
										info[3]->Int32Value(),
										info[4]->Int32Value(),
										info[5]->Int32Value(),
										info[6]->Int32Value(),
										info[7]->Int32Value()
									);
									info.GetReturnValue().Set(Nan::New(r));
									return;
								}
							}
						}
					}
				}
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkMultiThresholdWrap::AddLowpassIntervalSet(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkMultiThresholdWrap *wrapper = ObjectWrap::Unwrap<VtkMultiThresholdWrap>(info.Holder());
	vtkMultiThreshold *native = (vtkMultiThreshold *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsInt32())
		{
			if(info.Length() > 2 && info[2]->IsString())
			{
				Nan::Utf8String a2(info[2]);
				if(info.Length() > 3 && info[3]->IsInt32())
				{
					if(info.Length() > 4 && info[4]->IsInt32())
					{
						int r;
						if(info.Length() != 5)
						{
							Nan::ThrowError("Too many parameters.");
							return;
						}
						r = native->AddLowpassIntervalSet(
							info[0]->NumberValue(),
							info[1]->Int32Value(),
							*a2,
							info[3]->Int32Value(),
							info[4]->Int32Value()
						);
						info.GetReturnValue().Set(Nan::New(r));
						return;
					}
				}
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkMultiThresholdWrap::AddNotchIntervalSet(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkMultiThresholdWrap *wrapper = ObjectWrap::Unwrap<VtkMultiThresholdWrap>(info.Holder());
	vtkMultiThreshold *native = (vtkMultiThreshold *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsNumber())
	{
		if(info.Length() > 1 && info[1]->IsNumber())
		{
			if(info.Length() > 2 && info[2]->IsInt32())
			{
				if(info.Length() > 3 && info[3]->IsString())
				{
					Nan::Utf8String a3(info[3]);
					if(info.Length() > 4 && info[4]->IsInt32())
					{
						if(info.Length() > 5 && info[5]->IsInt32())
						{
							int r;
							if(info.Length() != 6)
							{
								Nan::ThrowError("Too many parameters.");
								return;
							}
							r = native->AddNotchIntervalSet(
								info[0]->NumberValue(),
								info[1]->NumberValue(),
								info[2]->Int32Value(),
								*a3,
								info[4]->Int32Value(),
								info[5]->Int32Value()
							);
							info.GetReturnValue().Set(Nan::New(r));
							return;
						}
					}
				}
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

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

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

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

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

