/* 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 "vtkMergeCellsWrap.h"
#include "vtkUnstructuredGridWrap.h"
#include "vtkDataSetWrap.h"
#include "../../plus/plus.h"

using namespace v8;

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

VtkMergeCellsWrap::VtkMergeCellsWrap()
{ }

VtkMergeCellsWrap::VtkMergeCellsWrap(vtkSmartPointer<vtkMergeCells> _native)
{ native = _native; }

VtkMergeCellsWrap::~VtkMergeCellsWrap()
{ }

void VtkMergeCellsWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkMergeCells").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("MergeCells").ToLocalChecked(), ConstructorGetter);
}

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

void VtkMergeCellsWrap::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("VtkMergeCellsWrap").ToLocalChecked());
	tpl->InstanceTemplate()->SetInternalFieldCount(1);

	Nan::SetPrototypeMethod(tpl, "Finish", Finish);
	Nan::SetPrototypeMethod(tpl, "finish", Finish);

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

	Nan::SetPrototypeMethod(tpl, "GetMergeDuplicatePoints", GetMergeDuplicatePoints);
	Nan::SetPrototypeMethod(tpl, "getMergeDuplicatePoints", GetMergeDuplicatePoints);

	Nan::SetPrototypeMethod(tpl, "GetPointMergeTolerance", GetPointMergeTolerance);
	Nan::SetPrototypeMethod(tpl, "getPointMergeTolerance", GetPointMergeTolerance);

	Nan::SetPrototypeMethod(tpl, "GetPointMergeToleranceMaxValue", GetPointMergeToleranceMaxValue);
	Nan::SetPrototypeMethod(tpl, "getPointMergeToleranceMaxValue", GetPointMergeToleranceMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetPointMergeToleranceMinValue", GetPointMergeToleranceMinValue);
	Nan::SetPrototypeMethod(tpl, "getPointMergeToleranceMinValue", GetPointMergeToleranceMinValue);

	Nan::SetPrototypeMethod(tpl, "GetTotalNumberOfDataSets", GetTotalNumberOfDataSets);
	Nan::SetPrototypeMethod(tpl, "getTotalNumberOfDataSets", GetTotalNumberOfDataSets);

	Nan::SetPrototypeMethod(tpl, "GetUnstructuredGrid", GetUnstructuredGrid);
	Nan::SetPrototypeMethod(tpl, "getUnstructuredGrid", GetUnstructuredGrid);

	Nan::SetPrototypeMethod(tpl, "GetUseGlobalCellIds", GetUseGlobalCellIds);
	Nan::SetPrototypeMethod(tpl, "getUseGlobalCellIds", GetUseGlobalCellIds);

	Nan::SetPrototypeMethod(tpl, "GetUseGlobalIds", GetUseGlobalIds);
	Nan::SetPrototypeMethod(tpl, "getUseGlobalIds", GetUseGlobalIds);

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

	Nan::SetPrototypeMethod(tpl, "MergeDataSet", MergeDataSet);
	Nan::SetPrototypeMethod(tpl, "mergeDataSet", MergeDataSet);

	Nan::SetPrototypeMethod(tpl, "MergeDuplicatePointsOff", MergeDuplicatePointsOff);
	Nan::SetPrototypeMethod(tpl, "mergeDuplicatePointsOff", MergeDuplicatePointsOff);

	Nan::SetPrototypeMethod(tpl, "MergeDuplicatePointsOn", MergeDuplicatePointsOn);
	Nan::SetPrototypeMethod(tpl, "mergeDuplicatePointsOn", MergeDuplicatePointsOn);

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

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

	Nan::SetPrototypeMethod(tpl, "SetMergeDuplicatePoints", SetMergeDuplicatePoints);
	Nan::SetPrototypeMethod(tpl, "setMergeDuplicatePoints", SetMergeDuplicatePoints);

	Nan::SetPrototypeMethod(tpl, "SetPointMergeTolerance", SetPointMergeTolerance);
	Nan::SetPrototypeMethod(tpl, "setPointMergeTolerance", SetPointMergeTolerance);

	Nan::SetPrototypeMethod(tpl, "SetTotalNumberOfDataSets", SetTotalNumberOfDataSets);
	Nan::SetPrototypeMethod(tpl, "setTotalNumberOfDataSets", SetTotalNumberOfDataSets);

	Nan::SetPrototypeMethod(tpl, "SetUnstructuredGrid", SetUnstructuredGrid);
	Nan::SetPrototypeMethod(tpl, "setUnstructuredGrid", SetUnstructuredGrid);

	Nan::SetPrototypeMethod(tpl, "SetUseGlobalCellIds", SetUseGlobalCellIds);
	Nan::SetPrototypeMethod(tpl, "setUseGlobalCellIds", SetUseGlobalCellIds);

	Nan::SetPrototypeMethod(tpl, "SetUseGlobalIds", SetUseGlobalIds);
	Nan::SetPrototypeMethod(tpl, "setUseGlobalIds", SetUseGlobalIds);

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

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

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

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

void VtkMergeCellsWrap::GetClassName(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkMergeCellsWrap *wrapper = ObjectWrap::Unwrap<VtkMergeCellsWrap>(info.Holder());
	vtkMergeCells *native = (vtkMergeCells *)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 VtkMergeCellsWrap::GetMergeDuplicatePoints(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkMergeCellsWrap *wrapper = ObjectWrap::Unwrap<VtkMergeCellsWrap>(info.Holder());
	vtkMergeCells *native = (vtkMergeCells *)wrapper->native.GetPointer();
	int r;
	if(info.Length() != 0)
	{
		Nan::ThrowError("Too many parameters.");
		return;
	}
	r = native->GetMergeDuplicatePoints();
	info.GetReturnValue().Set(Nan::New(r));
}

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

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

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

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

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

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

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

void VtkMergeCellsWrap::IsA(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkMergeCellsWrap *wrapper = ObjectWrap::Unwrap<VtkMergeCellsWrap>(info.Holder());
	vtkMergeCells *native = (vtkMergeCells *)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 VtkMergeCellsWrap::MergeDataSet(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkMergeCellsWrap *wrapper = ObjectWrap::Unwrap<VtkMergeCellsWrap>(info.Holder());
	vtkMergeCells *native = (vtkMergeCells *)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());
		int r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->MergeDataSet(
			(vtkDataSet *) a0->native.GetPointer()
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

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

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

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

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

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

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

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

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

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

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

