Ejemplo n.º 1
0
        /**
         * Add a new resource instance to the library.
         *
         * @param resource
         *      Resource to add to the library
         */
        public void addResource(Resource resource)
        {
            if (resource != null)
            {
                lock (sincronizeFlag)
                {
#if TODO_PH
                    if (resource is SkinResource)
                    {
                        SkinResource skin = (SkinResource)resource;
                        skins.Add(skin);
                        //osgGIS::Notify(osg::INFO)<<"ResourceLibrary: added skin" <<skin->getAbsoluteURI()<<std::endl;
                    }
                    else if (resource is ModelResource)
                    {
                        ModelResource model = (ModelResource)resource;
                        models.Add(model);
                        //osgGIS::Notify(osg::INFO)<<"ResourceLibrary: added model" <<skin->getAbsoulteURI()<<std::endl;
                        //osgDB::Registry::instance()->getDataFilePathList().push_back(osgDB::getFilePath (model->getAbsoluteURI)
                    }
                    else if (resource is RasterResource)
                    {
                        RasterResource raster = (RasterResource)resource;
                        rasters.Add(raster);
                        //osgGIS::notify(osg::INFO)<<"ResourceLibrary: added raster"<<raster->getAbsoluteURI()<<std::endl;
                    }
                    else if (resource is FeatureLayerResource)
                    {
                        FeatureLayerResource flr = (FeatureLayerResource)resource;
                        featureLayers.Add(flr);
                        //osgGIS::notify(osg::INFO)<<"ResourceLibrary: added feature layer "<<flr->getAbsoluteURI()<<std::endl;
                    }
                    else
#endif
                    if (resource is SRSResource)
                    {
                        SRSResource srsr = (SRSResource)resource;
                        srsList.Add(srsr);
                        //osgGIS::notify(osg::INFO)<<"ResourceLibrary: added SRS" << srsr->getName()<<std::endl;
                    }
#if TODO_PH
                    else if (resource is PathResource)
                    {
                        PathResource pr = (PathResource)resource;
                        paths.Add(pr);
                        //osgGIS::notify(osg::INFO)<<"ResourceLibrary: added path" << pr->getAbsoluteURI()<<std::endl;
                    }
#endif
                    resource.SincronizedFlag = sincronizeFlag;
                }
            }
        }
Ejemplo n.º 2
0
 static SRSResource()
 {
     bool _osggsis_dr = Registry.instance().addResourceType(SRSResource.getStaticResourceType(), SRSResource.getResourceFactory());
 }