コード例 #1
0
        int _transitionTime; //how much elapsed time between each snapshot

        #endregion Fields

        #region Constructors

        public SlotViewer(Trajectory trajectory, Scene scene)
        {
            ATOM_STACKS = (Options.GetInstance().AtomStacks);
            ATOM_SLICES = (Options.GetInstance().AtomSlices);
            _scene = scene;
            _trajectory = trajectory;
            _snapshotIndexA = 0;
            _snapshotIndexB = 1;

            Console.WriteLine();

            if (_trajectory.CountSnapshots() == 0)
                throw new Exception("No snapshots to work with!");
            else
                Console.WriteLine("Creating viewer for trajectory with {0} snapshots...", _trajectory.CountSnapshots());

            var RENDER_MODE = Options.GetInstance().RenderMode;
            if (RENDER_MODE == RenderMode.BALL_N_STICK)
            {
                AddAllAtoms();
                Console.WriteLine();
            }

            AddAllBonds();
            Console.WriteLine();

            Console.WriteLine("... done creating SlotViewer.");
        }
コード例 #2
0
        public Trajectory Parse(bool filter = true)
        {
            Console.WriteLine("Parsing trajectory PyON... ");
            Console.Clear();
            var top = ParseTopology();
            Trajectory trajectory = new Trajectory(top);

            ParsePositions(trajectory);

            Console.WriteLine("... done parsing trajectory.");

            return trajectory;
        }
コード例 #3
0
        private void ParsePositions(Trajectory trajectory)
        {
            Console.WriteLine("Parsing all snapshots... ");
            Console.Clear();

            string BEGIN = "PyON1positions\n[", END = "]\n---";
            int index = _pyon.IndexOf(BEGIN, 0);
            while (index != -1)
            {
                var range = new Pair<int, int>(index, _pyon.Length);
                var snapshotRange = StringManip.Between(_pyon, range, BEGIN, END);
                var snap = ParseSnapshot(snapshotRange, trajectory.GetTopology());
                trajectory.AddSnapshot(snap);
                index = _pyon.IndexOf(BEGIN, index + 1);
            }

            Console.WriteLine("... done parsing snapshots.");
            Console.Clear();
        }