// Copyright (c) The NodeRT Contributors
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the ""License""); you may
// not use this file except in compliance with the License. You may obtain a
// copy of the License at http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED ON AN  *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing permissions
// and limitations under the License.

// TODO: Verify that this is is still needed..
#define NTDDI_VERSION 0x06010000

#include <v8.h>
#include "nan.h"
#include <string>
#include <ppltasks.h>
#include "CollectionsConverter.h"
#include "CollectionsWrap.h"
#include "node-async.h"
#include "NodeRtUtils.h"
#include "OpaqueWrapper.h"
#include "WrapperBase.h"

#using <Windows.WinMD>

// this undefs fixes the issues of compiling Windows.Data.Json, Windows.Storag.FileProperties, and Windows.Stroage.Search
// Some of the node header files brings windows definitions with the same names as some of the WinRT methods
#undef DocumentProperties
#undef GetObject
#undef CreateEvent
#undef FindText
#undef SendMessage

const char* REGISTRATION_TOKEN_MAP_PROPERTY_NAME = "__registrationTokenMap__";

using v8::Array;
using v8::String;
using v8::Value;
using v8::Boolean;
using v8::Integer;
using v8::FunctionTemplate;
using v8::Object;
using v8::Local;
using v8::Function;
using v8::Date;
using v8::Number;
using v8::PropertyAttribute;
using v8::Primitive;
using Nan::HandleScope;
using Nan::Persistent;
using Nan::Undefined;
using Nan::True;
using Nan::False;
using Nan::Null;
using Nan::MaybeLocal;
using Nan::EscapableHandleScope;
using Nan::HandleScope;
using Nan::TryCatch;
using namespace concurrency;

