/* 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 "vtkContourLineInterpolatorWrap.h"
#include "vtkBezierContourLineInterpolatorWrap.h"
#include "vtkObjectBaseWrap.h"
#include "vtkRendererWrap.h"
#include "vtkContourRepresentationWrap.h"
#include "vtkIntArrayWrap.h"
#include "../../plus/plus.h"

using namespace v8;

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

VtkBezierContourLineInterpolatorWrap::VtkBezierContourLineInterpolatorWrap()
{ }

VtkBezierContourLineInterpolatorWrap::VtkBezierContourLineInterpolatorWrap(vtkSmartPointer<vtkBezierContourLineInterpolator> _native)
{ native = _native; }

VtkBezierContourLineInterpolatorWrap::~VtkBezierContourLineInterpolatorWrap()
{ }

void VtkBezierContourLineInterpolatorWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkBezierContourLineInterpolator").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("BezierContourLineInterpolator").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "GetMaximumCurveError", GetMaximumCurveError);
	Nan::SetPrototypeMethod(tpl, "getMaximumCurveError", GetMaximumCurveError);

	Nan::SetPrototypeMethod(tpl, "GetMaximumCurveErrorMaxValue", GetMaximumCurveErrorMaxValue);
	Nan::SetPrototypeMethod(tpl, "getMaximumCurveErrorMaxValue", GetMaximumCurveErrorMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetMaximumCurveErrorMinValue", GetMaximumCurveErrorMinValue);
	Nan::SetPrototypeMethod(tpl, "getMaximumCurveErrorMinValue", GetMaximumCurveErrorMinValue);

	Nan::SetPrototypeMethod(tpl, "GetMaximumCurveLineSegments", GetMaximumCurveLineSegments);
	Nan::SetPrototypeMethod(tpl, "getMaximumCurveLineSegments", GetMaximumCurveLineSegments);

	Nan::SetPrototypeMethod(tpl, "GetMaximumCurveLineSegmentsMaxValue", GetMaximumCurveLineSegmentsMaxValue);
	Nan::SetPrototypeMethod(tpl, "getMaximumCurveLineSegmentsMaxValue", GetMaximumCurveLineSegmentsMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetMaximumCurveLineSegmentsMinValue", GetMaximumCurveLineSegmentsMinValue);
	Nan::SetPrototypeMethod(tpl, "getMaximumCurveLineSegmentsMinValue", GetMaximumCurveLineSegmentsMinValue);

	Nan::SetPrototypeMethod(tpl, "GetSpan", GetSpan);
	Nan::SetPrototypeMethod(tpl, "getSpan", GetSpan);

	Nan::SetPrototypeMethod(tpl, "InterpolateLine", InterpolateLine);
	Nan::SetPrototypeMethod(tpl, "interpolateLine", InterpolateLine);

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

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

	Nan::SetPrototypeMethod(tpl, "SetMaximumCurveError", SetMaximumCurveError);
	Nan::SetPrototypeMethod(tpl, "setMaximumCurveError", SetMaximumCurveError);

	Nan::SetPrototypeMethod(tpl, "SetMaximumCurveLineSegments", SetMaximumCurveLineSegments);
	Nan::SetPrototypeMethod(tpl, "setMaximumCurveLineSegments", SetMaximumCurveLineSegments);

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

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

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

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

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

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

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

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

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

void VtkBezierContourLineInterpolatorWrap::GetSpan(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkBezierContourLineInterpolatorWrap *wrapper = ObjectWrap::Unwrap<VtkBezierContourLineInterpolatorWrap>(info.Holder());
	vtkBezierContourLineInterpolator *native = (vtkBezierContourLineInterpolator *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsInt32())
	{
		if(info.Length() > 1 && info[1]->IsObject() && (Nan::New(VtkIntArrayWrap::ptpl))->HasInstance(info[1]))
		{
			VtkIntArrayWrap *a1 = ObjectWrap::Unwrap<VtkIntArrayWrap>(info[1]->ToObject());
			if(info.Length() > 2 && info[2]->IsObject() && (Nan::New(VtkContourRepresentationWrap::ptpl))->HasInstance(info[2]))
			{
				VtkContourRepresentationWrap *a2 = ObjectWrap::Unwrap<VtkContourRepresentationWrap>(info[2]->ToObject());
								if(info.Length() != 3)
				{
					Nan::ThrowError("Too many parameters.");
					return;
				}
				native->GetSpan(
					info[0]->Int32Value(),
					(vtkIntArray *) a1->native.GetPointer(),
					(vtkContourRepresentation *) a2->native.GetPointer()
				);
				return;
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkBezierContourLineInterpolatorWrap::InterpolateLine(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkBezierContourLineInterpolatorWrap *wrapper = ObjectWrap::Unwrap<VtkBezierContourLineInterpolatorWrap>(info.Holder());
	vtkBezierContourLineInterpolator *native = (vtkBezierContourLineInterpolator *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsObject() && (Nan::New(VtkRendererWrap::ptpl))->HasInstance(info[0]))
	{
		VtkRendererWrap *a0 = ObjectWrap::Unwrap<VtkRendererWrap>(info[0]->ToObject());
		if(info.Length() > 1 && info[1]->IsObject() && (Nan::New(VtkContourRepresentationWrap::ptpl))->HasInstance(info[1]))
		{
			VtkContourRepresentationWrap *a1 = ObjectWrap::Unwrap<VtkContourRepresentationWrap>(info[1]->ToObject());
			if(info.Length() > 2 && info[2]->IsInt32())
			{
				if(info.Length() > 3 && info[3]->IsInt32())
				{
					int r;
					if(info.Length() != 4)
					{
						Nan::ThrowError("Too many parameters.");
						return;
					}
					r = native->InterpolateLine(
						(vtkRenderer *) a0->native.GetPointer(),
						(vtkContourRepresentation *) a1->native.GetPointer(),
						info[2]->Int32Value(),
						info[3]->Int32Value()
					);
					info.GetReturnValue().Set(Nan::New(r));
					return;
				}
			}
		}
	}
	Nan::ThrowError("Parameter mismatch");
}

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

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

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

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

