コード例 #1
0
        /// <summary> Converts an unordered point cloud from a .ply file to VDB format. </summary>
        /// <param name="filename">The absolute path to the .ply file. </param>
        /// <param name="outfile">The absolute path to the .vdb file. </param>
        /// <param name="cb">The optional <see cref="LoggingCallback">callback</see> for logging native messages.</param>
        /// <returns>True if the file was successfully converted,  false  if not. </returns>
        /// <remarks>Currently only supports vertex positions (float) and colors (uint8) </remarks>
        public static bool ConvertPLYToVDB(string filename, string outfile, LoggingCallback cb = null)
        {
            LoggingCallback logger = cb == null ? LogMessage : cb;

            openvdbInitialize();
            return(convertPLYToVDB(filename, outfile, logger));
        }
コード例 #2
0
        public void testCallback()
        {
            Configuration conf = new Configuration();
            MemoryManager mgr  = new MemoryManager(configuredPoolSize);
            long          pool = mgr.getTotalMemoryPool();

            LoggingCallback[] calls = new LoggingCallback[20];
            for (int i = 0; i < calls.Length; ++i)
            {
                calls[i] = new LoggingCallback();
                mgr.addWriter(i.ToString(), pool / 4, calls[i]);
            }
            // add enough rows to get the memory manager to check the limits
            for (int i = 0; i < 10000; ++i)
            {
                mgr.addedRow(1);
            }
            for (int call = 0; call < calls.Length; ++call)
            {
                Assert.Equal(2, calls[call].LogLength);
                foreach (double argument in calls[call].Log)
                {
                    Assert.Equal(0.2, argument, ERROR);
                }
            }
        }
コード例 #3
0
 public void testCallback()
 {
     Configuration conf = new Configuration();
     MemoryManager mgr = new MemoryManager(configuredPoolSize);
     long pool = mgr.getTotalMemoryPool();
     LoggingCallback[] calls = new LoggingCallback[20];
     for (int i = 0; i < calls.Length; ++i)
     {
         calls[i] = new LoggingCallback();
         mgr.addWriter(i.ToString(), pool / 4, calls[i]);
     }
     // add enough rows to get the memory manager to check the limits
     for (int i = 0; i < 10000; ++i)
     {
         mgr.addedRow(1);
     }
     for (int call = 0; call < calls.Length; ++call)
     {
         Assert.Equal(2, calls[call].LogLength);
         foreach (double argument in calls[call].Log)
         {
             Assert.Equal(0.2, argument, ERROR);
         }
     }
 }
コード例 #4
0
        static int Main(string[] args)
        {
            try
            {
                // set up a simple configuration that logs on the console.
                log4net.Config.XmlConfigurator.Configure();
                // command line parsing
                Options options = new Options();
                if (!CommandLine.Parser.Default.ParseArguments(args, options))
                {
                    Console.WriteLine(options.GetUsage());
                    return(-1);
                }
                string dbPath = options.InputFile;
                _log.Info(string.Format("db path = {0}", dbPath));

                LegacyDBUploder uploader = new treeDiM.PLMPackLib.LegacyDBUploder();
                LoggingCallback callback = new LoggingCallback();
                uploader.DatabasePath   = dbPath;
                uploader.UserName       = options.UserName;
                uploader.Password       = options.Password;
                uploader.ActuallyUpload = !options.Test;
                uploader.Upload(callback);
            }
            catch (Exception ex)
            {
                _log.Error(ex.ToString());
                return(-1);
            }
            return(0);
        }
コード例 #5
0
 internal static extern bool Configure(
     bool hasSignallingThread,
     bool hasWorkerThread,
     bool forceSoftwareVideoEncoder,
     bool autoShutdown,
     bool useFakeEncoders,
     bool useFakeDecoders,
     bool logToStdErr,
     bool logToDebug,
     LoggingCallback loggingCallback,
     int minimumLoggingSeverity);
コード例 #6
0
ファイル: HookFunc.cs プロジェクト: rwrc/OpenSandbox
 internal HookContext(HookClosure <ReturnType> closure,
                      HookOperation <ReturnType> operation, ErrorHandler <ReturnType> errorHandler,
                      LoggingCallback logging, string format, params object[] args)
 {
     closure_      = closure;
     operation_    = operation;
     errorHandler_ = errorHandler;
     logging_      = logging;
     format_       = format;
     args_         = args;
 }
コード例 #7
0
 /// <summary>
 /// Register the logger.
 /// </summary>
 public static void RegisterLogger()
 {
     // Register the logger if we have not already
     if (loggingCallback == null)
     {
         // Keep the callback as a member to prevent it from being garbage collected.
         loggingCallback = LoggingHandler;
         errorCallback   = ErrorHandler;
         hbFunctions.hb_register_logger(loggingCallback);
         hbFunctions.hb_register_error_handler(errorCallback);
     }
 }
コード例 #8
0
 private void Log(string text)
 {
     if (this.txtLog.InvokeRequired)
     {
         LoggingCallback d = new LoggingCallback(Log);
         this.Invoke(d, new object[] { text });
     }
     else
     {
         this.txtLog.Text = text;
     }
 }
