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

using namespace v8;

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

VtkIcicleViewWrap::VtkIcicleViewWrap()
{ }

VtkIcicleViewWrap::VtkIcicleViewWrap(vtkSmartPointer<vtkIcicleView> _native)
{ native = _native; }

VtkIcicleViewWrap::~VtkIcicleViewWrap()
{ }

void VtkIcicleViewWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkIcicleView").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("IcicleView").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "GetLayerThickness", GetLayerThickness);
	Nan::SetPrototypeMethod(tpl, "getLayerThickness", GetLayerThickness);

	Nan::SetPrototypeMethod(tpl, "GetRootWidth", GetRootWidth);
	Nan::SetPrototypeMethod(tpl, "getRootWidth", GetRootWidth);

	Nan::SetPrototypeMethod(tpl, "GetTopToBottom", GetTopToBottom);
	Nan::SetPrototypeMethod(tpl, "getTopToBottom", GetTopToBottom);

	Nan::SetPrototypeMethod(tpl, "GetUseGradientColoring", GetUseGradientColoring);
	Nan::SetPrototypeMethod(tpl, "getUseGradientColoring", GetUseGradientColoring);

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

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

	Nan::SetPrototypeMethod(tpl, "SetLayerThickness", SetLayerThickness);
	Nan::SetPrototypeMethod(tpl, "setLayerThickness", SetLayerThickness);

	Nan::SetPrototypeMethod(tpl, "SetRootWidth", SetRootWidth);
	Nan::SetPrototypeMethod(tpl, "setRootWidth", SetRootWidth);

	Nan::SetPrototypeMethod(tpl, "SetTopToBottom", SetTopToBottom);
	Nan::SetPrototypeMethod(tpl, "setTopToBottom", SetTopToBottom);

	Nan::SetPrototypeMethod(tpl, "SetUseGradientColoring", SetUseGradientColoring);
	Nan::SetPrototypeMethod(tpl, "setUseGradientColoring", SetUseGradientColoring);

	Nan::SetPrototypeMethod(tpl, "TopToBottomOff", TopToBottomOff);
	Nan::SetPrototypeMethod(tpl, "topToBottomOff", TopToBottomOff);

	Nan::SetPrototypeMethod(tpl, "TopToBottomOn", TopToBottomOn);
	Nan::SetPrototypeMethod(tpl, "topToBottomOn", TopToBottomOn);

	Nan::SetPrototypeMethod(tpl, "UseGradientColoringOff", UseGradientColoringOff);
	Nan::SetPrototypeMethod(tpl, "useGradientColoringOff", UseGradientColoringOff);

	Nan::SetPrototypeMethod(tpl, "UseGradientColoringOn", UseGradientColoringOn);
	Nan::SetPrototypeMethod(tpl, "useGradientColoringOn", UseGradientColoringOn);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

