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); }
void DevelopSomaMophology(INeuron neuron, Model3DGroup mophology, Imaging imager) { mophology.Children.Add(new GeometryModel3D(DevelopSomaGeometry(neuron), DevelopSomaMaterial(neuron, imager))); }
void DevelopDendriteMophology(INeuron neuron, Model3DGroup mophology, Imaging imager) { }
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; }
void DevelopAxonMophology(INeuron neuron, Model3DGroup mophology, Imaging imager) { }