/* 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 "vtkAbstractWidgetWrap.h"
#include "vtkImplicitCylinderWidgetWrap.h"
#include "vtkObjectWrap.h"
#include "vtkImplicitCylinderRepresentationWrap.h"
#include "../../plus/plus.h"

using namespace v8;

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

VtkImplicitCylinderWidgetWrap::VtkImplicitCylinderWidgetWrap()
{ }

VtkImplicitCylinderWidgetWrap::VtkImplicitCylinderWidgetWrap(vtkSmartPointer<vtkImplicitCylinderWidget> _native)
{ native = _native; }

VtkImplicitCylinderWidgetWrap::~VtkImplicitCylinderWidgetWrap()
{ }

void VtkImplicitCylinderWidgetWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkImplicitCylinderWidget").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("ImplicitCylinderWidget").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "CreateDefaultRepresentation", CreateDefaultRepresentation);
	Nan::SetPrototypeMethod(tpl, "createDefaultRepresentation", CreateDefaultRepresentation);

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

	Nan::SetPrototypeMethod(tpl, "GetCylinderRepresentation", GetCylinderRepresentation);
	Nan::SetPrototypeMethod(tpl, "getCylinderRepresentation", GetCylinderRepresentation);

	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, "SetEnabled", SetEnabled);
	Nan::SetPrototypeMethod(tpl, "setEnabled", SetEnabled);

	Nan::SetPrototypeMethod(tpl, "SetRepresentation", SetRepresentation);
	Nan::SetPrototypeMethod(tpl, "setRepresentation", SetRepresentation);

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

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

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

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

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

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

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

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

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

