public static void SetDefaultSettings() { FileNamePLY = "DepthAndColor.ply"; FileNameOBJ = "DepthAndColor.obj"; FileNameDepthOBJ = "Depth.obj"; ScannerMode = PointCloudUtils.ScannerMode.Depth; ScannerTypeDefault = PointCloudUtils.ScannerType.MicrosoftKinect; DisplayType = PointCloudUtils.DisplayType.Depth; BackgroundRemoved = false; InterpolateFrames = true; EntropyImage = true; SaveAndStop = true; CutFrames = true; CutFrameMaxDistance = 7500; CutFrameMinDistance = 500; SaveImageIfQualityIsBetterThan = 50; RotatePointCloud = true; SaveSettings(); InterpolationNumberOfFrames = 10; SnapshotNumberOfImages = 5; ShowOpenGLWindow = false; Height = 600; Width = 1000; ScanOnStartProgram = false; OpenGLRefreshAt = 5; ShowOnlyCalibrationPointCloud = false; ShowSkeleton = false; ShowFace = false; ShowFaceScanEllipse = false; }
private static void SetScannerMode(string stringMode) { for (int i = 0; i < Enum.GetValues(typeof(ScannerMode)).GetLength(0); i++) { string strVal = Enum.GetValues(typeof(ScannerMode)).GetValue(i).ToString(); if (stringMode == strVal) { ScannerMode = (ScannerMode)Enum.GetValues(typeof(ScannerMode)).GetValue(i); } } }
public static bool ValidateScannerMode(ScannerMode scanner_mode) { switch (scanner_mode) { case ScannerMode.Normal: case ScannerMode.Raw: case ScannerMode.Typed: return(true); default: // Warning: Invalid scanner mode PhpException.Throw(PhpError.Warning, LibResources.invalid_scanner_mode); return(false); } }
public static PhpArray parse_ini_file(Context ctx, string fileName, bool processSections = false, ScannerMode scanner_mode = ScannerMode.Normal) { if (scanner_mode != (int)ScannerMode.Normal) // TODO: handle value 1 { PhpException.ArgumentValueNotSupported("scanner_mode", scanner_mode); } // we're using binary mode because CR/LF stuff should be preserved for multiline values using (PhpStream stream = PhpStream.Open(ctx, fileName, "rb", StreamOpenOptions.ReportErrors, StreamContext.Default)) { if (stream == null) { return(null); //new PhpArray(); } ArrayBuilder builder = new ArrayBuilder(ctx, processSections); try { // parse the stream and let the builder build the resulting array Parse(ctx, stream, builder); } catch (ParseException e) { PhpException.Throw(PhpError.Warning, Resources.LibResources.ini_parse_error, e.LineNumber.ToString()); return(null); } // return what we have read so far - even if a parse error occurred return(builder.Result); } }
public static PhpArray parse_ini_string(Context ctx, string ini, bool processSections = false, ScannerMode scanner_mode = ScannerMode.Normal) { if (scanner_mode != (int)ScannerMode.Normal) // TODO: handle value 1 { PhpException.ArgumentValueNotSupported("scanner_mode", scanner_mode); } if (string.IsNullOrEmpty(ini)) { return(null); } var builder = new ArrayBuilder(ctx, processSections); try { // parse the stream and let the builder build the resulting array Parse(ctx, ini, builder); } catch (ParseException e) { PhpException.Throw(PhpError.Warning, Resources.LibResources.ini_parse_error, e.LineNumber.ToString()); return(null); } // return what we have read so far - even if a parse error occurred return(builder.Result); }
private PhpIniParser(LineGetter lineGetter, IParserCallbacks callbacks, ScannerMode scanner_mode) { this.lineGetter = lineGetter; this.callbacks = callbacks; this.scanner_mode = scanner_mode; }
/// <summary> /// Creates a new <see cref="PhpIniParser"/> operating on a given input stream. /// </summary> /// <param name="text">The input INI file content.</param> /// <param name="callbacks">Implementation of the parser callbacks invoked during parsing.</param> /// <param name="scanner_mode">Scanner mode.</param> private PhpIniParser(string text, IParserCallbacks callbacks, ScannerMode scanner_mode) : this(new LineGetterString(text), callbacks, scanner_mode) { }
/// <summary> /// Creates a new <see cref="PhpIniParser"/> operating on a given input stream. /// </summary> /// <param name="stream">The input stream. Should be open in binary mode.</param> /// <param name="callbacks">Implementation of the parser callbacks invoked during parsing.</param> /// <param name="scanner_mode">Scanner mode.</param> private PhpIniParser(PhpStream stream, IParserCallbacks callbacks, ScannerMode scanner_mode) : this(new LineGetterStream(stream), callbacks, scanner_mode) { }
internal static void Parse(Context ctx, string ini, IParserCallbacks callbacks, ScannerMode scanner_mode) { if (ini == null) { throw new ArgumentNullException("ini"); } if (callbacks == null) { throw new ArgumentNullException("callbacks"); } PhpIniParser parser = new PhpIniParser(ini, callbacks, scanner_mode); parser.TopLevel(ctx); }
/// <summary> /// Parses an INI-style configuration file. /// </summary> /// <param name="ctx">Runtime context.</param> /// <param name="stream">A stream referring to the file to parse. Should be open in binary mode.</param> /// <param name="callbacks">Implementation of the parser callbacks invoked during parsing.</param> /// <param name="scanner_mode">Scanner mode to use </param> /// <exception cref="ParseException">Parse error.</exception> /// <exception cref="ArgumentNullException"><paramref name="stream"/> or <paramref name="callbacks"/> is a <B>null</B> reference.</exception> /// <exception cref="ArgumentException">Stream is was not opened as binary.</exception> internal static void Parse(Context ctx, PhpStream stream, IParserCallbacks callbacks, ScannerMode scanner_mode) { if (stream == null) { throw new ArgumentNullException("stream"); } if (!stream.IsBinary) { throw new ArgumentException("Stream must be binary"); } if (callbacks == null) { throw new ArgumentNullException("callbacks"); } PhpIniParser parser = new PhpIniParser(stream, callbacks, scanner_mode); parser.TopLevel(ctx); }