/* 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 "vtkOpenGLRenderPassWrap.h"
#include "vtkDepthPeelingPassWrap.h"
#include "vtkObjectBaseWrap.h"
#include "vtkWindowWrap.h"
#include "vtkRenderPassWrap.h"
#include "../../plus/plus.h"

using namespace v8;

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

VtkDepthPeelingPassWrap::VtkDepthPeelingPassWrap()
{ }

VtkDepthPeelingPassWrap::VtkDepthPeelingPassWrap(vtkSmartPointer<vtkDepthPeelingPass> _native)
{ native = _native; }

VtkDepthPeelingPassWrap::~VtkDepthPeelingPassWrap()
{ }

void VtkDepthPeelingPassWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkDepthPeelingPass").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("DepthPeelingPass").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "GetMaximumNumberOfPeels", GetMaximumNumberOfPeels);
	Nan::SetPrototypeMethod(tpl, "getMaximumNumberOfPeels", GetMaximumNumberOfPeels);

	Nan::SetPrototypeMethod(tpl, "GetOcclusionRatio", GetOcclusionRatio);
	Nan::SetPrototypeMethod(tpl, "getOcclusionRatio", GetOcclusionRatio);

	Nan::SetPrototypeMethod(tpl, "GetOcclusionRatioMaxValue", GetOcclusionRatioMaxValue);
	Nan::SetPrototypeMethod(tpl, "getOcclusionRatioMaxValue", GetOcclusionRatioMaxValue);

	Nan::SetPrototypeMethod(tpl, "GetOcclusionRatioMinValue", GetOcclusionRatioMinValue);
	Nan::SetPrototypeMethod(tpl, "getOcclusionRatioMinValue", GetOcclusionRatioMinValue);

	Nan::SetPrototypeMethod(tpl, "GetTranslucentPass", GetTranslucentPass);
	Nan::SetPrototypeMethod(tpl, "getTranslucentPass", GetTranslucentPass);

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

	Nan::SetPrototypeMethod(tpl, "ReleaseGraphicsResources", ReleaseGraphicsResources);
	Nan::SetPrototypeMethod(tpl, "releaseGraphicsResources", ReleaseGraphicsResources);

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

	Nan::SetPrototypeMethod(tpl, "SetDepthFormat", SetDepthFormat);
	Nan::SetPrototypeMethod(tpl, "setDepthFormat", SetDepthFormat);

	Nan::SetPrototypeMethod(tpl, "SetMaximumNumberOfPeels", SetMaximumNumberOfPeels);
	Nan::SetPrototypeMethod(tpl, "setMaximumNumberOfPeels", SetMaximumNumberOfPeels);

	Nan::SetPrototypeMethod(tpl, "SetOcclusionRatio", SetOcclusionRatio);
	Nan::SetPrototypeMethod(tpl, "setOcclusionRatio", SetOcclusionRatio);

	Nan::SetPrototypeMethod(tpl, "SetTranslucentPass", SetTranslucentPass);
	Nan::SetPrototypeMethod(tpl, "setTranslucentPass", SetTranslucentPass);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

