Exemple #1
0
 /// <summary>
 /// Check a subsegment's deallocation.
 /// </summary>
 internal static bool IsDead(SubSegment sub)
 {
     return(sub.subsegs[0].seg == null);
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #6
0
 /// <summary>
 /// Check a subsegment's deallocation.
 /// </summary>
 internal static bool IsDead(SubSegment sub)
 {
     return sub.subsegs[0].seg == null;
 }
Exemple #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);
        }
Exemple #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;
        }
Exemple #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);
 }
Exemple #10
0
 /// <summary>
 /// Dissolve a bond (from the triangle side).
 /// </summary>
 internal void SegDissolve(SubSegment dummy)
 {
     tri.subsegs[orient].seg = dummy;
 }
Exemple #11
0
 /// <summary>
 /// Dissolve a bond (from the triangle side).
 /// </summary>
 internal void SegDissolve(SubSegment dummy)
 {
     tri.subsegs[orient].seg = dummy;
 }