<commit_before>﻿/*
The MIT License (MIT)
Copyright (c) 2018 Helix Toolkit contributors
*/
using System;
using System.Collections.Generic;
using SharpDX;
using SharpDX.Direct3D11;
using System.Linq;

#if NETFX_CORE
namespace HelixToolkit.UWP.Model.Scene
#else
namespace HelixToolkit.Wpf.SharpDX.Model.Scene
#endif
{
    using Core;

    public abstract class GeometryNode : SceneNode, IHitable, IThrowingShadow, IInstancing
    { 
        #region Properties   
        private Geometry3D geometry;
        public Geometry3D Geometry
        {
            set
            {
                if(Set(ref geometry, value))
                {
                    if (IsAttached)
                    {
                        BoundManager.Geometry = value;
                        BufferModelInternal = OnCreateBufferModel(this.GUID, value);
                    }
                    InvalidateRender();
                    OnGeometryChanged(value);
                }
            }
            get
            {
                return geometry;
            }
        }

        private IList<Matrix> instances;
        public IList<Matrix> Instances
        {
            set
            {
                if(Set(ref instances, value))
                {
                    BoundManager.Instances = value;
                }
            }
            get { return instances; }
        }
        /// <summary>
        /// Gets a value indicating whether this instance has instances.
        /// </summary>
        /// <value>
        ///   <c>true</c> if this instance has instances; otherwise, <c>false</c>.<commit_msg>Bug fix<commit_after>﻿/*
The MIT License (MIT)
Copyright (c) 2018 Helix Toolkit contributors
*/
using System;
using System.Collections.Generic;
using SharpDX;
using SharpDX.Direct3D11;
using System.Linq;

#if NETFX_CORE
namespace HelixToolkit.UWP.Model.Scene
#else
namespace HelixToolkit.Wpf.SharpDX.Model.Scene
#endif
{
    using Core;

    public abstract class GeometryNode : SceneNode, IHitable, IThrowingShadow, IInstancing
    { 
        #region Properties   
        private Geometry3D geometry;
        public Geometry3D Geometry
        {
            set
            {
                if(Set(ref geometry, value))
                {
                    if (IsAttached)
                    {
                        BoundManager.Geometry = value;
                        BufferModelInternal = OnCreateBufferModel(this.GUID, value);
                    }
                    InvalidateRender();
                    OnGeometryChanged(value);
                }
            }
            get
            {
                return geometry;
            }
        }

        private IList<Matrix> instances;
        public IList<Matrix> Instances
        {
            set
            {
                if(Set(ref instances, value))
                {
                    BoundManager.Instances = value;
                    InstanceBuffer.Elements = value;
                }
            }
            get { return instances; }
        }
        /// <summary>
        /// Gets a value indicating whether this instance has instances.
        /// </summary>
        /// <value>
        ///   <c>true</c> if this instance has instances; otherwise, <c>false</c>.
{'fraction_non_alphanumeric': 0.08116385911179173, 'fraction_numerical': 0.005513016845329249, 'mean_word_length': 1.303244005641749, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2562700', 'n_tokens_mistral': 859, 'n_tokens_neox': 788, 'n_words': 198}