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

using namespace v8;

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

VtkAnimationCueWrap::VtkAnimationCueWrap()
{ }

VtkAnimationCueWrap::VtkAnimationCueWrap(vtkSmartPointer<vtkAnimationCue> _native)
{ native = _native; }

VtkAnimationCueWrap::~VtkAnimationCueWrap()
{ }

void VtkAnimationCueWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkAnimationCue").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("AnimationCue").ToLocalChecked(), ConstructorGetter);
}

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

void VtkAnimationCueWrap::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("VtkAnimationCueWrap").ToLocalChecked());
	tpl->InstanceTemplate()->SetInternalFieldCount(1);

	Nan::SetPrototypeMethod(tpl, "Finalize", Finalize);
	Nan::SetPrototypeMethod(tpl, "finalize", Finalize);

	Nan::SetPrototypeMethod(tpl, "GetAnimationTime", GetAnimationTime);
	Nan::SetPrototypeMethod(tpl, "getAnimationTime", GetAnimationTime);

	Nan::SetPrototypeMethod(tpl, "GetClockTime", GetClockTime);
	Nan::SetPrototypeMethod(tpl, "getClockTime", GetClockTime);

	Nan::SetPrototypeMethod(tpl, "GetDeltaTime", GetDeltaTime);
	Nan::SetPrototypeMethod(tpl, "getDeltaTime", GetDeltaTime);

	Nan::SetPrototypeMethod(tpl, "GetEndTime", GetEndTime);
	Nan::SetPrototypeMethod(tpl, "getEndTime", GetEndTime);

	Nan::SetPrototypeMethod(tpl, "GetStartTime", GetStartTime);
	Nan::SetPrototypeMethod(tpl, "getStartTime", GetStartTime);

	Nan::SetPrototypeMethod(tpl, "GetTimeMode", GetTimeMode);
	Nan::SetPrototypeMethod(tpl, "getTimeMode", GetTimeMode);

	Nan::SetPrototypeMethod(tpl, "Initialize", Initialize);
	Nan::SetPrototypeMethod(tpl, "initialize", Initialize);

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

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

	Nan::SetPrototypeMethod(tpl, "SetEndTime", SetEndTime);
	Nan::SetPrototypeMethod(tpl, "setEndTime", SetEndTime);

	Nan::SetPrototypeMethod(tpl, "SetStartTime", SetStartTime);
	Nan::SetPrototypeMethod(tpl, "setStartTime", SetStartTime);

	Nan::SetPrototypeMethod(tpl, "SetTimeMode", SetTimeMode);
	Nan::SetPrototypeMethod(tpl, "setTimeMode", SetTimeMode);

	Nan::SetPrototypeMethod(tpl, "SetTimeModeToNormalized", SetTimeModeToNormalized);
	Nan::SetPrototypeMethod(tpl, "setTimeModeToNormalized", SetTimeModeToNormalized);

	Nan::SetPrototypeMethod(tpl, "SetTimeModeToRelative", SetTimeModeToRelative);
	Nan::SetPrototypeMethod(tpl, "setTimeModeToRelative", SetTimeModeToRelative);

	Nan::SetPrototypeMethod(tpl, "Tick", Tick);
	Nan::SetPrototypeMethod(tpl, "tick", Tick);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

