/* 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 "vtkUnstructuredGridQuadricDecimationWrap.h"
#include "vtkObjectBaseWrap.h"
#include "../../plus/plus.h"

using namespace v8;

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

VtkUnstructuredGridQuadricDecimationWrap::VtkUnstructuredGridQuadricDecimationWrap()
{ }

VtkUnstructuredGridQuadricDecimationWrap::VtkUnstructuredGridQuadricDecimationWrap(vtkSmartPointer<vtkUnstructuredGridQuadricDecimation> _native)
{ native = _native; }

VtkUnstructuredGridQuadricDecimationWrap::~VtkUnstructuredGridQuadricDecimationWrap()
{ }

void VtkUnstructuredGridQuadricDecimationWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkUnstructuredGridQuadricDecimation").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("UnstructuredGridQuadricDecimation").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "GetAutoAddCandidates", GetAutoAddCandidates);
	Nan::SetPrototypeMethod(tpl, "getAutoAddCandidates", GetAutoAddCandidates);

	Nan::SetPrototypeMethod(tpl, "GetAutoAddCandidatesThreshold", GetAutoAddCandidatesThreshold);
	Nan::SetPrototypeMethod(tpl, "getAutoAddCandidatesThreshold", GetAutoAddCandidatesThreshold);

	Nan::SetPrototypeMethod(tpl, "GetBoundaryWeight", GetBoundaryWeight);
	Nan::SetPrototypeMethod(tpl, "getBoundaryWeight", GetBoundaryWeight);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfCandidates", GetNumberOfCandidates);
	Nan::SetPrototypeMethod(tpl, "getNumberOfCandidates", GetNumberOfCandidates);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfEdgesToDecimate", GetNumberOfEdgesToDecimate);
	Nan::SetPrototypeMethod(tpl, "getNumberOfEdgesToDecimate", GetNumberOfEdgesToDecimate);

	Nan::SetPrototypeMethod(tpl, "GetNumberOfTetsOutput", GetNumberOfTetsOutput);
	Nan::SetPrototypeMethod(tpl, "getNumberOfTetsOutput", GetNumberOfTetsOutput);

	Nan::SetPrototypeMethod(tpl, "GetScalarsName", GetScalarsName);
	Nan::SetPrototypeMethod(tpl, "getScalarsName", GetScalarsName);

	Nan::SetPrototypeMethod(tpl, "GetTargetReduction", GetTargetReduction);
	Nan::SetPrototypeMethod(tpl, "getTargetReduction", GetTargetReduction);

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

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

	Nan::SetPrototypeMethod(tpl, "SetAutoAddCandidates", SetAutoAddCandidates);
	Nan::SetPrototypeMethod(tpl, "setAutoAddCandidates", SetAutoAddCandidates);

	Nan::SetPrototypeMethod(tpl, "SetAutoAddCandidatesThreshold", SetAutoAddCandidatesThreshold);
	Nan::SetPrototypeMethod(tpl, "setAutoAddCandidatesThreshold", SetAutoAddCandidatesThreshold);

	Nan::SetPrototypeMethod(tpl, "SetBoundaryWeight", SetBoundaryWeight);
	Nan::SetPrototypeMethod(tpl, "setBoundaryWeight", SetBoundaryWeight);

	Nan::SetPrototypeMethod(tpl, "SetNumberOfCandidates", SetNumberOfCandidates);
	Nan::SetPrototypeMethod(tpl, "setNumberOfCandidates", SetNumberOfCandidates);

	Nan::SetPrototypeMethod(tpl, "SetNumberOfEdgesToDecimate", SetNumberOfEdgesToDecimate);
	Nan::SetPrototypeMethod(tpl, "setNumberOfEdgesToDecimate", SetNumberOfEdgesToDecimate);

	Nan::SetPrototypeMethod(tpl, "SetNumberOfTetsOutput", SetNumberOfTetsOutput);
	Nan::SetPrototypeMethod(tpl, "setNumberOfTetsOutput", SetNumberOfTetsOutput);

	Nan::SetPrototypeMethod(tpl, "SetScalarsName", SetScalarsName);
	Nan::SetPrototypeMethod(tpl, "setScalarsName", SetScalarsName);

	Nan::SetPrototypeMethod(tpl, "SetTargetReduction", SetTargetReduction);
	Nan::SetPrototypeMethod(tpl, "setTargetReduction", SetTargetReduction);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

