Beispiel #1
0
        public void DrawModeUpdated(DrawTools.DrawMode mode)
        {
            if (mDrawContextOrtho != null)
            {
                mDrawContextOrtho.SetupTools(mode);
            }

            if (mDrawContextPers != null)
            {
                mDrawContextPers.SetupTools(mode);
            }
        }
Beispiel #2
0
        public bool Load()
        {
            string fileName = FileName();

            if (!File.Exists(fileName))
            {
                return(true);
            }

            StreamReader reader = new StreamReader(fileName);

            var js = reader.ReadToEnd();

            reader.Close();

            JObject root = JObject.Parse(js);

            JObject jo;

            ContinueCreateFigure = root.GetBool("ContinueCreateFigure", ContinueCreateFigure);

            LastDataDir   = root.GetString("LastDataDir", LastDataDir);
            LastScriptDir = root.GetString("LastScriptDir", LastScriptDir);

            jo             = (JObject)root["PointSnap"];
            SnapToPoint    = jo.GetBool("enable", SnapToPoint);
            PointSnapRange = jo.GetDouble("range", PointSnapRange);

            jo            = (JObject)root["SegmentSnap"];
            SnapToSegment = jo.GetBool("enable", SnapToSegment);

            jo            = (JObject)root["LineSnap"];
            SnapToLine    = jo.GetBool("enable", SnapToLine);
            LineSnapRange = jo.GetDouble("range", LineSnapRange);

            jo = (JObject)root["KeyMove"];
            if (jo != null)
            {
                KeyMoveUnit = jo.GetDouble("unit", KeyMoveUnit);
            }

            jo = (JObject)root["ZeroSnap"];
            if (jo != null)
            {
                SnapToZero = jo.GetBool("enable", SnapToZero);
            }

            jo = (JObject)root["LastDownSnap"];
            if (jo != null)
            {
                SnapToLastDownPoint = jo.GetBool("enable", SnapToLastDownPoint);
            }

            jo = (JObject)root["SelfPointSnap"];
            if (jo != null)
            {
                SnapToSelfPoint = jo.GetBool("enable", SnapToSelfPoint);
            }

            jo            = (JObject)root["DrawSettings"];
            DrawMode      = jo.GetEnum <DrawTools.DrawMode>("DrawMode", DrawMode);
            DrawMeshEdge  = jo.GetBool("DrawFaceOutline", DrawMeshEdge);
            FillMesh      = jo.GetBool("FillFace", FillMesh);
            DrawNormal    = jo.GetBool("DrawNormal", DrawNormal);
            DrawAxis      = jo.GetBool("DrawAxis", DrawAxis);
            DrawAxisLabel = jo.GetBool("DrawAxisLabel", DrawAxisLabel);
            DrawCompass   = jo.GetBool("DrawCompass", DrawCompass);

            jo = (JObject)root["GridInfo"];
            if (jo != null)
            {
                SnapToGrid = jo.GetBool("enable", SnapToSelfPoint);
                GridSize.X = jo.GetDouble("size_x", 10);
                GridSize.Y = jo.GetDouble("size_y", 10);
                GridSize.Z = jo.GetDouble("size_z", 10);
            }

            jo = (JObject)root["PrintSettings"];
            if (jo != null)
            {
                PrintWithBitmap             = jo.GetBool("PrintWithBitmap", PrintWithBitmap);
                MagnificationBitmapPrinting = jo.GetDouble("MagnificationBitmapPrinting", MagnificationBitmapPrinting);
            }

            return(true);
        }
Beispiel #3
0
 public void DrawModeUpdated(DrawTools.DrawMode drawMode)
 {
     System.Drawing.Color c = ViewModel.DC.Tools.BrushColor(DrawTools.BRUSH_BACKGROUND);
     viewRoot.Background = new SolidColorBrush(Color.FromRgb(c.R, c.G, c.B));
 }