/* 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 "vtkObjectWrap.h"
#include "vtkSliceCubesWrap.h"
#include "vtkVolumeReaderWrap.h"
#include "../../plus/plus.h"

using namespace v8;

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

VtkSliceCubesWrap::VtkSliceCubesWrap()
{ }

VtkSliceCubesWrap::VtkSliceCubesWrap(vtkSmartPointer<vtkSliceCubes> _native)
{ native = _native; }

VtkSliceCubesWrap::~VtkSliceCubesWrap()
{ }

void VtkSliceCubesWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkSliceCubes").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("SliceCubes").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "GetClassName", GetClassName);
	Nan::SetPrototypeMethod(tpl, "getClassName", GetClassName);

	Nan::SetPrototypeMethod(tpl, "GetFileName", GetFileName);
	Nan::SetPrototypeMethod(tpl, "getFileName", GetFileName);

	Nan::SetPrototypeMethod(tpl, "GetLimitsFileName", GetLimitsFileName);
	Nan::SetPrototypeMethod(tpl, "getLimitsFileName", GetLimitsFileName);

	Nan::SetPrototypeMethod(tpl, "GetReader", GetReader);
	Nan::SetPrototypeMethod(tpl, "getReader", GetReader);

	Nan::SetPrototypeMethod(tpl, "GetValue", GetValue);
	Nan::SetPrototypeMethod(tpl, "getValue", GetValue);

	Nan::SetPrototypeMethod(tpl, "IsA", IsA);
	Nan::SetPrototypeMethod(tpl, "isA", IsA);

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

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

	Nan::SetPrototypeMethod(tpl, "SetFileName", SetFileName);
	Nan::SetPrototypeMethod(tpl, "setFileName", SetFileName);

	Nan::SetPrototypeMethod(tpl, "SetLimitsFileName", SetLimitsFileName);
	Nan::SetPrototypeMethod(tpl, "setLimitsFileName", SetLimitsFileName);

	Nan::SetPrototypeMethod(tpl, "SetReader", SetReader);
	Nan::SetPrototypeMethod(tpl, "setReader", SetReader);

	Nan::SetPrototypeMethod(tpl, "SetValue", SetValue);
	Nan::SetPrototypeMethod(tpl, "setValue", SetValue);

	Nan::SetPrototypeMethod(tpl, "Update", Update);
	Nan::SetPrototypeMethod(tpl, "update", Update);

	Nan::SetPrototypeMethod(tpl, "Write", Write);
	Nan::SetPrototypeMethod(tpl, "write", Write);

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

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

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

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

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

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

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

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

void VtkSliceCubesWrap::IsA(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkSliceCubesWrap *wrapper = ObjectWrap::Unwrap<VtkSliceCubesWrap>(info.Holder());
	vtkSliceCubes *native = (vtkSliceCubes *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsString())
	{
		Nan::Utf8String a0(info[0]);
		int r;
		if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		r = native->IsA(
			*a0
		);
		info.GetReturnValue().Set(Nan::New(r));
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

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

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

void VtkSliceCubesWrap::SetFileName(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkSliceCubesWrap *wrapper = ObjectWrap::Unwrap<VtkSliceCubesWrap>(info.Holder());
	vtkSliceCubes *native = (vtkSliceCubes *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsString())
	{
		Nan::Utf8String a0(info[0]);
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetFileName(
			*a0
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

void VtkSliceCubesWrap::SetLimitsFileName(const Nan::FunctionCallbackInfo<v8::Value>& info)
{
	VtkSliceCubesWrap *wrapper = ObjectWrap::Unwrap<VtkSliceCubesWrap>(info.Holder());
	vtkSliceCubes *native = (vtkSliceCubes *)wrapper->native.GetPointer();
	if(info.Length() > 0 && info[0]->IsString())
	{
		Nan::Utf8String a0(info[0]);
				if(info.Length() != 1)
		{
			Nan::ThrowError("Too many parameters.");
			return;
		}
		native->SetLimitsFileName(
			*a0
		);
		return;
	}
	Nan::ThrowError("Parameter mismatch");
}

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

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

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

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

