Ejemplo n.º 1
0
        /// <summary>
        /// Given a filter compute which of the surfaces in the list match any given time aspect
        /// of the filter, and the overall existence map of the surveyed surfaces that match the filter.
        /// ComparisonList denotes a possibly pre-filtered set of surfaces for another filter; if this is the same as the
        /// filtered set of surfaces then the overall existence map for those surfaces will not be computed as it is
        /// assumed to be the same.
        /// </summary>
        public bool ProcessSurveyedSurfacesForFilter(Guid siteModelId,
                                                     ICombinedFilter filter,
                                                     ISurveyedSurfaces comparisonList,
                                                     ISurveyedSurfaces filteredSurveyedSurfaces,
                                                     ISubGridTreeBitMask overallExistenceMap)
        {
            // Filter out any surveyed surfaces which don't match current filter (if any) - realistically, this is time filters we're thinking of here
            FilterSurveyedSurfaceDetails(filter.AttributeFilter.HasTimeFilter,
                                         filter.AttributeFilter.StartTime, filter.AttributeFilter.EndTime,
                                         filter.AttributeFilter.ExcludeSurveyedSurfaces(),
                                         filteredSurveyedSurfaces,
                                         filter.AttributeFilter.SurveyedSurfaceExclusionList);

            if (filteredSurveyedSurfaces != null)
            {
                if (filteredSurveyedSurfaces.IsSameAs(comparisonList))
                {
                    return(true);
                }

                if (filteredSurveyedSurfaces.Count > 0)
                {
                    var surveyedSurfaceExistenceMap = GetExistenceMaps().GetCombinedExistenceMap(siteModelId,
                                                                                                 filteredSurveyedSurfaces.Select(x => new Tuple <long, Guid>(Consts.EXISTENCE_SURVEYED_SURFACE_DESCRIPTOR, x.ID)).ToArray());

                    if (overallExistenceMap == null)
                    {
                        return(false);
                    }

                    overallExistenceMap.SetOp_OR(surveyedSurfaceExistenceMap);
                }
            }

            return(true);
        }