예제 #1
0
        public void SetDrawingOwner(SharpGLForm owner)
        {
            double s;

            fOwner = owner;
            //
            _synching = true;
            //
            viewSize  = fOwner.GetViewSize();
            viewSizeN = (int)viewSize;
            //
            hsbShiftX.Minimum = -viewSizeN;
            hsbShiftX.Maximum = viewSizeN;
            s = fOwner.GetShiftX();
            txtShiftX.Text  = s.ToString(CultureInfo.InvariantCulture);
            hsbShiftX.Value = (int)s;
            //
            hsbShiftY.Minimum = -viewSizeN;
            hsbShiftY.Maximum = viewSizeN;
            s = fOwner.GetShiftY();
            txtShiftY.Text  = s.ToString(CultureInfo.InvariantCulture);
            hsbShiftY.Value = (int)s;
            //
            hsbShiftZ.Minimum = -viewSizeN;
            hsbShiftZ.Maximum = viewSizeN;
            s = fOwner.GetShiftZ();
            txtShiftZ.Text  = s.ToString(CultureInfo.InvariantCulture);
            hsbShiftZ.Value = (int)s;
            //
            _synching = false;
        }
예제 #2
0
        public bool SetDataFile(SharpGLForm form, string filename)
        {
            bool bRet = false;

            drawingForm = form;
            if (!string.IsNullOrEmpty(filename))
            {
                int    n;
                string dir = Path.GetDirectoryName(filename);
                fileext      = Path.GetExtension(filename);
                filenamebase = Path.GetFileNameWithoutExtension(filename);
                if (!string.IsNullOrEmpty(filenamebase))
                {
                    n = filenamebase.LastIndexOf('_');
                    if (n > 0)
                    {
                        int    nl = filenamebase.Length - n - 1;
                        string ts = filenamebase.Substring(n + 1, nl);
                        try
                        {
                            int tIdx = Convert.ToInt32(ts);
                            if (tIdx >= 0)
                            {
                                nupTimeStepIndex.Value = tIdx;
                                filenamebase           = Path.Combine(dir, filenamebase.Substring(0, n + 1));
                                bRet = true;
                                if (string.CompareOrdinal(fileext, ".em") == 0)
                                {
                                    emFormat = EMFileFormat.EMinSohere;
                                }
                                else if (string.CompareOrdinal(fileext, ".field") == 0)
                                {
                                    emFormat = EMFileFormat.EMfieldPoints;
                                }
                                else
                                {
                                    bRet = false;
                                    MessageBox.Show(this, "Unsupported file format", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                }
                            }
                        }
                        catch
                        {
                        }
                    }
                }
            }
            return(bRet);
        }
예제 #3
0
 public void SetDrawingForm(SharpGLForm form)
 {
     drawingForm = form;
     btApplySkipRadius.Enabled = form.IsInSphere();
 }