/* 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 "vtkUnstructuredGridAlgorithmWrap.h"
#include "vtkAppendFilterWrap.h"
#include "vtkObjectWrap.h"
#include "vtkDataSetWrap.h"
#include "vtkDataSetCollectionWrap.h"
#include "../../plus/plus.h"

using namespace v8;

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

VtkAppendFilterWrap::VtkAppendFilterWrap()
{ }

VtkAppendFilterWrap::VtkAppendFilterWrap(vtkSmartPointer<vtkAppendFilter> _native)
{ native = _native; }

VtkAppendFilterWrap::~VtkAppendFilterWrap()
{ }

void VtkAppendFilterWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkAppendFilter").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("AppendFilter").ToLocalChecked(), ConstructorGetter);
}

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

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

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

	Nan::SetPrototypeMethod(tpl, "GetInput", GetInput);
	Nan::SetPrototypeMethod(tpl, "getInput", GetInput);

	Nan::SetPrototypeMethod(tpl, "GetInputList", GetInputList);
	Nan::SetPrototypeMethod(tpl, "getInputList", GetInputList);

	Nan::SetPrototypeMethod(tpl, "GetMergePoints", GetMergePoints);
	Nan::SetPrototypeMethod(tpl, "getMergePoints", GetMergePoints);

	Nan::SetPrototypeMethod(tpl, "GetOutputPointsPrecision", GetOutputPointsPrecision);
	Nan::SetPrototypeMethod(tpl, "getOutputPointsPrecision", GetOutputPointsPrecision);

	Nan::SetPrototypeMethod(tpl, "GetOutputPointsPrecisionMaxValue", GetOutputPointsPrecisionMaxValue);
	Nan::SetPrototypeMethod(tpl, "getOutputPointsPrecisionMaxValue", GetOutputPointsPrecisionMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetOutputPointsPrecisionMinValue", GetOutputPointsPrecisionMinValue);
	Nan::SetPrototypeMethod(tpl, "getOutputPointsPrecisionMinValue", GetOutputPointsPrecisionMinValue);

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

	Nan::SetPrototypeMethod(tpl, "MergePointsOff", MergePointsOff);
	Nan::SetPrototypeMethod(tpl, "mergePointsOff", MergePointsOff);

	Nan::SetPrototypeMethod(tpl, "MergePointsOn", MergePointsOn);
	Nan::SetPrototypeMethod(tpl, "mergePointsOn", MergePointsOn);

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

	Nan::SetPrototypeMethod(tpl, "RemoveInputData", RemoveInputData);
	Nan::SetPrototypeMethod(tpl, "removeInputData", RemoveInputData);

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

	Nan::SetPrototypeMethod(tpl, "SetMergePoints", SetMergePoints);
	Nan::SetPrototypeMethod(tpl, "setMergePoints", SetMergePoints);

	Nan::SetPrototypeMethod(tpl, "SetOutputPointsPrecision", SetOutputPointsPrecision);
	Nan::SetPrototypeMethod(tpl, "setOutputPointsPrecision", SetOutputPointsPrecision);

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

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

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

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

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

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

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

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

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

void VtkAppendFilterWrap::IsA(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkAppendFilterWrap *wrapper = ObjectWrap::Unwrap<VtkAppendFilterWrap>(info.Holder());
	vtkAppendFilter *native = (vtkAppendFilter *)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 VtkAppendFilterWrap::MergePointsOff(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkAppendFilterWrap *wrapper = ObjectWrap::Unwrap<VtkAppendFilterWrap>(info.Holder());
	vtkAppendFilter *native = (vtkAppendFilter *)wrapper->native.GetPointer();
		if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	native->MergePointsOff();
}

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

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

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

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

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

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

