示例#1
0
        /**
         * Adds a graph that should be used to build geometry within
         * the specified visibility range.
         *
         * @param min_range
         *      Minimum visibility range - get any closer and the geometry
         *      disappeares.
         * @param max_range
         *      Maximum visibility range - get any further and the geometry
         *      disappears.
         * @param graph
         *      Compile geometry using this graph for the given range.
         */
        public void addFilterGraph(float min_range, float max_range, FilterGraph graph)
        {
            FilterGraphRange slice;

            slice.min_range = min_range;
            slice.max_range = max_range;
            slice.graph     = graph;

            graph_ranges.Add(slice);
        }
示例#2
0
        public Node compile(FeatureLayer layer, FeatureCursor cursor, FilterGraph graph)
        {
            osg.ref_ptr <FilterEnv> env = getSession().createFilterEnv();
            env.setExtent(getAreaOfInterest(layer));
            env.setInputSRS(layer.getSRS());
            env.setTerrainNode(terrain.get());
            env.setTerrainSRS(terrain_srs.get());
            env.setTerrainReadCallback(read_cb.get());

            osg.Group *       output;
            FilterGraphResult r = graph.computeNodes(cursor, env.get(), output);

            return(r.isOK() ? output : NULL);
        }
示例#3
0
 /**
  * Constructs a new compiler.
  *
  * @param graph
  *      Single filter graph to compile.
  */
 public SimpleLayerCompiler(FilterGraph graph)
 {
     addFilterGraph(FLT_MIN, FLT_MAX, graph);
 }