コード例 #9
0
        /// <summary> Loads a PointDataGrid from <see cref="FilePath" />.</summary>
        /// <param name="gridName">The name of the grid to load.</param>
        /// <param name="cb">The optional <see cref="LoggingCallback">callback</see> for logging native messages.</param>
        /// <remarks> <see cref="FilePath"/> must be set in order to load the grid.</remarks>
        /// <exception cref="Exception">The file is not found, or <see cref="FilePath"/> is not set.</exception>
        public void Load(string name = null, LoggingCallback cb = null)
        {
            if (string.IsNullOrEmpty(FilePath))
            {
                throw new Exception("FilePath must be set in order to load a PointDataGrid");
            }
            if (!File.Exists(FilePath))
            {
                throw new FileNotFoundException(string.Format("{0} could not be found!", FilePath));
            }
            string          grid   = name == null ? gridName : name;
            LoggingCallback logger = cb == null ? LogMessage : cb;

            gridRef = readPointGridFromFile(FilePath, grid, logger);
        }
コード例 #10
0
        private void Initialize(LoggingCallback callback, String userData)
        {
            if (userData == null)
            {
                userData = String.Empty;
            }

            m_assimpCallback = OnAiLogStreamCallback;
            m_logCallback    = callback;
            m_userData       = userData;

            AiLogStream logStream;

            logStream.Callback = Marshal.GetFunctionPointerForDelegate(m_assimpCallback);
            logStream.UserData = IntPtr.Zero;

            m_logstreamPtr = MemoryHelper.AllocateMemory(MemoryHelper.SizeOf <AiLogStream>());
            Marshal.StructureToPtr(logStream, m_logstreamPtr, false);
        }
コード例 #11
0
 /// <summary>
 /// Register the logger.
 /// </summary>
 public static void RegisterLogger()
 {
     // Register the logger if we have not already
     if (loggingCallback == null)
     {
         // Keep the callback as a member to prevent it from being garbage collected.
         loggingCallback = new LoggingCallback(LoggingHandler);
         errorCallback = new LoggingCallback(ErrorHandler);
         HBFunctions.hb_register_logger(loggingCallback);
         HBFunctions.hb_register_error_handler(errorCallback);
     }
 }
コード例 #12
0
 /// <summary>
 /// Constructs a new LogStream.
 /// </summary>
 /// <param name="callback">Logging callback that is called when messages are received by the log stream.</param>
 public LogStream(LoggingCallback callback)
 {
     Initialize(callback, String.Empty);
 }
コード例 #13
0
 // (void (*cb)(const char *line, void *argp), void* argp
 private static extern int quiche_enable_debug_logging(LoggingCallback cb, IntPtr argp);
コード例 #14
0
ファイル: ximcnet-template.cs プロジェクト: EPC-MSU/libximc
 public static extern void set_logging_callback([MarshalAs(UnmanagedType.FunctionPtr)] LoggingCallback logging_callback, IntPtr user_data);
コード例 #15
0
 public static extern void hb_register_logger(LoggingCallback callback);
コード例 #16
0
 public static extern void hb_register_error_handler(LoggingCallback callback);
コード例 #17
0
ファイル: HbFunctions.cs プロジェクト: shkolnik/HandBrake
 public static extern void hb_register_error_handler(LoggingCallback callback);
コード例 #18
0
 public void hb_register_logger(LoggingCallback callback)
 {
     HBFunctions.hb_register_logger(callback);
 }
コード例 #19
0
 public static int QuicheEnableDebugLogging(LoggingCallback cb, IntPtr argp)
 {
     return(quiche_enable_debug_logging(cb, argp));
 }
コード例 #20
0
 private static extern IntPtr readPointGridFromFile(string filename, string gridName, LoggingCallback cb);
コード例 #21
0
ファイル: LogStream.cs プロジェクト: hasanabb/assimp-net
 /// <summary>
 /// Constructs a new LogStream.
 /// </summary>
 /// <param name="callback">Logging callback that is called when messages are received by the log stream.</param>
 public LogStream(LoggingCallback callback)
 {
     Initialize(callback, String.Empty);
 }
コード例 #22
0
ファイル: LogStream.cs プロジェクト: hasanabb/assimp-net
 /// <summary>
 /// Constructs a new LogStream.
 /// </summary>
 /// <param name="callback">Logging callback that is called when messages are received by the log stream.</param>
 /// <param name="userData">User-supplied data</param>
 public LogStream(LoggingCallback callback, String userData)
 {
     Initialize(callback, userData);
 }
コード例 #23
0
 public void hb_register_error_handler(LoggingCallback callback)
 {
     HBFunctions.hb_register_error_handler(callback);
 }
コード例 #24
0
 /// <summary>
 /// Constructs a new LogStream.
 /// </summary>
 /// <param name="callback">Logging callback that is called when messages are received by the log stream.</param>
 /// <param name="userData">User-supplied data</param>
 public LogStream(LoggingCallback callback, String userData)
 {
     Initialize(callback, userData);
 }
コード例 #25
0
ファイル: HbFunctions.cs プロジェクト: shkolnik/HandBrake
 public static extern void hb_register_logger(LoggingCallback callback);
コード例 #26
0
 private static extern bool convertPLYToVDB(string filename, string outfile, LoggingCallback callback);
コード例 #27
0
ファイル: LogStream.cs プロジェクト: hasanabb/assimp-net
        private void Initialize(LoggingCallback callback, String userData)
        {
            if(userData == null)
                userData = String.Empty;

            m_assimpCallback = OnAiLogStreamCallback;
            m_logCallback = callback;
            m_userData = userData;

            AiLogStream logStream;
            logStream.Callback = Marshal.GetFunctionPointerForDelegate(m_assimpCallback);
            logStream.UserData = IntPtr.Zero;

            m_logstreamPtr = MemoryHelper.AllocateMemory(MemoryHelper.SizeOf<AiLogStream>());
            Marshal.StructureToPtr(logStream, m_logstreamPtr, false);
        }