Exemple #1
0
        public override void Paint()
        {
            TopoModel model = ActiveModel;

            if (Visible)
            {
                if (false) //**Main.main.objectPlacement.checkCutFaces.Checked)
                {
                    // int cutpos = Main.main.objectPlacement.cutPositionSlider.Value;
                    if (ForceRefresh || ctrl.updateCuts || lastRendered != 1 || activeModel != activeSubmesh ||
                        lastShowEdges != SettingsProvider.Instance.ThreeDSettings.ShowEdges || lastSelected != Selected)
                    {
                        RHVector3 normpoint = ctrl.cutPos.Add(ctrl.cutDirection);
                        RHVector3 point     = new RHVector3(0, 0, 0);
                        ReverseTransformPoint(ctrl.cutPos, point);
                        ReverseTransformPoint(normpoint, normpoint);
                        RHVector3 normal = normpoint.Subtract(point);

                        submesh.Clear();
                        model.CutMesh(submesh, normal, point,
                                      outside ? Submesh.MESHCOLOR_OUTSIDE : Submesh.MESHCOLOR_FRONTBACK);
                        submesh.selected = Selected;
                        submesh.Compress();
                        lastShowEdges = SettingsProvider.Instance.ThreeDSettings.ShowEdges;
                        lastSelected  = Selected;
                        activeSubmesh = activeModel;
                        lastRendered  = 1;
                    }
                }
                else
                {
                    if (ForceRefresh || ctrl.updateCuts || lastRendered != 0 || activeModel != activeSubmesh ||
                        lastShowEdges != SettingsProvider.Instance.ThreeDSettings.ShowEdges)
                    {
                        submesh.Clear();
                        submesh.defaultColor =
                            ProjectManager.Instance.CurrentProject.projectSettings.PrinterSettings.Extruders[ExtruderNumber].ExtruderColor;
                        model.FillMesh(submesh, outside ? Submesh.MESHCOLOR_OUTSIDE : Submesh.MESHCOLOR_FRONTBACK);
                        submesh.selected = Selected;
                        submesh.Compress();
                        lastShowEdges = SettingsProvider.Instance.ThreeDSettings.ShowEdges;
                        lastSelected  = Selected;
                        activeSubmesh = activeModel;
                        lastRendered  = 0;
                    }
                }
//            submesh.Draw(SettingsProvider.Instance.ThreeDSettings.drawMethod,ctrl.cam.EdgeTranslation());
                submesh.Draw(2, ctrl.cam.EdgeTranslation());
            }
            ForceRefresh = false;
        }
Exemple #2
0
        public override void Paint()
        {
            TopoModel model = ActiveModel;

            if (Main.main.objectPlacement.checkCutFaces.Checked)
            {
                int cutpos = Main.main.objectPlacement.cutPositionSlider.Value;
                if (ForceRefresh || Main.main.threedview.updateCuts || lastRendered != 1 || activeModel != activeSubmesh || lastShowEdges != Main.threeDSettings.ShowEdges || lastSelected != Selected)
                {
                    RHVector3 normpoint = Main.main.threedview.cutPos.Add(Main.main.threedview.cutDirection);
                    RHVector3 point     = new RHVector3(0, 0, 0);
                    ReverseTransformPoint(Main.main.threedview.cutPos, point);
                    ReverseTransformPoint(normpoint, normpoint);
                    RHVector3 normal = normpoint.Subtract(point);

                    submesh.Clear();
                    model.CutMesh(submesh, normal, point, outside ? Submesh.MESHCOLOR_OUTSIDE : Submesh.MESHCOLOR_FRONTBACK);
                    submesh.selected = Selected;
                    submesh.Compress();
                    lastShowEdges = Main.threeDSettings.ShowEdges;
                    lastSelected  = Selected;
                    activeSubmesh = activeModel;
                    lastRendered  = 1;
                }
            }
            else
            {
                if (ForceRefresh || Main.main.threedview.updateCuts || lastRendered != 0 || activeModel != activeSubmesh || lastShowEdges != Main.threeDSettings.ShowEdges)
                {
                    submesh.Clear();
                    model.FillMesh(submesh, outside ? Submesh.MESHCOLOR_OUTSIDE : Submesh.MESHCOLOR_FRONTBACK);
                    submesh.selected = Selected;
                    submesh.Compress();
                    lastShowEdges = Main.threeDSettings.ShowEdges;
                    lastSelected  = Selected;
                    activeSubmesh = activeModel;
                    lastRendered  = 0;
                }
            }
            submesh.Draw(Main.threeDSettings.drawMethod, Main.main.threedview.cam.EdgeTranslation());
            ForceRefresh = false;
        }