Пример #1
0
 /// <summary>
 /// Check a subsegment's deallocation.
 /// </summary>
 internal static bool IsDead(SubSegment sub)
 {
     return(sub.subsegs[0].seg == null);
 }
Пример #2
0
 /// <summary>
 /// Set a subsegment's deallocation.
 /// </summary>
 internal static void Kill(SubSegment sub)
 {
     sub.subsegs[0].seg = null;
     sub.subsegs[1].seg = null;
 }
Пример #3
0
 /// <summary>
 /// Set a subsegment's deallocation.
 /// </summary>
 internal static void Kill(SubSegment sub)
 {
     sub.subsegs[0].seg = null;
     sub.subsegs[1].seg = null;
 }
Пример #4
0
 /// <summary>
 /// Dissolve a subsegment bond (from one side).
 /// </summary>
 /// <remarks>Note that the other subsegment will still think it's
 /// connected to this subsegment.</remarks>
 internal void Dissolve(SubSegment dummy)
 {
     seg.subsegs[orient].seg = dummy;
 }
Пример #5
0
 /// <summary>
 /// Dissolve a subsegment bond (from one side).
 /// </summary>
 /// <remarks>Note that the other subsegment will still think it's 
 /// connected to this subsegment.</remarks>
 internal void Dissolve(SubSegment dummy)
 {
     seg.subsegs[orient].seg = dummy;
 }
Пример #6
0
 /// <summary>
 /// Check a subsegment's deallocation.
 /// </summary>
 internal static bool IsDead(SubSegment sub)
 {
     return sub.subsegs[0].seg == null;
 }
Пример #7
0
        /// <summary>
        /// Create a new subsegment with orientation zero.
        /// </summary>
        /// <param name="newsubseg">Reference to the new subseg.</param>
        internal void MakeSegment(ref Osub newsubseg)
        {
            var seg = new SubSegment();

            seg.hash = this.hash_seg++;

            seg.subsegs[0].seg = dummysub;
            seg.subsegs[1].seg = dummysub;

            seg.triangles[0].tri = dummytri;
            seg.triangles[1].tri = dummytri;

            newsubseg.seg = seg;
            newsubseg.orient = 0;

            subsegs.Add(seg.hash, seg);
        }
Пример #8
0
        private void Initialize()
        {
            dummysub = new SubSegment();
            dummysub.hash = DUMMY;

            // Initialize the two adjoining subsegments to be the omnipresent
            // subsegment. These will eventually be changed by various bonding
            // operations, but their values don't really matter, as long as they
            // can legally be dereferenced.
            dummysub.subsegs[0].seg = dummysub;
            dummysub.subsegs[1].seg = dummysub;

            // Set up 'dummytri', the 'triangle' that occupies "outer space."
            dummytri = new Triangle();
            dummytri.hash = dummytri.id = DUMMY;

            // Initialize the three adjoining triangles to be "outer space." These
            // will eventually be changed by various bonding operations, but their
            // values don't really matter, as long as they can legally be
            // dereferenced.
            dummytri.neighbors[0].tri = dummytri;
            dummytri.neighbors[1].tri = dummytri;
            dummytri.neighbors[2].tri = dummytri;

            // Initialize the three adjoining subsegments of 'dummytri' to be
            // the omnipresent subsegment.
            dummytri.subsegs[0].seg = dummysub;
            dummytri.subsegs[1].seg = dummysub;
            dummytri.subsegs[2].seg = dummysub;
        }
Пример #9
0
 /// <summary>
 /// Deallocate space for a subsegment, marking it dead.
 /// </summary>
 /// <param name="dyingsubseg"></param>
 internal void SubsegDealloc(SubSegment dyingsubseg)
 {
     // Mark the subsegment as dead. This makes it possible to detect dead 
     // subsegments when traversing the list of all subsegments.
     Osub.Kill(dyingsubseg);
     subsegs.Remove(dyingsubseg.hash);
 }
Пример #10
0
 /// <summary>
 /// Dissolve a bond (from the triangle side).
 /// </summary>
 internal void SegDissolve(SubSegment dummy)
 {
     tri.subsegs[orient].seg = dummy;
 }
Пример #11
0
 /// <summary>
 /// Dissolve a bond (from the triangle side).
 /// </summary>
 internal void SegDissolve(SubSegment dummy)
 {
     tri.subsegs[orient].seg = dummy;
 }