当前位置: 首页>>代码示例>>C#>>正文


C# Source.isIntermediate方法代码示例

本文整理汇总了C#中Source.isIntermediate方法的典型用法代码示例。如果您正苦于以下问题:C# Source.isIntermediate方法的具体用法?C# Source.isIntermediate怎么用?C# Source.isIntermediate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Source的用法示例。


在下文中一共展示了Source.isIntermediate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: build

        protected bool build(Source source, Session session)
        {
            //osgGIS.notice() << "Building source " << source.getName() << std.endl;

            // only need to build intermediate sources.
            if (!source.isIntermediate())
            {
                //osgGIS.info() << "...source " << source.getName() << " does not need building (not intermediate)." << std.endl;
                return true;
            }

            Source parent = source.getParentSource();
            if (parent == null)
            {
                //osgGIS.warn()  << "...ERROR: No parent source found for intermediate source \"" << source.getName() << "\"" << std.endl;
                return false;
            }

            // check whether a rebuild is required:
            if (parent.getTimeLastModified() < source.getTimeLastModified())
            {
                //osgGIS.info() << "...source " << source.getName() << " does not need building (newer than parent)." << std.endl;
                return true;
            }

            // build it's parent first:
            if (!build(parent, session))
            {
                //osgGIS.warn() << "...ERROR: Failed to build source \"" << parent.getName() << "\", parent of source \"" << source.getName() << "\"" << std.endl;
                return false;
            }

            // validate the existence of a filter graph:
            FilterGraph graph = source.getFilterGraph();
            if (graph == null)
            {
                //osgGIS.warn() << "...ERROR: No filter graph set for intermediate source \"" << source.getName() << "\"" << std.endl;
                return false;
            }

            // establish a feature layer for the parent source:
            FeatureLayer feature_layer = Registry.instance().createFeatureLayer(parent.getAbsoluteURI());
            if (feature_layer == null)
            {
                //osgGIS.warn() << "...ERROR: Cannot access source \"" << source.getName() << "\"" << std.endl;
                return false;
            }

            //TODO: should we allow terrains for a source compile?? No. Because we would need to transform
            // the source into terrain SRS space, which we do not want to do until we're building nodes.

            // initialize a source data compiler. we use a temporary session because this source build
            // is unrelated to the current "master" build. If we used the same session, the new feature
            // store would hang around and not get properly closed out for use in the next round.
            Session temp_session = session.derive();
            FilterEnv source_env = temp_session.createFilterEnv();

            FeatureStoreCompiler compiler = new FeatureStoreCompiler(feature_layer, graph);

            if (!compiler.compile(source.getAbsoluteURI(), source_env))
            {
                //osgGIS.warn() << "...ERROR: failure compiling source \"" << source.getName() << "\"" << std.endl;
                return false;
            }

            //osgGIS.notice() << "...done compiling source \"" << source.getName() << "\"" << std.endl;

            return true;
        }
开发者ID:agustinsantos,项目名称:mogregis3d,代码行数:69,代码来源:Builder.cs


注:本文中的Source.isIntermediate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。