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

using namespace v8;

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

VtkFrustumCoverageCullerWrap::VtkFrustumCoverageCullerWrap()
{ }

VtkFrustumCoverageCullerWrap::VtkFrustumCoverageCullerWrap(vtkSmartPointer<vtkFrustumCoverageCuller> _native)
{ native = _native; }

VtkFrustumCoverageCullerWrap::~VtkFrustumCoverageCullerWrap()
{ }

void VtkFrustumCoverageCullerWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkFrustumCoverageCuller").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("FrustumCoverageCuller").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "GetMaximumCoverage", GetMaximumCoverage);
	Nan::SetPrototypeMethod(tpl, "getMaximumCoverage", GetMaximumCoverage);

	Nan::SetPrototypeMethod(tpl, "GetMinimumCoverage", GetMinimumCoverage);
	Nan::SetPrototypeMethod(tpl, "getMinimumCoverage", GetMinimumCoverage);

	Nan::SetPrototypeMethod(tpl, "GetSortingStyle", GetSortingStyle);
	Nan::SetPrototypeMethod(tpl, "getSortingStyle", GetSortingStyle);

	Nan::SetPrototypeMethod(tpl, "GetSortingStyleAsString", GetSortingStyleAsString);
	Nan::SetPrototypeMethod(tpl, "getSortingStyleAsString", GetSortingStyleAsString);

	Nan::SetPrototypeMethod(tpl, "GetSortingStyleMaxValue", GetSortingStyleMaxValue);
	Nan::SetPrototypeMethod(tpl, "getSortingStyleMaxValue", GetSortingStyleMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetSortingStyleMinValue", GetSortingStyleMinValue);
	Nan::SetPrototypeMethod(tpl, "getSortingStyleMinValue", GetSortingStyleMinValue);

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

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

	Nan::SetPrototypeMethod(tpl, "SetMaximumCoverage", SetMaximumCoverage);
	Nan::SetPrototypeMethod(tpl, "setMaximumCoverage", SetMaximumCoverage);

	Nan::SetPrototypeMethod(tpl, "SetMinimumCoverage", SetMinimumCoverage);
	Nan::SetPrototypeMethod(tpl, "setMinimumCoverage", SetMinimumCoverage);

	Nan::SetPrototypeMethod(tpl, "SetSortingStyle", SetSortingStyle);
	Nan::SetPrototypeMethod(tpl, "setSortingStyle", SetSortingStyle);

	Nan::SetPrototypeMethod(tpl, "SetSortingStyleToBackToFront", SetSortingStyleToBackToFront);
	Nan::SetPrototypeMethod(tpl, "setSortingStyleToBackToFront", SetSortingStyleToBackToFront);

	Nan::SetPrototypeMethod(tpl, "SetSortingStyleToFrontToBack", SetSortingStyleToFrontToBack);
	Nan::SetPrototypeMethod(tpl, "setSortingStyleToFrontToBack", SetSortingStyleToFrontToBack);

	Nan::SetPrototypeMethod(tpl, "SetSortingStyleToNone", SetSortingStyleToNone);
	Nan::SetPrototypeMethod(tpl, "setSortingStyleToNone", SetSortingStyleToNone);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

