示例#1
0
文件: Edge.cs 项目: drdbkarron/DMT01
        public static void AnnotateRecursion(Edge E0, Edge E1, int depth)
        {
            if (E0 == null)
            {
                return;
            }

            if (E0.ParentBoxel == null)
            {
                return;
            }

            Boxel B0 = E0.ParentBoxel;

            if (E1 == null)
            {
                return;
            }

            if (E1.ParentBoxel == null)
            {
                return;
            }

            Boxel B1 = E1.ParentBoxel;

            if (false)
            {
                System.Diagnostics.Debug.WriteLine(String.Format("{6}:B[{0},{1}*E{2}]-{7}->B[{3},{4}*E{5}] ",
                                                                 B0.I, B0.J, E0.EdgeIndex,
                                                                 B1.I, B1.J, E1.EdgeIndex, depth, Boxel.EncodeBoxelAdjacency(B0, B1)));
            }
            if (true)
            {
                OpenGL gl = MainWindow.staticGLHook;
                if (gl == null)
                {
                    return;
                }

                float [] Centroid1 = E0.ParentBoxel.Centroid.cf;
                gl.PushAttrib(SharpGL.Enumerations.AttributeMask.All);
                gl.Color(0, .9, .1);
                gl.PointSize(6);

                B0.SmallerBoxAbout(gl, .65f);
                gl.Color(.9, .9, .1);
                B1.SmallerBoxAbout(gl, .55f);
                gl.PopAttrib( );
            }
        }
示例#2
0
文件: Edge.cs 项目: drdbkarron/DMT01
 public Edge(short EI, Vertex V0, Vertex V1, Boxel Parent)
 {
     this.EdgeIndex = EI;
     this.V         = new Vertex [2] {
         V0, V1
     };
     this.Delta_V  = this.V [1].V - this.V [0].V;
     this.delta_cf = new float [3] {
         this.V [1].cf[0] - this.V [0].cf[0],
         this.V [1].cf[1] - this.V [0].cf[1],
         this.V [1].cf[2] - this.V [0].cf[2],
     };
     this.ParentBoxel = Parent;
 }
示例#3
0
文件: Edge.cs 项目: drdbkarron/DMT01
        public Edge(short EI, short subEdgeIndex, Vertex V0, Vertex V1, Boxel Parent)
        {
            this.EdgeIndex = EI;
            this.V [0]     = V0;
            this.V [1]     = V1;
            this.Delta_V   = this.V [1].V - this.V [0].V;
            this.delta_cf  = new float [3] {
                this.V [1].cf[0] - this.V [0].cf[0],
                this.V [1].cf[1] - this.V [0].cf[1],
                this.V [1].cf[2] - this.V [0].cf[2]
            };

            this.SubEdgeIndex = subEdgeIndex;
            this.ParentBoxel  = Parent;
        }
示例#4
0
文件: Edge.cs 项目: drdbkarron/DMT01
        public static Edge GetExitEdge(Edge EntryEdge)
        {
            Boxel EntryBoxel = EntryEdge.ParentBoxel;

            float [] EntryHit = EntryEdge.Hit;
            for (int i = 0; i < 4; i++)
            {
                Edge E = EntryBoxel.E [i];
                if (E == null)
                {
                    continue;
                }

                Boolean CongruentEdges = Equals(E, EntryEdge);
                if (CongruentEdges)
                {
                    continue;
                }

                if (E.Hit == null)
                {
                    continue;
                }

                float [] Hit = E.Hit;
                if (Equals(EntryHit, Hit))
                {
                    continue;
                }

                if (E.Hit != null)
                {
                    return(E);
                }
            }
            return(null);
        }