Beispiel #1
0
 void IFeedBack.PaintTo3D(IPaintTo3D paintTo3D)
 {
     paintTo3D.UseZBuffer(true);
     paintTo3D.Blending(true);
     paintTo3D.SetColor(color);
     GeoPoint[] pnts = new GeoPoint[4];
     pnts[0] = pln.ToGlobal(new GeoPoint2D(-width / 2, -height / 2));
     pnts[1] = pln.ToGlobal(new GeoPoint2D(width / 2, -height / 2));
     pnts[2] = pln.ToGlobal(new GeoPoint2D(width / 2, height / 2));
     pnts[3] = pln.ToGlobal(new GeoPoint2D(-width / 2, height / 2));
     GeoVector[] norm = new GeoVector[4];
     norm[0] = pln.Normal;
     norm[1] = pln.Normal;
     norm[2] = pln.Normal;
     norm[3] = pln.Normal;
     int[] ind = new int[6];
     ind[0] = 0;
     ind[1] = 1;
     ind[2] = 2;
     ind[3] = 0;
     ind[4] = 2;
     ind[5] = 3;
     paintTo3D.Triangle(pnts, norm, ind);
     paintTo3D.Blending(false);
     paintTo3D.UseZBuffer(true);
 }
Beispiel #2
0
        internal void Repaint(Rectangle IsInvalid, IView View, IPaintTo3D paintTo3D)
        {
            if (Settings.GlobalSettings.GetBoolValue("ActionFeedBack.UseZBuffer", true))
            {
                paintTo3D.UseZBuffer(true);
            }

            Color selectColor = frame.GetColorSetting("Select.SelectColor", Color.Yellow);   // die Farbe für die selektierten Objekte
            Color focusColor  = frame.GetColorSetting("Select.FocusColor", Color.LightBlue); // die Farbe für das Objekt mit dem Focus

            foreach (IView vw in frame.AllViews)
            {
                for (int i = 0; i < repaintObjects.Count; ++i)
                {
                    IFeedBack go = repaintObjects[i] as IFeedBack;
                    if (go != null)
                    {
                        go.PaintTo3D(paintTo3D);
                    }
                }

                bool oldSelectMode = paintTo3D.SelectMode;
                paintTo3D.SelectMode = true;
                for (int i = 0; i < paintAsSelected.Count; ++i)
                {
                    IGeoObjectImpl go = paintAsSelected[i] as IGeoObjectImpl;
                    if (go != null)
                    {
                        paintTo3D.SelectColor = selectColor;
                        paintTo3D.OpenList("feedback");
                        go.PaintTo3D(paintTo3D);
                        IPaintTo3DList list = paintTo3D.CloseList();
                        if (list != null)
                        {
                            paintTo3D.SelectedList(list, selectWidth);
                        }
                    }
                }
                paintTo3D.SelectMode = oldSelectMode;
            }

            if (paintAsTransparent.Count > 0)
            {
                paintTo3D.OpenList("feedback-transparent");

                foreach (IGeoObject go in paintAsTransparent)
                {
                    go.PaintTo3D(paintTo3D);
                }

                IPaintTo3DList displayList = paintTo3D.CloseList();

                paintTo3D.Blending(true);
                paintTo3D.List(displayList);
                paintTo3D.Blending(false);
            }
        }