Beispiel #1
0
 public Axis3D(Axes3D axes, Axis3DCollection axisCollection)
 {
     axisLabels          = new List <TextBlock>();
     labelProperties     = new LabelProperties(axisCollection.TickLabels);
     model3D             = new LinesModel3D();
     this.axes           = axes;
     this.axisCollection = axisCollection;
     this.axes.Children.Add(model3D);
 }
Beispiel #2
0
        public Axes3D() : base()
        {
            labelProperties = new LabelProperties();
            xAxisCollection.TickLabels.SetParent(labelProperties);
            yAxisCollection.TickLabels.SetParent(labelProperties);
            zAxisCollection.TickLabels.SetParent(labelProperties);
            xAxisCollection.AxisLabels.Text = "X";
            yAxisCollection.AxisLabels.Text = "Y";
            zAxisCollection.AxisLabels.Text = "Z";

            sides  = new LinesModel3D[6];
            MinusX = new LinesModel3D(); sides[(int)GraphSides.MinusX] = MinusX;
            MinusY = new LinesModel3D(); sides[(int)GraphSides.MinusY] = MinusY;
            MinusZ = new LinesModel3D(); sides[(int)GraphSides.MinusZ] = MinusZ;
            PlusX  = new LinesModel3D(); sides[(int)GraphSides.PlusX] = PlusX;
            PlusY  = new LinesModel3D(); sides[(int)GraphSides.PlusY] = PlusY;
            PlusZ  = new LinesModel3D(); sides[(int)GraphSides.PlusZ] = PlusZ;

            this.Children.Add(MinusX);
            this.Children.Add(PlusX);
            this.Children.Add(MinusY);
            this.Children.Add(PlusY);
            this.Children.Add(MinusZ);
            this.Children.Add(PlusZ);

            xAxes = new XAxis3D[2];
            yAxes = new YAxis3D[2];
            zAxes = new ZAxis3D[4];
            // X Axes
            xAxes[(int)XAxisType.MinusY] = new XAxis3D(this, xAxisCollection, XAxisType.MinusY);
            xAxes[(int)XAxisType.PlusY]  = new XAxis3D(this, xAxisCollection, XAxisType.PlusY);
            xAxisCollection.AddAxis(xAxes[(int)XAxisType.MinusY]); xAxisCollection.AddAxis(xAxes[(int)XAxisType.PlusY]);

            // Y Axes
            yAxes[(int)YAxisType.MinusX] = new YAxis3D(this, yAxisCollection, YAxisType.MinusX);
            yAxes[(int)YAxisType.PlusX]  = new YAxis3D(this, yAxisCollection, YAxisType.PlusX);
            yAxisCollection.AddAxis(yAxes[(int)YAxisType.MinusX]); yAxisCollection.AddAxis(yAxes[(int)YAxisType.PlusX]);

            // Z Axes
            zAxes[(int)ZAxisType.MinusXMinusY] = new ZAxis3D(this, zAxisCollection, ZAxisType.MinusXMinusY);
            zAxes[(int)ZAxisType.MinusXPlusY]  = new ZAxis3D(this, zAxisCollection, ZAxisType.MinusXPlusY);
            zAxes[(int)ZAxisType.PlusXMinusY]  = new ZAxis3D(this, zAxisCollection, ZAxisType.PlusXMinusY);
            zAxes[(int)ZAxisType.PlusXPlusY]   = new ZAxis3D(this, zAxisCollection, ZAxisType.PlusXPlusY);
            zAxisCollection.AddAxis(zAxes[(int)ZAxisType.MinusXMinusY]); zAxisCollection.AddAxis(zAxes[(int)ZAxisType.MinusXPlusY]);
            zAxisCollection.AddAxis(zAxes[(int)ZAxisType.PlusXMinusY]); zAxisCollection.AddAxis(zAxes[(int)ZAxisType.PlusXPlusY]);

            Base = new LinesModel3D();
            this.Children.Add(Base); // Add base last so that this can overwrite other lines.
            PlusZ.IsVisible = false;
            // Note axes are already added as Children
            Generate();
        }
