const float MStageRequiredTimesteps = 1238.4f / SecondsPerTimestep; // 20.64 minutes (from Potten92)

        public CryptCC(IRenderer renderer, string filename, float averageGrowthTimeSeconds, float attachmentForce)
        {
            string extension = System.IO.Path.GetExtension(filename);

            filename = System.IO.Path.GetDirectoryName(filename) + @"\" + System.IO.Path.GetFileNameWithoutExtension(filename);

            outfile    = new System.IO.StreamWriter(@"C:\Users\Tim\Desktop\" + filename + "_CC" + (averageGrowthTimeSeconds / 3600).ToString() + "hrs_AF" + attachmentForce.ToString() + extension, false);
            m_renderer = renderer;
            m_scene    = m_renderer.GetNewScene();

            m_averageGrowthTimeSeconds     = averageGrowthTimeSeconds;
            m_offMembraneRestorationFactor = attachmentForce;

            m_random    = new Random(DateTime.Now.Millisecond);
            m_normalRNG = new NormalDistributionRNG(m_random, m_averageGrowthTimesteps, GrowthTimestepsStandardDeviation);

            m_cells = new CellArrayCC();

            m_renderArraysAnoikis           = new RenderArrays3d();
            m_renderArraysAnoikis.Positions = new List <Vector3d>();
            m_renderArraysAnoikis.Colours   = new List <Colour>();
            m_renderArraysAnoikis.Visible   = new List <bool>();

            m_renderArraysCells           = new RenderArrays3d();
            m_renderArraysCells.Positions = m_cells.Positions;
            m_renderArraysCells.Colours   = m_cells.Colours;
            m_renderArraysCells.Visible   = m_cells.Active;

            m_scene.CreateCamera();
            m_scene.SetCurrentCamera(0);

            m_scene.RenderArrays3d.Add(m_renderArraysCells);

            m_baseColours  = new Colour[11];
            m_colourCounts = new int[11];

            m_baseColours[00] = new Colour()
            {
                R = 1.0f, G = 0.0f, B = 0.0f, A = 0.0f
            };
            m_baseColours[01] = new Colour()
            {
                R = 0.0f, G = 1.0f, B = 0.0f, A = 0.0f
            };
            m_baseColours[02] = new Colour()
            {
                R = 0.0f, G = 0.0f, B = 1.0f, A = 0.0f
            };
            m_baseColours[03] = new Colour()
            {
                R = 1.0f, G = 1.0f, B = 0.0f, A = 0.0f
            };
            m_baseColours[04] = new Colour()
            {
                R = 0.0f, G = 1.0f, B = 1.0f, A = 0.0f
            };
            m_baseColours[05] = new Colour()
            {
                R = 1.0f, G = 0.5f, B = 0.5f, A = 0.0f
            };
            m_baseColours[06] = new Colour()
            {
                R = 0.5f, G = 1.0f, B = 0.5f, A = 0.0f
            };
            m_baseColours[07] = new Colour()
            {
                R = 0.5f, G = 0.5f, B = 1.0f, A = 0.0f
            };
            m_baseColours[08] = new Colour()
            {
                R = 1.0f, G = 1.0f, B = 0.5f, A = 0.0f
            };
            m_baseColours[09] = new Colour()
            {
                R = 0.5f, G = 1.0f, B = 1.0f, A = 0.0f
            };
            m_baseColours[10] = new Colour()
            {
                R = 1.0f, G = 0.5f, B = 1.0f, A = 0.0f
            };

            m_crypts = new CryptArrayCC();

            float centeringOffset = m_fieldHalfSize - 2000f;

            for (int y = 0; y < m_numCryptsPerSide; y++)
            {
                for (int x = 0; x < m_numCryptsPerSide; x++)
                {
                    int colourIndex = (x + y * m_numCryptsPerSide) % m_baseColours.Count();

                    PopulateCrypt(x, y, colourIndex, centeringOffset);

                    m_crypts.Add(new Vector3d(x * m_initialCryptSeparation - centeringOffset, 0.0f, y * m_initialCryptSeparation - centeringOffset));
                }
            }

            m_grid = new UniformIndexGrid(m_numCryptsPerSide * 2, 30, m_numCryptsPerSide * 2, new Vector3d(2.0f * (m_colonBoundary.X + 100.0f), -1.0f * (CryptHeight + 500.0f), 2.0f * (m_colonBoundary.Y + 100.0f)), new Vector3d(-1.0f * (m_colonBoundary.X + 10.0f), 0.0f, -1.0f * (m_colonBoundary.Y + 10.0f)));
        }
Exemple #2
0
        public CellVisualiser(IRenderer renderer)
        {
            m_renderer = renderer;
            m_scene    = m_renderer.GetNewScene();

            m_positions = new List <List <Vector3d> >();

            m_random = new Random();

            m_renderArrays           = new RenderArrays3d();
            m_renderArrays.Positions = new List <Vector3d>();
            m_renderArrays.Colours   = new List <Colour>();

            m_scene.CreateCamera();
            m_scene.SetCurrentCamera(0);

            m_scene.RenderArrays3d.Add(m_renderArrays);

            m_baseColours = new Colour[11];

            m_baseColours[00] = new Colour()
            {
                R = 1.0f, G = 0.0f, B = 0.0f, A = 0.0f
            };
            m_baseColours[01] = new Colour()
            {
                R = 0.0f, G = 1.0f, B = 0.0f, A = 0.0f
            };
            m_baseColours[02] = new Colour()
            {
                R = 0.0f, G = 0.0f, B = 1.0f, A = 0.0f
            };
            m_baseColours[03] = new Colour()
            {
                R = 1.0f, G = 1.0f, B = 0.0f, A = 0.0f
            };
            m_baseColours[04] = new Colour()
            {
                R = 0.0f, G = 1.0f, B = 1.0f, A = 0.0f
            };
            m_baseColours[05] = new Colour()
            {
                R = 1.0f, G = 0.5f, B = 0.5f, A = 0.0f
            };
            m_baseColours[06] = new Colour()
            {
                R = 0.5f, G = 1.0f, B = 0.5f, A = 0.0f
            };
            m_baseColours[07] = new Colour()
            {
                R = 0.5f, G = 0.5f, B = 1.0f, A = 0.0f
            };
            m_baseColours[08] = new Colour()
            {
                R = 1.0f, G = 1.0f, B = 0.5f, A = 0.0f
            };
            m_baseColours[09] = new Colour()
            {
                R = 0.5f, G = 1.0f, B = 1.0f, A = 0.0f
            };
            m_baseColours[10] = new Colour()
            {
                R = 1.0f, G = 0.5f, B = 1.0f, A = 0.0f
            };

            LoadFile("C:/Users/Tim/Desktop/UbuntuScratch/chasteOutput/OverlappingSpheres/results_from_time_0/results.viznodes");
        }