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

using namespace v8;

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

VtkPointCloudFilterWrap::VtkPointCloudFilterWrap()
{ }

VtkPointCloudFilterWrap::VtkPointCloudFilterWrap(vtkSmartPointer<vtkPointCloudFilter> _native)
{ native = _native; }

VtkPointCloudFilterWrap::~VtkPointCloudFilterWrap()
{ }

void VtkPointCloudFilterWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkPointCloudFilter").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("PointCloudFilter").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "GenerateOutliersOff", GenerateOutliersOff);
	Nan::SetPrototypeMethod(tpl, "generateOutliersOff", GenerateOutliersOff);

	Nan::SetPrototypeMethod(tpl, "GenerateOutliersOn", GenerateOutliersOn);
	Nan::SetPrototypeMethod(tpl, "generateOutliersOn", GenerateOutliersOn);

	Nan::SetPrototypeMethod(tpl, "GenerateVerticesOff", GenerateVerticesOff);
	Nan::SetPrototypeMethod(tpl, "generateVerticesOff", GenerateVerticesOff);

	Nan::SetPrototypeMethod(tpl, "GenerateVerticesOn", GenerateVerticesOn);
	Nan::SetPrototypeMethod(tpl, "generateVerticesOn", GenerateVerticesOn);

	Nan::SetPrototypeMethod(tpl, "GetGenerateOutliers", GetGenerateOutliers);
	Nan::SetPrototypeMethod(tpl, "getGenerateOutliers", GetGenerateOutliers);

	Nan::SetPrototypeMethod(tpl, "GetGenerateVertices", GetGenerateVertices);
	Nan::SetPrototypeMethod(tpl, "getGenerateVertices", GetGenerateVertices);

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

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

	Nan::SetPrototypeMethod(tpl, "SetGenerateOutliers", SetGenerateOutliers);
	Nan::SetPrototypeMethod(tpl, "setGenerateOutliers", SetGenerateOutliers);

	Nan::SetPrototypeMethod(tpl, "SetGenerateVertices", SetGenerateVertices);
	Nan::SetPrototypeMethod(tpl, "setGenerateVertices", SetGenerateVertices);

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

void VtkPointCloudFilterWrap::New(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	if(!info.IsConstructCall())
	{
		Nan::ThrowError("Constructor not called in a construct call.");
		return;
	}

	if(info.Length() == 0)
	{
		Nan::ThrowError("Cannot create instance of abstract class.");
		return;
	}
	else
	{
		if(info[0]->ToObject() != vtkNodeJsNoWrap )
		{
			Nan::ThrowError("Parameter Error");
			return;
		}
	}

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

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

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

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

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

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

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

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

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

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

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

