/// <summary>
        /// Clones this object.
        /// </summary>
        public GeometrySurface Clone(
            Geometry newOwner,
            bool copyGeometryData = true, int capacityMultiplier = 1,
            int baseIndex         = 0)
        {
            newOwner.EnsureNotNull(nameof(newOwner));

            // Create new Geometry object
            var indexCount = _corners.Count;
            var result     = new GeometrySurface(newOwner, indexCount / 3 * capacityMultiplier);

            // Copy geometry
            if (copyGeometryData)
            {
                for (var loop = 0; loop < indexCount; loop++)
                {
                    var cornerToAdd = _corners[loop];
                    cornerToAdd.Index = cornerToAdd.Index + baseIndex;
                    result._corners.Add(cornerToAdd);
                }
            }

            return(result);
        }
 public void RemoveSurface(GeometrySurface surface)
 {
     _surfaces.Remove(surface);
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GeometryTextRenderer" /> class.
 /// </summary>
 public GeometryTextRenderer(GeometrySurface targetSurface, TextGeometryOptions textGeometryOptions)
 {
     _targetSurface   = targetSurface;
     _geometryOptions = textGeometryOptions;
 }