public TrajectoriesDataSource(Host host, PointSet data) : base(Guid.NewGuid()) { this.pointSet = data; this.host = host; if (pointSet.Metadata.ContainsKey("ProbePicture")) { probesHelper = new ProbesHelper(pointSet.Metadata["ProbePicture"], true); } else { probesHelper = new ProbesHelper("ProbeSample.png", false); } // set up the Ontology, a description of the kind of data we contain. // See DataSource sample for more details. OntologySpecification o = this.Ontology.Edit(); o.PrimitiveTypes.Create("RasterPatch", "GeoEntity", typeof(RasterPatch2)); this.UpdateOntology(o); EntitySpecification entitySpec = new EntitySpecification(this.Ontology.EntityTypes["GeoEntity"]); entity = this.EntityAuthorityReference.EntityAuthority.CreateEntity(true, entitySpec); }
public static PointProbeViewModel Create(IMachineElementViewModel parent, Point3D point, double radius = 5.0) { var t = parent.GetChainTansform(); var p = t.Inverse.Transform(point); //var builder = new MeshBuilder(); //builder.AddSphere(p, radius); //var vm = new PointProbeViewModel() //{ // X = p.X, // Y = p.Y, // Z = p.Z, // Radius = radius, // Parent = parent, // MeshGeometry = builder.ToMesh(), // Fill = Brushes.Yellow //}; //vm._onIsSelectedChanged = (b) => vm.Fill = b ? Brushes.Red : Brushes.Yellow; //vm.PropertyChanged += (s, e) => vm.OnPropertyChanged(s, e); //return vm; //return null; var probe = new PointProbeViewModel() { Parent = parent, Geometry = ProbesHelper.GetProbePointModel(p, radius), Material = PhongMaterials.Yellow, Visible = true, X = p.X, Y = p.Y, Z = p.Z }; probe.Name = $"Probe point {probe.Id}"; return(probe); }
public static PointsDistanceViewModel Create(PointProbeViewModel vm1, PointProbeViewModel vm2) { var p1 = new Point3D(vm1.X, vm1.Y, vm1.Z); var p2 = new Point3D(vm2.X, vm2.Y, vm2.Z); var t1 = vm1.GetChainTansform(); var t2 = vm2.GetChainTansform(); var pp2 = t1.Inverse.Transform(t2.Transform(p2)); var p12 = pp2 - p1; var points = new Point3D[] { p1, p1 + new Vector3D(p12.X, 0.0, 0.0), p1 + new Vector3D(p12.X, p12.Y, 0.0), pp2 }; var pdvm = new PointsDistanceViewModel() { X = p12.X, Y = p12.Y, Z = p12.Z, //_vm1 = vm1, //_vm2 = vm2, Parent = vm1, Visible = true, Geometry = ProbesHelper.GetProbeDistanceModel(points), Thickness = 1.0, Smoothness = 1.0, Color = Colors.Yellow }; pdvm.Name = $"Probe distance {pdvm.Id}"; return(pdvm); }
public void SetPicture(string fileName) { probesHelper = new ProbesHelper(fileName, true); this.OnDataChanged(null); }