Esempio n. 1
0
        /// <returns>if new meshes where generated.</returns>
        public bool GenerateExtraMeshes()
        {
            if (TwoWayDouble == null)
            {
                return(false);
            }

            NodeInfoFamily cached = MeshLUT[TwoWayDouble.m_nodeMesh];

            if (TwoWayRight == null)
            {
                TwoWayRight = CopyNodeInfo_shallow(TwoWayDouble);
                if (cached != null)
                {
                    TwoWayRight.m_nodeMesh = cached.TwoWayRight.m_nodeMesh;
                }
                else
                {
                    TwoWayRight.m_nodeMesh = TwoWayDouble.m_nodeMesh.CutMesh2(keepLeftSide: false);
                }
            }
            if (TwoWayLeft == null)
            {
                TwoWayLeft = CopyNodeInfo_shallow(TwoWayDouble);
                if (cached != null)
                {
                    TwoWayLeft.m_nodeMesh = cached.TwoWayLeft.m_nodeMesh;
                }
                else
                {
                    TwoWayLeft.m_nodeMesh = TwoWayDouble.m_nodeMesh.CutMesh2(keepLeftSide: true);
                }
            }

            MeshLUT[TwoWayDouble.m_nodeMesh] = this;
            if (StationDouble != null)
            {
                MeshLUT[StationDouble.m_nodeMesh] = this;
            }
            if (StationSingle != null)
            {
                MeshLUT[StationSingle.m_nodeMesh] = this;
            }
            if (Station != null)
            {
                MeshLUT[Station.m_nodeMesh] = this;
            }

            return(cached == null);
        }
Esempio n. 2
0
        public void FillInTheBlanks(NodeInfoFamily source, bool station = false)
        {
            TwoWayDouble = TwoWayDouble ?? source.TwoWayDouble;
            TwoWayRight  = TwoWayRight ?? source.TwoWayRight;
            TwoWayLeft   = TwoWayLeft ?? source.TwoWayLeft;

            OneWay      = OneWay ?? source.OneWay;
            OneWayEnd   = OneWayEnd ?? source.OneWayEnd;
            OneWayStart = OneWayStart ?? source.OneWayStart;

            if (station)
            {
                StationDouble = StationDouble ?? source.StationDouble;
                StationSingle = StationSingle ?? source.StationSingle;
                Station       = Station ?? source.Station;
            }
        }