namespace NodeRT { namespace Windows { namespace UI { namespace Composition { namespace Scenes { 
  v8::Local<v8::Value> WrapSceneObject(::Windows::UI::Composition::Scenes::SceneObject^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneObject^ UnwrapSceneObject(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneBoundingBox(::Windows::UI::Composition::Scenes::SceneBoundingBox^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneBoundingBox^ UnwrapSceneBoundingBox(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneComponent(::Windows::UI::Composition::Scenes::SceneComponent^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneComponent^ UnwrapSceneComponent(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneComponentCollection(::Windows::UI::Composition::Scenes::SceneComponentCollection^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneComponentCollection^ UnwrapSceneComponentCollection(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneMaterial(::Windows::UI::Composition::Scenes::SceneMaterial^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneMaterial^ UnwrapSceneMaterial(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneMaterialInput(::Windows::UI::Composition::Scenes::SceneMaterialInput^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneMaterialInput^ UnwrapSceneMaterialInput(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneMesh(::Windows::UI::Composition::Scenes::SceneMesh^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneMesh^ UnwrapSceneMesh(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneMeshMaterialAttributeMap(::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^ UnwrapSceneMeshMaterialAttributeMap(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneRendererComponent(::Windows::UI::Composition::Scenes::SceneRendererComponent^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneRendererComponent^ UnwrapSceneRendererComponent(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneMeshRendererComponent(::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^ UnwrapSceneMeshRendererComponent(Local<Value> value);
  
  v8::Local<v8::Value> WrapScenePbrMaterial(::Windows::UI::Composition::Scenes::ScenePbrMaterial^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::ScenePbrMaterial^ UnwrapScenePbrMaterial(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneMetallicRoughnessMaterial(::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^ UnwrapSceneMetallicRoughnessMaterial(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneModelTransform(::Windows::UI::Composition::Scenes::SceneModelTransform^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneModelTransform^ UnwrapSceneModelTransform(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneNode(::Windows::UI::Composition::Scenes::SceneNode^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneNode^ UnwrapSceneNode(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneNodeCollection(::Windows::UI::Composition::Scenes::SceneNodeCollection^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneNodeCollection^ UnwrapSceneNodeCollection(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneSurfaceMaterialInput(::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^ UnwrapSceneSurfaceMaterialInput(Local<Value> value);
  
  v8::Local<v8::Value> WrapSceneVisual(::Windows::UI::Composition::Scenes::SceneVisual^ wintRtInstance);
  ::Windows::UI::Composition::Scenes::SceneVisual^ UnwrapSceneVisual(Local<Value> value);
  



  static void InitSceneAlphaModeEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("SceneAlphaMode").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("opaque").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::Scenes::SceneAlphaMode::Opaque)));
    Nan::Set(enumObject, Nan::New<String>("alphaTest").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::Scenes::SceneAlphaMode::AlphaTest)));
    Nan::Set(enumObject, Nan::New<String>("blend").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::Scenes::SceneAlphaMode::Blend)));
  }

  static void InitSceneAttributeSemanticEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("SceneAttributeSemantic").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("index").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::Scenes::SceneAttributeSemantic::Index)));
    Nan::Set(enumObject, Nan::New<String>("vertex").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::Scenes::SceneAttributeSemantic::Vertex)));
    Nan::Set(enumObject, Nan::New<String>("normal").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::Scenes::SceneAttributeSemantic::Normal)));
    Nan::Set(enumObject, Nan::New<String>("texCoord0").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::Scenes::SceneAttributeSemantic::TexCoord0)));
    Nan::Set(enumObject, Nan::New<String>("texCoord1").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::Scenes::SceneAttributeSemantic::TexCoord1)));
    Nan::Set(enumObject, Nan::New<String>("color").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::Scenes::SceneAttributeSemantic::Color)));
    Nan::Set(enumObject, Nan::New<String>("tangent").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::Scenes::SceneAttributeSemantic::Tangent)));
  }

  static void InitSceneComponentTypeEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("SceneComponentType").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("meshRendererComponent").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::Scenes::SceneComponentType::MeshRendererComponent)));
  }

  static void InitSceneWrappingModeEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("SceneWrappingMode").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("clampToEdge").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::Scenes::SceneWrappingMode::ClampToEdge)));
    Nan::Set(enumObject, Nan::New<String>("mirroredRepeat").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::Scenes::SceneWrappingMode::MirroredRepeat)));
    Nan::Set(enumObject, Nan::New<String>("repeat").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::Scenes::SceneWrappingMode::Repeat)));
  }


  static bool IsVector3JsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("z").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    return true;
  }

  ::Platform::Numerics::Vector3 Vector3FromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Platform::Numerics::Vector3 returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.X = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.Y = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("z").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.Z = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    return returnValue;
  }

  Local<Value> Vector3ToJsObject(::Platform::Numerics::Vector3 value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();

    Nan::Set(obj, Nan::New<String>("x").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.X)));
    Nan::Set(obj, Nan::New<String>("y").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.Y)));
    Nan::Set(obj, Nan::New<String>("z").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.Z)));

    return scope.Escape(obj);
  }
  static bool IsVector4JsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("z").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("w").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    return true;
  }

  ::Platform::Numerics::Vector4 Vector4FromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Platform::Numerics::Vector4 returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.X = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.Y = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("z").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.Z = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("w").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.W = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    return returnValue;
  }

  Local<Value> Vector4ToJsObject(::Platform::Numerics::Vector4 value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();

    Nan::Set(obj, Nan::New<String>("x").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.X)));
    Nan::Set(obj, Nan::New<String>("y").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.Y)));
    Nan::Set(obj, Nan::New<String>("z").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.Z)));
    Nan::Set(obj, Nan::New<String>("w").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.W)));

    return scope.Escape(obj);
  }
  static bool IsQuaternionJsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("z").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("w").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    return true;
  }

  ::Platform::Numerics::Quaternion QuaternionFromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Platform::Numerics::Quaternion returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.X = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.Y = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("z").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.Z = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("w").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.W = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    return returnValue;
  }

  Local<Value> QuaternionToJsObject(::Platform::Numerics::Quaternion value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();

    Nan::Set(obj, Nan::New<String>("x").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.X)));
    Nan::Set(obj, Nan::New<String>("y").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.Y)));
    Nan::Set(obj, Nan::New<String>("z").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.Z)));
    Nan::Set(obj, Nan::New<String>("w").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.W)));

    return scope.Escape(obj);
  }
  static bool IsMatrix4x4JsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    symbol = Nan::New<String>("m11").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m12").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m13").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m14").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m21").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m22").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m23").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m24").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m31").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m32").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m33").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m34").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m41").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m42").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m43").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m44").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    return true;
  }

  ::Platform::Numerics::Matrix4x4 Matrix4x4FromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Platform::Numerics::Matrix4x4 returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    symbol = Nan::New<String>("m11").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M11 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m12").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M12 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m13").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M13 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m14").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M14 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m21").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M21 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m22").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M22 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m23").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M23 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m24").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M24 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m31").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M31 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m32").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M32 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m33").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M33 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m34").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M34 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m41").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M41 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m42").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M42 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m43").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M43 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m44").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M44 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    return returnValue;
  }

  Local<Value> Matrix4x4ToJsObject(::Platform::Numerics::Matrix4x4 value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();

    Nan::Set(obj, Nan::New<String>("m11").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M11)));
    Nan::Set(obj, Nan::New<String>("m12").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M12)));
    Nan::Set(obj, Nan::New<String>("m13").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M13)));
    Nan::Set(obj, Nan::New<String>("m14").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M14)));
    Nan::Set(obj, Nan::New<String>("m21").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M21)));
    Nan::Set(obj, Nan::New<String>("m22").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M22)));
    Nan::Set(obj, Nan::New<String>("m23").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M23)));
    Nan::Set(obj, Nan::New<String>("m24").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M24)));
    Nan::Set(obj, Nan::New<String>("m31").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M31)));
    Nan::Set(obj, Nan::New<String>("m32").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M32)));
    Nan::Set(obj, Nan::New<String>("m33").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M33)));
    Nan::Set(obj, Nan::New<String>("m34").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M34)));
    Nan::Set(obj, Nan::New<String>("m41").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M41)));
    Nan::Set(obj, Nan::New<String>("m42").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M42)));
    Nan::Set(obj, Nan::New<String>("m43").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M43)));
    Nan::Set(obj, Nan::New<String>("m44").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M44)));

    return scope.Escape(obj);
  }
  static bool IsVector2JsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    return true;
  }

  ::Platform::Numerics::Vector2 Vector2FromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Platform::Numerics::Vector2 returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.X = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.Y = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    return returnValue;
  }

  Local<Value> Vector2ToJsObject(::Platform::Numerics::Vector2 value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();

    Nan::Set(obj, Nan::New<String>("x").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.X)));
    Nan::Set(obj, Nan::New<String>("y").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.Y)));

    return scope.Escape(obj);
  }

  class SceneObject : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneObject").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("SceneObject").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneObject(::Windows::UI::Composition::Scenes::SceneObject^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneObject^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneObject^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneObject^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneObject *wrapperInstance = new SceneObject(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneObject^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneObject^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneObject^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneObject(winRtInstance));
    }





    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneObject^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneObject(::Windows::UI::Composition::Scenes::SceneObject^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneObject^ UnwrapSceneObject(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneObject::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneObject(::Windows::UI::Composition::Scenes::SceneObject^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneObject::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneObject^ UnwrapSceneObject(Local<Value> value) {
     return SceneObject::Unwrap<SceneObject>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneObject(Local<Object> exports) {
    SceneObject::Init(exports);
  }

  class SceneBoundingBox : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneBoundingBox").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("center").ToLocalChecked(), CenterGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("extents").ToLocalChecked(), ExtentsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("max").ToLocalChecked(), MaxGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("min").ToLocalChecked(), MinGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("size").ToLocalChecked(), SizeGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("SceneBoundingBox").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneBoundingBox(::Windows::UI::Composition::Scenes::SceneBoundingBox^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneBoundingBox^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneBoundingBox^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneBoundingBox^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneBoundingBox *wrapperInstance = new SceneBoundingBox(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneBoundingBox^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneBoundingBox^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneBoundingBox^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneBoundingBox(winRtInstance));
    }





    static void CenterGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneBoundingBox^>(info.This())) {
        return;
      }

      SceneBoundingBox *wrapper = SceneBoundingBox::Unwrap<SceneBoundingBox>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Center;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ExtentsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneBoundingBox^>(info.This())) {
        return;
      }

      SceneBoundingBox *wrapper = SceneBoundingBox::Unwrap<SceneBoundingBox>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Extents;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void MaxGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneBoundingBox^>(info.This())) {
        return;
      }

      SceneBoundingBox *wrapper = SceneBoundingBox::Unwrap<SceneBoundingBox>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Max;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void MinGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneBoundingBox^>(info.This())) {
        return;
      }

      SceneBoundingBox *wrapper = SceneBoundingBox::Unwrap<SceneBoundingBox>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Min;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SizeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneBoundingBox^>(info.This())) {
        return;
      }

      SceneBoundingBox *wrapper = SceneBoundingBox::Unwrap<SceneBoundingBox>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Size;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneBoundingBox^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneBoundingBox(::Windows::UI::Composition::Scenes::SceneBoundingBox^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneBoundingBox^ UnwrapSceneBoundingBox(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneBoundingBox::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneBoundingBox(::Windows::UI::Composition::Scenes::SceneBoundingBox^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneBoundingBox::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneBoundingBox^ UnwrapSceneBoundingBox(Local<Value> value) {
     return SceneBoundingBox::Unwrap<SceneBoundingBox>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneBoundingBox(Local<Object> exports) {
    SceneBoundingBox::Init(exports);
  }

  class SceneComponent : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneComponent").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("componentType").ToLocalChecked(), ComponentTypeGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("SceneComponent").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneComponent(::Windows::UI::Composition::Scenes::SceneComponent^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneComponent^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponent^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneComponent^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneComponent *wrapperInstance = new SceneComponent(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponent^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneComponent^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneComponent^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneComponent(winRtInstance));
    }





    static void ComponentTypeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponent^>(info.This())) {
        return;
      }

      SceneComponent *wrapper = SceneComponent::Unwrap<SceneComponent>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneComponentType result = wrapper->_instance->ComponentType;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneComponent^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneComponent(::Windows::UI::Composition::Scenes::SceneComponent^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneComponent^ UnwrapSceneComponent(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneComponent::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneComponent(::Windows::UI::Composition::Scenes::SceneComponent^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneComponent::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneComponent^ UnwrapSceneComponent(Local<Value> value) {
     return SceneComponent::Unwrap<SceneComponent>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneComponent(Local<Object> exports) {
    SceneComponent::Init(exports);
  }

  class SceneComponentCollection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneComponentCollection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getAt", GetAt);
            Nan::SetPrototypeMethod(localRef, "getView", GetView);
            Nan::SetPrototypeMethod(localRef, "indexOf", IndexOf);
            Nan::SetPrototypeMethod(localRef, "setAt", SetAt);
            Nan::SetPrototypeMethod(localRef, "insertAt", InsertAt);
            Nan::SetPrototypeMethod(localRef, "removeAt", RemoveAt);
            Nan::SetPrototypeMethod(localRef, "append", Append);
            Nan::SetPrototypeMethod(localRef, "removeAtEnd", RemoveAtEnd);
            Nan::SetPrototypeMethod(localRef, "clear", Clear);
            Nan::SetPrototypeMethod(localRef, "getMany", GetMany);
            Nan::SetPrototypeMethod(localRef, "replaceAll", ReplaceAll);
            Nan::SetPrototypeMethod(localRef, "first", First);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("SceneComponentCollection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneComponentCollection(::Windows::UI::Composition::Scenes::SceneComponentCollection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneComponentCollection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponentCollection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneComponentCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneComponentCollection *wrapperInstance = new SceneComponentCollection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponentCollection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneComponentCollection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneComponentCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneComponentCollection(winRtInstance));
    }


    static void GetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponentCollection^>(info.This())) {
        return;
      }

      SceneComponentCollection *wrapper = SceneComponentCollection::Unwrap<SceneComponentCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          ::Windows::UI::Composition::Scenes::SceneComponent^ result;
          result = wrapper->_instance->GetAt(arg0);
          info.GetReturnValue().Set(WrapSceneComponent(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponentCollection^>(info.This())) {
        return;
      }

      SceneComponentCollection *wrapper = SceneComponentCollection::Unwrap<SceneComponentCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IVectorView<::Windows::UI::Composition::Scenes::SceneComponent^>^ result;
          result = wrapper->_instance->GetView();
          info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Windows::UI::Composition::Scenes::SceneComponent^>::CreateVectorViewWrapper(result, 
            [](::Windows::UI::Composition::Scenes::SceneComponent^ val) -> Local<Value> {
              return WrapSceneComponent(val);
            },
            [](Local<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponent^>(value);
            },
            [](Local<Value> value) -> ::Windows::UI::Composition::Scenes::SceneComponent^ {
              return UnwrapSceneComponent(value);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void IndexOf(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponentCollection^>(info.This())) {
        return;
      }

      SceneComponentCollection *wrapper = SceneComponentCollection::Unwrap<SceneComponentCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponent^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Scenes::SceneComponent^ arg0 = UnwrapSceneComponent(info[0]);
          unsigned int arg1;
          
          bool result;
          result = wrapper->_instance->IndexOf(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("boolean").ToLocalChecked(), Nan::New<Boolean>(result));
          Nan::Set(resObj, Nan::New<String>("index").ToLocalChecked(), Nan::New<Integer>(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponentCollection^>(info.This())) {
        return;
      }

      SceneComponentCollection *wrapper = SceneComponentCollection::Unwrap<SceneComponentCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponent^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Composition::Scenes::SceneComponent^ arg1 = UnwrapSceneComponent(info[1]);
          
          wrapper->_instance->SetAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponentCollection^>(info.This())) {
        return;
      }

      SceneComponentCollection *wrapper = SceneComponentCollection::Unwrap<SceneComponentCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponent^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Composition::Scenes::SceneComponent^ arg1 = UnwrapSceneComponent(info[1]);
          
          wrapper->_instance->InsertAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponentCollection^>(info.This())) {
        return;
      }

      SceneComponentCollection *wrapper = SceneComponentCollection::Unwrap<SceneComponentCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          wrapper->_instance->RemoveAt(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Append(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponentCollection^>(info.This())) {
        return;
      }

      SceneComponentCollection *wrapper = SceneComponentCollection::Unwrap<SceneComponentCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponent^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Scenes::SceneComponent^ arg0 = UnwrapSceneComponent(info[0]);
          
          wrapper->_instance->Append(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAtEnd(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponentCollection^>(info.This())) {
        return;
      }

      SceneComponentCollection *wrapper = SceneComponentCollection::Unwrap<SceneComponentCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->RemoveAtEnd();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponentCollection^>(info.This())) {
        return;
      }

      SceneComponentCollection *wrapper = SceneComponentCollection::Unwrap<SceneComponentCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Clear();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetMany(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Not implemented")));
    }
    static void ReplaceAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponentCollection^>(info.This())) {
        return;
      }

      SceneComponentCollection *wrapper = SceneComponentCollection::Unwrap<SceneComponentCollection>(info.This());

      if (info.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<::Windows::UI::Composition::Scenes::SceneComponent^>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Platform::Array<::Windows::UI::Composition::Scenes::SceneComponent^>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<::Windows::UI::Composition::Scenes::SceneComponent^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<::Windows::UI::Composition::Scenes::SceneComponent^>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponent^>(value);
                 },
                 [](Local<Value> value) -> ::Windows::UI::Composition::Scenes::SceneComponent^ {
                   return UnwrapSceneComponent(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<::Windows::UI::Composition::Scenes::SceneComponent^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          wrapper->_instance->ReplaceAll(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponentCollection^>(info.This())) {
        return;
      }

      SceneComponentCollection *wrapper = SceneComponentCollection::Unwrap<SceneComponentCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::UI::Composition::Scenes::SceneComponent^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::UI::Composition::Scenes::SceneComponent^>::CreateIteratorWrapper(result, 
            [](::Windows::UI::Composition::Scenes::SceneComponent^ val) -> Local<Value> {
              return WrapSceneComponent(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneComponentCollection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneComponentCollection(::Windows::UI::Composition::Scenes::SceneComponentCollection^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneComponentCollection^ UnwrapSceneComponentCollection(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneComponentCollection::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneComponentCollection(::Windows::UI::Composition::Scenes::SceneComponentCollection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneComponentCollection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneComponentCollection^ UnwrapSceneComponentCollection(Local<Value> value) {
     return SceneComponentCollection::Unwrap<SceneComponentCollection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneComponentCollection(Local<Object> exports) {
    SceneComponentCollection::Init(exports);
  }

  class SceneMaterial : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneMaterial").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("SceneMaterial").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneMaterial(::Windows::UI::Composition::Scenes::SceneMaterial^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneMaterial^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMaterial^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneMaterial^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneMaterial *wrapperInstance = new SceneMaterial(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMaterial^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneMaterial^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneMaterial^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneMaterial(winRtInstance));
    }





    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneMaterial^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneMaterial(::Windows::UI::Composition::Scenes::SceneMaterial^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneMaterial^ UnwrapSceneMaterial(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneMaterial::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneMaterial(::Windows::UI::Composition::Scenes::SceneMaterial^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneMaterial::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneMaterial^ UnwrapSceneMaterial(Local<Value> value) {
     return SceneMaterial::Unwrap<SceneMaterial>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneMaterial(Local<Object> exports) {
    SceneMaterial::Init(exports);
  }

  class SceneMaterialInput : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneMaterialInput").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("SceneMaterialInput").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneMaterialInput(::Windows::UI::Composition::Scenes::SceneMaterialInput^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneMaterialInput^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneMaterialInput^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneMaterialInput *wrapperInstance = new SceneMaterialInput(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneMaterialInput^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneMaterialInput^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneMaterialInput(winRtInstance));
    }





    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneMaterialInput^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneMaterialInput(::Windows::UI::Composition::Scenes::SceneMaterialInput^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneMaterialInput^ UnwrapSceneMaterialInput(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneMaterialInput::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneMaterialInput(::Windows::UI::Composition::Scenes::SceneMaterialInput^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneMaterialInput::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneMaterialInput^ UnwrapSceneMaterialInput(Local<Value> value) {
     return SceneMaterialInput::Unwrap<SceneMaterialInput>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneMaterialInput(Local<Object> exports) {
    SceneMaterialInput::Init(exports);
  }

  class SceneMesh : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneMesh").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "fillMeshAttribute", FillMeshAttribute);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("primitiveTopology").ToLocalChecked(), PrimitiveTopologyGetter, PrimitiveTopologySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("bounds").ToLocalChecked(), BoundsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetMethod(constructor, "create", Create);


        Nan::Set(exports, Nan::New<String>("SceneMesh").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneMesh(::Windows::UI::Composition::Scenes::SceneMesh^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneMesh^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMesh^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneMesh^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneMesh *wrapperInstance = new SceneMesh(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMesh^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneMesh^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneMesh^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneMesh(winRtInstance));
    }


    static void FillMeshAttribute(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMesh^>(info.This())) {
        return;
      }

      SceneMesh *wrapper = SceneMesh::Unwrap<SceneMesh>(info.This());

      if (info.Length() == 3
        && info[0]->IsInt32()
        && info[1]->IsInt32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::MemoryBuffer^>(info[2]))
      {
        try
        {
          ::Windows::UI::Composition::Scenes::SceneAttributeSemantic arg0 = static_cast<::Windows::UI::Composition::Scenes::SceneAttributeSemantic>(Nan::To<int32_t>(info[0]).FromMaybe(0));
          ::Windows::Graphics::DirectX::DirectXPixelFormat arg1 = static_cast<::Windows::Graphics::DirectX::DirectXPixelFormat>(Nan::To<int32_t>(info[1]).FromMaybe(0));
          ::Windows::Foundation::MemoryBuffer^ arg2 = dynamic_cast<::Windows::Foundation::MemoryBuffer^>(NodeRT::Utils::GetObjectInstance(info[2]));
          
          wrapper->_instance->FillMeshAttribute(arg0, arg1, arg2);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void Create(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Compositor^ arg0 = dynamic_cast<::Windows::UI::Composition::Compositor^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          ::Windows::UI::Composition::Scenes::SceneMesh^ result;
          result = ::Windows::UI::Composition::Scenes::SceneMesh::Create(arg0);
          info.GetReturnValue().Set(WrapSceneMesh(result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void PrimitiveTopologyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMesh^>(info.This())) {
        return;
      }

      SceneMesh *wrapper = SceneMesh::Unwrap<SceneMesh>(info.This());

      try  {
        ::Windows::Graphics::DirectX::DirectXPrimitiveTopology result = wrapper->_instance->PrimitiveTopology;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PrimitiveTopologySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMesh^>(info.This())) {
        return;
      }

      SceneMesh *wrapper = SceneMesh::Unwrap<SceneMesh>(info.This());

      try {

        ::Windows::Graphics::DirectX::DirectXPrimitiveTopology winRtValue = static_cast<::Windows::Graphics::DirectX::DirectXPrimitiveTopology>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->PrimitiveTopology = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BoundsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMesh^>(info.This())) {
        return;
      }

      SceneMesh *wrapper = SceneMesh::Unwrap<SceneMesh>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneBoundingBox^ result = wrapper->_instance->Bounds;
        info.GetReturnValue().Set(WrapSceneBoundingBox(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneMesh^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneMesh(::Windows::UI::Composition::Scenes::SceneMesh^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneMesh^ UnwrapSceneMesh(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneMesh::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneMesh(::Windows::UI::Composition::Scenes::SceneMesh^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneMesh::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneMesh^ UnwrapSceneMesh(Local<Value> value) {
     return SceneMesh::Unwrap<SceneMesh>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneMesh(Local<Object> exports) {
    SceneMesh::Init(exports);
  }

  class SceneMeshMaterialAttributeMap : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneMeshMaterialAttributeMap").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "lookup", Lookup);
            Nan::SetPrototypeMethod(localRef, "hasKey", HasKey);
            Nan::SetPrototypeMethod(localRef, "getView", GetView);
            Nan::SetPrototypeMethod(localRef, "insert", Insert);
            Nan::SetPrototypeMethod(localRef, "remove", Remove);
            Nan::SetPrototypeMethod(localRef, "clear", Clear);
            Nan::SetPrototypeMethod(localRef, "first", First);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("SceneMeshMaterialAttributeMap").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneMeshMaterialAttributeMap(::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneMeshMaterialAttributeMap *wrapperInstance = new SceneMeshMaterialAttributeMap(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneMeshMaterialAttributeMap(winRtInstance));
    }


    static void Lookup(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^>(info.This())) {
        return;
      }

      SceneMeshMaterialAttributeMap *wrapper = SceneMeshMaterialAttributeMap::Unwrap<SceneMeshMaterialAttributeMap>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          
          ::Windows::UI::Composition::Scenes::SceneAttributeSemantic result;
          result = wrapper->_instance->Lookup(arg0);
          info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void HasKey(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^>(info.This())) {
        return;
      }

      SceneMeshMaterialAttributeMap *wrapper = SceneMeshMaterialAttributeMap::Unwrap<SceneMeshMaterialAttributeMap>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          
          bool result;
          result = wrapper->_instance->HasKey(arg0);
          info.GetReturnValue().Set(Nan::New<Boolean>(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^>(info.This())) {
        return;
      }

      SceneMeshMaterialAttributeMap *wrapper = SceneMeshMaterialAttributeMap::Unwrap<SceneMeshMaterialAttributeMap>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IMapView<::Platform::String^, ::Windows::UI::Composition::Scenes::SceneAttributeSemantic>^ result;
          result = wrapper->_instance->GetView();
          info.GetReturnValue().Set(NodeRT::Collections::MapViewWrapper<::Platform::String^,::Windows::UI::Composition::Scenes::SceneAttributeSemantic>::CreateMapViewWrapper(result, 
            [](::Platform::String^ val) -> Local<Value> {
              return NodeRT::Utils::NewString(val->Data());
            },
            [](Local<Value> value) -> bool {
              return value->IsString();
            },
            [](Local<Value> value) -> ::Platform::String^ {
              return ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));
            },
            [](::Windows::UI::Composition::Scenes::SceneAttributeSemantic val) -> Local<Value> {
              return Nan::New<Integer>(static_cast<int>(val));
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Insert(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^>(info.This())) {
        return;
      }

      SceneMeshMaterialAttributeMap *wrapper = SceneMeshMaterialAttributeMap::Unwrap<SceneMeshMaterialAttributeMap>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && info[1]->IsInt32())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Windows::UI::Composition::Scenes::SceneAttributeSemantic arg1 = static_cast<::Windows::UI::Composition::Scenes::SceneAttributeSemantic>(Nan::To<int32_t>(info[1]).FromMaybe(0));
          
          bool result;
          result = wrapper->_instance->Insert(arg0, arg1);
          info.GetReturnValue().Set(Nan::New<Boolean>(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Remove(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^>(info.This())) {
        return;
      }

      SceneMeshMaterialAttributeMap *wrapper = SceneMeshMaterialAttributeMap::Unwrap<SceneMeshMaterialAttributeMap>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          
          wrapper->_instance->Remove(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^>(info.This())) {
        return;
      }

      SceneMeshMaterialAttributeMap *wrapper = SceneMeshMaterialAttributeMap::Unwrap<SceneMeshMaterialAttributeMap>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Clear();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^>(info.This())) {
        return;
      }

      SceneMeshMaterialAttributeMap *wrapper = SceneMeshMaterialAttributeMap::Unwrap<SceneMeshMaterialAttributeMap>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::Foundation::Collections::IKeyValuePair<::Platform::String^, ::Windows::UI::Composition::Scenes::SceneAttributeSemantic>^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::Foundation::Collections::IKeyValuePair<::Platform::String^, ::Windows::UI::Composition::Scenes::SceneAttributeSemantic>^>::CreateIteratorWrapper(result, 
            [](::Windows::Foundation::Collections::IKeyValuePair<::Platform::String^, ::Windows::UI::Composition::Scenes::SceneAttributeSemantic>^ val) -> Local<Value> {
              return NodeRT::Collections::KeyValuePairWrapper<::Platform::String^,::Windows::UI::Composition::Scenes::SceneAttributeSemantic>::CreateKeyValuePairWrapper(val, 
            [](::Platform::String^ val) -> Local<Value> {
              return NodeRT::Utils::NewString(val->Data());
            },
            [](::Windows::UI::Composition::Scenes::SceneAttributeSemantic val) -> Local<Value> {
              return Nan::New<Integer>(static_cast<int>(val));
            }
          );
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneMeshMaterialAttributeMap(::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^ UnwrapSceneMeshMaterialAttributeMap(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneMeshMaterialAttributeMap::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneMeshMaterialAttributeMap(::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneMeshMaterialAttributeMap::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^ UnwrapSceneMeshMaterialAttributeMap(Local<Value> value) {
     return SceneMeshMaterialAttributeMap::Unwrap<SceneMeshMaterialAttributeMap>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneMeshMaterialAttributeMap(Local<Object> exports) {
    SceneMeshMaterialAttributeMap::Init(exports);
  }

  class SceneRendererComponent : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneRendererComponent").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("componentType").ToLocalChecked(), ComponentTypeGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("SceneRendererComponent").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneRendererComponent(::Windows::UI::Composition::Scenes::SceneRendererComponent^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneRendererComponent^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneRendererComponent^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneRendererComponent^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneRendererComponent *wrapperInstance = new SceneRendererComponent(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneRendererComponent^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneRendererComponent^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneRendererComponent^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneRendererComponent(winRtInstance));
    }





    static void ComponentTypeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponent^>(info.This())) {
        return;
      }

      SceneComponent *wrapper = SceneComponent::Unwrap<SceneComponent>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneComponentType result = wrapper->_instance->ComponentType;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneRendererComponent^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneRendererComponent(::Windows::UI::Composition::Scenes::SceneRendererComponent^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneRendererComponent^ UnwrapSceneRendererComponent(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneRendererComponent::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneRendererComponent(::Windows::UI::Composition::Scenes::SceneRendererComponent^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneRendererComponent::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneRendererComponent^ UnwrapSceneRendererComponent(Local<Value> value) {
     return SceneRendererComponent::Unwrap<SceneRendererComponent>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneRendererComponent(Local<Object> exports) {
    SceneRendererComponent::Init(exports);
  }

  class SceneMeshRendererComponent : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneMeshRendererComponent").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("mesh").ToLocalChecked(), MeshGetter, MeshSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("material").ToLocalChecked(), MaterialGetter, MaterialSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("uVMappings").ToLocalChecked(), UVMappingsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("componentType").ToLocalChecked(), ComponentTypeGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetMethod(constructor, "create", Create);


        Nan::Set(exports, Nan::New<String>("SceneMeshRendererComponent").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneMeshRendererComponent(::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneMeshRendererComponent *wrapperInstance = new SceneMeshRendererComponent(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneMeshRendererComponent(winRtInstance));
    }





    static void Create(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Compositor^ arg0 = dynamic_cast<::Windows::UI::Composition::Compositor^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          ::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^ result;
          result = ::Windows::UI::Composition::Scenes::SceneMeshRendererComponent::Create(arg0);
          info.GetReturnValue().Set(WrapSceneMeshRendererComponent(result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void MeshGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^>(info.This())) {
        return;
      }

      SceneMeshRendererComponent *wrapper = SceneMeshRendererComponent::Unwrap<SceneMeshRendererComponent>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneMesh^ result = wrapper->_instance->Mesh;
        info.GetReturnValue().Set(WrapSceneMesh(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void MeshSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMesh^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^>(info.This())) {
        return;
      }

      SceneMeshRendererComponent *wrapper = SceneMeshRendererComponent::Unwrap<SceneMeshRendererComponent>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneMesh^ winRtValue = dynamic_cast<::Windows::UI::Composition::Scenes::SceneMesh^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Mesh = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void MaterialGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^>(info.This())) {
        return;
      }

      SceneMeshRendererComponent *wrapper = SceneMeshRendererComponent::Unwrap<SceneMeshRendererComponent>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneMaterial^ result = wrapper->_instance->Material;
        info.GetReturnValue().Set(WrapSceneMaterial(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void MaterialSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMaterial^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^>(info.This())) {
        return;
      }

      SceneMeshRendererComponent *wrapper = SceneMeshRendererComponent::Unwrap<SceneMeshRendererComponent>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneMaterial^ winRtValue = dynamic_cast<::Windows::UI::Composition::Scenes::SceneMaterial^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Material = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void UVMappingsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^>(info.This())) {
        return;
      }

      SceneMeshRendererComponent *wrapper = SceneMeshRendererComponent::Unwrap<SceneMeshRendererComponent>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneMeshMaterialAttributeMap^ result = wrapper->_instance->UVMappings;
        info.GetReturnValue().Set(WrapSceneMeshMaterialAttributeMap(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ComponentTypeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneComponent^>(info.This())) {
        return;
      }

      SceneComponent *wrapper = SceneComponent::Unwrap<SceneComponent>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneComponentType result = wrapper->_instance->ComponentType;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneMeshRendererComponent(::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^ UnwrapSceneMeshRendererComponent(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneMeshRendererComponent::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneMeshRendererComponent(::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneMeshRendererComponent::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneMeshRendererComponent^ UnwrapSceneMeshRendererComponent(Local<Value> value) {
     return SceneMeshRendererComponent::Unwrap<SceneMeshRendererComponent>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneMeshRendererComponent(Local<Object> exports) {
    SceneMeshRendererComponent::Init(exports);
  }

  class ScenePbrMaterial : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("ScenePbrMaterial").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("occlusionStrength").ToLocalChecked(), OcclusionStrengthGetter, OcclusionStrengthSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("occlusionInput").ToLocalChecked(), OcclusionInputGetter, OcclusionInputSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("normalScale").ToLocalChecked(), NormalScaleGetter, NormalScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("normalInput").ToLocalChecked(), NormalInputGetter, NormalInputSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isDoubleSided").ToLocalChecked(), IsDoubleSidedGetter, IsDoubleSidedSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emissiveInput").ToLocalChecked(), EmissiveInputGetter, EmissiveInputSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emissiveFactor").ToLocalChecked(), EmissiveFactorGetter, EmissiveFactorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("alphaMode").ToLocalChecked(), AlphaModeGetter, AlphaModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("alphaCutoff").ToLocalChecked(), AlphaCutoffGetter, AlphaCutoffSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("ScenePbrMaterial").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      ScenePbrMaterial(::Windows::UI::Composition::Scenes::ScenePbrMaterial^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::ScenePbrMaterial^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::ScenePbrMaterial^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      ScenePbrMaterial *wrapperInstance = new ScenePbrMaterial(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::ScenePbrMaterial^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::ScenePbrMaterial^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapScenePbrMaterial(winRtInstance));
    }





    static void OcclusionStrengthGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        float result = wrapper->_instance->OcclusionStrength;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OcclusionStrengthSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->OcclusionStrength = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OcclusionInputGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ result = wrapper->_instance->OcclusionInput;
        info.GetReturnValue().Set(WrapSceneMaterialInput(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OcclusionInputSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ winRtValue = dynamic_cast<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->OcclusionInput = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void NormalScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        float result = wrapper->_instance->NormalScale;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void NormalScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->NormalScale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void NormalInputGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ result = wrapper->_instance->NormalInput;
        info.GetReturnValue().Set(WrapSceneMaterialInput(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void NormalInputSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ winRtValue = dynamic_cast<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->NormalInput = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsDoubleSidedGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        bool result = wrapper->_instance->IsDoubleSided;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsDoubleSidedSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsDoubleSided = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void EmissiveInputGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ result = wrapper->_instance->EmissiveInput;
        info.GetReturnValue().Set(WrapSceneMaterialInput(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmissiveInputSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ winRtValue = dynamic_cast<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->EmissiveInput = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void EmissiveFactorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->EmissiveFactor;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmissiveFactorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->EmissiveFactor = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AlphaModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneAlphaMode result = wrapper->_instance->AlphaMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AlphaModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneAlphaMode winRtValue = static_cast<::Windows::UI::Composition::Scenes::SceneAlphaMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->AlphaMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AlphaCutoffGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        float result = wrapper->_instance->AlphaCutoff;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AlphaCutoffSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->AlphaCutoff = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::ScenePbrMaterial^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapScenePbrMaterial(::Windows::UI::Composition::Scenes::ScenePbrMaterial^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::ScenePbrMaterial^ UnwrapScenePbrMaterial(Local<Value> value);
  };

  Persistent<FunctionTemplate> ScenePbrMaterial::s_constructorTemplate;

  v8::Local<v8::Value> WrapScenePbrMaterial(::Windows::UI::Composition::Scenes::ScenePbrMaterial^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(ScenePbrMaterial::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::ScenePbrMaterial^ UnwrapScenePbrMaterial(Local<Value> value) {
     return ScenePbrMaterial::Unwrap<ScenePbrMaterial>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitScenePbrMaterial(Local<Object> exports) {
    ScenePbrMaterial::Init(exports);
  }

  class SceneMetallicRoughnessMaterial : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneMetallicRoughnessMaterial").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("roughnessFactor").ToLocalChecked(), RoughnessFactorGetter, RoughnessFactorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("metallicRoughnessInput").ToLocalChecked(), MetallicRoughnessInputGetter, MetallicRoughnessInputSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("metallicFactor").ToLocalChecked(), MetallicFactorGetter, MetallicFactorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("baseColorInput").ToLocalChecked(), BaseColorInputGetter, BaseColorInputSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("baseColorFactor").ToLocalChecked(), BaseColorFactorGetter, BaseColorFactorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("occlusionStrength").ToLocalChecked(), OcclusionStrengthGetter, OcclusionStrengthSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("occlusionInput").ToLocalChecked(), OcclusionInputGetter, OcclusionInputSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("normalScale").ToLocalChecked(), NormalScaleGetter, NormalScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("normalInput").ToLocalChecked(), NormalInputGetter, NormalInputSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isDoubleSided").ToLocalChecked(), IsDoubleSidedGetter, IsDoubleSidedSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emissiveInput").ToLocalChecked(), EmissiveInputGetter, EmissiveInputSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emissiveFactor").ToLocalChecked(), EmissiveFactorGetter, EmissiveFactorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("alphaMode").ToLocalChecked(), AlphaModeGetter, AlphaModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("alphaCutoff").ToLocalChecked(), AlphaCutoffGetter, AlphaCutoffSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetMethod(constructor, "create", Create);


        Nan::Set(exports, Nan::New<String>("SceneMetallicRoughnessMaterial").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneMetallicRoughnessMaterial(::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneMetallicRoughnessMaterial *wrapperInstance = new SceneMetallicRoughnessMaterial(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneMetallicRoughnessMaterial(winRtInstance));
    }





    static void Create(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Compositor^ arg0 = dynamic_cast<::Windows::UI::Composition::Compositor^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          ::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^ result;
          result = ::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial::Create(arg0);
          info.GetReturnValue().Set(WrapSceneMetallicRoughnessMaterial(result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void RoughnessFactorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^>(info.This())) {
        return;
      }

      SceneMetallicRoughnessMaterial *wrapper = SceneMetallicRoughnessMaterial::Unwrap<SceneMetallicRoughnessMaterial>(info.This());

      try  {
        float result = wrapper->_instance->RoughnessFactor;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RoughnessFactorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^>(info.This())) {
        return;
      }

      SceneMetallicRoughnessMaterial *wrapper = SceneMetallicRoughnessMaterial::Unwrap<SceneMetallicRoughnessMaterial>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RoughnessFactor = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void MetallicRoughnessInputGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^>(info.This())) {
        return;
      }

      SceneMetallicRoughnessMaterial *wrapper = SceneMetallicRoughnessMaterial::Unwrap<SceneMetallicRoughnessMaterial>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ result = wrapper->_instance->MetallicRoughnessInput;
        info.GetReturnValue().Set(WrapSceneMaterialInput(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void MetallicRoughnessInputSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^>(info.This())) {
        return;
      }

      SceneMetallicRoughnessMaterial *wrapper = SceneMetallicRoughnessMaterial::Unwrap<SceneMetallicRoughnessMaterial>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ winRtValue = dynamic_cast<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->MetallicRoughnessInput = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void MetallicFactorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^>(info.This())) {
        return;
      }

      SceneMetallicRoughnessMaterial *wrapper = SceneMetallicRoughnessMaterial::Unwrap<SceneMetallicRoughnessMaterial>(info.This());

      try  {
        float result = wrapper->_instance->MetallicFactor;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void MetallicFactorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^>(info.This())) {
        return;
      }

      SceneMetallicRoughnessMaterial *wrapper = SceneMetallicRoughnessMaterial::Unwrap<SceneMetallicRoughnessMaterial>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->MetallicFactor = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BaseColorInputGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^>(info.This())) {
        return;
      }

      SceneMetallicRoughnessMaterial *wrapper = SceneMetallicRoughnessMaterial::Unwrap<SceneMetallicRoughnessMaterial>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ result = wrapper->_instance->BaseColorInput;
        info.GetReturnValue().Set(WrapSceneMaterialInput(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BaseColorInputSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^>(info.This())) {
        return;
      }

      SceneMetallicRoughnessMaterial *wrapper = SceneMetallicRoughnessMaterial::Unwrap<SceneMetallicRoughnessMaterial>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ winRtValue = dynamic_cast<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->BaseColorInput = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BaseColorFactorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^>(info.This())) {
        return;
      }

      SceneMetallicRoughnessMaterial *wrapper = SceneMetallicRoughnessMaterial::Unwrap<SceneMetallicRoughnessMaterial>(info.This());

      try  {
        ::Platform::Numerics::Vector4 result = wrapper->_instance->BaseColorFactor;
        info.GetReturnValue().Set(Vector4ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BaseColorFactorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector4JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^>(info.This())) {
        return;
      }

      SceneMetallicRoughnessMaterial *wrapper = SceneMetallicRoughnessMaterial::Unwrap<SceneMetallicRoughnessMaterial>(info.This());

      try {

        ::Platform::Numerics::Vector4 winRtValue = Vector4FromJsObject(value);

        wrapper->_instance->BaseColorFactor = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OcclusionStrengthGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        float result = wrapper->_instance->OcclusionStrength;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OcclusionStrengthSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->OcclusionStrength = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OcclusionInputGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ result = wrapper->_instance->OcclusionInput;
        info.GetReturnValue().Set(WrapSceneMaterialInput(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OcclusionInputSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ winRtValue = dynamic_cast<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->OcclusionInput = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void NormalScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        float result = wrapper->_instance->NormalScale;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void NormalScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->NormalScale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void NormalInputGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ result = wrapper->_instance->NormalInput;
        info.GetReturnValue().Set(WrapSceneMaterialInput(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void NormalInputSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ winRtValue = dynamic_cast<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->NormalInput = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsDoubleSidedGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        bool result = wrapper->_instance->IsDoubleSided;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsDoubleSidedSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsDoubleSided = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void EmissiveInputGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ result = wrapper->_instance->EmissiveInput;
        info.GetReturnValue().Set(WrapSceneMaterialInput(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmissiveInputSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneMaterialInput^ winRtValue = dynamic_cast<::Windows::UI::Composition::Scenes::SceneMaterialInput^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->EmissiveInput = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void EmissiveFactorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->EmissiveFactor;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmissiveFactorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->EmissiveFactor = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AlphaModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneAlphaMode result = wrapper->_instance->AlphaMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AlphaModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneAlphaMode winRtValue = static_cast<::Windows::UI::Composition::Scenes::SceneAlphaMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->AlphaMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AlphaCutoffGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try  {
        float result = wrapper->_instance->AlphaCutoff;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AlphaCutoffSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::ScenePbrMaterial^>(info.This())) {
        return;
      }

      ScenePbrMaterial *wrapper = ScenePbrMaterial::Unwrap<ScenePbrMaterial>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->AlphaCutoff = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneMetallicRoughnessMaterial(::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^ UnwrapSceneMetallicRoughnessMaterial(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneMetallicRoughnessMaterial::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneMetallicRoughnessMaterial(::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneMetallicRoughnessMaterial::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneMetallicRoughnessMaterial^ UnwrapSceneMetallicRoughnessMaterial(Local<Value> value) {
     return SceneMetallicRoughnessMaterial::Unwrap<SceneMetallicRoughnessMaterial>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneMetallicRoughnessMaterial(Local<Object> exports) {
    SceneMetallicRoughnessMaterial::Init(exports);
  }

  class SceneModelTransform : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneModelTransform").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("translation").ToLocalChecked(), TranslationGetter, TranslationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("scale").ToLocalChecked(), ScaleGetter, ScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAxis").ToLocalChecked(), RotationAxisGetter, RotationAxisSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngleInDegrees").ToLocalChecked(), RotationAngleInDegreesGetter, RotationAngleInDegreesSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngle").ToLocalChecked(), RotationAngleGetter, RotationAngleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("orientation").ToLocalChecked(), OrientationGetter, OrientationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("SceneModelTransform").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneModelTransform(::Windows::UI::Composition::Scenes::SceneModelTransform^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneModelTransform^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneModelTransform^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneModelTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneModelTransform *wrapperInstance = new SceneModelTransform(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneModelTransform^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneModelTransform^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneModelTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneModelTransform(winRtInstance));
    }





    static void TranslationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneModelTransform^>(info.This())) {
        return;
      }

      SceneModelTransform *wrapper = SceneModelTransform::Unwrap<SceneModelTransform>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Translation;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TranslationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneModelTransform^>(info.This())) {
        return;
      }

      SceneModelTransform *wrapper = SceneModelTransform::Unwrap<SceneModelTransform>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Translation = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneModelTransform^>(info.This())) {
        return;
      }

      SceneModelTransform *wrapper = SceneModelTransform::Unwrap<SceneModelTransform>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Scale;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneModelTransform^>(info.This())) {
        return;
      }

      SceneModelTransform *wrapper = SceneModelTransform::Unwrap<SceneModelTransform>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Scale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAxisGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneModelTransform^>(info.This())) {
        return;
      }

      SceneModelTransform *wrapper = SceneModelTransform::Unwrap<SceneModelTransform>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->RotationAxis;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAxisSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneModelTransform^>(info.This())) {
        return;
      }

      SceneModelTransform *wrapper = SceneModelTransform::Unwrap<SceneModelTransform>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->RotationAxis = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleInDegreesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneModelTransform^>(info.This())) {
        return;
      }

      SceneModelTransform *wrapper = SceneModelTransform::Unwrap<SceneModelTransform>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngleInDegrees;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleInDegreesSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneModelTransform^>(info.This())) {
        return;
      }

      SceneModelTransform *wrapper = SceneModelTransform::Unwrap<SceneModelTransform>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngleInDegrees = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneModelTransform^>(info.This())) {
        return;
      }

      SceneModelTransform *wrapper = SceneModelTransform::Unwrap<SceneModelTransform>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngle;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneModelTransform^>(info.This())) {
        return;
      }

      SceneModelTransform *wrapper = SceneModelTransform::Unwrap<SceneModelTransform>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngle = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OrientationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneModelTransform^>(info.This())) {
        return;
      }

      SceneModelTransform *wrapper = SceneModelTransform::Unwrap<SceneModelTransform>(info.This());

      try  {
        ::Platform::Numerics::Quaternion result = wrapper->_instance->Orientation;
        info.GetReturnValue().Set(QuaternionToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OrientationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsQuaternionJsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneModelTransform^>(info.This())) {
        return;
      }

      SceneModelTransform *wrapper = SceneModelTransform::Unwrap<SceneModelTransform>(info.This());

      try {

        ::Platform::Numerics::Quaternion winRtValue = QuaternionFromJsObject(value);

        wrapper->_instance->Orientation = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneModelTransform^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneModelTransform(::Windows::UI::Composition::Scenes::SceneModelTransform^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneModelTransform^ UnwrapSceneModelTransform(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneModelTransform::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneModelTransform(::Windows::UI::Composition::Scenes::SceneModelTransform^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneModelTransform::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneModelTransform^ UnwrapSceneModelTransform(Local<Value> value) {
     return SceneModelTransform::Unwrap<SceneModelTransform>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneModelTransform(Local<Object> exports) {
    SceneModelTransform::Init(exports);
  }

  class SceneNode : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneNode").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "findFirstComponentOfType", FindFirstComponentOfType);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("children").ToLocalChecked(), ChildrenGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("components").ToLocalChecked(), ComponentsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("parent").ToLocalChecked(), ParentGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetMethod(constructor, "create", Create);


        Nan::Set(exports, Nan::New<String>("SceneNode").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneNode(::Windows::UI::Composition::Scenes::SceneNode^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneNode^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNode^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneNode^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneNode *wrapperInstance = new SceneNode(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNode^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneNode^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneNode^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneNode(winRtInstance));
    }


    static void FindFirstComponentOfType(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNode^>(info.This())) {
        return;
      }

      SceneNode *wrapper = SceneNode::Unwrap<SceneNode>(info.This());

      if (info.Length() == 1
        && info[0]->IsInt32())
      {
        try
        {
          ::Windows::UI::Composition::Scenes::SceneComponentType arg0 = static_cast<::Windows::UI::Composition::Scenes::SceneComponentType>(Nan::To<int32_t>(info[0]).FromMaybe(0));
          
          ::Windows::UI::Composition::Scenes::SceneComponent^ result;
          result = wrapper->_instance->FindFirstComponentOfType(arg0);
          info.GetReturnValue().Set(WrapSceneComponent(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void Create(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Compositor^ arg0 = dynamic_cast<::Windows::UI::Composition::Compositor^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          ::Windows::UI::Composition::Scenes::SceneNode^ result;
          result = ::Windows::UI::Composition::Scenes::SceneNode::Create(arg0);
          info.GetReturnValue().Set(WrapSceneNode(result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void ChildrenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNode^>(info.This())) {
        return;
      }

      SceneNode *wrapper = SceneNode::Unwrap<SceneNode>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneNodeCollection^ result = wrapper->_instance->Children;
        info.GetReturnValue().Set(WrapSceneNodeCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ComponentsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNode^>(info.This())) {
        return;
      }

      SceneNode *wrapper = SceneNode::Unwrap<SceneNode>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneComponentCollection^ result = wrapper->_instance->Components;
        info.GetReturnValue().Set(WrapSceneComponentCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ParentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNode^>(info.This())) {
        return;
      }

      SceneNode *wrapper = SceneNode::Unwrap<SceneNode>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneNode^ result = wrapper->_instance->Parent;
        info.GetReturnValue().Set(WrapSceneNode(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNode^>(info.This())) {
        return;
      }

      SceneNode *wrapper = SceneNode::Unwrap<SceneNode>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneModelTransform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapSceneModelTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneNode^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneNode(::Windows::UI::Composition::Scenes::SceneNode^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneNode^ UnwrapSceneNode(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneNode::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneNode(::Windows::UI::Composition::Scenes::SceneNode^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneNode::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneNode^ UnwrapSceneNode(Local<Value> value) {
     return SceneNode::Unwrap<SceneNode>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneNode(Local<Object> exports) {
    SceneNode::Init(exports);
  }

  class SceneNodeCollection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneNodeCollection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getAt", GetAt);
            Nan::SetPrototypeMethod(localRef, "getView", GetView);
            Nan::SetPrototypeMethod(localRef, "indexOf", IndexOf);
            Nan::SetPrototypeMethod(localRef, "setAt", SetAt);
            Nan::SetPrototypeMethod(localRef, "insertAt", InsertAt);
            Nan::SetPrototypeMethod(localRef, "removeAt", RemoveAt);
            Nan::SetPrototypeMethod(localRef, "append", Append);
            Nan::SetPrototypeMethod(localRef, "removeAtEnd", RemoveAtEnd);
            Nan::SetPrototypeMethod(localRef, "clear", Clear);
            Nan::SetPrototypeMethod(localRef, "getMany", GetMany);
            Nan::SetPrototypeMethod(localRef, "replaceAll", ReplaceAll);
            Nan::SetPrototypeMethod(localRef, "first", First);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("SceneNodeCollection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneNodeCollection(::Windows::UI::Composition::Scenes::SceneNodeCollection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneNodeCollection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNodeCollection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneNodeCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneNodeCollection *wrapperInstance = new SceneNodeCollection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNodeCollection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneNodeCollection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneNodeCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneNodeCollection(winRtInstance));
    }


    static void GetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNodeCollection^>(info.This())) {
        return;
      }

      SceneNodeCollection *wrapper = SceneNodeCollection::Unwrap<SceneNodeCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          ::Windows::UI::Composition::Scenes::SceneNode^ result;
          result = wrapper->_instance->GetAt(arg0);
          info.GetReturnValue().Set(WrapSceneNode(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNodeCollection^>(info.This())) {
        return;
      }

      SceneNodeCollection *wrapper = SceneNodeCollection::Unwrap<SceneNodeCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IVectorView<::Windows::UI::Composition::Scenes::SceneNode^>^ result;
          result = wrapper->_instance->GetView();
          info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Windows::UI::Composition::Scenes::SceneNode^>::CreateVectorViewWrapper(result, 
            [](::Windows::UI::Composition::Scenes::SceneNode^ val) -> Local<Value> {
              return WrapSceneNode(val);
            },
            [](Local<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNode^>(value);
            },
            [](Local<Value> value) -> ::Windows::UI::Composition::Scenes::SceneNode^ {
              return UnwrapSceneNode(value);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void IndexOf(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNodeCollection^>(info.This())) {
        return;
      }

      SceneNodeCollection *wrapper = SceneNodeCollection::Unwrap<SceneNodeCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNode^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Scenes::SceneNode^ arg0 = UnwrapSceneNode(info[0]);
          unsigned int arg1;
          
          bool result;
          result = wrapper->_instance->IndexOf(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("boolean").ToLocalChecked(), Nan::New<Boolean>(result));
          Nan::Set(resObj, Nan::New<String>("index").ToLocalChecked(), Nan::New<Integer>(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNodeCollection^>(info.This())) {
        return;
      }

      SceneNodeCollection *wrapper = SceneNodeCollection::Unwrap<SceneNodeCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNode^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Composition::Scenes::SceneNode^ arg1 = UnwrapSceneNode(info[1]);
          
          wrapper->_instance->SetAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNodeCollection^>(info.This())) {
        return;
      }

      SceneNodeCollection *wrapper = SceneNodeCollection::Unwrap<SceneNodeCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNode^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Composition::Scenes::SceneNode^ arg1 = UnwrapSceneNode(info[1]);
          
          wrapper->_instance->InsertAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNodeCollection^>(info.This())) {
        return;
      }

      SceneNodeCollection *wrapper = SceneNodeCollection::Unwrap<SceneNodeCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          wrapper->_instance->RemoveAt(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Append(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNodeCollection^>(info.This())) {
        return;
      }

      SceneNodeCollection *wrapper = SceneNodeCollection::Unwrap<SceneNodeCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNode^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Scenes::SceneNode^ arg0 = UnwrapSceneNode(info[0]);
          
          wrapper->_instance->Append(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAtEnd(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNodeCollection^>(info.This())) {
        return;
      }

      SceneNodeCollection *wrapper = SceneNodeCollection::Unwrap<SceneNodeCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->RemoveAtEnd();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNodeCollection^>(info.This())) {
        return;
      }

      SceneNodeCollection *wrapper = SceneNodeCollection::Unwrap<SceneNodeCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Clear();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetMany(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Not implemented")));
    }
    static void ReplaceAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNodeCollection^>(info.This())) {
        return;
      }

      SceneNodeCollection *wrapper = SceneNodeCollection::Unwrap<SceneNodeCollection>(info.This());

      if (info.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<::Windows::UI::Composition::Scenes::SceneNode^>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Platform::Array<::Windows::UI::Composition::Scenes::SceneNode^>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<::Windows::UI::Composition::Scenes::SceneNode^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<::Windows::UI::Composition::Scenes::SceneNode^>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNode^>(value);
                 },
                 [](Local<Value> value) -> ::Windows::UI::Composition::Scenes::SceneNode^ {
                   return UnwrapSceneNode(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<::Windows::UI::Composition::Scenes::SceneNode^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          wrapper->_instance->ReplaceAll(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNodeCollection^>(info.This())) {
        return;
      }

      SceneNodeCollection *wrapper = SceneNodeCollection::Unwrap<SceneNodeCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::UI::Composition::Scenes::SceneNode^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::UI::Composition::Scenes::SceneNode^>::CreateIteratorWrapper(result, 
            [](::Windows::UI::Composition::Scenes::SceneNode^ val) -> Local<Value> {
              return WrapSceneNode(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneNodeCollection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneNodeCollection(::Windows::UI::Composition::Scenes::SceneNodeCollection^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneNodeCollection^ UnwrapSceneNodeCollection(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneNodeCollection::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneNodeCollection(::Windows::UI::Composition::Scenes::SceneNodeCollection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneNodeCollection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneNodeCollection^ UnwrapSceneNodeCollection(Local<Value> value) {
     return SceneNodeCollection::Unwrap<SceneNodeCollection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneNodeCollection(Local<Object> exports) {
    SceneNodeCollection::Init(exports);
  }

  class SceneSurfaceMaterialInput : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneSurfaceMaterialInput").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("wrappingVMode").ToLocalChecked(), WrappingVModeGetter, WrappingVModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("wrappingUMode").ToLocalChecked(), WrappingUModeGetter, WrappingUModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("surface").ToLocalChecked(), SurfaceGetter, SurfaceSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("bitmapInterpolationMode").ToLocalChecked(), BitmapInterpolationModeGetter, BitmapInterpolationModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetMethod(constructor, "create", Create);


        Nan::Set(exports, Nan::New<String>("SceneSurfaceMaterialInput").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneSurfaceMaterialInput(::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneSurfaceMaterialInput *wrapperInstance = new SceneSurfaceMaterialInput(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneSurfaceMaterialInput(winRtInstance));
    }





    static void Create(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Compositor^ arg0 = dynamic_cast<::Windows::UI::Composition::Compositor^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          ::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^ result;
          result = ::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput::Create(arg0);
          info.GetReturnValue().Set(WrapSceneSurfaceMaterialInput(result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void WrappingVModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^>(info.This())) {
        return;
      }

      SceneSurfaceMaterialInput *wrapper = SceneSurfaceMaterialInput::Unwrap<SceneSurfaceMaterialInput>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneWrappingMode result = wrapper->_instance->WrappingVMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void WrappingVModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^>(info.This())) {
        return;
      }

      SceneSurfaceMaterialInput *wrapper = SceneSurfaceMaterialInput::Unwrap<SceneSurfaceMaterialInput>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneWrappingMode winRtValue = static_cast<::Windows::UI::Composition::Scenes::SceneWrappingMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->WrappingVMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void WrappingUModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^>(info.This())) {
        return;
      }

      SceneSurfaceMaterialInput *wrapper = SceneSurfaceMaterialInput::Unwrap<SceneSurfaceMaterialInput>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneWrappingMode result = wrapper->_instance->WrappingUMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void WrappingUModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^>(info.This())) {
        return;
      }

      SceneSurfaceMaterialInput *wrapper = SceneSurfaceMaterialInput::Unwrap<SceneSurfaceMaterialInput>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneWrappingMode winRtValue = static_cast<::Windows::UI::Composition::Scenes::SceneWrappingMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->WrappingUMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void SurfaceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^>(info.This())) {
        return;
      }

      SceneSurfaceMaterialInput *wrapper = SceneSurfaceMaterialInput::Unwrap<SceneSurfaceMaterialInput>(info.This());

      try  {
        ::Windows::UI::Composition::ICompositionSurface^ result = wrapper->_instance->Surface;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ICompositionSurface", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SurfaceSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ICompositionSurface^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^>(info.This())) {
        return;
      }

      SceneSurfaceMaterialInput *wrapper = SceneSurfaceMaterialInput::Unwrap<SceneSurfaceMaterialInput>(info.This());

      try {

        ::Windows::UI::Composition::ICompositionSurface^ winRtValue = dynamic_cast<::Windows::UI::Composition::ICompositionSurface^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Surface = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BitmapInterpolationModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^>(info.This())) {
        return;
      }

      SceneSurfaceMaterialInput *wrapper = SceneSurfaceMaterialInput::Unwrap<SceneSurfaceMaterialInput>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBitmapInterpolationMode result = wrapper->_instance->BitmapInterpolationMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BitmapInterpolationModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^>(info.This())) {
        return;
      }

      SceneSurfaceMaterialInput *wrapper = SceneSurfaceMaterialInput::Unwrap<SceneSurfaceMaterialInput>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBitmapInterpolationMode winRtValue = static_cast<::Windows::UI::Composition::CompositionBitmapInterpolationMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->BitmapInterpolationMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneSurfaceMaterialInput(::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^ UnwrapSceneSurfaceMaterialInput(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneSurfaceMaterialInput::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneSurfaceMaterialInput(::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneSurfaceMaterialInput::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneSurfaceMaterialInput^ UnwrapSceneSurfaceMaterialInput(Local<Value> value) {
     return SceneSurfaceMaterialInput::Unwrap<SceneSurfaceMaterialInput>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneSurfaceMaterialInput(Local<Object> exports) {
    SceneSurfaceMaterialInput::Init(exports);
  }

  class SceneVisual : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SceneVisual").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("root").ToLocalChecked(), RootGetter, RootSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("children").ToLocalChecked(), ChildrenGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transformMatrix").ToLocalChecked(), TransformMatrixGetter, TransformMatrixSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("size").ToLocalChecked(), SizeGetter, SizeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("scale").ToLocalChecked(), ScaleGetter, ScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAxis").ToLocalChecked(), RotationAxisGetter, RotationAxisSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngleInDegrees").ToLocalChecked(), RotationAngleInDegreesGetter, RotationAngleInDegreesSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngle").ToLocalChecked(), RotationAngleGetter, RotationAngleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("orientation").ToLocalChecked(), OrientationGetter, OrientationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("offset").ToLocalChecked(), OffsetGetter, OffsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isVisible").ToLocalChecked(), IsVisibleGetter, IsVisibleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositeMode").ToLocalChecked(), CompositeModeGetter, CompositeModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("clip").ToLocalChecked(), ClipGetter, ClipSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerPoint").ToLocalChecked(), CenterPointGetter, CenterPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("borderMode").ToLocalChecked(), BorderModeGetter, BorderModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("backfaceVisibility").ToLocalChecked(), BackfaceVisibilityGetter, BackfaceVisibilitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("anchorPoint").ToLocalChecked(), AnchorPointGetter, AnchorPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("parent").ToLocalChecked(), ParentGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("relativeSizeAdjustment").ToLocalChecked(), RelativeSizeAdjustmentGetter, RelativeSizeAdjustmentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("relativeOffsetAdjustment").ToLocalChecked(), RelativeOffsetAdjustmentGetter, RelativeOffsetAdjustmentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("parentForTransform").ToLocalChecked(), ParentForTransformGetter, ParentForTransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isHitTestVisible").ToLocalChecked(), IsHitTestVisibleGetter, IsHitTestVisibleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isPixelSnappingEnabled").ToLocalChecked(), IsPixelSnappingEnabledGetter, IsPixelSnappingEnabledSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcherQueue").ToLocalChecked(), DispatcherQueueGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetMethod(constructor, "create", Create);


        Nan::Set(exports, Nan::New<String>("SceneVisual").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SceneVisual(::Windows::UI::Composition::Scenes::SceneVisual^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Scenes::SceneVisual^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneVisual^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Scenes::SceneVisual^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SceneVisual *wrapperInstance = new SceneVisual(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneVisual^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Scenes::SceneVisual^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Scenes::SceneVisual^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSceneVisual(winRtInstance));
    }





    static void Create(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Compositor^ arg0 = dynamic_cast<::Windows::UI::Composition::Compositor^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          ::Windows::UI::Composition::Scenes::SceneVisual^ result;
          result = ::Windows::UI::Composition::Scenes::SceneVisual::Create(arg0);
          info.GetReturnValue().Set(WrapSceneVisual(result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void RootGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneVisual^>(info.This())) {
        return;
      }

      SceneVisual *wrapper = SceneVisual::Unwrap<SceneVisual>(info.This());

      try  {
        ::Windows::UI::Composition::Scenes::SceneNode^ result = wrapper->_instance->Root;
        info.GetReturnValue().Set(WrapSceneNode(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RootSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneNode^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Scenes::SceneVisual^>(info.This())) {
        return;
      }

      SceneVisual *wrapper = SceneVisual::Unwrap<SceneVisual>(info.This());

      try {

        ::Windows::UI::Composition::Scenes::SceneNode^ winRtValue = dynamic_cast<::Windows::UI::Composition::Scenes::SceneNode^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Root = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ChildrenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ContainerVisual^>(info.This())) {
        return;
      }

      ContainerVisual *wrapper = ContainerVisual::Unwrap<ContainerVisual>(info.This());

      try  {
        ::Windows::UI::Composition::VisualCollection^ result = wrapper->_instance->Children;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "VisualCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformMatrixGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Matrix4x4 result = wrapper->_instance->TransformMatrix;
        info.GetReturnValue().Set(Matrix4x4ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformMatrixSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsMatrix4x4JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Matrix4x4 winRtValue = Matrix4x4FromJsObject(value);

        wrapper->_instance->TransformMatrix = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void SizeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->Size;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SizeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->Size = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Scale;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Scale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAxisGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->RotationAxis;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAxisSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->RotationAxis = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleInDegreesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngleInDegrees;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleInDegreesSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngleInDegrees = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngle;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngle = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OrientationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Quaternion result = wrapper->_instance->Orientation;
        info.GetReturnValue().Set(QuaternionToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OrientationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsQuaternionJsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Quaternion winRtValue = QuaternionFromJsObject(value);

        wrapper->_instance->Orientation = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OffsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Offset;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Offset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsVisibleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        bool result = wrapper->_instance->IsVisible;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsVisibleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsVisible = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositeModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionCompositeMode result = wrapper->_instance->CompositeMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositeModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionCompositeMode winRtValue = static_cast<::Windows::UI::Composition::CompositionCompositeMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->CompositeMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ClipGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionClip^ result = wrapper->_instance->Clip;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionClip", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ClipSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionClip^ winRtValue = dynamic_cast<::Windows::UI::Composition::CompositionClip^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Clip = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->CenterPoint;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->CenterPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BorderModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBorderMode result = wrapper->_instance->BorderMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BorderModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBorderMode winRtValue = static_cast<::Windows::UI::Composition::CompositionBorderMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->BorderMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BackfaceVisibilityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBackfaceVisibility result = wrapper->_instance->BackfaceVisibility;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BackfaceVisibilitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBackfaceVisibility winRtValue = static_cast<::Windows::UI::Composition::CompositionBackfaceVisibility>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->BackfaceVisibility = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AnchorPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->AnchorPoint;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AnchorPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->AnchorPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ParentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::ContainerVisual^ result = wrapper->_instance->Parent;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ContainerVisual", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RelativeSizeAdjustmentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->RelativeSizeAdjustment;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RelativeSizeAdjustmentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->RelativeSizeAdjustment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RelativeOffsetAdjustmentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->RelativeOffsetAdjustment;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RelativeOffsetAdjustmentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->RelativeOffsetAdjustment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ParentForTransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::Visual^ result = wrapper->_instance->ParentForTransform;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Visual", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ParentForTransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::Visual^ winRtValue = dynamic_cast<::Windows::UI::Composition::Visual^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ParentForTransform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsHitTestVisibleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        bool result = wrapper->_instance->IsHitTestVisible;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsHitTestVisibleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsHitTestVisible = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsPixelSnappingEnabledGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        bool result = wrapper->_instance->IsPixelSnappingEnabled;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsPixelSnappingEnabledSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsPixelSnappingEnabled = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "Compositor", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "CompositionPropertySet", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Composition", "ImplicitAnimationCollection", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherQueueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::System::DispatcherQueue^ result = wrapper->_instance->DispatcherQueue;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.System", "DispatcherQueue", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::Scenes::SceneVisual^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSceneVisual(::Windows::UI::Composition::Scenes::SceneVisual^ wintRtInstance);
      friend ::Windows::UI::Composition::Scenes::SceneVisual^ UnwrapSceneVisual(Local<Value> value);
  };

  Persistent<FunctionTemplate> SceneVisual::s_constructorTemplate;

  v8::Local<v8::Value> WrapSceneVisual(::Windows::UI::Composition::Scenes::SceneVisual^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SceneVisual::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Scenes::SceneVisual^ UnwrapSceneVisual(Local<Value> value) {
     return SceneVisual::Unwrap<SceneVisual>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSceneVisual(Local<Object> exports) {
    SceneVisual::Init(exports);
  }


} } } } } 

NAN_MODULE_INIT(init) {
  // We ignore failures for now since it probably means that
  // the initialization already happened for STA, and that's cool

  CoInitializeEx(nullptr, COINIT_MULTITHREADED);

  /*
  if (FAILED(CoInitializeEx(nullptr, COINIT_MULTITHREADED))) {
    Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"error in CoInitializeEx()")));
    return;
  }
  */

      NodeRT::Windows::UI::Composition::Scenes::InitSceneAlphaModeEnum(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneAttributeSemanticEnum(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneComponentTypeEnum(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneWrappingModeEnum(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneObject(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneBoundingBox(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneComponent(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneComponentCollection(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneMaterial(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneMaterialInput(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneMesh(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneMeshMaterialAttributeMap(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneRendererComponent(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneMeshRendererComponent(target);
      NodeRT::Windows::UI::Composition::Scenes::InitScenePbrMaterial(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneMetallicRoughnessMaterial(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneModelTransform(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneNode(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneNodeCollection(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneSurfaceMaterialInput(target);
      NodeRT::Windows::UI::Composition::Scenes::InitSceneVisual(target);


  NodeRT::Utils::RegisterNameSpace("Windows.UI.Composition.Scenes", target);
}



NODE_MODULE(binding, init)
