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

using namespace v8;

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

VtkRenderTimerLogWrap::VtkRenderTimerLogWrap()
{ }

VtkRenderTimerLogWrap::VtkRenderTimerLogWrap(vtkSmartPointer<vtkRenderTimerLog> _native)
{ native = _native; }

VtkRenderTimerLogWrap::~VtkRenderTimerLogWrap()
{ }

void VtkRenderTimerLogWrap::Init(v8::Local<v8::Object> exports)
{
	Nan::SetAccessor(exports, Nan::New("vtkRenderTimerLog").ToLocalChecked(), ConstructorGetter);
	Nan::SetAccessor(exports, Nan::New("RenderTimerLog").ToLocalChecked(), ConstructorGetter);
}

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

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

	Nan::SetPrototypeMethod(tpl, "FrameReady", FrameReady);
	Nan::SetPrototypeMethod(tpl, "frameReady", FrameReady);

	Nan::SetPrototypeMethod(tpl, "GetFrameLimit", GetFrameLimit);
	Nan::SetPrototypeMethod(tpl, "getFrameLimit", GetFrameLimit);

	Nan::SetPrototypeMethod(tpl, "GetLoggingEnabled", GetLoggingEnabled);
	Nan::SetPrototypeMethod(tpl, "getLoggingEnabled", GetLoggingEnabled);

	Nan::SetPrototypeMethod(tpl, "IsSupported", IsSupported);
	Nan::SetPrototypeMethod(tpl, "isSupported", IsSupported);

	Nan::SetPrototypeMethod(tpl, "LoggingEnabledOff", LoggingEnabledOff);
	Nan::SetPrototypeMethod(tpl, "loggingEnabledOff", LoggingEnabledOff);

	Nan::SetPrototypeMethod(tpl, "LoggingEnabledOn", LoggingEnabledOn);
	Nan::SetPrototypeMethod(tpl, "loggingEnabledOn", LoggingEnabledOn);

	Nan::SetPrototypeMethod(tpl, "MarkEndEvent", MarkEndEvent);
	Nan::SetPrototypeMethod(tpl, "markEndEvent", MarkEndEvent);

	Nan::SetPrototypeMethod(tpl, "MarkFrame", MarkFrame);
	Nan::SetPrototypeMethod(tpl, "markFrame", MarkFrame);

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

	Nan::SetPrototypeMethod(tpl, "SetLoggingEnabled", SetLoggingEnabled);
	Nan::SetPrototypeMethod(tpl, "setLoggingEnabled", SetLoggingEnabled);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

