Exemplo n.º 1
0
        public LotEditorItemMarker CreateGeometry()
        {
            LotEditorItemMarker   marker = new LotEditorItemMarker(this);
            Model3DCollection     coll   = new Model3DCollection();
            TruncatedConeVisual3D cone   = new TruncatedConeVisual3D();

            cone.Height             = 2.5;
            cone.BaseRadius         = 0;
            cone.TopRadius          = 1;
            cone.Material           = MaterialHelper.CreateMaterial(Brushes.Red, new SolidColorBrush(Color.FromScRgb(1f, 0.2f, 0.0f, 0f)));
            marker.ManipulatorModel = cone.Model;
            marker.Transform        = new MatrixTransform3D(this.Transform.GetAsMatrix3D());
            ModelRepresentation     = marker;

            BillboardTextVisual3D billboard = new BillboardTextVisual3D();

            billboard.Text       = Index.ToString();
            billboard.Background = Brushes.White;
            billboard.Transform  = new TranslateTransform3D(0, 0, 5);

            marker.Children.Add(billboard);


            return(marker);
        }
Exemplo n.º 2
0
        public LotEditorItemMarker CreateGeometry()
        {
            LotEditorItemMarker   marker = new LotEditorItemMarker(this);
            TruncatedConeVisual3D cone   = new TruncatedConeVisual3D();

            cone.Height             = 2.5;
            cone.BaseRadius         = 0;
            cone.TopRadius          = 1;
            cone.Material           = MaterialHelper.CreateMaterial(Brushes.Blue, new SolidColorBrush(Color.FromScRgb(1f, 0.0f, 0.0f, 0.2f)));
            marker.ManipulatorModel = cone.Model;
            marker.Transform        = new MatrixTransform3D(this.Transform.GetAsMatrix3D());
            ModelRepresentation     = marker;
            return(marker);
        }
Exemplo n.º 3
0
        public LotEditorItemMarker CreateGeometry()
        {
            LotEditorItemMarker item = new LotEditorItemMarker(this);

            BoxVisual3D box = new BoxVisual3D();

            box.Height    = 2;
            box.Width     = 2;
            box.Length    = 2;
            box.Transform = new MatrixTransform3D(this.Transform);
            box.Material  = MaterialHelper.CreateMaterial(Brushes.Black, Brushes.Blue);
            //  this.ModelRepresentation = box;
            return(item);
        }
Exemplo n.º 4
0
        //   [PropertyFilePropertyArrayAttribute(new uint[] { 0x0d109090, 0x0d109091, 0x0d109092 }, Optional=true)]
        //  public KeyProperty RenderGroup
        //  { get; set; }

        //   [PropertyFilePropertyArrayAttribute(new uint[] { 0x0d1090a0, 0x0d1090a1, 0x0d1090a2 }, Optional = true)]
        //   public Int32Property DecalMachineSpec
        //  { get; set; }

        public LotEditorItemMarker CreateGeometry()
        {
            LotEditorItemMarker marker    = new LotEditorItemMarker(this);
            RectangleVisual3D   rectangle = new RectangleVisual3D();

            rectangle.Length        = 2 * Scale;
            rectangle.Width         = 2 * Scale;
            rectangle.Material      = new DiffuseMaterial(Brushes.Transparent);
            rectangle.BackMaterial  = MaterialHelper.CreateMaterial(Brushes.Green, new SolidColorBrush(Color.FromScRgb(1f, 0.2f, 0.2f, 0f)));
            marker.ManipulatorModel = rectangle.Model;
            marker.Transform        = new MatrixTransform3D(this.Transform.GetAsMatrix3D());
            ModelRepresentation     = marker;
            return(marker);
        }
Exemplo n.º 5
0
        public LotEditorItemMarker CreateGeometry()
        {
            LotEditorItemMarker item = new LotEditorItemMarker(this);

            SphereVisual3D point = new SphereVisual3D();

            point.Radius = 2;

            point.Material = MaterialHelper.CreateMaterial(Brushes.Black, Brushes.Aqua);

            item.ManipulatorModel    = point.Model;
            item.Transform           = new TranslateTransform3D(Point.X, Point.Y, Point.Z);
            this.ModelRepresentation = item;
            return(item);
        }
Exemplo n.º 6
0
 public void UpdateGeometry()
 {
     ModelRepresentation = CreateGeometry();
 }
 public LotEditorItemManipulator(LotEditorItemMarker parent)
 {
     Parent = parent;
 }
Exemplo n.º 8
0
        public LotEditorItemMarker CreateGeometry()
        {
            LotEditorItemMarker marker;

            if (this.ModelRepresentation == null)
            {
                marker = new LotEditorItemMarker(this);
            }
            else
            {
                marker = this.ModelRepresentation;
            }

            if (ViewLotEditor.LightTypes[LightType.InstanceId] == "Spot")
            {
                TruncatedConeVisual3D cone = new TruncatedConeVisual3D();
                cone.Height     = LightLength.Value;
                cone.BaseRadius = 0;
                cone.TopRadius  = LightOuterRadius.Value;
                Transform3DGroup transforms = new Transform3DGroup();
                transforms.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(1, 0, 0), -90)));
                Transform3D coneTransform = new MatrixTransform3D(LightTransform.GetAsMatrix3D());
                transforms.Children.Add(coneTransform);
                // cone.Transform = transforms;

                cone.Material = MaterialHelper.CreateMaterial(Brushes.Black, new SolidColorBrush(LightColor.Color), opacity: 0.6);
                //ModelRepresentation.Model = cone.Model;

                marker.Transform        = transforms;
                marker.ManipulatorModel = cone.Model;
                ModelRepresentation     = marker;
                return(marker);
            }
            else if (ViewLotEditor.LightTypes[LightType.InstanceId] == "Point")
            {
                HelixToolkit.Wpf.SphereVisual3D sphere = new HelixToolkit.Wpf.SphereVisual3D();
                sphere.Radius = 1;

                sphere.Material = MaterialHelper.CreateMaterial(Brushes.Black, new SolidColorBrush(LightColor.Color));

                marker.Transform        = new MatrixTransform3D(LightTransform.GetAsMatrix3D());
                marker.ManipulatorModel = sphere.Model;
                ModelRepresentation     = marker;
                return(marker);
            }
            else if (ViewLotEditor.LightTypes[LightType.InstanceId] == "Line")
            {
                BoxVisual3D lineLight = new BoxVisual3D();
                lineLight.Height = LightLength.Value;

                lineLight.Center = new Point3D(0, 0, -(LightLength.Value / 2));

                Transform3DGroup transforms = new Transform3DGroup();
                // transforms.Children.Add(new TranslateTransform3D(0, 0, -(light.LightLength / 2)));
                transforms.Children.Add(new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(1, 0, 0), 90)));
                transforms.Children.Add(new MatrixTransform3D(LightTransform.GetAsMatrix3D()));

                lineLight.Material = MaterialHelper.CreateMaterial(Brushes.Black, new SolidColorBrush(LightColor.Color));

                marker.Transform        = transforms;
                marker.ManipulatorModel = lineLight.Model;
                ModelRepresentation     = marker;
                return(marker);
            }

            return(new LotEditorItemMarker(this));
        }