示例#1
0
文件: Cell.cs 项目: babaq/Soul
        public Cell(INeuron neuron, ModelVisual3D mophology, Imaging imager)
        {
            this.neuron = neuron;
            this.mophology = mophology;
            this.imager = imager;
            neuron.Updated += OnUpdated;
            neuron.Hillock.Spike += OnSpike;
            IsPushing = true;

            var transforms = new Transform3DGroup();
            Rotate = new RotateTransform3D(new QuaternionRotation3D());
            Translate = new TranslateTransform3D(neuron.Position.X, neuron.Position.Y, neuron.Position.Z);
            Scale = new ScaleTransform3D();
            transforms.Children.Add(Rotate);
            transforms.Children.Add(Translate);
            transforms.Children.Add(Scale);
            Mophology.Transform = transforms;

            var binding = new Binding()
            {
                Source = neuron,
                Path = new PropertyPath("Position"),
                Mode = BindingMode.OneWay
            };
            BindingOperations.SetBinding(this, Cell.PositionProperty, binding);
        }
示例#2
0
文件: StemCell.cs 项目: babaq/Soul
 void DevelopSomaMophology(INeuron neuron, Model3DGroup mophology, Imaging imager)
 {
     mophology.Children.Add(new GeometryModel3D(DevelopSomaGeometry(neuron), DevelopSomaMaterial(neuron, imager)));
 }
示例#3
0
文件: StemCell.cs 项目: babaq/Soul
 void DevelopDendriteMophology(INeuron neuron, Model3DGroup mophology, Imaging imager)
 {
 }
示例#4
0
文件: StemCell.cs 项目: babaq/Soul
        MaterialGroup DevelopSomaMaterial(INeuron neuron, Imaging imager)
        {
            MaterialGroup mg = new MaterialGroup();
            switch (neuron.Type)
            {
                case NeuronType.LI:
                case NeuronType.IF:
                case NeuronType.HH:
                case NeuronType.MP:
                    var brush = new SolidColorBrush();
                    imager.Dye = Imaging.Dyes(neuron.Type);

                    var binding = new Binding()
                                      {
                                          Source = neuron,
                                          Path = new PropertyPath("Output"),
                                          Converter = imager,
                                          ConverterParameter = neuron.Hillock.Type,
                                          Mode = BindingMode.OneWay
                                      };
                    BindingOperations.SetBinding(brush, SolidColorBrush.ColorProperty, binding);

                    mg.Children.Add(new DiffuseMaterial(brush));
                    break;
            }
            return mg;
        }
示例#5
0
文件: StemCell.cs 项目: babaq/Soul
 void DevelopAxonMophology(INeuron neuron, Model3DGroup mophology, Imaging imager)
 {
 }