Beispiel #3
0
        static void LineThicknessChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            LinesModel3D lines = obj as LinesModel3D;
            bool         previousThickLines = lines.thickLines;
            bool         thickLines         = true;

            if (lines.effectUnavailable || (((double)args.NewValue == 1.0) && (lines.dpi == 96)))
            {
                thickLines = false;
            }
            if (previousThickLines != thickLines)
            {
                lines.pointsChanged   = true;
                lines.geometryChanged = true;
                lines.thickVertices   = null;
                lines.indices         = null;
                lines.vertices        = null;
            }
            lines.thickLines = thickLines;
            lines.viewportImage.RequestRender();
        }
Beispiel #4
0
        public Axes3D() : base()
        {
            labelProperties = new LabelProperties();
            xAxisCollection.TickLabels.SetParent(labelProperties);
            yAxisCollection.TickLabels.SetParent(labelProperties);
            zAxisCollection.TickLabels.SetParent(labelProperties);
            xAxisCollection.AxisLabels.Text = "X";
            yAxisCollection.AxisLabels.Text = "Y";
            zAxisCollection.AxisLabels.Text = "Z";

            sides = new LinesModel3D[6]; 
            MinusX = new LinesModel3D(); sides[(int)GraphSides.MinusX] = MinusX;
            MinusY = new LinesModel3D(); sides[(int)GraphSides.MinusY] = MinusY;
            MinusZ = new LinesModel3D(); sides[(int)GraphSides.MinusZ] = MinusZ;
            PlusX = new LinesModel3D(); sides[(int)GraphSides.PlusX] = PlusX;
            PlusY = new LinesModel3D(); sides[(int)GraphSides.PlusY] = PlusY;
            PlusZ = new LinesModel3D(); sides[(int)GraphSides.PlusZ] = PlusZ;

            this.Children.Add(MinusX);
            this.Children.Add(PlusX);
            this.Children.Add(MinusY);
            this.Children.Add(PlusY);
            this.Children.Add(MinusZ);
            this.Children.Add(PlusZ);

            xAxes = new XAxis3D[2];
            yAxes = new YAxis3D[2];
            zAxes = new ZAxis3D[4];
            // X Axes
            xAxes[(int)XAxisType.MinusY] = new XAxis3D(this, xAxisCollection, XAxisType.MinusY);
            xAxes[(int)XAxisType.PlusY] = new XAxis3D(this, xAxisCollection, XAxisType.PlusY);
            xAxisCollection.AddAxis(xAxes[(int)XAxisType.MinusY]); xAxisCollection.AddAxis(xAxes[(int)XAxisType.PlusY]); 

            // Y Axes
            yAxes[(int)YAxisType.MinusX] = new YAxis3D(this, yAxisCollection, YAxisType.MinusX);
            yAxes[(int)YAxisType.PlusX] = new YAxis3D(this, yAxisCollection, YAxisType.PlusX);
            yAxisCollection.AddAxis(yAxes[(int)YAxisType.MinusX]); yAxisCollection.AddAxis(yAxes[(int)YAxisType.PlusX]); 

            // Z Axes
            zAxes[(int)ZAxisType.MinusXMinusY] = new ZAxis3D(this, zAxisCollection, ZAxisType.MinusXMinusY);
            zAxes[(int)ZAxisType.MinusXPlusY] = new ZAxis3D(this, zAxisCollection, ZAxisType.MinusXPlusY);
            zAxes[(int)ZAxisType.PlusXMinusY] = new ZAxis3D(this, zAxisCollection, ZAxisType.PlusXMinusY);
            zAxes[(int)ZAxisType.PlusXPlusY] = new ZAxis3D(this, zAxisCollection, ZAxisType.PlusXPlusY);
            zAxisCollection.AddAxis(zAxes[(int)ZAxisType.MinusXMinusY]); zAxisCollection.AddAxis(zAxes[(int)ZAxisType.MinusXPlusY]);
            zAxisCollection.AddAxis(zAxes[(int)ZAxisType.PlusXMinusY]); zAxisCollection.AddAxis(zAxes[(int)ZAxisType.PlusXPlusY]);

            Base = new LinesModel3D(); 
            this.Children.Add(Base); // Add base last so that this can overwrite other lines.
            PlusZ.IsVisible = false;
            // Note axes are already added as Children
            Generate();
        }
Beispiel #5
0
 public Axis3D(Axes3D axes, Axis3DCollection axisCollection)
 {
     axisLabels = new List<TextBlock>();
     labelProperties = new LabelProperties(axisCollection.TickLabels);
     model3D = new LinesModel3D();
     this.axes = axes;
     this.axisCollection = axisCollection;
     this.axes.Children.Add(model3D);
 }