Beispiel #1
0
        internal static CCubePos GetCubeCoordinates(this CDimPos aDimensionCoordinates, CCubePos aCubeCoordinates, int aEdgeLength)
        {
            var aBaseX   = aCubeCoordinates.x;
            var aBaseY   = aCubeCoordinates.y;
            var aBaseZ   = aCubeCoordinates.z;
            var aOffsetX = aDimensionCoordinates.c1;
            var aOffsetZ = aDimensionCoordinates.c0;
            var aX1      = aOffsetX % ((Int64)aEdgeLength);
            var aOffsetY = (aOffsetX - aX1) / ((Int64)aEdgeLength);
            var aX       = aX1 + aBaseX;
            var aY       = aBaseY + aOffsetY;
            var aZ       = aBaseZ + aOffsetZ;

            return(new CCubePos((Int64)aX, (Int64)aY, (Int64)aZ));
        }
Beispiel #2
0
        internal CDimPos(CDimPos aParent, Int64 c)
        {
            switch (aParent.Length)
            {
            case 0:
                this.c0 = c;
                this.c1 = default(Int64?);
                break;

            case 1:
                this.c0 = aParent.c0;
                this.c1 = c;
                break;

            default:
                throw new ArgumentException();
            }
        }
Beispiel #3
0
 internal void AllocateSubDimensions(int aSize)
 {
     if (this.AllocateSubDimensionsDone)
     {
         throw new InvalidOperationException();
     }
     else
     {
         var aSubs = new CDimension[aSize];
         for (int aIdx = 0; aIdx < aSize; ++aIdx)
         {
             var aDimPos    = new CDimPos(this.DimensionCoordinates, aIdx);
             var aDimension = this.RootDimension.NewDimension(this, aDimPos);
             aSubs[aIdx] = aDimension;
         }
         this.Dimensions = aSubs;
         this.Size       = aSize;
         this.AllocateSubDimensionsDone = true;
     }
 }
Beispiel #4
0
 internal abstract CDimension NewDimension(CServiceLocatorNode aParent, CDimPos aDimPos);