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

using namespace v8;

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

VtkAdaptiveSubdivisionFilterWrap::VtkAdaptiveSubdivisionFilterWrap()
{ }

VtkAdaptiveSubdivisionFilterWrap::VtkAdaptiveSubdivisionFilterWrap(vtkSmartPointer<vtkAdaptiveSubdivisionFilter> _native)
{ native = _native; }

VtkAdaptiveSubdivisionFilterWrap::~VtkAdaptiveSubdivisionFilterWrap()
{ }

void VtkAdaptiveSubdivisionFilterWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkAdaptiveSubdivisionFilter").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("AdaptiveSubdivisionFilter").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "CreateDefaultLocator", CreateDefaultLocator);
	Nan::SetPrototypeMethod(tpl, "createDefaultLocator", CreateDefaultLocator);

	Nan::SetPrototypeMethod(tpl, "GetLocator", GetLocator);
	Nan::SetPrototypeMethod(tpl, "getLocator", GetLocator);

	Nan::SetPrototypeMethod(tpl, "GetMaximumEdgeLength", GetMaximumEdgeLength);
	Nan::SetPrototypeMethod(tpl, "getMaximumEdgeLength", GetMaximumEdgeLength);

	Nan::SetPrototypeMethod(tpl, "GetMaximumEdgeLengthMaxValue", GetMaximumEdgeLengthMaxValue);
	Nan::SetPrototypeMethod(tpl, "getMaximumEdgeLengthMaxValue", GetMaximumEdgeLengthMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetMaximumEdgeLengthMinValue", GetMaximumEdgeLengthMinValue);
	Nan::SetPrototypeMethod(tpl, "getMaximumEdgeLengthMinValue", GetMaximumEdgeLengthMinValue);

	Nan::SetPrototypeMethod(tpl, "GetMaximumTriangleArea", GetMaximumTriangleArea);
	Nan::SetPrototypeMethod(tpl, "getMaximumTriangleArea", GetMaximumTriangleArea);

	Nan::SetPrototypeMethod(tpl, "GetMaximumTriangleAreaMaxValue", GetMaximumTriangleAreaMaxValue);
	Nan::SetPrototypeMethod(tpl, "getMaximumTriangleAreaMaxValue", GetMaximumTriangleAreaMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetMaximumTriangleAreaMinValue", GetMaximumTriangleAreaMinValue);
	Nan::SetPrototypeMethod(tpl, "getMaximumTriangleAreaMinValue", GetMaximumTriangleAreaMinValue);

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

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

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

	Nan::SetPrototypeMethod(tpl, "SetLocator", SetLocator);
	Nan::SetPrototypeMethod(tpl, "setLocator", SetLocator);

	Nan::SetPrototypeMethod(tpl, "SetMaximumEdgeLength", SetMaximumEdgeLength);
	Nan::SetPrototypeMethod(tpl, "setMaximumEdgeLength", SetMaximumEdgeLength);

	Nan::SetPrototypeMethod(tpl, "SetMaximumTriangleArea", SetMaximumTriangleArea);
	Nan::SetPrototypeMethod(tpl, "setMaximumTriangleArea", SetMaximumTriangleArea);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

void VtkAdaptiveSubdivisionFilterWrap::SetOutputPointsPrecision(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkAdaptiveSubdivisionFilterWrap *wrapper = ObjectWrap::Unwrap<VtkAdaptiveSubdivisionFilterWrap>(info.Holder());
	vtkAdaptiveSubdivisionFilter *native = (vtkAdaptiveSubdivisionFilter *)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");
}

