public StratifiedRenderer(IBoundedShape <T> Source, Surfacize <T, Material> SurfacizeFunc, T Default) { this._Default = Default; this._Source = Source; this._SurfacizeFunc = SurfacizeFunc; this._OrientedRenderers = new _OrientedRenderer[3]; }
public _OrientedRenderer(StratifiedRenderer <T> StratifiedRenderer, Axis Axis) { this._StratifiedRenderer = StratifiedRenderer; this._Axis = Axis; IBoundedShape <T> source = this._StratifiedRenderer._Source; Vector <int> bounds = source.Bound; this._DirBounds = bounds[Axis]; this._Interior = new OrientedPartRenderer(Shape.EnumerateInterior(source, this._StratifiedRenderer._SurfacizeFunc, Material.Default), Axis, this._DirBounds); this._Levels = new VBO <ColorNormalVertex> [this._DirBounds - 1, 2]; }
/// <summary> /// Enumerates the interior surfaces in a bounded shape. /// </summary> public static IEnumerableSurface <F> EnumerateInterior <T, F>(IBoundedShape <T> Source, Surfacize <T, F> SurfacizeFunc, F Excluded) where F : IEquatable <F> { IEnumerableInteriorSurfaceShape <T> eiss = Source.Extend <IEnumerableInteriorSurfaceShape <T> >(); if (eiss != null) { return(eiss.EnumerateInteriorBorders(SurfacizeFunc, Excluded)); } return(new EnumerableInteriorSurface <T, F>(Source, SurfacizeFunc, Excluded)); }
/// <summary> /// "Slices" the specified shape, returning a plane of the borders on the specified axis /// and level. /// </summary> public static IBoundedPlaneSurface <F> Slice <T, F>(IBoundedShape <T> Source, Axis Axis, int Level, Surfacize <T, F> SurfacizeFunc, F Excluded) where F : IEquatable <F> { IBoundedSliceableSurfaceShape <T> bsss = Source.Extend <IBoundedSliceableSurfaceShape <T> >(); if (bsss != null) { return(bsss.Slice(SurfacizeFunc, Excluded, Axis, Level)); } // Too sleepy to do this right now... throw new NotImplementedException(); }
/// <summary> /// Creates a filled infinite shape with the specified parameters. /// </summary> public static IFilledInfiniteShape <T> Fill <T>(IBoundedShape <T> Source, T Default) { IFillableBoundedShape <T> fbs = Source.Extend <IFillableBoundedShape <T> >(); if (fbs != null) { return(fbs.Fill(Default)); } return(new FilledInfiniteShape <T>() { Source = Source, Default = Default }); }
/// <summary> /// Creates an octree representation of the data specified in "Shape". Since the size /// of an octree must be a power of 2, all extra space is filled with the specified /// default value. /// </summary> public static Octree <T> Create(IBoundedShape <T> Shape, T Default) { Vector <int> bound = Shape.Bound; int mbound = bound.X; mbound = mbound < bound.Y ? bound.Y : mbound; mbound = mbound < bound.Z ? bound.Z : mbound; mbound -= 1; int d = 0; while (mbound > 0) { mbound /= 2; d++; } return(Octree <T> .Create(Cubia.Shape.Fill(Shape, Default), d)); }
public EnumerableInteriorSurface(IBoundedShape <T> Source, Surfacize <T, F> SurfacizeFunc, F Excluded) { this._Source = Source; this._SurfacizeFunc = SurfacizeFunc; this._Excluded = Excluded; }