/// <summary>
        /// Создание менеджера
        /// </summary>
        public ObjectManager(ConvexHullInternal hull)
        {
            Dimension        = hull.Dimension;
            Hull             = hull;
            FacePool         = hull.FacePool;
            FacePoolSize     = 0;
            FacePoolCapacity = hull.FacePool.Length;
            FreeFaceIndices  = new IndexBuffer();

            EmptyBufferStack  = new SimpleList <IndexBuffer>();
            DeferredFaceStack = new SimpleList <DeferredFace>();
        }
Пример #2
0
        /// <summary>
        /// Класс выпуклой оболочки
        /// </summary>
        internal static ConvexHull <TVertex, TFace> GetConvexHull <TVertex, TFace>(IList <TVertex> data, ConvexHullComputationConfig config)
            where TFace : ConvexFace <TVertex, TFace>, new()
            where TVertex : IVertex
        {
            config = config ?? new ConvexHullComputationConfig();

            var vertices = new IVertex[data.Count];

            for (int i = 0; i < data.Count; i++)
            {
                vertices[i] = data[i];
            }
            ConvexHullInternal ch = new ConvexHullInternal(vertices, false, config);

            ch.FindConvexHull();

            var hull = ch.GetHullVertices(data);

            return(new ConvexHull <TVertex, TFace> {
                Points = hull, Faces = ch.GetConvexFaces <TVertex, TFace>()
            });
        }