コード例 #1
0
        /// <summary>
        ///   Updating results on the surface being analyzed
        /// </summary>
        /// <remarks>
        ///   This is called periodically by the Idling event
        ///   until there is no more results to be updated.
        /// </remarks>
        /// <returns>
        ///   Returns True if there is still more to be processed.
        /// </returns>
        public bool UpdateResults()
        {
            // If we still need to initialize the result manager
            // it means we were interrupted and we restarted.
            // Therefore we know we do not have any results to pick up.
            // Instead, we initialize the manager and start a new calculation.
            // We will have first results from this new calculation process
            // next time we get called here.

            if (m_needInitialization)
            {
                Initialize();
                return(StartCalculation());
            }

            // We aks the Result instance if there are results available
            // The methods returns True only if there has been results added
            // since the last time we called that method.

            IList <UV>           points;
            IList <ValueAtPoint> values;

            if (m_results.GetResults(out points, out values))
            {
                FieldDomainPointsByUV fieldPoints = new FieldDomainPointsByUV(points);
                FieldValues           fieldValues = new FieldValues(values);
                m_SFManager.UpdateSpatialFieldPrimitive(m_fieldId, fieldPoints, fieldValues, m_schemaId);
            }

            // if the thread is not around anymore to result more data,
            // it means the analysis is finished for the FaceAnalyzer too.

            return((m_threadAgent != null) && (m_threadAgent.IsThreadAlive));
        }