├── src ├── Core │ ├── OCLayer │ │ ├── src │ │ │ ├── IDatabase.cpp │ │ │ ├── FeatureNode.cpp │ │ │ ├── FeatureEffect.cpp │ │ │ ├── FeatureLayer.cpp │ │ │ ├── LayerManager.cpp │ │ │ ├── Feature.cpp │ │ │ ├── ScenePass.cpp │ │ │ ├── QueryInfo.cpp │ │ │ ├── IRecord.cpp │ │ │ ├── OCResource.cpp │ │ │ ├── IFeature.cpp │ │ │ └── IArchive.cpp │ │ ├── FeatureLayer.h │ │ ├── FeatureEffect.h │ │ ├── LayerManager.h │ │ ├── FeatureNode.h │ │ ├── OCResource.h │ │ ├── BaseNodeMask.h │ │ ├── IRecord.h │ │ ├── IFeature.h │ │ ├── Feature.h │ │ ├── SqliteArchive.h │ │ ├── QueryInfo.h │ │ ├── ReadFileCallback.h │ │ ├── CMakeLists.txt │ │ └── ScenePass.h │ ├── OCesium │ │ ├── src │ │ │ ├── BaseWriter.cpp │ │ │ ├── FeatureAttributeCallback.cpp │ │ │ ├── MapProject.cpp │ │ │ ├── DracoEncoder.cpp │ │ │ ├── image.cc │ │ │ ├── gltfConfig.cpp │ │ │ ├── GLTFObject.cpp │ │ │ └── CmptWriter.cpp │ │ ├── KtxCompress.h │ │ ├── WebpEncoder.h │ │ ├── X3DM.h │ │ ├── TextureOptimize.h │ │ ├── FeatureAttributeCallback.h │ │ ├── glTFOptimize.h │ │ ├── CmptWriter.h │ │ ├── GLTFObject.h │ │ ├── DracoEncoder.h │ │ ├── gltfAttributeCallback.h │ │ ├── BaseWriter.h │ │ ├── B3dmWriter.h │ │ ├── gltfConfig.h │ │ ├── PntsWriter.h │ │ ├── MapProject.h │ │ ├── glTFConverter.h │ │ ├── converter │ │ │ └── glTFOptimize.cpp │ │ ├── I3dmWriter.h │ │ ├── ConvertWorkqueue.h │ │ ├── ObliqueConverter.h │ │ ├── MergeTriangleOperator.h │ │ ├── internal │ │ │ └── swap.h │ │ ├── gltfMaterial.h │ │ ├── BatchGroup.h │ │ └── BuildingConverter.h │ ├── OCUtility │ │ ├── aes.h │ │ ├── src │ │ │ ├── Rectangle.cpp │ │ │ ├── Vector4.cpp │ │ │ ├── AxisAlignedBox.cpp │ │ │ ├── Vector2.cpp │ │ │ └── tinyxmlerror.cpp │ │ ├── md5.h │ │ ├── RGBAEncoder.h │ │ ├── Android.mk │ │ ├── FileUtil.h │ │ └── CMakeLists.txt │ ├── OCModel │ │ ├── LineTable.h │ │ ├── ModelNode.h │ │ ├── OCModel.aps │ │ ├── OCModel.rc │ │ ├── PipeLine.h │ │ ├── PipeMath.h │ │ ├── IModelTable.h │ │ ├── src │ │ │ ├── ISection.cpp │ │ │ ├── PipeLine.cpp │ │ │ ├── PipeNode.cpp │ │ │ ├── IModelTable.cpp │ │ │ ├── LineTable.cpp │ │ │ ├── NodeExInfo.cpp │ │ │ ├── NodeTable.cpp │ │ │ ├── PipeTable.cpp │ │ │ ├── TableConfig.cpp │ │ │ ├── xmlConfig.cpp │ │ │ ├── ModelUtility.cpp │ │ │ ├── CirclePipeNode2.cpp │ │ │ ├── CirclePipeNode3.cpp │ │ │ ├── IModelFactory.cpp │ │ │ ├── ModelListennerBase.cpp │ │ │ ├── ModelArchive.cpp │ │ │ ├── PipeLineInfo.cpp │ │ │ ├── ShelfModelFactory.cpp │ │ │ ├── ModelDataQueryCallback.cpp │ │ │ └── DataFilter.cpp │ │ ├── PipeLineInfo.h │ │ ├── ShelfModelFactory.h │ │ ├── IModelFactory.h │ │ ├── ModelListennerBase.h │ │ ├── PipeModelFactory.h │ │ ├── ModelDataQueryCallback.h │ │ ├── ModelUtility.h │ │ ├── TilesetSaveStrategy.h │ │ ├── PipeGeomLibrary.h │ │ ├── DataFilter.h │ │ ├── NodeExInfo.h │ │ ├── ProjectTool.h │ │ ├── xmlConfig.h │ │ ├── NodeTable.h │ │ ├── BuildWell.h │ │ ├── IModelDatabase.h │ │ └── PipeTable.h │ ├── OCNetCDF │ │ ├── src │ │ │ ├── DBZ.cpp │ │ │ ├── NcDBZ.cpp │ │ │ ├── AWXReader.cpp │ │ │ ├── NcVolume.cpp │ │ │ └── Ncep.cpp │ │ ├── CinRadHeader.h │ │ ├── Ncep.h │ │ ├── Reflective.h │ │ ├── AWXReader.h │ │ ├── NcZT.h │ │ ├── NcZQ.h │ │ ├── DBZ.h │ │ ├── NcDBZ.h │ │ ├── npy │ │ │ └── npyTemprature.h │ │ ├── NcepWind.h │ │ ├── NetCDFDefine.h │ │ ├── NcUV.h │ │ ├── NetCDFReader.h │ │ ├── CINRad.h │ │ ├── ICinRadReader.h │ │ ├── NcVolume.h │ │ ├── CMakeLists.txt │ │ └── TransferFunction.h │ ├── OCVolume │ │ ├── src │ │ │ └── Swan.cpp │ │ ├── CinRadHeader.h │ │ ├── FyAwx.h │ │ ├── CinRadC.h │ │ ├── Swan.h │ │ ├── Volume.h │ │ ├── Vtk.h │ │ ├── CinRad.h │ │ ├── CMakeLists.txt │ │ ├── CinRadReaderFMT.h │ │ ├── CinRadReader.h │ │ └── VolumeDefine.h │ ├── OCServer │ │ ├── OCRegister.h │ │ ├── invokeCommand.h │ │ ├── VolumeManager.h │ │ ├── OCServerDefine.h │ │ ├── CMakeLists.txt │ │ ├── OCServer.h │ │ └── src │ │ │ ├── VolumeManager.cpp │ │ │ └── OCRegister.cpp │ ├── OCZip │ │ ├── ZipDefine.h │ │ ├── BZip2.h │ │ ├── PakoZip.h │ │ ├── iostd.h │ │ ├── iowin32.h │ │ ├── Makefile │ │ ├── src │ │ │ ├── BZip2.cpp │ │ │ └── PakoZip.cpp │ │ ├── CMakeLists.txt │ │ └── mztools.h │ ├── OCMain │ │ ├── src │ │ │ ├── FunctionalArchive.cpp │ │ │ └── OCPluginTool.cpp │ │ ├── json │ │ │ ├── json.h │ │ │ ├── version.h │ │ │ ├── autolink.h │ │ │ ├── forwards.h │ │ │ └── features.h │ │ ├── OCPluginTool.h │ │ ├── JsonHelper.h │ │ ├── Environment.h │ │ ├── BaseEnum.h │ │ ├── BaseEvents.h │ │ ├── DatabaseDefine.h │ │ ├── JsonPackage.h │ │ ├── stl.h │ │ ├── osgearth.h │ │ ├── Singleton.h │ │ ├── GLX │ │ │ └── CORETimerImp.h │ │ └── CMakeLists.txt │ ├── OCHttpClient │ │ ├── HttpClientDefine.h │ │ └── CMakeLists.txt │ └── OCHttpServer │ │ ├── HttpServerDefine.h │ │ ├── HttpServer.h │ │ ├── WebSocket.h │ │ ├── CMakeLists.txt │ │ └── src │ │ └── WebSocket.cc ├── Application │ ├── Weathertoy │ │ ├── ServerThread.cpp │ │ ├── RCa17512 │ │ ├── main.cpp │ │ ├── res │ │ │ ├── app.ico │ │ │ ├── app.png │ │ │ ├── earth.png │ │ │ ├── logo.png │ │ │ ├── splash.png │ │ │ └── splash2.png │ │ ├── resource.h │ │ ├── resource1.h │ │ ├── LabViewer.cpp │ │ ├── ThunderKML.h │ │ ├── WeatherLab.rc │ │ ├── RadarStationKML.h │ │ ├── WeatherLabMenu.cpp │ │ ├── main │ │ │ ├── cplusplus.js │ │ │ └── main.html │ │ ├── LabWebEngineView.cpp │ │ ├── RibbonMenuWidget.cpp │ │ ├── copyFrom.bat │ │ ├── Bridge.h │ │ ├── ServerThread.h │ │ ├── weatherlab.qrc │ │ ├── resources.qrc │ │ ├── RibbonMenuWidget.h │ │ ├── LabWebEngineView.h │ │ ├── Bridge.cpp │ │ ├── WeatherLab.vcxproj.user │ │ ├── CMakeLists.txt │ │ └── LabViewer.h │ ├── OConv │ │ ├── Geography │ │ │ ├── Kriging.h │ │ │ ├── GDALTool.cpp │ │ │ ├── GeographyTool.cpp │ │ │ ├── GeographyTool.h │ │ │ ├── GDALTool.h │ │ │ └── ShpDrawer.h │ │ ├── SqliteOper.h │ │ ├── ConvCommand.h │ │ ├── RadarStationKML.cpp │ │ ├── RadarStationKML.h │ │ ├── OConvMapCacher.h │ │ ├── deprecated.cpp │ │ ├── Thread │ │ │ └── ConvWorkqueue.h │ │ ├── lic.cpp │ │ └── CMakeLists.txt │ └── OCServerApp │ │ ├── OCServer.rc │ │ ├── resource.h │ │ ├── server.ico │ │ ├── OCServer.aps │ │ ├── OCServer.vcxproj.user │ │ ├── main.cpp │ │ ├── CMakeLists.txt │ │ └── OCServer.vcxproj.filters ├── Plugins │ ├── pipe │ │ ├── LineTable.h │ │ ├── PipeLine.h │ │ ├── LineTable.cpp │ │ ├── NodeExInfo.cpp │ │ ├── NodeTable.cpp │ │ ├── PipeLine.cpp │ │ ├── PipeNode.cpp │ │ ├── PipeTable.cpp │ │ ├── PipeModelFactory.h │ │ ├── PipeArchive.h │ │ ├── CMakeLists.txt │ │ ├── PipeArchive.cpp │ │ ├── NodeExInfo.h │ │ ├── PipeTable.h │ │ └── NodeTable.h │ ├── sqlite │ │ ├── SQLite.h │ │ ├── SQLite.cpp │ │ ├── CMakeLists.txt │ │ ├── SqliteDatabase.h │ │ └── SqliteArchive.h │ ├── shapefile │ │ ├── ShapeFileDatabase.cpp │ │ ├── CMakeLists.txt │ │ ├── ShapeFileArchive.h │ │ └── ShapeFileDatabase.h │ ├── ifc │ │ ├── IFCConverter.h │ │ ├── CMakeLists.txt │ │ ├── IFCArchive.cpp │ │ └── IFCArchive.h │ ├── nc │ │ ├── CMakeLists.txt │ │ └── NCArchive.h │ ├── functional │ │ ├── CMakeLists.txt │ │ ├── FuncArchive.h │ │ └── FuncArchive.cpp │ ├── vrl │ │ └── CMakeLists.txt │ └── CMakeLists.txt ├── Linux │ └── OCVolumeConverter │ │ ├── WatcherManager.h │ │ ├── Tool.h │ │ ├── watcher.h │ │ ├── fetcher.h │ │ ├── CMakeLists.txt │ │ ├── WatcherManager.cpp │ │ └── TaskWorkQueue.h └── CMakeLists.txt ├── .gitmodules ├── .gitignore └── README.md /src/Core/OCLayer/src/IDatabase.cpp: -------------------------------------------------------------------------------- 1 | #include "IDatabase.h" -------------------------------------------------------------------------------- /src/Core/OCesium/src/BaseWriter.cpp: -------------------------------------------------------------------------------- 1 | #include "BaseWriter.h" 2 | -------------------------------------------------------------------------------- /src/Application/Weathertoy/ServerThread.cpp: -------------------------------------------------------------------------------- 1 | #include "ServerThread.h" 2 | -------------------------------------------------------------------------------- /src/Application/OConv/Geography/Kriging.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void TestKriging(); -------------------------------------------------------------------------------- /src/Core/OCesium/src/FeatureAttributeCallback.cpp: -------------------------------------------------------------------------------- 1 | #include "FeatureAttributeCallback.h" 2 | -------------------------------------------------------------------------------- /src/Application/OCServerApp/OCServer.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON "server.ico" -------------------------------------------------------------------------------- /src/Core/OCUtility/aes.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCUtility/aes.h -------------------------------------------------------------------------------- /src/Application/OConv/SqliteOper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void createSqlite(); 4 | 5 | void openSqlite(); -------------------------------------------------------------------------------- /src/Core/OCModel/LineTable.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/LineTable.h -------------------------------------------------------------------------------- /src/Core/OCModel/ModelNode.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/ModelNode.h -------------------------------------------------------------------------------- /src/Core/OCModel/OCModel.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/OCModel.aps -------------------------------------------------------------------------------- /src/Core/OCModel/OCModel.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/OCModel.rc -------------------------------------------------------------------------------- /src/Core/OCModel/PipeLine.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/PipeLine.h -------------------------------------------------------------------------------- /src/Core/OCModel/PipeMath.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/PipeMath.h -------------------------------------------------------------------------------- /src/Plugins/pipe/LineTable.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Plugins/pipe/LineTable.h -------------------------------------------------------------------------------- /src/Plugins/pipe/PipeLine.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Plugins/pipe/PipeLine.h -------------------------------------------------------------------------------- /src/Plugins/sqlite/SQLite.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Plugins/sqlite/SQLite.h -------------------------------------------------------------------------------- /src/Core/OCModel/IModelTable.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/IModelTable.h -------------------------------------------------------------------------------- /src/Core/OCNetCDF/src/DBZ.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCNetCDF/src/DBZ.cpp -------------------------------------------------------------------------------- /src/Core/OCNetCDF/src/NcDBZ.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCNetCDF/src/NcDBZ.cpp -------------------------------------------------------------------------------- /src/Core/OCVolume/src/Swan.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCVolume/src/Swan.cpp -------------------------------------------------------------------------------- /src/Plugins/pipe/LineTable.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Plugins/pipe/LineTable.cpp -------------------------------------------------------------------------------- /src/Plugins/pipe/NodeExInfo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Plugins/pipe/NodeExInfo.cpp -------------------------------------------------------------------------------- /src/Plugins/pipe/NodeTable.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Plugins/pipe/NodeTable.cpp -------------------------------------------------------------------------------- /src/Plugins/pipe/PipeLine.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Plugins/pipe/PipeLine.cpp -------------------------------------------------------------------------------- /src/Plugins/pipe/PipeNode.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Plugins/pipe/PipeNode.cpp -------------------------------------------------------------------------------- /src/Plugins/pipe/PipeTable.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Plugins/pipe/PipeTable.cpp -------------------------------------------------------------------------------- /src/Plugins/sqlite/SQLite.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Plugins/sqlite/SQLite.cpp -------------------------------------------------------------------------------- /src/Core/OCModel/src/ISection.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/src/ISection.cpp -------------------------------------------------------------------------------- /src/Core/OCModel/src/PipeLine.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/src/PipeLine.cpp -------------------------------------------------------------------------------- /src/Core/OCModel/src/PipeNode.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/src/PipeNode.cpp -------------------------------------------------------------------------------- /src/Core/OCNetCDF/CinRadHeader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCNetCDF/CinRadHeader.h -------------------------------------------------------------------------------- /src/Core/OCVolume/CinRadHeader.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCVolume/CinRadHeader.h -------------------------------------------------------------------------------- /src/Application/OConv/ConvCommand.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/OConv/ConvCommand.h -------------------------------------------------------------------------------- /src/Application/Weathertoy/RCa17512: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/RCa17512 -------------------------------------------------------------------------------- /src/Application/Weathertoy/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/main.cpp -------------------------------------------------------------------------------- /src/Core/OCModel/src/IModelTable.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/src/IModelTable.cpp -------------------------------------------------------------------------------- /src/Core/OCModel/src/LineTable.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/src/LineTable.cpp -------------------------------------------------------------------------------- /src/Core/OCModel/src/NodeExInfo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/src/NodeExInfo.cpp -------------------------------------------------------------------------------- /src/Core/OCModel/src/NodeTable.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/src/NodeTable.cpp -------------------------------------------------------------------------------- /src/Core/OCModel/src/PipeTable.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/src/PipeTable.cpp -------------------------------------------------------------------------------- /src/Core/OCModel/src/TableConfig.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/src/TableConfig.cpp -------------------------------------------------------------------------------- /src/Core/OCModel/src/xmlConfig.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/src/xmlConfig.cpp -------------------------------------------------------------------------------- /src/Core/OCNetCDF/src/AWXReader.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCNetCDF/src/AWXReader.cpp -------------------------------------------------------------------------------- /src/Core/OCesium/src/MapProject.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCesium/src/MapProject.cpp -------------------------------------------------------------------------------- /src/Application/OCServerApp/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/OCServerApp/resource.h -------------------------------------------------------------------------------- /src/Application/OCServerApp/server.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/OCServerApp/server.ico -------------------------------------------------------------------------------- /src/Application/Weathertoy/res/app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/res/app.ico -------------------------------------------------------------------------------- /src/Application/Weathertoy/res/app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/res/app.png -------------------------------------------------------------------------------- /src/Application/Weathertoy/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/resource.h -------------------------------------------------------------------------------- /src/Application/Weathertoy/resource1.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/resource1.h -------------------------------------------------------------------------------- /src/Core/OCModel/src/ModelUtility.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/src/ModelUtility.cpp -------------------------------------------------------------------------------- /src/Core/OCesium/src/DracoEncoder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCesium/src/DracoEncoder.cpp -------------------------------------------------------------------------------- /src/Application/OCServerApp/OCServer.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/OCServerApp/OCServer.aps -------------------------------------------------------------------------------- /src/Application/OConv/RadarStationKML.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/OConv/RadarStationKML.cpp -------------------------------------------------------------------------------- /src/Application/Weathertoy/LabViewer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/LabViewer.cpp -------------------------------------------------------------------------------- /src/Application/Weathertoy/ThunderKML.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/ThunderKML.h -------------------------------------------------------------------------------- /src/Application/Weathertoy/WeatherLab.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/WeatherLab.rc -------------------------------------------------------------------------------- /src/Application/Weathertoy/res/earth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/res/earth.png -------------------------------------------------------------------------------- /src/Application/Weathertoy/res/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/res/logo.png -------------------------------------------------------------------------------- /src/Application/Weathertoy/res/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/res/splash.png -------------------------------------------------------------------------------- /src/Core/OCModel/src/CirclePipeNode2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/src/CirclePipeNode2.cpp -------------------------------------------------------------------------------- /src/Core/OCModel/src/CirclePipeNode3.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Core/OCModel/src/CirclePipeNode3.cpp -------------------------------------------------------------------------------- /src/Application/Weathertoy/res/splash2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/res/splash2.png -------------------------------------------------------------------------------- /src/Plugins/shapefile/ShapeFileDatabase.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Plugins/shapefile/ShapeFileDatabase.cpp -------------------------------------------------------------------------------- /src/Application/OConv/Geography/GDALTool.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/OConv/Geography/GDALTool.cpp -------------------------------------------------------------------------------- /src/Application/Weathertoy/RadarStationKML.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/RadarStationKML.h -------------------------------------------------------------------------------- /src/Application/Weathertoy/WeatherLabMenu.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/WeatherLabMenu.cpp -------------------------------------------------------------------------------- /src/Application/Weathertoy/main/cplusplus.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/main/cplusplus.js -------------------------------------------------------------------------------- /src/Core/OCUtility/src/Rectangle.cpp: -------------------------------------------------------------------------------- 1 | #include "Rectangle.h" 2 | 3 | namespace OC 4 | { 5 | const CRectangle CRectangle::ZERO(0,0,0,0); 6 | } -------------------------------------------------------------------------------- /src/Application/Weathertoy/LabWebEngineView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/LabWebEngineView.cpp -------------------------------------------------------------------------------- /src/Application/Weathertoy/RibbonMenuWidget.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/Weathertoy/RibbonMenuWidget.cpp -------------------------------------------------------------------------------- /src/Application/OConv/Geography/GeographyTool.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpgpp/osgcesium/HEAD/src/Application/OConv/Geography/GeographyTool.cpp -------------------------------------------------------------------------------- /src/Core/OCUtility/src/Vector4.cpp: -------------------------------------------------------------------------------- 1 | #include "Vector4.h" 2 | #include "MathUtil.h" 3 | 4 | namespace OC 5 | { 6 | const CVector4 CVector4::ZERO( 0, 0, 0, 0 ); 7 | } 8 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "OpenSceneGraph"] 2 | path = OpenSceneGraph 3 | url = https://github.com/openscenegraph/OpenSceneGraph.git 4 | [submodule "osgearth"] 5 | path = osgearth 6 | url = https://github.com/gwaldron/osgearth.git 7 | -------------------------------------------------------------------------------- /src/Core/OCNetCDF/src/NcVolume.cpp: -------------------------------------------------------------------------------- 1 | #include "NcVolume.h" 2 | 3 | namespace OC 4 | {namespace Volume{ 5 | 6 | NcVolume::NcVolume() 7 | { 8 | 9 | } 10 | 11 | NcVolume::~NcVolume() 12 | { 13 | 14 | } 15 | 16 | }} 17 | -------------------------------------------------------------------------------- /src/Core/OCLayer/src/FeatureNode.cpp: -------------------------------------------------------------------------------- 1 | #include "FeatureNode.h" 2 | 3 | namespace OC 4 | { 5 | CFeatureNode::CFeatureNode(CFeature* owner) 6 | { 7 | 8 | } 9 | 10 | CFeatureNode::~CFeatureNode(void) 11 | { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Application/OConv/Geography/GeographyTool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ShpDrawerHelper.h" 3 | 4 | using namespace OC; 5 | class GeographyTool 6 | { 7 | public: 8 | static void json2Mxd(String filename); 9 | }; 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Core/OCLayer/src/FeatureEffect.cpp: -------------------------------------------------------------------------------- 1 | #include "FeatureEffect.h" 2 | 3 | namespace OC 4 | { 5 | IFeatureEffect::IFeatureEffect() 6 | { 7 | 8 | } 9 | 10 | IFeatureEffect::~IFeatureEffect(void) 11 | { 12 | 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /src/Core/OCUtility/src/AxisAlignedBox.cpp: -------------------------------------------------------------------------------- 1 | #include "AxisAlignedBox.h" 2 | 3 | namespace OC 4 | { 5 | const CAxisAlignedBox CAxisAlignedBox::BOX_NULL; 6 | const CAxisAlignedBox CAxisAlignedBox::BOX_INFINITE(CAxisAlignedBox::EXTENT_INFINITE); 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/Plugins/ifc/IFCConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace osg 4 | { 5 | class Node; 6 | } 7 | class IFCConverter 8 | { 9 | public: 10 | IFCConverter(void); 11 | ~IFCConverter(void); 12 | 13 | 14 | osg::Node* read(const char* file); 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /src/Plugins/nc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(TARGET_SRC 2 | NCArchive.cpp 3 | ) 4 | 5 | SET(TARGET_H 6 | NCArchive.h 7 | ) 8 | 9 | SET(TARGET_ADDED_LIBRARIES OCNetCDF OCesium) 10 | 11 | SET(TARGET_EXTERNAL_LIBRARIES 12 | zlib 13 | ) 14 | 15 | SETUP_PLUGIN(nc) 16 | -------------------------------------------------------------------------------- /src/Application/Weathertoy/main/main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WeatherLab 5 | 6 | 7 | Simple Tools mode. 8 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Core/OCModel/src/IModelFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "IModelFactory.h" 2 | 3 | namespace OC 4 | { 5 | namespace Modeling 6 | { 7 | IModelFactory::IModelFactory(void) 8 | { 9 | } 10 | 11 | IModelFactory::~IModelFactory(void) 12 | { 13 | 14 | } 15 | } 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Application/Weathertoy/copyFrom.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | @set root=%~dp0 3 | xcopy %root%\..\..\..\..\apache-tomcat-7.0.99\webapps\WeatherLab\WeatherLab\js\app.js %root%\main /D/Y 4 | xcopy %root%\..\..\..\..\apache-tomcat-7.0.99\webapps\WeatherLab\WeatherLab\js\chunk-vendors.js %root%\main /D/Y 5 | pause -------------------------------------------------------------------------------- /src/Core/OCServer/OCRegister.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "OCServerDefine.h" 4 | #include "OCUtility/StringConverter.h" 5 | 6 | namespace OC 7 | { 8 | namespace Server 9 | { 10 | class OCRegister 11 | { 12 | public: 13 | static String getRegister(StringVector params); 14 | }; 15 | } 16 | } -------------------------------------------------------------------------------- /src/Core/OCNetCDF/Ncep.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_NCEP_H_ 2 | #define _OC_NCEP_H_ 3 | 4 | #include "Volume.h" 5 | 6 | namespace OC 7 | { 8 | class Ncep : public CVolume 9 | { 10 | public: 11 | Ncep(); 12 | ~Ncep(); 13 | osg::Image* readImage(String filename, String var_name); 14 | }; 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/Core/OCModel/src/ModelListennerBase.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "ModelListennerBase.h" 3 | 4 | 5 | namespace OC 6 | { 7 | namespace Modeling 8 | { 9 | ModelListennerBase::ModelListennerBase(void) 10 | { 11 | } 12 | 13 | ModelListennerBase::~ModelListennerBase(void) 14 | { 15 | } 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/Plugins/functional/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(TARGET_SRC 2 | FuncArchive.cpp 3 | ) 4 | 5 | SET(TARGET_H 6 | FuncArchive.h 7 | ) 8 | 9 | SET(TARGET_ADDED_LIBRARIES 10 | osg 11 | osgDB 12 | osgEarth 13 | ) 14 | 15 | SET(TARGET_EXTERNAL_LIBRARIES 16 | zlib 17 | ) 18 | 19 | SETUP_PLUGIN(func) 20 | -------------------------------------------------------------------------------- /src/Core/OCServer/invokeCommand.h: -------------------------------------------------------------------------------- 1 | #ifndef _INVOKE_COMMAND_H__ 2 | #define _INVOKE_COMMAND_H__ 3 | 4 | #include "OCServer.h" 5 | #include "OCMain/JsonPackage.h" 6 | 7 | namespace OC 8 | { 9 | namespace Server 10 | { 11 | String invoke(OC::String jsonStr); 12 | } 13 | } 14 | 15 | #endif // !_INVOKE_COMMAND_H__ 16 | 17 | -------------------------------------------------------------------------------- /src/Application/OConv/RadarStationKML.h: -------------------------------------------------------------------------------- 1 | #ifndef _STATION_TO_KML_H__ 2 | #define _STATION_TO_KML_H__ 3 | 4 | #include "OCMain/stl.h" 5 | 6 | using namespace OC; 7 | 8 | void stationToKML(String filename, String outFilename, bool isStation); 9 | void stationToKML2(String filename); 10 | 11 | #endif // !_STATION_TO_KML_H__ 12 | -------------------------------------------------------------------------------- /src/Core/OCLayer/src/FeatureLayer.cpp: -------------------------------------------------------------------------------- 1 | #include "FeatureLayer.h" 2 | #include "LayerManager.h" 3 | 4 | namespace OC 5 | { 6 | CFeatureLayer::CFeatureLayer(String layerID) 7 | :ILayer(SingletonPtr(LayerManager),layerID) 8 | { 9 | 10 | } 11 | 12 | CFeatureLayer::~CFeatureLayer(void) 13 | { 14 | 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/Core/OCZip/ZipDefine.h: -------------------------------------------------------------------------------- 1 | #ifndef _OCZIP_DEFINE_H__ 2 | #define _OCZIP_DEFINE_H__ 3 | 4 | #ifdef _WIN32 5 | #ifdef OCZip_EXPORTS 6 | #define ZEXPORT2 __declspec(dllexport) 7 | #else 8 | #define ZEXPORT2 __declspec(dllimport) 9 | #endif 10 | #else 11 | #define ZEXPORT2 12 | #endif 13 | 14 | #endif // !_oczip_define_h__ 15 | 16 | -------------------------------------------------------------------------------- /src/Application/Weathertoy/Bridge.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class Bridge : public QObject 6 | { 7 | Q_OBJECT 8 | public: 9 | static Bridge* instance(); 10 | ~Bridge(); 11 | public slots: 12 | void showMsgBox(); 13 | void eval(QString method,QString json); 14 | private: 15 | Bridge(); 16 | }; 17 | -------------------------------------------------------------------------------- /src/Core/OCLayer/FeatureLayer.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_FEATURELAYER_H__ 2 | #define _OC_FEATURELAYER_H__ 3 | 4 | #include "ILayer.h" 5 | 6 | namespace OC 7 | { 8 | class _LayerExport CFeatureLayer : public ILayer 9 | { 10 | public: 11 | CFeatureLayer(String layerID = StringUtil::BLANK); 12 | ~CFeatureLayer(void); 13 | }; 14 | } 15 | #endif 16 | -------------------------------------------------------------------------------- /src/Core/OCMain/src/FunctionalArchive.cpp: -------------------------------------------------------------------------------- 1 | #include "FunctionalArchive.h" 2 | 3 | namespace OC 4 | { 5 | FunctionalArchive::FunctionalArchive() 6 | { 7 | 8 | } 9 | 10 | FunctionalArchive::~FunctionalArchive() 11 | { 12 | 13 | } 14 | 15 | CVector2 FunctionalArchive::gauss2LH(CVector2 coord) 16 | { 17 | return CVector2(); 18 | } 19 | } -------------------------------------------------------------------------------- /src/Core/OCLayer/FeatureEffect.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_IFEATUREEFFECT_CLASS__ 2 | #define _OC_IFEATUREEFFECT_CLASS__ 3 | 4 | #include "LayerDefine.h" 5 | 6 | namespace OC 7 | { 8 | class _LayerExport IFeatureEffect : public osg::Object 9 | { 10 | public: 11 | IFeatureEffect(); 12 | virtual ~IFeatureEffect(); 13 | }; 14 | } 15 | #endif 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Core/OCZip/BZip2.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_BZip2_H__ 2 | 3 | #include "ZipDefine.h" 4 | #include 5 | 6 | namespace OC 7 | { 8 | class ZEXPORT2 BZip2 9 | { 10 | public: 11 | BZip2() {} 12 | ~BZip2() {} 13 | 14 | static size_t openBZ2(std::string filename, std::ostream& os); 15 | }; 16 | } 17 | 18 | #endif // !_OC_BZip2_H__ 19 | 20 | -------------------------------------------------------------------------------- /src/Core/OCModel/src/ModelArchive.cpp: -------------------------------------------------------------------------------- 1 | #include "ModelArchive.h" 2 | 3 | namespace OC 4 | {namespace Modeling{ 5 | 6 | ModelArchive::ModelArchive() 7 | { 8 | 9 | } 10 | 11 | ModelArchive::~ModelArchive() 12 | { 13 | 14 | } 15 | 16 | IModelTable* ModelArchive::getModelTable(ModelDataManager* owner) 17 | { 18 | return NULL; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Plugins/shapefile/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(TARGET_SRC 2 | ShapeFileArchive.cpp 3 | ShapeFileDatabase.cpp 4 | ) 5 | 6 | SET(TARGET_H 7 | ShapeFileArchive.h 8 | ShapeFileDatabase.h 9 | ) 10 | 11 | SET(TARGET_ADDED_LIBRARIES OCModel osgEarth) 12 | 13 | SET(TARGET_EXTERNAL_LIBRARIES 14 | gdal_i 15 | ) 16 | 17 | SETUP_PLUGIN(shapefile) 18 | -------------------------------------------------------------------------------- /src/Core/OCLayer/LayerManager.h: -------------------------------------------------------------------------------- 1 | #ifndef __LAYER_MANAGER__H_ 2 | #define __LAYER_MANAGER__H_ 3 | 4 | #include "ILayer.h" 5 | #include "OCMain/Singleton.h" 6 | 7 | namespace OC 8 | { 9 | class _LayerExport LayerManager : public CSingleton 10 | { 11 | public: 12 | LayerManager(void); 13 | ~LayerManager(void); 14 | }; 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/Core/OCVolume/FyAwx.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_FyAwx_H__ 2 | #define _OC_FyAwx_H__ 3 | 4 | #include "VolumeObject.h" 5 | 6 | namespace OC 7 | { 8 | class FyAwx : public Volume::CVolumeObject 9 | { 10 | public: 11 | FyAwx() {} 12 | ~FyAwx() {} 13 | virtual bool convert(std::string filename); 14 | }; 15 | } 16 | 17 | #endif // !_OC_FyAwx_H__ 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Plugins/sqlite/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(TARGET_SRC 2 | SqliteArchive.cpp 3 | SqliteDatabase.cpp 4 | Sqlite.cpp 5 | ) 6 | 7 | SET(TARGET_H 8 | SqliteArchive.h 9 | SqliteDatabase.h 10 | Sqlite.h 11 | ) 12 | 13 | SET(TARGET_ADDED_LIBRARIES OCLayer) 14 | 15 | SET(TARGET_EXTERNAL_LIBRARIES 16 | sqlite3 17 | ) 18 | 19 | SETUP_PLUGIN(sqlite) 20 | -------------------------------------------------------------------------------- /src/Core/OCLayer/FeatureNode.h: -------------------------------------------------------------------------------- 1 | #ifndef _FEATURE_NODE_CLASS_H__ 2 | #define _FEATURE_NODE_CLASS_H__ 3 | 4 | #include "SceneNode.h" 5 | #include "FeatureRecord.h" 6 | 7 | namespace OC 8 | { 9 | class _LayerExport CFeatureNode : public CSceneNode 10 | { 11 | public: 12 | CFeatureNode(CFeature* owner); 13 | virtual ~CFeatureNode(void); 14 | }; 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/Core/OCModel/src/PipeLineInfo.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "PipeLineInfo.h" 3 | 4 | namespace OC 5 | { 6 | namespace Modeling 7 | { 8 | CPipeLineInfo::CPipeLineInfo(void) 9 | { 10 | } 11 | 12 | 13 | CPipeLineInfo::~CPipeLineInfo(void) 14 | { 15 | } 16 | 17 | LinePtrList& CPipeLineInfo::getExtraLine() 18 | { 19 | return mLineList; 20 | } 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/Core/OCVolume/CinRadC.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_CINRADC_H__ 2 | #include "VolumeObject.h" 3 | 4 | namespace OC 5 | { 6 | namespace Volume 7 | { 8 | class CinRadC : public CVolumeObject 9 | { 10 | public: 11 | CinRadC(); 12 | ~CinRadC(); 13 | }; 14 | } 15 | } 16 | 17 | 18 | #endif // !_OC_CINRADC_H__ 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Core/OCNetCDF/Reflective.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_REFLECTIVE_H_ 2 | #define _OC_REFLECTIVE_H_ 3 | 4 | #include "Volume.h" 5 | #include "Humidity.h" 6 | 7 | namespace OC 8 | { 9 | class Reflective : public CVolume 10 | { 11 | public: 12 | Reflective(); 13 | ~Reflective(); 14 | 15 | osg::Image* readImage(String filename, String var_name); 16 | 17 | }; 18 | } 19 | 20 | 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/Core/OCZip/PakoZip.h: -------------------------------------------------------------------------------- 1 | #ifndef _PAKO_ZIP_H__ 2 | #define _PAKO_ZIP_H__ 3 | 4 | #include "ZipDefine.h" 5 | #include 6 | 7 | namespace OC 8 | { 9 | class ZEXPORT2 PakoZip 10 | { 11 | public: 12 | PakoZip(); 13 | ~PakoZip(); 14 | static bool compress(std::ostream& fout, const std::string& src); 15 | }; 16 | } 17 | #endif 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Application/OConv/Geography/GDALTool.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_GDALTOOL_H__ 2 | 3 | #include "OCMain/Environment.h" 4 | 5 | namespace OC 6 | { 7 | class GDALTool 8 | { 9 | public: 10 | GDALTool(); 11 | ~GDALTool(); 12 | void testIDW(String filename); 13 | void testContour(String inputDEM,String outputSHP,double dfContourInterval); 14 | }; 15 | } 16 | 17 | #endif // !_OC_GDALTOOL_H__ 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Core/OCHttpClient/HttpClientDefine.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_HTTP_Client_DEFINE_H_ 2 | #define _OC_HTTP_Client_DEFINE_H_ 3 | 4 | #if defined(_MSC_VER) 5 | #ifndef OCHttpClient_EXPORTS 6 | #define _HttpClientExport __declspec(dllimport) 7 | #else 8 | #define _HttpClientExport __declspec(dllexport) 9 | #endif 10 | #else 11 | #define _HttpClientExport 12 | #endif 13 | 14 | #include "OCMain/stl.h" 15 | 16 | #endif -------------------------------------------------------------------------------- /src/Core/OCNetCDF/AWXReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NetCDFDefine.h" 4 | #include "OCVolume/VolumeObject.h" 5 | 6 | namespace OC 7 | { 8 | class AWXReader : public Volume::CVolumeObject 9 | { 10 | public: 11 | AWXReader() {} 12 | ~AWXReader() {} 13 | virtual bool convert(std::string filename); 14 | 15 | osg::Image* readImage(String filename, String var_name); 16 | }; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/Core/OCNetCDF/NcZT.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_Volume_NcZT_H__ 2 | #define _OC_Volume_NcZT_H__ 3 | 4 | #include "NcVolume.h" 5 | 6 | namespace OC 7 | { 8 | namespace Volume 9 | { 10 | class NcZT : public NcVolume 11 | { 12 | public: 13 | NcZT(String varname); 14 | ~NcZT(); 15 | virtual bool convert(std::string filename); 16 | private: 17 | String mVarname; 18 | }; 19 | } 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/Application/OConv/OConvMapCacher.h: -------------------------------------------------------------------------------- 1 | #include "OCMain/osg.h" 2 | #include "OCMain/osgearth.h" 3 | #include "OCMain/Environment.h" 4 | #include "OCMain/ConfigManager.h" 5 | 6 | namespace OC 7 | { 8 | class OConvMapCacher 9 | { 10 | public: 11 | OConvMapCacher(); 12 | ~OConvMapCacher(); 13 | void requestCes(int x, int y, int z, int level); 14 | void requestTDT(String map, int x, int y, int z, int level); 15 | }; 16 | } -------------------------------------------------------------------------------- /src/Core/OCNetCDF/NcZQ.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_Volume_NcZQ_H__ 2 | #define _OC_Volume_NcZQ_H__ 3 | 4 | #include "NcVolume.h" 5 | 6 | namespace OC 7 | { 8 | namespace Volume 9 | { 10 | class NcZQ : public NcVolume 11 | { 12 | public: 13 | NcZQ(String varname); 14 | ~NcZQ(); 15 | 16 | virtual bool convert(std::string filename); 17 | private: 18 | String mVarname; 19 | }; 20 | } 21 | } 22 | 23 | #endif 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Core/OCModel/src/ShelfModelFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "ShelfModelFactory.h" 2 | #include "IModelData.h" 3 | 4 | namespace OC 5 | { 6 | namespace Modeling 7 | { 8 | ShelfModelFactory::ShelfModelFactory(void) 9 | { 10 | } 11 | 12 | 13 | ShelfModelFactory::~ShelfModelFactory(void) 14 | { 15 | } 16 | 17 | bool ShelfModelFactory::build(IModelData* data) 18 | { 19 | return data->build(); 20 | } 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/Core/OCModel/PipeLineInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef _PIPE_LINE_INFO_CLASS_H_ 2 | #define _PIPE_LINE_INFO_CLASS_H_ 3 | 4 | #include "PipeLine.h" 5 | 6 | namespace OC 7 | { 8 | namespace Modeling 9 | { 10 | class CPipeLineInfo 11 | { 12 | public: 13 | CPipeLineInfo(void); 14 | ~CPipeLineInfo(void); 15 | 16 | LinePtrList& getExtraLine(); 17 | private: 18 | LinePtrList mLineList; 19 | }; 20 | } 21 | } 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/Core/OCUtility/src/Vector2.cpp: -------------------------------------------------------------------------------- 1 | #include "Vector2.h" 2 | #include "MathUtil.h" 3 | 4 | namespace OC 5 | { 6 | const CVector2 CVector2::ZERO( 0, 0); 7 | 8 | const CVector2 CVector2::UNIT_X( 1, 0); 9 | const CVector2 CVector2::UNIT_Y( 0, 1); 10 | const CVector2 CVector2::NEGATIVE_UNIT_X( -1, 0); 11 | const CVector2 CVector2::NEGATIVE_UNIT_Y( 0, -1); 12 | const CVector2 CVector2::UNIT_SCALE(1, 1); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/Core/OCModel/ShelfModelFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef _SHELF_MODEL_FACTORY_H_ 2 | #define _SHELF_MODEL_FACTORY_H_ 3 | 4 | #include "IModelFactory.h" 5 | 6 | namespace OC 7 | { 8 | namespace Modeling 9 | { 10 | class ShelfModelFactory : public IModelFactory 11 | { 12 | public: 13 | ShelfModelFactory(void); 14 | ~ShelfModelFactory(void); 15 | virtual bool build(IModelData* data); 16 | }; 17 | } 18 | } 19 | 20 | 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/Core/OCModel/IModelFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef _IMODEL_FACTORY_CLASS_H_ 2 | #define _IMODEL_FACTORY_CLASS_H_ 3 | 4 | #include "ModelDefine.h" 5 | 6 | namespace OC 7 | { 8 | namespace Modeling 9 | { 10 | class _ModelExport IModelFactory 11 | { 12 | public: 13 | IModelFactory(void); 14 | virtual ~IModelFactory(void); 15 | 16 | virtual bool build(IModelData* data){return false;} 17 | }; 18 | } 19 | } 20 | 21 | 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /src/Core/OCModel/ModelListennerBase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ModelDefine.h" 3 | #include "OCMain/Environment.h" 4 | 5 | namespace OC 6 | { 7 | namespace Modeling 8 | { 9 | class _ModelExport ModelListennerBase 10 | { 11 | public: 12 | ModelListennerBase(void); 13 | ~ModelListennerBase(void); 14 | public: 15 | virtual void setProcessFocus(int n,int num){}; 16 | virtual void setEditText(String text){}; 17 | }; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Core/OCHttpServer/HttpServerDefine.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_HTTP_SERVER_DEFINE_H_ 2 | #define _OC_HTTP_SERVER_DEFINE_H_ 3 | 4 | #if defined(_MSC_VER) 5 | #ifndef OCHttpServer_EXPORTS 6 | #define _HttpServerExport __declspec(dllimport) 7 | #else 8 | #define _HttpServerExport __declspec(dllexport) 9 | #endif 10 | #else 11 | #define _HttpServerExport 12 | #endif 13 | 14 | #include "OCMain/stl.h" 15 | #define OCLogStream Singleton(OC::LogManager).stream() 16 | 17 | #endif -------------------------------------------------------------------------------- /src/Core/OCUtility/md5.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_MD5_H_ 2 | #define _OC_MD5_H_ 3 | 4 | #define _CRT_SECURE_NO_WARNINGS 5 | 6 | #include 7 | #include 8 | 9 | std::string md5(std::string dat); 10 | std::string md5(const void* dat, size_t len); 11 | std::string md5file(const char* filename); 12 | std::string md5file(std::FILE* file); 13 | std::string md5sum6(std::string dat); 14 | std::string md5sum6(const void* dat, size_t len); 15 | 16 | #endif // end of MD5_H -------------------------------------------------------------------------------- /src/Linux/OCVolumeConverter/WatcherManager.h: -------------------------------------------------------------------------------- 1 | #ifndef _WATCHER_MANAGER_H__ 2 | #define _WATCHER_MANAGER_H__ 3 | 4 | #include "watcher.h" 5 | 6 | using namespace OC; 7 | 8 | class WatcherManager 9 | { 10 | public: 11 | WatcherManager(); 12 | ~WatcherManager(); 13 | void add(String path); 14 | void remove(String path); 15 | 16 | typedef std::map > WatcherMap; 17 | WatcherMap mWatcherMap; 18 | }; 19 | 20 | 21 | #endif -------------------------------------------------------------------------------- /src/Core/OCVolume/Swan.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_VOLUME_SWAN_H__ 2 | #define _OC_VOLUME_SWAN_H__ 3 | 4 | #include "VolumeObject.h" 5 | 6 | namespace OC 7 | { 8 | namespace Volume 9 | { 10 | class CSwan : public CVolumeObject 11 | { 12 | public: 13 | CSwan(); 14 | ~CSwan(); 15 | bool convert(std::stringstream& sstream); 16 | }; 17 | } 18 | } 19 | 20 | #endif // !_OC_VOLUME_SWAN_H__ 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/Core/OCesium/KtxCompress.h: -------------------------------------------------------------------------------- 1 | #ifndef _KTX_COMPRESS_H__ 2 | #define _KTX_COMPRESS_H__ 3 | 4 | #include "CesiumDefine.h" 5 | 6 | namespace OC 7 | { 8 | namespace Cesium 9 | { 10 | class _CesiumExport KtxCompress 11 | { 12 | public: 13 | KtxCompress(); 14 | ~KtxCompress(); 15 | 16 | static osg::UByteArray* writeImage(osg::Image* image); 17 | }; 18 | } 19 | }//namespace 20 | 21 | #endif -------------------------------------------------------------------------------- /src/Core/OCVolume/Volume.h: -------------------------------------------------------------------------------- 1 | #ifndef _OCVOLUME_H__ 2 | #define _OCVOLUME_H__ 3 | 4 | #include "VolumeObject.h" 5 | 6 | namespace OC 7 | { 8 | namespace Volume 9 | { 10 | class _VoloumeExport CVolume 11 | { 12 | public: 13 | CVolume(); 14 | ~CVolume(); 15 | 16 | static CVolumeObject* convert(String filename, String varname = StringUtil::BLANK); 17 | }; 18 | } 19 | } 20 | 21 | #endif // !_OCVOLUME_H__ 22 | -------------------------------------------------------------------------------- /src/Linux/OCVolumeConverter/Tool.h: -------------------------------------------------------------------------------- 1 | #ifndef _OCVOLUMCONVERTER_TOOL_H__ 2 | #define _OCVOLUMCONVERTER_TOOL_H__ 3 | 4 | #include "TaskWorkQueue.h" 5 | using namespace OC; 6 | 7 | int convertVolume(String filename,String outfilename,String varname); 8 | int handleFile(OC::String filename,OC::TaskWorkQueue::RequestType type); 9 | int clearCacher(time_t today); 10 | void test(); 11 | 12 | time_t tickTheDayBefore(time_t daybefore = 0); 13 | String parseTime(time_t t); 14 | 15 | #endif -------------------------------------------------------------------------------- /src/Linux/OCVolumeConverter/watcher.h: -------------------------------------------------------------------------------- 1 | #ifndef _WATCHER_H__ 2 | #define _WATCHER_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "OCMain/osg.h" 9 | #include "OCMain/Environment.h" 10 | 11 | class watcher : public osg::Referenced 12 | { 13 | public: 14 | watcher(); 15 | ~watcher(); 16 | int createTask(std::string path); 17 | int fd; 18 | int wd; 19 | std::string _path; 20 | }; 21 | 22 | #endif -------------------------------------------------------------------------------- /src/Core/OCNetCDF/src/Ncep.cpp: -------------------------------------------------------------------------------- 1 | #include "Ncep.h" 2 | 3 | 4 | using namespace OC; 5 | 6 | #define GFS_URL "https://nomads.ncep.noaa.gov/cgi-bin/filter_{DIR}_${RES}.pl?file={DIR}.t${GFS_TIME}z.pgrb2.${RES}.f000&${LEVEL}&subregion=&${BBOX}&dir=%2F{DIR}.${GFS_DATE}%2F${GFS_TIME}%2Fatmos" 7 | 8 | Ncep::Ncep() 9 | { 10 | 11 | } 12 | 13 | Ncep::~Ncep() 14 | { 15 | 16 | } 17 | 18 | osg::Image* Ncep::readImage(String filename, String var_name) 19 | { 20 | return NULL; 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Application/Weathertoy/ServerThread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "OCHttpServer/HttpServer.h" 5 | 6 | class ServerThread : public QThread 7 | { 8 | public: 9 | ServerThread(int port, OC::String path = ""):_port(port), _path(path){} 10 | OC::HttpServer& server(){return mServer;} 11 | private: 12 | void run() 13 | { 14 | mServer.init(_port); 15 | } 16 | 17 | OC::HttpServer mServer; 18 | int _port; 19 | OC::String _path; 20 | }; -------------------------------------------------------------------------------- /src/Core/OCLayer/src/LayerManager.cpp: -------------------------------------------------------------------------------- 1 | #include "LayerManager.h" 2 | 3 | namespace OC 4 | { 5 | 6 | #if SingletonConfig == SingletonNormal 7 | template<>LayerManager* CSingleton::msSingleton = NULL; 8 | #elif SingletonConfig == SingletonProcess 9 | template<>std::map CSingleton::msPidton; 10 | #endif 11 | 12 | LayerManager::LayerManager(void) 13 | { 14 | 15 | } 16 | 17 | LayerManager::~LayerManager(void) 18 | { 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Core/OCNetCDF/DBZ.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_VOLUME_DBZ_H_ 2 | #define _OC_VOLUME_DBZ_H_ 3 | 4 | #include "Volume.h" 5 | #include "Humidity.h" 6 | 7 | namespace OC 8 | { 9 | class CDBZ : public CVolume 10 | { 11 | public: 12 | CDBZ(); 13 | ~CDBZ(); 14 | 15 | osg::Image* readImage(String filename, String var_name); 16 | osg::Image* readImage2(String filename, String var_name); 17 | void readDBZ2Cesium(String filename, String var_name); 18 | 19 | }; 20 | } 21 | 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/Core/OCLayer/src/Feature.cpp: -------------------------------------------------------------------------------- 1 | #include "Feature.h" 2 | #include "FeatureLayer.h" 3 | 4 | namespace OC 5 | { 6 | String CFeature::ClassGUID = "OC::Feature"; 7 | 8 | CFeature::CFeature() 9 | { 10 | 11 | } 12 | 13 | CFeature::~CFeature(void) 14 | { 15 | 16 | } 17 | 18 | void CFeature::prepareImpl(void) 19 | { 20 | } 21 | 22 | void CFeature::loadImpl(void) 23 | { 24 | load(); 25 | } 26 | 27 | bool CFeature::load() 28 | { 29 | return true; 30 | } 31 | 32 | }//namespace 33 | -------------------------------------------------------------------------------- /src/Core/OCMain/json/json.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_JSON_H_INCLUDED 7 | #define JSON_JSON_H_INCLUDED 8 | 9 | #include "autolink.h" 10 | #include "value.h" 11 | #include "reader.h" 12 | #include "writer.h" 13 | #include "features.h" 14 | 15 | #endif // JSON_JSON_H_INCLUDED 16 | -------------------------------------------------------------------------------- /src/Core/OCNetCDF/NcDBZ.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_Nc_DBZ_H__ 2 | #define _OC_Nc_DBZ_H__ 3 | 4 | #include "NcVolume.h" 5 | 6 | namespace OC 7 | { 8 | namespace Volume 9 | { 10 | class NcDBZ : public NcVolume 11 | { 12 | public: 13 | NcDBZ(String varname); 14 | ~NcDBZ(); 15 | virtual bool convert(std::string filename); 16 | 17 | String mVarname; 18 | float fill_value = -31.328f; 19 | float missing_value = -31.328f; 20 | float unit = 1000.0f; 21 | }; 22 | } 23 | } 24 | 25 | 26 | #endif -------------------------------------------------------------------------------- /src/Core/OCesium/WebpEncoder.h: -------------------------------------------------------------------------------- 1 | #ifndef _WEBP_ENCODER_H__ 2 | #define _WEBP_ENCODER_H__ 3 | 4 | #include "CesiumDefine.h" 5 | 6 | namespace OC 7 | { 8 | namespace Cesium 9 | { 10 | class _CesiumExport WebpEncoder 11 | { 12 | public: 13 | WebpEncoder(); 14 | ~WebpEncoder(); 15 | 16 | static osgDB::ReaderWriter::WriteResult writeImage(const osg::Image& img, std::ostream& fout); 17 | }; 18 | } 19 | } 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /src/Core/OCesium/X3DM.h: -------------------------------------------------------------------------------- 1 | #ifndef OC_X3DM_WRITER_H 2 | #define OC_X3DM_WRITER_H 3 | 4 | #include "CesiumDefine.h" 5 | 6 | namespace OC 7 | { 8 | namespace Cesium 9 | { 10 | class _CesiumExport X3DMWriter 11 | { 12 | public: 13 | static bool writePNTS(const String& location, 14 | const String& featureTableJSON, 15 | const String& featureTableBody, 16 | const String& batchTableJSON, 17 | const String& batchTableBody); 18 | }; 19 | } 20 | } 21 | 22 | #endif // OSGEARTH_B3DM_WRITER_H -------------------------------------------------------------------------------- /src/Plugins/vrl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(TARGET_SRC 2 | ConvertToVRML.cpp 3 | ReaderWriterVRML2.cpp 4 | Primitives.cpp 5 | IndexedFaceSet.cpp 6 | ) 7 | 8 | SET(TARGET_H 9 | ConvertToVRML.h 10 | ReaderWriterVRML2.h 11 | ) 12 | 13 | SET(TARGET_EXTERNAL_LIBRARIES 14 | openvrml 15 | ) 16 | 17 | ADD_DEFINITIONS(-DOPENVRML_USE_DLL) 18 | 19 | INCLUDE_DIRECTORIES(${WORKINGPATH}/3rdParty/etc/boost) 20 | LINK_DIRECTORIES(${WORKINGPATH}/3rdParty/etc/boost/lib) 21 | 22 | SETUP_PLUGIN(vrl) 23 | -------------------------------------------------------------------------------- /src/Application/Weathertoy/weatherlab.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main/main.html 4 | res/splash.png 5 | res/logo.png 6 | res/earth.png 7 | res/app.png 8 | main/cplusplus.js 9 | main/qwebchannel.js 10 | res/splash2.png 11 | main/app.js 12 | res/menu.xml 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Core/OCMain/OCPluginTool.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_PluginTool_H__ 2 | #define _OC_PluginTool_H__ 3 | 4 | #include "FunctionalArchive.h" 5 | #include "Singleton.h" 6 | 7 | namespace OC 8 | { 9 | class _MainExport OCPluginTool : public CSingleton 10 | { 11 | public: 12 | OCPluginTool(); 13 | ~OCPluginTool(); 14 | FunctionalArchive* getFunctional(); 15 | private: 16 | osg::ref_ptr mFunctionalArchive; 17 | }; 18 | 19 | } 20 | 21 | #endif // !_OC_PluginTool_H__ 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Plugins/ifc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(TARGET_SRC 2 | IFCArchive.cpp 3 | IFCConverter.cpp 4 | ) 5 | 6 | SET(TARGET_H 7 | IFCArchive.h 8 | IFCConverter.h 9 | ) 10 | 11 | SET(TARGET_ADDED_LIBRARIES IfcPlusPlus carve osgText) 12 | 13 | INCLUDE_DIRECTORIES(${WORKINGPATH}/3rdParty/etc) 14 | INCLUDE_DIRECTORIES(${WORKINGPATH}/3rdParty/etc/boost) 15 | INCLUDE_DIRECTORIES(${WORKINGPATH}/3rdParty/etc/ifcplusplus) 16 | INCLUDE_DIRECTORIES(${WORKINGPATH}/3rdParty/etc/ifcplusplus/carve/include) 17 | 18 | SETUP_PLUGIN(ifc) 19 | -------------------------------------------------------------------------------- /src/Application/Weathertoy/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main/main.html 4 | res/splash.png 5 | res/logo.png 6 | res/earth.png 7 | res/app.png 8 | main/cplusplus.js 9 | main/qwebchannel.js 10 | res/splash2.png 11 | main/app.js 12 | main/WeatherEarth.js 13 | res/menu.xml 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Core/OCServer/VolumeManager.h: -------------------------------------------------------------------------------- 1 | #ifndef _VOLUMEMANAGER_H__ 2 | #define _VOLUMEMANAGER_H__ 3 | 4 | #include "OCServerDefine.h" 5 | #include "OCMain/DataStream.h" 6 | #include "OCMain/osg.h" 7 | 8 | namespace OC 9 | { 10 | namespace Server 11 | { 12 | class VolumeManager 13 | { 14 | public: 15 | static String getVolumeFile(const String name, const String varname, const String ext, const String dir, const String version = "1.0"); 16 | 17 | }; 18 | } 19 | } 20 | 21 | #endif 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Core/OCesium/TextureOptimize.h: -------------------------------------------------------------------------------- 1 | #ifndef _Cesium_TEXTURE_OPTIMIZE_H__ 2 | #define _Cesium_TEXTURE_OPTIMIZE_H__ 3 | 4 | #include "BatchGeode.h" 5 | 6 | namespace OC 7 | { 8 | namespace Cesium 9 | { 10 | class TextureOptimize 11 | { 12 | public: 13 | static void merge_clamp(BatchGeodeList& batchGeodeList, BatchGeodeMap& mBatchGeodeMap); 14 | static void merge_repeat(BatchGeodeList& batchGeodeList, BatchGeodeMap& mBatchGeodeMap); 15 | static void scaleDimansion(osg::Image* image); 16 | }; 17 | } 18 | } 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /src/Core/OCVolume/Vtk.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_VOLUME_VTK_H__ 2 | #define _OC_VOLUME_VTK_H__ 3 | 4 | #include "VolumeObject.h" 5 | 6 | namespace OC 7 | { 8 | namespace Volume 9 | { 10 | class _VoloumeExport Vtk : public CVolumeObject 11 | { 12 | public: 13 | Vtk(String varname = "xyz"); 14 | ~Vtk(); 15 | bool convert(std::string filename); 16 | bool mNeedStatistic; 17 | bool mUseXYZ; 18 | bool mConvertGauss; 19 | float mFillValue; 20 | String mVarname; 21 | }; 22 | } 23 | } 24 | 25 | #endif // !_OC_VOLUME_VTK_H__ 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/Plugins/pipe/PipeModelFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_Model_PipeModelFactory_H__ 2 | #define _OC_Model_PipeModelFactory_H__ 3 | 4 | #include "OCModel/IModelFactory.h" 5 | 6 | namespace OC 7 | { 8 | namespace Modeling 9 | { 10 | class PipeModelFactory : public IModelFactory 11 | { 12 | public: 13 | PipeModelFactory(void){} 14 | ~PipeModelFactory(void){} 15 | 16 | virtual bool build(IModelData* data); 17 | public: 18 | bool createNode(PipeNode* pNode); 19 | bool createLine(PipeLine* pLine); 20 | }; 21 | } 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/Core/OCModel/PipeModelFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef _PIPE_MODEL_FACTORY_CLASS_H__ 2 | #define _PIPE_MODEL_FACTORY_CLASS_H__ 3 | 4 | #include "IModelFactory.h" 5 | 6 | namespace OC 7 | { 8 | namespace Modeling 9 | { 10 | class _ModelExport PipeModelFactory : public IModelFactory 11 | { 12 | public: 13 | PipeModelFactory(void){} 14 | ~PipeModelFactory(void){} 15 | 16 | virtual bool build(IModelData* data); 17 | public: 18 | bool createNode(PipeNode* pNode); 19 | bool createLine(PipeLine* pLine); 20 | }; 21 | } 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/Core/OCNetCDF/npy/npyTemprature.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "NcVolume.h" 4 | #include "OCMain/DataStream.h" 5 | #include "OCVolume/VolumeObject.h" 6 | 7 | namespace OC 8 | { 9 | namespace Volume 10 | { 11 | class npyTemprature : public Volume::CVolumeObject 12 | { 13 | public: 14 | npyTemprature(String varname); 15 | ~npyTemprature(); 16 | virtual bool convert(std::string filename); 17 | private: 18 | String mVarname; 19 | }; 20 | } 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Core/OCZip/iostd.h: -------------------------------------------------------------------------------- 1 | /* iowin32.h -- IO base function header for compress/uncompress .zip 2 | files using zlib + zip or unzip API 3 | This IO API version uses the Win32 API (for Microsoft Windows) 4 | 5 | Version 1.01e, February 12th, 2005 6 | 7 | Copyright (C) 1998-2005 Gilles Vollant 8 | */ 9 | 10 | #if _WIN32 11 | #include 12 | #endif 13 | 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | void fill_std_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /src/Core/OCLayer/OCResource.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLOBAL_ARCHIVE_H_ 2 | #define _GLOBAL_ARCHIVE_H_ 3 | 4 | #include "OCMain/Singleton.h" 5 | #include "IArchive.h" 6 | #include "LayerDefine.h" 7 | 8 | namespace OC 9 | { 10 | class _LayerExport OCResource : public CSingleton 11 | { 12 | public: 13 | OCResource(void); 14 | ~OCResource(void); 15 | 16 | IArchive* getArchive(); 17 | 18 | osg::Node* readNode(String file); 19 | osg::Image* readImage(String file); 20 | private: 21 | osg::ref_ptr mArchive; 22 | }; 23 | } 24 | 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/Core/OCZip/iowin32.h: -------------------------------------------------------------------------------- 1 | /* iowin32.h -- IO base function header for compress/uncompress .zip 2 | files using zlib + zip or unzip API 3 | This IO API version uses the Win32 API (for Microsoft Windows) 4 | 5 | Version 1.01e, February 12th, 2005 6 | 7 | Copyright (C) 1998-2005 Gilles Vollant 8 | */ 9 | 10 | #if _WIN32 11 | #include 12 | 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/Core/OCesium/FeatureAttributeCallback.h: -------------------------------------------------------------------------------- 1 | #ifndef _FEATURE_ATTRIBUTE_CALLBACK_H__ 2 | #define _FEATURE_ATTRIBUTE_CALLBACK_H__ 3 | 4 | #include "gltfConfig.h" 5 | 6 | namespace OC 7 | { 8 | namespace Cesium 9 | { 10 | class _CesiumExport FeatureAttributeCallback : public osg::Referenced 11 | { 12 | public: 13 | FeatureAttributeCallback(){} 14 | virtual ~FeatureAttributeCallback() {} 15 | virtual void onSetAttirubte(String name,FeatureBatchTable* table){} 16 | }; 17 | } 18 | } 19 | 20 | #endif -------------------------------------------------------------------------------- /src/Application/Weathertoy/RibbonMenuWidget.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTRIBBON_H 2 | #define TESTRIBBON_H 3 | 4 | #include 5 | #include 6 | 7 | class LabViewer; 8 | class CRibbonMenuWidget : public QWidget 9 | { 10 | Q_OBJECT 11 | public: 12 | CRibbonMenuWidget(LabViewer *createor, QWidget *parent = 0, Qt::WindowFlags flags = 0); 13 | ~CRibbonMenuWidget(); 14 | public: 15 | private: 16 | void loadFileXml(); 17 | void loadToolXml(); 18 | private: 19 | QString mApplicationDir; 20 | LabViewer* mCreator; 21 | }; 22 | 23 | #endif // TESTRIBBON_H 24 | -------------------------------------------------------------------------------- /src/Core/OCesium/glTFOptimize.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLTF_OPTIMIZE_H__ 2 | #define _GLTF_OPTIMIZE_H__ 3 | 4 | #include "CesiumDefine.h" 5 | 6 | namespace OC 7 | { 8 | namespace Cesium 9 | { 10 | class _CesiumExport glTFVisitor : public osg::NodeVisitor 11 | { 12 | public: 13 | glTFVisitor(); 14 | ~glTFVisitor(); 15 | 16 | void apply(osg::StateSet& stateset); 17 | void apply(osg::Geode& geode); 18 | void apply(osg::Node& node); 19 | 20 | bool removeStateset; 21 | osgEarth::optional offset; 22 | }; 23 | } 24 | } 25 | 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/Plugins/functional/FuncArchive.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_FuncArchive_H__ 2 | #define _OC_FuncArchive_H__ 3 | 4 | #include "OCMain/FunctionalArchive.h" 5 | 6 | using namespace OC; 7 | 8 | class FuncArchive : public FunctionalArchive 9 | { 10 | public: 11 | FuncArchive(void); 12 | ~FuncArchive(void); 13 | 14 | CVector2 gauss2LH(CVector2 coord); 15 | String invoke(StringVector params); 16 | osgDB::ReaderWriter::ReadResult openArchive(const String& fileName, osgDB::ReaderWriter::ArchiveStatus status, unsigned int dep, const osgDB::Options* options) const; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/Plugins/pipe/PipeArchive.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_FuncArchive_H__ 2 | #define _OC_FuncArchive_H__ 3 | 4 | #include "OCModel/ModelArchive.h" 5 | 6 | using namespace OC; 7 | using namespace OC::Modeling; 8 | 9 | class PipeArchive : public ModelArchive 10 | { 11 | public: 12 | PipeArchive(void); 13 | ~PipeArchive(void); 14 | virtual IModelTable* getModelTable(ModelDataManager* owner); 15 | 16 | osgDB::ReaderWriter::ReadResult openArchive(const String& fileName, osgDB::ReaderWriter::ArchiveStatus status, unsigned int dep, const osgDB::Options* options) const; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/Core/OCMain/json/version.h: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT. This file (and "version") is generated by CMake. 2 | // Run CMake configure step to update it. 3 | #ifndef JSON_VERSION_H_INCLUDED 4 | # define JSON_VERSION_H_INCLUDED 5 | 6 | # define JSONCPP_VERSION_STRING "0.10.7" 7 | # define JSONCPP_VERSION_MAJOR 0 8 | # define JSONCPP_VERSION_MINOR 10 9 | # define JSONCPP_VERSION_PATCH 7 10 | # define JSONCPP_VERSION_QUALIFIER 11 | # define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8)) 12 | 13 | #endif // JSON_VERSION_H_INCLUDED 14 | -------------------------------------------------------------------------------- /src/Core/OCZip/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS=-O -I../.. 3 | 4 | UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a 5 | ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a 6 | 7 | .c.o: 8 | $(CC) -c $(CFLAGS) $*.c 9 | 10 | all: miniunz minizip 11 | 12 | miniunz: $(UNZ_OBJS) 13 | $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) 14 | 15 | minizip: $(ZIP_OBJS) 16 | $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) 17 | 18 | test: miniunz minizip 19 | ./minizip test readme.txt 20 | ./miniunz -l test.zip 21 | mv readme.txt readme.old 22 | ./miniunz test.zip 23 | 24 | clean: 25 | /bin/rm -f *.o *~ minizip miniunz 26 | -------------------------------------------------------------------------------- /src/Core/OCNetCDF/NcepWind.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_NcepWind_H__ 2 | #define _OC_NcepWind_H__ 3 | 4 | #include "OCVolume/VolumeObject.h" 5 | 6 | namespace OC 7 | { 8 | class NcepWind : public Volume::CVolumeObject 9 | { 10 | public: 11 | NcepWind(); 12 | ~NcepWind(); 13 | virtual bool convert(String filename); 14 | 15 | bool flipX = false; 16 | float interval = 0.0; 17 | String nameU; 18 | String nameV; 19 | String levelX; 20 | String levelY; 21 | String levelZ; 22 | private: 23 | void readGrib(String filename); 24 | }; 25 | } 26 | 27 | #endif // !_OC_NcepWind_H__ 28 | -------------------------------------------------------------------------------- /src/Core/OCesium/CmptWriter.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_CMPT_WRITER_H 2 | #define _OC_CMPT_WRITER_H 3 | 4 | #include "CesiumDefine.h" 5 | #include "FeatureBatchTable.h" 6 | #include "BaseWriter.h" 7 | 8 | namespace OC 9 | { 10 | namespace Cesium 11 | { 12 | class _CesiumExport CmptWriter : public osg::Referenced 13 | { 14 | public: 15 | CmptWriter(); 16 | ~CmptWriter(); 17 | 18 | void push(BaseWriter* object); 19 | void writeCmpt(String filename); 20 | uint32 getLength(); 21 | private: 22 | std::vector > mTiles; 23 | }; 24 | } 25 | } 26 | 27 | #endif -------------------------------------------------------------------------------- /src/Linux/OCVolumeConverter/fetcher.h: -------------------------------------------------------------------------------- 1 | #ifndef _FETCHER_H__ 2 | #define _FETCHER_H__ 3 | 4 | #include "TaskWorkQueue.h" 5 | 6 | using namespace OC; 7 | 8 | class CFetcher : public osg::Referenced 9 | { 10 | public: 11 | CFetcher(String dir); 12 | ~CFetcher(); 13 | void start(); 14 | void stop(); 15 | private: 16 | void clear(); 17 | bool mRunning; 18 | long monitor_tick; 19 | float mInterval; 20 | String mMonitorDir; 21 | String mMonitorDay; 22 | CORE_STATIC_MUTEX(mutex) 23 | static time_t mStaticLastClearTick; 24 | }; 25 | 26 | 27 | 28 | #endif // !_FETCHER_H__ 29 | -------------------------------------------------------------------------------- /src/Core/OCLayer/BaseNodeMask.h: -------------------------------------------------------------------------------- 1 | #ifndef _CORE_NODE_MASK_H__ 2 | #define _CORE_NODE_MASK_H__ 3 | 4 | 5 | #define SkyBoxNodeMask 1 6 | #define SceneNodeMask 1<<1 7 | #define FeatureNodeMask 1<<2 8 | #define VectorNodeMask 1<<3 9 | #define LabelNodeMask 1<<4 10 | #define PipeFeatureNodeMask 1<<5 11 | #define ReceivesShadowTraversalMask 1<<6 12 | #define CastsShadowTraversalMask 1<<7 13 | #define TerrainNodeMask 1<<8 14 | #define DraggerIntersectMask 1<<9 15 | #define UIMask 1<<10 16 | #define PassMask 1<<11 17 | 18 | #endif // _CORE_NODE_MASK_H__ -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | *.pdb 19 | *.exp 20 | 21 | # Fortran module files 22 | *.mod 23 | *.smod 24 | 25 | # Compiled Static libraries 26 | *.lai 27 | *.la 28 | *.a 29 | *.lib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | 36 | /3rdParty 37 | /3rdParty/ 38 | /lib/ 39 | /bin/temp/ 40 | /bin/resources/ 41 | /bin/translations/ 42 | /bin/platforms/ 43 | /build/ 44 | /Package/ 45 | -------------------------------------------------------------------------------- /src/Plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROJECT(OSG_PLUGINS_MASTER) 2 | 3 | SET(TARGET_DEFAULT_PREFIX "osgdb_") 4 | SET(TARGET_DEFAULT_LABEL_PREFIX "Plugins") 5 | SET(TARGET_COMMON_LIBRARIES 6 | OpenThreads 7 | osg 8 | osgDB 9 | osgUtil 10 | OCZip 11 | OCUtility 12 | OCMain 13 | OCLayer 14 | ) 15 | 16 | INCLUDE_DIRECTORIES(${WORKINGPATH}/src/Core) 17 | 18 | IF(WIN32) 19 | ADD_SUBDIRECTORY(nc) 20 | ADD_SUBDIRECTORY(ifc) 21 | ADD_SUBDIRECTORY(vrl) 22 | ADD_SUBDIRECTORY(shapefile) 23 | ADD_SUBDIRECTORY(functional) 24 | ADD_SUBDIRECTORY(sqlite) 25 | #ADD_SUBDIRECTORY(pipe) 26 | ENDIF(WIN32) 27 | -------------------------------------------------------------------------------- /src/Core/OCesium/GLTFObject.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_GLTF_OBJCET_H_ 2 | #define _OC_GLTF_OBJCET_H_ 3 | 4 | #include "BatchGroup.h" 5 | 6 | namespace OC 7 | { 8 | namespace Cesium 9 | { 10 | class _CesiumExport GLTFObject : public BatchGroup 11 | { 12 | public: 13 | GLTFObject(FeatureBatchTable* featureBatchTable = NULL); 14 | 15 | bool writeToFile(String filename, bool isBinary); 16 | bool writeToStream(std::ostream& output, bool isBinary); 17 | uint32 bytesLength(); 18 | protected: 19 | ~GLTFObject(); 20 | private: 21 | uint32 mBytesLength = 0; 22 | }; 23 | } 24 | } 25 | 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/Linux/OCVolumeConverter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 2 | 3 | SET(LIB_NAME OCVolumeConverter) 4 | 5 | SET(TARGET_H 6 | fetcher.h 7 | watcher.h 8 | WatcherManager.h 9 | TaskWorkQueue.h 10 | Tool.h 11 | ) 12 | 13 | SET(TARGET_SRC 14 | fetcher.cpp 15 | watcher.cpp 16 | WatcherManager.cpp 17 | TaskWorkQueue.cpp 18 | Tool.cpp 19 | main.cpp 20 | ) 21 | 22 | SET(TARGET_COMMON_LIBRARIES 23 | OpenThreads 24 | osg 25 | osgDB 26 | OCVolume 27 | OCUtility 28 | OCMain 29 | ) 30 | 31 | SETUP_APPLICATION(${LIB_NAME}) 32 | -------------------------------------------------------------------------------- /src/Plugins/pipe/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(TARGET_SRC 2 | PipeArchive.cpp 3 | PipeTable.cpp 4 | LineTable.cpp 5 | NodeTable.cpp 6 | PipeLine.cpp 7 | PipeNode.cpp 8 | NodeExInfo.cpp 9 | PipeModelFactory.cpp 10 | ) 11 | 12 | SET(TARGET_H 13 | PipeArchive.h 14 | PipeTable.h 15 | LineTable.h 16 | NodeTable.h 17 | PipeLine.h 18 | PipeNode.h 19 | NodeExInfo.h 20 | PipeModelFactory.h 21 | ) 22 | 23 | SET(TARGET_ADDED_LIBRARIES 24 | osg 25 | osgDB 26 | OCModel 27 | ) 28 | 29 | SET(TARGET_EXTERNAL_LIBRARIES 30 | zlib 31 | ) 32 | 33 | SETUP_PLUGIN(pipe) 34 | -------------------------------------------------------------------------------- /src/Core/OCesium/DracoEncoder.h: -------------------------------------------------------------------------------- 1 | #ifndef _DRACO_ENCODER_H__ 2 | #define _DRACO_ENCODER_H__ 3 | 4 | #include "CesiumDefine.h" 5 | 6 | namespace OC 7 | { 8 | namespace Cesium 9 | { 10 | class DracoEncoder 11 | { 12 | public: 13 | DracoEncoder(); 14 | ~DracoEncoder(); 15 | 16 | bool encode(BatchGeode* batchGeode); 17 | 18 | DracoAttributeMap mAttributeMap; 19 | const char* data(); 20 | size_t size(); 21 | private: 22 | draco::EncoderBuffer* buffer; 23 | }; 24 | } 25 | } 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /src/Core/OCHttpServer/HttpServer.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_HTTP_SERVER_H_ 2 | #define _OC_HTTP_SERVER_H_ 3 | 4 | #include "HttpServerDefine.h" 5 | 6 | namespace OC 7 | { 8 | namespace Server { 9 | class COCServer; 10 | } 11 | class _HttpServerExport HttpServer 12 | { 13 | public: 14 | HttpServer(); 15 | ~HttpServer(); 16 | bool isRunning(); 17 | void quit(); 18 | void init(int port = 8125); 19 | void registerALocation(std::string uriPrefix, std::string path); 20 | 21 | private: 22 | Server::COCServer* mOCServer; 23 | }; 24 | } 25 | 26 | #endif // !1 27 | -------------------------------------------------------------------------------- /src/Core/OCMain/JsonHelper.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_JSONHELPER_H__ 2 | #define _OC_JSONHELPER_H__ 3 | 4 | #include "JsonPackage.h" 5 | #include "Common.h" 6 | 7 | namespace OC 8 | { 9 | class _MainExport JsonHelper 10 | { 11 | public: 12 | JsonHelper(void); 13 | ~JsonHelper(void); 14 | 15 | static std::vector > parseStringPairList(String jsonStr); 16 | static NameValuePairList parseNameValuePairList(String jsonStr); 17 | static StringMap parseStyleString(String styleStr); 18 | static osg::MixinVector parseGeometryJson(String jsonStr); 19 | }; 20 | 21 | } 22 | 23 | 24 | #endif 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/Plugins/ifc/IFCArchive.cpp: -------------------------------------------------------------------------------- 1 | #include "IFCArchive.h" 2 | #include "IFCConverter.h" 3 | 4 | IFCArchive::IFCArchive(void) 5 | { 6 | supportsExtension("ifc","OC ifc data format"); 7 | } 8 | 9 | 10 | IFCArchive::~IFCArchive(void) 11 | { 12 | } 13 | 14 | osgDB::ReaderWriter::ReadResult IFCArchive::readNode(std::istream& /*fin*/,const Options*) const 15 | { 16 | return nullptr; 17 | } 18 | 19 | osgDB::ReaderWriter::ReadResult IFCArchive::readNode(const String& fileName, const osgDB::ReaderWriter::Options*) const 20 | { 21 | IFCConverter converter; 22 | return converter.read(fileName.c_str()); 23 | } 24 | 25 | REGISTER_OSGPLUGIN(ifc, IFCArchive) 26 | -------------------------------------------------------------------------------- /src/Core/OCModel/ModelDataQueryCallback.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_MODEL_QUERY_H__ 2 | #define _OC_MODEL_QUERY_H__ 3 | 4 | #include "ModelDefine.h" 5 | 6 | namespace OC 7 | { 8 | namespace Modeling 9 | { 10 | class _ModelExport ModelDataQueryCallback : public CQueryCallback 11 | { 12 | public: 13 | enum DataType 14 | { 15 | Type_Line, 16 | Type_Node, 17 | Type_Mold 18 | }; 19 | ModelDataQueryCallback(IModelTable* table,DataType type); 20 | ~ModelDataQueryCallback(); 21 | virtual bool onQuery(TemplateRecord* record); 22 | private: 23 | IModelTable* mTable; 24 | DataType mType; 25 | }; 26 | } 27 | } 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /src/Core/OCMain/Environment.h: -------------------------------------------------------------------------------- 1 | #ifndef __APPLICATION_ENVIRONMENT__H_ 2 | #define __APPLICATION_ENVIRONMENT__H_ 3 | 4 | #include "BaseDefine.h" 5 | 6 | namespace OC 7 | { 8 | class _MainExport Environment 9 | { 10 | public: 11 | Environment(uint32 magic = 0); 12 | ~Environment(void); 13 | 14 | static Environment* getSingletonPtr(); 15 | static Environment& getSingleton(); 16 | 17 | void setAppDir(String dir); 18 | String getAppDir(); 19 | String getLogPath(); 20 | String getTempDir(); 21 | private: 22 | String mApplicationDir; 23 | LogManager* mLogManager; 24 | OCPluginTool* mOCPluginTool; 25 | }; 26 | } 27 | 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/Core/OCNetCDF/NetCDFDefine.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_NETCDF_DEFINE_H_ 2 | #define _OC_NETCDF_DEFINE_H_ 3 | 4 | #if defined(_MSC_VER) 5 | #ifndef OCNetCDF_EXPORTS 6 | #define _NetCDFExport __declspec(dllimport) 7 | #else 8 | #define _NetCDFExport __declspec(dllexport) 9 | #endif 10 | #else 11 | #define _NetCDFExport 12 | #endif 13 | 14 | #include "OCMain/osg.h" 15 | #include "OCUtility/StringUtil.h" 16 | #include "OCUtility/Rectangle.h" 17 | #include "OCUtility/StringConverter.h" 18 | 19 | namespace OC 20 | { 21 | class CNetCDFReader; 22 | 23 | #define NcCheck(e) if(NC_NOERR != e) {printf("Error: %s\n", nc_strerror(e)); return false;} 24 | 25 | } 26 | 27 | #endif // 28 | -------------------------------------------------------------------------------- /src/Core/OCesium/gltfAttributeCallback.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLTF_ATTRIBUTE_CALLBACK_H__ 2 | #define _GLTF_ATTRIBUTE_CALLBACK_H__ 3 | 4 | #include "glTFOptimize.h" 5 | #include "CesiumTool.h" 6 | 7 | namespace OC 8 | { 9 | namespace Cesium 10 | { 11 | class gltfAttributeCallback : public Cesium::FeatureAttributeCallback 12 | { 13 | public: 14 | gltfAttributeCallback(); 15 | ~gltfAttributeCallback(); 16 | 17 | void readFile(String filename); 18 | osg::ref_ptr header; 19 | std::map > mAttributeMap; 20 | virtual void onSetAttirubte(String name, Cesium::FeatureBatchTable* table); 21 | }; 22 | } 23 | } 24 | 25 | #endif -------------------------------------------------------------------------------- /src/Application/OCServerApp/OCServer.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | --port 8082 5 | WindowsLocalDebugger 6 | 7 | 8 | --port 8082 9 | WindowsLocalDebugger 10 | 11 | -------------------------------------------------------------------------------- /src/Plugins/ifc/IFCArchive.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_IFC_ARCHIVE_CLASS_H__ 2 | #define _OC_IFC_ARCHIVE_CLASS_H__ 3 | 4 | #include "OCLayer/IArchive.h" 5 | 6 | using namespace OC; 7 | 8 | class IFCArchive : 9 | public IArchive 10 | { 11 | public: 12 | IFCArchive(void); 13 | ~IFCArchive(void); 14 | virtual const char* libraryName() const { return "OCPlugins IFC"; } 15 | virtual const char* className() const { return "IFCArchive"; } 16 | virtual osgDB::ReaderWriter::ReadResult readNode(std::istream& /*fin*/,const Options* =NULL) const; 17 | virtual osgDB::ReaderWriter::ReadResult readNode(const String& /*fileName*/, const osgDB::ReaderWriter::Options* =NULL) const; 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # osgcesium 2 | 3 | Tool for convert osg model (osgb obj... and etc format) to 3dtiles(b3dm ctmp pnts i3dm) 4 | 5 | key word: 6 | draco 7 | ktx2 8 | webp 9 | 10 | 11 | Main Code in 12 | 13 | src/Core/OCesium 14 | src/Application/OConv 15 | 16 | useage: 17 | 18 | OConv.exe {\"function\":\"obj23dtiles\",\"output\":\"K:/\",\"filename\":\"I:/Dev/Assets/3dtiles/jf/ServerRoom.obj\",\"offset\":\"116.39123 39.90691 0 \",\"localOffset\":false,\"writeGltf\":false,\"AtlasImageSize\":4096,\"MaxTextureSize\":256,\"sectionSize\":0,\"enableDracoCompress\":true,\"disableLight\":true,\"enableWebpCompress\":false,\"mergeRepeatTexture\":true,\"quantizationbits\":16,\"forceDoubleSide\":false} 19 | -------------------------------------------------------------------------------- /src/Core/OCNetCDF/NcUV.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_VOLUME_UV_H_ 2 | #define _OC_VOLUME_UV_H_ 3 | 4 | #include "OCUtility/Vector3i.h" 5 | #include "NcVolume.h" 6 | 7 | namespace OC 8 | { 9 | namespace Volume 10 | { 11 | class NcUV : public NcVolume 12 | { 13 | public: 14 | NcUV(); 15 | ~NcUV(); 16 | String nameU; 17 | String nameV; 18 | String levelX; 19 | String levelY; 20 | String levelZ; 21 | bool flipX = false; 22 | float interval = 0.0; 23 | inline CVector3i getVarDim(String name); 24 | inline bool isValid(); 25 | inline int getLevel(); 26 | virtual bool convert(std::string filename); 27 | int _ncid; 28 | }; 29 | } 30 | } 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /src/Core/OCVolume/CinRad.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_CinRad_H__ 2 | #define _OC_CinRad_H__ 3 | 4 | #include "VolumeObject.h" 5 | #include "CinRadHeader.h" 6 | 7 | namespace OC 8 | { 9 | namespace Volume 10 | { 11 | class CinRad : public CVolumeObject 12 | { 13 | public: 14 | CinRad() {} 15 | virtual ~CinRad() {} 16 | virtual osg::Image* generateVolumeImage(); 17 | 18 | protected: 19 | typedef std::vector > ImageList; 20 | int mRadius; 21 | float mUnit; 22 | ImageList mImageList; 23 | ImageList mFloatImageList; 24 | std::vector mPitchList; 25 | }; 26 | } 27 | } 28 | 29 | #endif // !_OC_CinRad_H__ 30 | 31 | -------------------------------------------------------------------------------- /src/Core/OCNetCDF/NetCDFReader.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_NETCDFREADER_H_ 2 | #define _OC_NETCDFREADER_H_ 3 | 4 | #include "NetCDFDefine.h" 5 | #include "OCVolume/VolumeObject.h" 6 | 7 | namespace OC 8 | { 9 | class _NetCDFExport CNetCDFReader 10 | { 11 | public: 12 | CNetCDFReader(); 13 | ~CNetCDFReader(); 14 | 15 | osg::Image* readNpy(String filename, String var); 16 | osg::Image* readAWX(String filename, String var); 17 | osg::Image* readGRB2(String filename, String var); 18 | osg::Image* readNC(String filename, String var); 19 | osg::Image* readSW(String filename, String var); 20 | Volume::CVolumeObject* readVolume(String filename, String var); 21 | }; 22 | } 23 | 24 | 25 | #endif // !1 26 | 27 | -------------------------------------------------------------------------------- /src/Core/OCHttpClient/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 2 | INCLUDE_DIRECTORIES(${WORKINGPATH}/3rdParty/include) 3 | 4 | SET(LIB_NAME OCHttpClient) 5 | 6 | SET(TARGET_H 7 | HttpClientDefine.h 8 | HttpClient.h 9 | HTTPRequest.h 10 | HTTPResponse.h 11 | ) 12 | 13 | SET(TARGET_SRC 14 | src/HttpClient.cpp 15 | src/HTTPRequest.cpp 16 | src/HTTPResponse.cpp 17 | ) 18 | 19 | SET(TARGET_LIBRARIES 20 | OpenThreads 21 | osg 22 | osgDB 23 | osgEarth 24 | OCUtility 25 | OCMain 26 | OCServer 27 | ) 28 | 29 | SET(TARGET_EXTERNAL_LIBRARIES 30 | curl 31 | ) 32 | 33 | SETUP_LIBRARY(${LIB_NAME}) 34 | ADD_DEPENDENCIES(OCHttpServer ${LIB_NAME}) 35 | -------------------------------------------------------------------------------- /src/Core/OCMain/BaseEnum.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_ENUM_H__ 2 | #define _OC_ENUM_H__ 3 | 4 | enum ArchiveDataFrom 5 | { 6 | DATA_FROM_DB, 7 | DATA_FROM_NET, 8 | DATA_FROM_REFPATH, 9 | DATA_FROM_RAW_DATABASE 10 | }; 11 | 12 | enum RegionEventState 13 | { 14 | STANDBY, 15 | INVOKED 16 | }; 17 | 18 | enum MovableFinishState 19 | { 20 | Stay_Feature_Position, 21 | Stay_Start_Point, 22 | Stay_End_Point, 23 | Wait_For_Next_Point, 24 | Disappear 25 | }; 26 | 27 | enum EffectState 28 | { 29 | STATE_EMPTY, 30 | STATE_HIGHLIGHT, 31 | STATE_TEXTURE_MOVE, 32 | STATE_SCALE_ANIMATION, 33 | STATE_TRANSPARENT 34 | }; 35 | 36 | enum FetureMode 37 | { 38 | NormalFeature, 39 | RoleFeature, 40 | EffectFeature 41 | }; 42 | 43 | #endif -------------------------------------------------------------------------------- /src/Core/OCServer/OCServerDefine.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_SERVER__DEFINE_H_ 2 | #define _OC_SERVER__DEFINE_H_ 3 | 4 | #if defined(_MSC_VER) 5 | #ifndef OCServer_EXPORTS 6 | #define _OCServerExport __declspec(dllimport) 7 | #else 8 | #define _OCServerExport __declspec(dllexport) 9 | #endif 10 | #else 11 | #define _OCServerExport 12 | #endif 13 | 14 | #include "OCMain/Environment.h" 15 | #include "OCMain/ConfigManager.h" 16 | 17 | namespace OC 18 | { 19 | namespace Server 20 | { 21 | class COCServer; 22 | class OCRegister; 23 | 24 | #define ConfigNameDataDir "data_dir" 25 | #define ConfigNameCacheDir "cache_dir" 26 | #define _getServerDir(name) Singleton(ConfigManager).getStringValue(name) 27 | 28 | } 29 | } 30 | 31 | #endif -------------------------------------------------------------------------------- /src/Core/OCMain/src/OCPluginTool.cpp: -------------------------------------------------------------------------------- 1 | #include "OCPluginTool.h" 2 | 3 | namespace OC 4 | { 5 | #if SingletonConfig == SingletonNormal 6 | template<>OCPluginTool* CSingleton::msSingleton = NULL; 7 | #elif SingletonConfig == SingletonProcess 8 | template<>std::map CSingleton::msPidton; 9 | #endif 10 | 11 | OCPluginTool::OCPluginTool() 12 | { 13 | mFunctionalArchive = static_cast(osgDB::Registry::instance()->openArchive(".func", osgDB::ReaderWriter::READ, 0, NULL).takeArchive()); 14 | } 15 | 16 | OCPluginTool::~OCPluginTool() 17 | { 18 | 19 | } 20 | 21 | FunctionalArchive* OCPluginTool::getFunctional() 22 | { 23 | return mFunctionalArchive.get(); 24 | } 25 | } -------------------------------------------------------------------------------- /src/Core/OCLayer/IRecord.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_IRECORD_H__ 2 | #define _OC_IRECORD_H__ 3 | 4 | #include "LayerDefine.h" 5 | 6 | namespace OC 7 | { 8 | class _LayerExport IRecord : public osg::Referenced 9 | { 10 | public: 11 | IRecord(); 12 | ~IRecord(); 13 | 14 | virtual long getID(); 15 | virtual void setID(long id); 16 | 17 | virtual String getFeatureName(); 18 | virtual void setFeatureName(String name); 19 | 20 | virtual IFeature* getOwnerFeature(); 21 | virtual void setOwnerFeature(IFeature* feature); 22 | 23 | virtual void update(); 24 | 25 | void dirty(bool _dirty = true); 26 | 27 | protected: 28 | long mID; 29 | bool mDirty; 30 | String mFeatureName; 31 | IFeature* mOwner; 32 | }; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/Core/OCZip/src/BZip2.cpp: -------------------------------------------------------------------------------- 1 | #include "BZip2.h" 2 | #include "./bz2/bzlib.h" 3 | 4 | namespace OC 5 | { 6 | size_t BZip2::openBZ2(std::string filename, std::ostream& os) 7 | { 8 | size_t size = 0; 9 | BZFILE* bzfile = BZ2_bzopen(filename.c_str(), "r"); 10 | if (bzfile) 11 | { 12 | #define BUFF_SIZE 10240 13 | char buffer[BUFF_SIZE]; 14 | int read = BZ2_bzread(bzfile, buffer, BUFF_SIZE); 15 | while (read > 0) 16 | { 17 | size += read; 18 | os.write(buffer, read); 19 | read = BZ2_bzread(bzfile, buffer, BUFF_SIZE); 20 | } 21 | BZ2_bzclose(bzfile); 22 | } 23 | return size; 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /src/Application/OCServerApp/main.cpp: -------------------------------------------------------------------------------- 1 | // OCServer.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 2 | // 3 | 4 | #include "OCMain/ConfigManager.h" 5 | #include "OCHttpServer/HttpServer.h" 6 | 7 | using namespace OC; 8 | 9 | HttpServer* server = NULL; 10 | 11 | BOOL WINAPI HandlerRoutine(DWORD dwCtrlType) { 12 | 13 | if (CTRL_CLOSE_EVENT == dwCtrlType) { 14 | CORE_SAFE_DELETE(server); 15 | } 16 | 17 | return TRUE; 18 | } 19 | 20 | int main(int argc, char** argv) 21 | { 22 | SetConsoleCtrlHandler(HandlerRoutine,true); 23 | osg::ArgumentParser arguments(&argc, argv); 24 | int port = 8125; 25 | while (arguments.read("--port", port)) {} 26 | server = new HttpServer; 27 | server->init(port); 28 | return 0; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /src/Plugins/sqlite/SqliteDatabase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "OCLayer/IDatabase.h" 4 | #include "SQLite.h" 5 | 6 | namespace OC 7 | { 8 | class SqliteDatabase:public IDatabase 9 | { 10 | public: 11 | SqliteDatabase(); 12 | ~SqliteDatabase(); 13 | virtual bool create(String url,String user = StringUtil::BLANK,String psw = StringUtil::BLANK); 14 | virtual bool connect(String url); 15 | virtual bool createTable(String name, OCHeaderInfo* headinfo); 16 | virtual bool existTable(String name); 17 | virtual TemplateRecordList query(String table, OCHeaderInfo* headinfo, CQueryInfo* filter = NULL); 18 | virtual bool insert(String table, TemplateRecord* record); 19 | private: 20 | SQLite mSqlite; 21 | bool mIsSpatialite = false; 22 | }; 23 | } -------------------------------------------------------------------------------- /src/Application/OCServerApp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 2 | INCLUDE_DIRECTORIES(${WORKINGPATH}/OsgCesium/Core) 3 | INCLUDE_DIRECTORIES(${WORKINGPATH}/OsgCesium/Core/OCThread) 4 | INCLUDE_DIRECTORIES(${WORKINGPATH}/3rdParty/x64/include) 5 | INCLUDE_DIRECTORIES(${WORKINGPATH}/OpenSceneGraph/include) 6 | INCLUDE_DIRECTORIES(${WORKINGPATH}/OSGEarth/src) 7 | 8 | SET(LIB_NAME OCServerApp) 9 | 10 | SET(TARGET_H 11 | 12 | ) 13 | 14 | SET(TARGET_SRC 15 | OCServer.rc 16 | main.cpp 17 | ) 18 | 19 | SET(TARGET_COMMON_LIBRARIES 20 | OpenThreads 21 | osg 22 | osgDB 23 | osgEarth 24 | OCUtility 25 | OCHttpServer 26 | ) 27 | 28 | SET(TARGET_EXTERNAL_LIBRARIES 29 | zlib 30 | ) 31 | 32 | SETUP_APPLICATION(${LIB_NAME}) 33 | -------------------------------------------------------------------------------- /src/Plugins/pipe/PipeArchive.cpp: -------------------------------------------------------------------------------- 1 | #include "PipeArchive.h" 2 | #include "PipeTable.h" 3 | 4 | PipeArchive::PipeArchive(void) 5 | { 6 | supportsExtension("pipe", "OC pipe modeling"); 7 | } 8 | 9 | PipeArchive::~PipeArchive(void) 10 | { 11 | 12 | } 13 | 14 | IModelTable* PipeArchive::getModelTable(ModelDataManager* owner) 15 | { 16 | return new PipeTable(owner); 17 | } 18 | 19 | osgDB::ReaderWriter::ReadResult PipeArchive::openArchive(const String& fileName, osgDB::ReaderWriter::ArchiveStatus status, unsigned int dep, const osgDB::Options* options) const 20 | { 21 | String ext = osgDB::getLowerCaseFileExtension(fileName); 22 | if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED; 23 | return new PipeArchive; 24 | } 25 | 26 | REGISTER_OSGPLUGIN(func, PipeArchive) 27 | -------------------------------------------------------------------------------- /src/Plugins/sqlite/SqliteArchive.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "OCLayer/IArchive.h" 4 | 5 | namespace OC 6 | { 7 | class SqliteArchive : public IArchive 8 | { 9 | public: 10 | SqliteArchive(); 11 | ~SqliteArchive(); 12 | virtual const char* libraryName() const { return "OCPlugins Sqlite"; } 13 | virtual const char* className() const { return "OC::SqliteArchive"; } 14 | virtual bool open(String filename,ArchiveStatus status,const osgDB::ReaderWriter::Options* options); 15 | virtual osgDB::ReaderWriter::ReadResult openArchive(const String& /*fileName*/,ArchiveStatus, unsigned int =4096, const osgDB::Options* =NULL) const; 16 | virtual osgDB::ReaderWriter::ReadResult readNode(const String& /*fileName*/, const osgDB::ReaderWriter::Options* = NULL) const; 17 | }; 18 | } -------------------------------------------------------------------------------- /src/Core/OCServer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 2 | INCLUDE_DIRECTORIES(${WORKINGPATH}/OpenSceneGraph/include) 3 | INCLUDE_DIRECTORIES(${WORKINGPATH}/OSGEarth/src) 4 | 5 | SET(LIB_NAME OCServer) 6 | 7 | SET(TARGET_H 8 | invokeCommand.h 9 | OCRegister.h 10 | OCServer.h 11 | OCServerDefine.h 12 | VolumeManager.h 13 | 14 | ) 15 | 16 | SET(TARGET_SRC 17 | src/invokeCommand.cpp 18 | src/OCRegister.cpp 19 | src/OCServer.cpp 20 | src/VolumeManager.cpp 21 | ) 22 | 23 | SET(TARGET_LIBRARIES 24 | OpenThreads 25 | osg 26 | osgDB 27 | osgEarth 28 | OCUtility 29 | OCLayer 30 | OCMain 31 | OCVolume 32 | ) 33 | 34 | ADD_DEPENDENCIES(OCHttpServer ${LIB_NAME}) 35 | 36 | SETUP_LIBRARY(${LIB_NAME}) 37 | -------------------------------------------------------------------------------- /src/Core/OCesium/src/image.cc: -------------------------------------------------------------------------------- 1 | // -*- tab-width: 4; -*- 2 | // vi: set sw=2 ts=4 expandtab: 3 | 4 | // Copyright 2010-2020 The Khronos Group Inc. 5 | // SPDX-License-Identifier: Apache-2.0 6 | 7 | //! 8 | //! @internal 9 | //! @~English 10 | //! @file image.cc 11 | //! 12 | //! @brief Image creation functions 13 | //! 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #include "image.hpp" 20 | 21 | //const std::vector Image::CreateFunctions = { 22 | // CreateFromNPBM, 23 | // CreateFromPNG, 24 | // CreateFromJPG 25 | //}; 26 | 27 | Image* Image::CreateFromFile(const _tstring& name, 28 | bool transformOETF, bool rescaleTo8Bit) { 29 | return nullptr; // Keep compilers happy. 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Core/OCMain/json/autolink.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_AUTOLINK_H_INCLUDED 7 | #define JSON_AUTOLINK_H_INCLUDED 8 | 9 | #include "config.h" 10 | 11 | #ifdef JSON_IN_CPPTL 12 | #include 13 | #endif 14 | 15 | #if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && \ 16 | !defined(JSON_IN_CPPTL) 17 | #define CPPTL_AUTOLINK_NAME "json" 18 | #undef CPPTL_AUTOLINK_DLL 19 | #ifdef JSON_DLL 20 | #define CPPTL_AUTOLINK_DLL 21 | #endif 22 | #include "autolink.h" 23 | #endif 24 | 25 | #endif // JSON_AUTOLINK_H_INCLUDED 26 | -------------------------------------------------------------------------------- /src/Core/OCNetCDF/CINRad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ICinRadReader.h" 4 | 5 | namespace OC 6 | { 7 | class CINRad : public CVolume 8 | { 9 | public: 10 | CINRad(String filename); 11 | ~CINRad(); 12 | 13 | osg::Image* readImage(String filename, String var_name); 14 | osg::Image* readImageForVolume(String filename, String var_name); 15 | void setType(Type type){mType = type;} 16 | private: 17 | ImageList readImageList(String filename, String var_name,bool usefloat = false); 18 | void parseName(String filename); 19 | int mRadarRadius; 20 | float mUnit = 1000.0f; 21 | Type mType; 22 | String mFilename; 23 | DataStreamPtr mDataStream; 24 | std::vector mPitchList; 25 | osg::ref_ptr mVelocityImage; 26 | }; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /src/Linux/OCVolumeConverter/WatcherManager.cpp: -------------------------------------------------------------------------------- 1 | #include "WatcherManager.h" 2 | 3 | WatcherManager::WatcherManager() 4 | { 5 | 6 | } 7 | 8 | WatcherManager::~WatcherManager() 9 | { 10 | 11 | } 12 | 13 | void WatcherManager::add(String path) 14 | { 15 | if(mWatcherMap.find(path) != mWatcherMap.end()) 16 | { 17 | std::cout<<"Already watching:" << path << std::endl; 18 | return; 19 | } 20 | std::cout<<"start watching:" << path << std::endl; 21 | 22 | watcher* wat = mWatcherMap[path] = new watcher; 23 | wat->createTask(path); 24 | } 25 | 26 | void WatcherManager::remove(String path) 27 | { 28 | if(mWatcherMap.find(path) != mWatcherMap.end()) 29 | { 30 | std::cout<<"remove watching:" << path << std::endl; 31 | mWatcherMap.erase(path); 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/Application/Weathertoy/LabWebEngineView.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | class LabWebEngineView : public QWebEngineView 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | LabWebEngineView(QWidget *parent); 13 | ~LabWebEngineView(); 14 | protected: 15 | void dragEnterEvent(QDragEnterEvent* event); 16 | void dropEvent(QDropEvent* event); 17 | 18 | bool event(QEvent* event) override; 19 | virtual void mousePressEvent(QMouseEvent* event); 20 | void mouseMoveEvent(QMouseEvent* event); 21 | void mouseReleaseEvent(QMouseEvent* event); 22 | bool eventFilter(QObject* obj, QEvent* ev); 23 | private: 24 | bool onMove = false; 25 | QPoint last = QPoint(0, 0); 26 | QPointer child_; 27 | }; 28 | -------------------------------------------------------------------------------- /src/Core/OCZip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 2 | INCLUDE_DIRECTORIES(${WORKINGPATH}/3rdParty/include) 3 | 4 | SET(LIB_NAME OCZip) 5 | 6 | SET(TARGET_H 7 | crypt.h 8 | ioapi.h 9 | iostd.h 10 | PakoZip.h 11 | unzip.h 12 | zip.h 13 | ZipDefine.h 14 | BZip2.h 15 | bz2/bzlib.h 16 | bz2/bzlib_private.h 17 | ) 18 | 19 | SET(TARGET_SRC 20 | src/ioapi.cpp 21 | src/iostd.cpp 22 | src/iowin32.c 23 | src/PakoZip.cpp 24 | src/zip.c 25 | src/unzip.c 26 | src/BZip2.cpp 27 | bz2/blocksort.c 28 | bz2/bzlib.c 29 | bz2/compress.c 30 | bz2/crctable.c 31 | bz2/decompress.c 32 | bz2/huffman.c 33 | bz2/randtable.c 34 | ) 35 | 36 | SET(TARGET_EXTERNAL_LIBRARIES 37 | zlib 38 | ) 39 | 40 | SETUP_GROUP() 41 | SETUP_LIBRARY(${LIB_NAME}) 42 | -------------------------------------------------------------------------------- /src/Core/OCZip/mztools.h: -------------------------------------------------------------------------------- 1 | /* 2 | Additional tools for Minizip 3 | Code: Xavier Roche '2004 4 | License: Same as ZLIB (www.gzip.org) 5 | */ 6 | 7 | #ifndef _zip_tools_H 8 | #define _zip_tools_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #ifndef _ZLIB_H 15 | #include "zlib.h" 16 | #endif 17 | 18 | #include "unzip.h" 19 | 20 | /* Repair a ZIP file (missing central directory) 21 | file: file to recover 22 | fileOut: output file after recovery 23 | fileOutTmp: temporary file name used for recovery 24 | */ 25 | extern int ZEXPORT unzRepair(const char* file, 26 | const char* fileOut, 27 | const char* fileOutTmp, 28 | uLong* nRecovered, 29 | uLong* bytesRecovered); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/Core/OCModel/ModelUtility.h: -------------------------------------------------------------------------------- 1 | #ifndef _MODEL_UTILITY_H_ 2 | #define _MODEL_UTILITY_H_ 3 | 4 | #include "PipeMath.h" 5 | 6 | namespace OC 7 | { 8 | namespace Modeling 9 | { 10 | class _ModelExport ModelUtility 11 | { 12 | public: 13 | ModelUtility(void); 14 | ~ModelUtility(void); 15 | static String fixshelftable(String table); 16 | static void getMinMaxSection(LinePtrList linkLines,PipeSection& minSect,PipeSection& maxSect); 17 | static Vector3List parseSpatialField(String geomStr); 18 | static Vector3List parseGeom(uchar* ptr); 19 | static PipeSection parseSect(String sectStr); 20 | static void setTexture(osg::Node* node,String texture,bool tInternal = false); 21 | static osg::StateSet* createTextureStateset(String imageurl,bool readimage); 22 | }; 23 | } 24 | } 25 | 26 | 27 | #endif 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/Core/OCNetCDF/ICinRadReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Volume.h" 4 | #include "CinRadHeader.h" 5 | 6 | namespace OC 7 | { 8 | typedef std::vector > ImageList; 9 | class ICinRadReader 10 | { 11 | public: 12 | ICinRadReader(Type type) 13 | :_type(type) 14 | { 15 | if (_type == CA) 16 | { 17 | _radius = 800; 18 | _radiusDoupplerV = 1600; 19 | } 20 | } 21 | virtual ~ICinRadReader() {} 22 | virtual void read(DataStreamPtr dataStream) {} 23 | virtual ImageList generateImage(float clampMin, float clampMax,bool autoResize = true) = 0; 24 | int t() { return 2 * _radius; } 25 | int s() { return 2 * _radius; } 26 | 27 | int _radius = 460; 28 | int _radiusDoupplerV = 920; 29 | Type _type; 30 | ImageList mFloatImageList; 31 | std::vector pitchList; 32 | }; 33 | } -------------------------------------------------------------------------------- /src/Core/OCNetCDF/NcVolume.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_NetCDF_Volume_H__ 2 | #define _OC_NetCDF_Volume_H__ 3 | 4 | #include "NetCDFDefine.h" 5 | #include 6 | #include "OCMain/ConfigManager.h" 7 | #include "OCMain/DataStream.h" 8 | #include "OCUtility/RGBAEncoder.h" 9 | #include "OCVolume/VolumeObject.h" 10 | 11 | namespace OC 12 | { 13 | namespace Volume 14 | { 15 | class NcVolume : public CVolumeObject 16 | { 17 | public: 18 | NcVolume(); 19 | virtual ~NcVolume(); 20 | 21 | 22 | long mDimX = 0; 23 | long mDimY = 0; 24 | long mDimZ = 0; 25 | long mDimension = 3; 26 | 27 | std::vector elvValues; 28 | std::vector var1Values; 29 | std::vector var2Values; 30 | std::vector lonValues; 31 | std::vector latValues; 32 | std::vector heiValues; 33 | }; 34 | } 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/Core/OCLayer/IFeature.h: -------------------------------------------------------------------------------- 1 | #ifndef _IFEATURE_CLASS_ 2 | #define _IFEATURE_CLASS_ 3 | 4 | #include "OCMain/osg.h" 5 | #include "IRecord.h" 6 | 7 | namespace OC 8 | { 9 | class _LayerExport IFeature 10 | { 11 | public: 12 | static String LabelFeatureType; 13 | static String ModelFeatureType; 14 | public: 15 | IFeature(void); 16 | virtual ~IFeature(void); 17 | 18 | virtual void setFeatureName(String name); 19 | virtual String getFeatureName(); 20 | 21 | virtual void setID(long id); 22 | virtual long getID(); 23 | 24 | virtual ILayer* getParent(); 25 | virtual void setParent(ILayer* layer); 26 | 27 | void setRecord(IRecord* record); 28 | IRecord* getRecrod(); 29 | 30 | String getType(); 31 | 32 | protected: 33 | String mFeatureType; 34 | ILayer* mParent; 35 | osg::ref_ptr mRecord; 36 | }; 37 | } 38 | 39 | #endif -------------------------------------------------------------------------------- /src/Core/OCModel/TilesetSaveStrategy.h: -------------------------------------------------------------------------------- 1 | #include "SaveStrategy.h" 2 | #include "OCesium/B3dmWriter.h" 3 | #include "OCesium/TDTiles.h" 4 | 5 | namespace OC 6 | { 7 | namespace Modeling 8 | { 9 | class _ModelExport TilesetSaveStrategy :public SaveStrategy 10 | { 11 | public: 12 | TilesetSaveStrategy(); 13 | ~TilesetSaveStrategy(); 14 | virtual bool init(); 15 | virtual bool writeFeature(FeatureRecord* record); 16 | 17 | protected: 18 | typedef std::map > GlobalTiles; 19 | void writeTileset(); 20 | GlobalTiles findGlobal(IGroupModelData* groupMD); 21 | private: 22 | osg::BoundingBox mRootBoundBox; 23 | osg::ref_ptr mRootTileset; 24 | std::map > mTiltWriterMap; 25 | }; 26 | } 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/Core/OCLayer/src/ScenePass.cpp: -------------------------------------------------------------------------------- 1 | #include "ScenePass.h" 2 | 3 | namespace OC 4 | { 5 | CScenePassCamera::CScenePassCamera(void) 6 | :mGroup(NULL) 7 | { 8 | 9 | } 10 | 11 | void CScenePassCamera::setCullNode(osg::Group* g) 12 | { 13 | mGroup = g; 14 | } 15 | 16 | CScenePassCamera::~CScenePassCamera(void) 17 | { 18 | 19 | } 20 | 21 | void CScenePassCamera::cull(osgUtil::CullVisitor& cv) 22 | { 23 | mGroup->osg::Group::traverse(cv); 24 | } 25 | 26 | void CScenePassCamera::traverse(osg::NodeVisitor& nv) 27 | { 28 | if (mGroup/* && nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR*/) 29 | { 30 | mGroup->osg::Group::traverse(nv); 31 | } 32 | else 33 | { 34 | osg::Camera::traverse(nv); 35 | } 36 | } 37 | 38 | CScenePass::CScenePass(void) 39 | { 40 | } 41 | 42 | 43 | CScenePass::~CScenePass(void) 44 | { 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /src/Core/OCesium/BaseWriter.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_Base_Writer_H 2 | #define _OC_Base_Writer_H 3 | 4 | #include "CesiumDefine.h" 5 | 6 | namespace OC 7 | { 8 | namespace Cesium 9 | { 10 | class _CesiumExport BaseWriter : public osg::Object 11 | { 12 | public: 13 | BaseWriter() {} 14 | virtual ~BaseWriter() {}; 15 | 16 | BaseWriter(const BaseWriter& eh, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) {} 17 | META_Object(OCesium, BaseWriter); 18 | 19 | virtual bool writeToFile(String filename) { return false; } 20 | virtual bool writeToStream(std::ostream& output) { return false; } 21 | virtual uint32 bytesLength(){return mBytesLength;} 22 | 23 | protected: 24 | uint32 mBytesLength = 0; 25 | }; 26 | }} 27 | 28 | 29 | #endif -------------------------------------------------------------------------------- /src/Plugins/shapefile/ShapeFileArchive.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "OCLayer/IArchive.h" 4 | 5 | namespace OC 6 | { 7 | namespace Modeling 8 | { 9 | class ShapeFileArchive:public IArchive 10 | { 11 | public: 12 | ShapeFileArchive(); 13 | ~ShapeFileArchive(); 14 | virtual const char* libraryName() const { return "OCPlugins ShapeFile"; } 15 | virtual const char* className() const { return "Shapefile"; } 16 | virtual bool acceptsExtension(const String& extension) const { return osgDB::ReaderWriter::acceptsExtension(extension); } 17 | virtual bool open(String filename,ArchiveStatus status,const osgDB::ReaderWriter::Options* options); 18 | virtual osgDB::ReaderWriter::ReadResult openArchive(const String& /*fileName*/,ArchiveStatus, unsigned int =4096, const osgDB::Options* =NULL) const; 19 | virtual bool writeFeature(FeatureRecord* record); 20 | }; 21 | } 22 | } -------------------------------------------------------------------------------- /src/Core/OCMain/BaseEvents.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_CORE_EVENTS_H__ 2 | #define _OC_CORE_EVENTS_H__ 3 | 4 | #include "OCommon/osg_headers.h" 5 | #include "BaseDefine.h" 6 | 7 | namespace OC 8 | { 9 | class CSceneChangeListener : public osg::Referenced 10 | { 11 | public: 12 | CSceneChangeListener(){} 13 | virtual ~CSceneChangeListener(){} 14 | virtual void onSceneChange(String scene) = 0; 15 | }; 16 | 17 | class CTerrainBlenderListener : public osg::Referenced 18 | { 19 | public: 20 | CTerrainBlenderListener(){} 21 | virtual ~CTerrainBlenderListener(){} 22 | virtual void onValueChange(double value) = 0; 23 | }; 24 | 25 | class SceneInfoBarListener : public osg::Referenced 26 | { 27 | public: 28 | SceneInfoBarListener(){} 29 | virtual ~SceneInfoBarListener(){} 30 | virtual void OnMove(){} 31 | virtual void OnThroughGround(bool underground){} 32 | }; 33 | } 34 | 35 | 36 | 37 | #endif -------------------------------------------------------------------------------- /src/Core/OCVolume/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 2 | INCLUDE_DIRECTORIES(${WORKINGPATH}/3rdParty/include) 3 | 4 | SET(LIB_NAME OCVolume) 5 | 6 | SET(TARGET_H 7 | VolumeDefine.h 8 | VolumeObject.h 9 | CinRadHeader.h 10 | CinRadReader.h 11 | CinRadReaderFMT.h 12 | Volume.h 13 | Swan.h 14 | Vtk.h 15 | CinRadC.h 16 | CinRad.h 17 | FyAwx.h 18 | ) 19 | 20 | SET(TARGET_SRC 21 | src/VolumeObject.cpp 22 | src/CinRadReader.cpp 23 | src/CinRadReaderFMT.cpp 24 | src/Swan.cpp 25 | src/Volume.cpp 26 | src/Vtk.cpp 27 | src/CinRadC.cpp 28 | src/CinRad.cpp 29 | src/FyAwx.cpp 30 | ) 31 | 32 | SET(TARGET_LIBRARIES 33 | OpenThreads 34 | osg 35 | osgDB 36 | OCZip 37 | OCMain 38 | OCUtility 39 | ) 40 | 41 | SET(TARGET_EXTERNAL_LIBRARIES 42 | zlib 43 | ) 44 | 45 | SETUP_LIBRARY(${LIB_NAME}) 46 | -------------------------------------------------------------------------------- /src/Core/OCModel/PipeGeomLibrary.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "OCMain/Singleton.h" 3 | #include "ISection.h" 4 | #include "PipeData.h" 5 | 6 | namespace OC 7 | { 8 | namespace Modeling 9 | { 10 | class _ModelExport PipeGeomLibrary : public CSingleton 11 | { 12 | public: 13 | PipeGeomLibrary(); 14 | ~PipeGeomLibrary(); 15 | 16 | osg::Node* createInstance(CCirclePipeLine* pipeline); 17 | osg::Node* createInstance(CRectPipeLine* pipeline); 18 | private: 19 | osg::Geode* createUnitCirclePipe(); 20 | osg::Geode* createUnitRectPipe(bool close); 21 | osg::ref_ptr mCirclePipe; 22 | osg::ref_ptr mRectPipe; 23 | osg::ref_ptr mRectPipeClose; 24 | osg::ref_ptr mPipeInstanceProgram; 25 | osg::ref_ptr mNormaizeState; 26 | RefObjectCacher mInstanceTextures; 27 | }; 28 | } 29 | } -------------------------------------------------------------------------------- /src/Core/OCLayer/src/QueryInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "QueryInfo.h" 2 | 3 | namespace OC 4 | { 5 | String CQueryInfo::NameTileID = "TileID"; 6 | String CQueryInfo::NameClause = "Clause"; 7 | String CQueryInfo::NameRectangle = "Rectangle"; 8 | String CQueryInfo::NameLayerName = "LayerName"; 9 | String CQueryInfo::NamePaperRange = "PaperRange"; 10 | String CQueryInfo::NameCreateTileRecord = "CreateTileRecord"; 11 | String CQueryInfo::NameQueryModelData = "QueryModelData"; 12 | 13 | CQueryInfo::CQueryInfo(void) 14 | { 15 | } 16 | 17 | CQueryInfo::CQueryInfo(const CQueryInfo& info,const osg::CopyOp& copyop) 18 | :CCoreConfig(info) 19 | { 20 | } 21 | 22 | CQueryInfo::~CQueryInfo(void) 23 | { 24 | } 25 | 26 | void CQueryInfo::setCallback(CQueryCallback* query) 27 | { 28 | mCallback = query; 29 | } 30 | 31 | CQueryCallback* CQueryInfo::getCallback() 32 | { 33 | return mCallback.get(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/Core/OCesium/B3dmWriter.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_B3DM_WRITER_H__ 2 | #define _OC_B3DM_WRITER_H__ 3 | 4 | #include "CesiumDefine.h" 5 | #include "FeatureBatchTable.h" 6 | #include "GLTFObject.h" 7 | #include "BaseWriter.h" 8 | 9 | namespace OC 10 | { 11 | namespace Cesium 12 | { 13 | class _CesiumExport B3dmWriter : public BaseWriter 14 | { 15 | public: 16 | B3dmWriter(); 17 | ~B3dmWriter(); 18 | 19 | virtual bool writeToFile(String filename); 20 | virtual bool writeToStream(std::ostream& output); 21 | virtual uint32 bytesLength(); 22 | 23 | GLTFObject* getGltfObject(); 24 | void copyAttributes(B3dmWriter* rhs); 25 | FeatureBatchTable* getFeatureBatchTable(); 26 | 27 | std::vector > splitByCapcity(); 28 | private: 29 | osg::ref_ptr mGltfObject; 30 | osg::ref_ptr mFeatureBatchTable; 31 | }; 32 | } 33 | } 34 | 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /src/Core/OCesium/gltfConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLTF_CONFIG_DEFINE_H__ 2 | #define _GLTF_CONFIG_DEFINE_H__ 3 | 4 | #include "CesiumDefine.h" 5 | 6 | namespace OC 7 | { 8 | namespace Cesium 9 | { 10 | class _CesiumExport gltfConfig 11 | { 12 | public: 13 | static int sectionSize; 14 | static int quantizationbits; 15 | static int AtlasImageSize; 16 | static int MaxTextureSize; 17 | static int TextrueCoordError; 18 | static bool GeodePerId; 19 | static bool writeGltf; 20 | static bool prettyPrint; 21 | static bool mergeClampTexture; 22 | static bool mergeRepeatTexture; 23 | static bool disableLight; 24 | static bool enableWebpCompress; 25 | static bool enableKtxCompress; 26 | static bool enableDracoCompress; 27 | static bool forceDoubleSide; 28 | static float geometryErroRatio; 29 | static float metallicFactor; 30 | static float roughnessFactor; 31 | }; 32 | } 33 | } 34 | 35 | #endif // ! 36 | -------------------------------------------------------------------------------- /src/Core/OCLayer/Feature.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_FEATURE_H__ 2 | #define _OC_FEATURE_H__ 3 | 4 | #include "IFeature.h" 5 | #include "FeatureNode.h" 6 | 7 | namespace OC 8 | { 9 | class _LayerExport CFeature : public IFeature 10 | { 11 | public: 12 | static String ClassGUID; 13 | 14 | CFeature(); 15 | ~CFeature(); 16 | 17 | bool load(); 18 | 19 | virtual void loadImpl(void); 20 | virtual void unloadImpl(void){} 21 | 22 | virtual void preUnloadImpl(void) {} 23 | 24 | virtual void postUnloadImpl(void) {} 25 | 26 | virtual void prepareImpl(void); 27 | 28 | virtual void unprepareImpl(void) {} 29 | 30 | size_t calculateSize(void) const { return 0; } 31 | private: 32 | bool mLoaded; 33 | bool mAttached; 34 | osg::ref_ptr mFeatureNode; 35 | osg::ref_ptr mFeatureRecord; 36 | }; 37 | 38 | typedef SharedPtr FeaturePtr; 39 | } 40 | 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Core/OCVolume/CinRadReaderFMT.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_VOLUME_CINRAD_FMT_H__ 2 | #define _OC_VOLUME_CINRAD_FMT_H__ 3 | 4 | #include "VolumeObject.h" 5 | #include "CinRadHeader.h" 6 | #include "CinRad.h" 7 | 8 | namespace OC 9 | { 10 | namespace Volume 11 | { 12 | class CinRadReaderFMT : public CinRad 13 | { 14 | public: 15 | CinRadReaderFMT(); 16 | ~CinRadReaderFMT(); 17 | bool convert(std::istream& sstream); 18 | protected: 19 | void parseData(std::istream& sstream); 20 | void generateImage(); 21 | private: 22 | typedef std::vector > ImageList; 23 | typedef std::vector TList; 24 | typedef std::map TListMap; 25 | TListMap mPitchRadialMapDBZ; 26 | }; 27 | } 28 | } 29 | 30 | 31 | 32 | #endif // !_OC_VOLUME_CINRAD_FMT_H__ 33 | -------------------------------------------------------------------------------- /src/Core/OCLayer/src/IRecord.cpp: -------------------------------------------------------------------------------- 1 | #include "IRecord.h" 2 | 3 | namespace OC 4 | { 5 | IRecord::IRecord() 6 | :mID(-9999) 7 | ,mOwner(NULL) 8 | ,mDirty(false) 9 | { 10 | 11 | } 12 | 13 | IRecord::~IRecord() 14 | { 15 | 16 | } 17 | 18 | long IRecord::getID() 19 | { 20 | return mID; 21 | } 22 | 23 | void IRecord::setID(long id) 24 | { 25 | mID = id; 26 | } 27 | 28 | String IRecord::getFeatureName() 29 | { 30 | return mFeatureName; 31 | } 32 | 33 | void IRecord::setFeatureName(String name) 34 | { 35 | mFeatureName = name; 36 | } 37 | 38 | IFeature* IRecord::getOwnerFeature() 39 | { 40 | return mOwner; 41 | } 42 | 43 | void IRecord::setOwnerFeature(IFeature* feature) 44 | { 45 | mOwner = feature; 46 | } 47 | 48 | void IRecord::update() 49 | { 50 | if (!mDirty) 51 | { 52 | return; 53 | } 54 | // 55 | } 56 | 57 | void IRecord::dirty(bool _dirty) 58 | { 59 | mDirty = _dirty; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/Core/OCNetCDF/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 2 | INCLUDE_DIRECTORIES(${WORKINGPATH}/3rdParty/include) 3 | 4 | SET(LIB_NAME OCNetCDF) 5 | 6 | SET(TARGET_H 7 | npy/cnpy.h 8 | npy/npyTemprature.h 9 | NcDBZ.h 10 | NcZQ.h 11 | NetCDFDefine.h 12 | NetCDFReader.h 13 | NcZT.h 14 | NcUV.h 15 | NcVolume.h 16 | NcepWind.h 17 | ) 18 | 19 | SET(TARGET_SRC 20 | npy/cnpy.cpp 21 | npy/npyTemprature.cpp 22 | src/NcDBZ.cpp 23 | src/NcZQ.cpp 24 | src/NetCDFReader.cpp 25 | src/NcZT.cpp 26 | src/NcUV.cpp 27 | src/NcVolume.cpp 28 | src/NcepWind.cpp 29 | ) 30 | 31 | SET(TARGET_LIBRARIES 32 | OpenThreads 33 | osg 34 | osgDB 35 | osgEarth 36 | OCUtility 37 | OCMain 38 | OCVolume 39 | ) 40 | 41 | SET(TARGET_EXTERNAL_LIBRARIES 42 | gdal_i 43 | netcdf 44 | zlib 45 | ) 46 | 47 | SETUP_GROUP() 48 | SETUP_LIBRARY(${LIB_NAME}) 49 | -------------------------------------------------------------------------------- /src/Application/OConv/deprecated.cpp: -------------------------------------------------------------------------------- 1 | #include "ConvCommand.h" 2 | 3 | 4 | void computeTexture(OC::Json::Value& root) 5 | { 6 | osg::ref_ptr options = new osgDB::Options; 7 | StringStream sstream; 8 | sstream << "noRotation" << std::endl; 9 | sstream << "noTesselateLargePolygons" << std::endl; 10 | sstream << "noTriStripPolygons" << std::endl; 11 | sstream << "noReverseFaces" << std::endl; 12 | options->setOptionString(sstream.str()); 13 | 14 | CTextureVisitor v; 15 | String filename = JsonPackage::getString(root, "filename"); 16 | osg::ref_ptr node = osgDB::readNodeFile(filename, options); 17 | v.traverse(*node); 18 | v.mBoundComputed = true; 19 | v.traverse(*node); 20 | 21 | String basename, extension, out_dir; 22 | StringUtil::splitFullFilename(filename, basename, extension, out_dir); 23 | String out_file = out_dir + basename + "_texture." + extension; 24 | osgDB::writeNodeFile(*node, out_file, options); 25 | } 26 | -------------------------------------------------------------------------------- /src/Core/OCServer/OCServer.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_SERVER_CLASS_H__ 2 | #define _OC_SERVER_CLASS_H__ 3 | 4 | #include "OCServerDefine.h" 5 | #include "OCMain/Singleton.h" 6 | #include "OCMain/DataStream.h" 7 | #include "OCLayer/OCResource.h" 8 | 9 | namespace OC 10 | { 11 | namespace Server 12 | { 13 | class _OCServerExport COCServer : public CSingleton 14 | { 15 | public: 16 | COCServer(); 17 | ~COCServer(); 18 | void init(); 19 | String invoke(String jsonStr); 20 | String getDataInfo(String method, String param, String filter); 21 | MemoryDataStreamPtr getByteData(String method, String param, String filter); 22 | MemoryDataStreamPtr getByteData(String filename); 23 | private: 24 | OCResource* mOCResource; 25 | Environment* mEnvironment; 26 | ConfigManager* mConfigManager; 27 | std::map mMemoryCaches; 28 | }; 29 | } 30 | } 31 | 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/Core/OCUtility/src/tinyxmlerror.cpp: -------------------------------------------------------------------------------- 1 | #include "tinyxml.h" 2 | 3 | // The goal of the seperate error file is to make the first 4 | // step towards localization. tinyxml (currently) only supports 5 | // english error messages, but the could now be translated. 6 | // 7 | // It also cleans up the code a bit. 8 | // 9 | 10 | const char* TiXmlBase::errorString[ TIXML_ERROR_STRING_COUNT ] = 11 | { 12 | "No error", 13 | "Error", 14 | "Failed to open file", 15 | "Error parsing Element.", 16 | "Failed to read Element name", 17 | "Error reading Element value.", 18 | "Error reading Attributes.", 19 | "Error: empty tag.", 20 | "Error reading end tag.", 21 | "Error parsing Unknown.", 22 | "Error parsing Comment.", 23 | "Error parsing Declaration.", 24 | "Error document empty.", 25 | "Error null (0) or unexpected EOF found in input stream.", 26 | "Error parsing CDATA.", 27 | "Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.", 28 | }; 29 | -------------------------------------------------------------------------------- /src/Core/OCHttpServer/WebSocket.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | using namespace drogon; 5 | namespace OC 6 | { 7 | class WebSocketTest : public drogon::WebSocketController 8 | { 9 | public: 10 | virtual void handleNewMessage(const WebSocketConnectionPtr &, 11 | std::string &&, 12 | const WebSocketMessageType &) override; 13 | virtual void handleConnectionClosed( 14 | const WebSocketConnectionPtr &) override; 15 | virtual void handleNewConnection(const HttpRequestPtr &, 16 | const WebSocketConnectionPtr &) override; 17 | WS_PATH_LIST_BEGIN 18 | // list path definations here; 19 | WS_PATH_ADD("/OCserver/Websocket", "drogon::LocalHostFilter", Get); 20 | WS_PATH_LIST_END 21 | private: 22 | PubSubService chatRooms_; 23 | }; 24 | } // namespace example 25 | -------------------------------------------------------------------------------- /src/Core/OCVolume/CinRadReader.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_VOLUME_CinRad_Reader_H__ 2 | #define _OC_VOLUME_CinRad_Reader_H__ 3 | 4 | #include "VolumeObject.h" 5 | #include "CinRad.h" 6 | 7 | namespace OC 8 | { 9 | namespace Volume 10 | { 11 | class CinRadReader : public CinRad 12 | { 13 | public: 14 | CinRadReader(String name); 15 | virtual ~CinRadReader(); 16 | virtual bool convert(std::istream& sstream); 17 | protected: 18 | void parseName(String name); 19 | void parseData(std::istream& sstream); 20 | void generateImage(); 21 | private: 22 | typedef std::vector > ImageList; 23 | typedef std::vector TList; 24 | typedef std::map TListMap; 25 | TListMap mPitchRadialMapDBZ; 26 | }; 27 | } 28 | } 29 | 30 | 31 | 32 | #endif // !_OC_VOLUME_CINRAD_FMT_H__ 33 | -------------------------------------------------------------------------------- /src/Core/OCMain/json/forwards.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_FORWARDS_H_INCLUDED 7 | #define JSON_FORWARDS_H_INCLUDED 8 | 9 | #if !defined(JSON_IS_AMALGAMATION) 10 | #include "config.h" 11 | #endif // if !defined(JSON_IS_AMALGAMATION) 12 | 13 | namespace OC { 14 | namespace Json { 15 | 16 | // writer.h 17 | class FastWriter; 18 | class StyledWriter; 19 | 20 | // reader.h 21 | class Reader; 22 | 23 | // features.h 24 | class Features; 25 | 26 | // value.h 27 | typedef unsigned int ArrayIndex; 28 | class StaticString; 29 | class Path; 30 | class PathArgument; 31 | class Value; 32 | class ValueIteratorBase; 33 | class ValueIterator; 34 | class ValueConstIterator; 35 | 36 | } // namespace Json 37 | } // namespace Json 38 | 39 | #endif // JSON_FORWARDS_H_INCLUDED 40 | -------------------------------------------------------------------------------- /src/Core/OCUtility/RGBAEncoder.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_RGBA_ENCODER_H__ 2 | #define _OC_RGBA_ENCODER_H__ 3 | 4 | #include "OCMain/osg.h" 5 | #include "UtilityDefine.h" 6 | 7 | namespace OC 8 | { 9 | class _UtilityExport RGBAEncoder 10 | { 11 | public: 12 | RGBAEncoder() {} 13 | ~RGBAEncoder() {} 14 | static osg::Vec4 encodeFloatRGBA(float v); 15 | static float decodeRGBAFloat(osg::Vec4 rgba); 16 | static osg::Vec4ub packFloat(float value); 17 | static float unpackFloat(osg::Vec4ub packedFloat); 18 | static float unpackFloat(osg::Vec4 packedFloat); 19 | static osg::Vec2 octEncodeInRange(osg::Vec3 normal, float rangeMax); 20 | static osg::Vec2 octEncode(osg::Vec3 vector); 21 | static osg::Vec4 octEncodeToVec4(osg::Vec3 vector); 22 | static osg::Vec3 octDecodeInRange(float x, float y, float rangeMax); 23 | static osg::Vec3 octDecode(float x, float y); 24 | static osg::Vec3 octDecodeFromVec4(osg::Vec4 encoded); 25 | }; 26 | } 27 | 28 | 29 | #endif // !_OC_RGBA_ENCODER_H__ 30 | -------------------------------------------------------------------------------- /src/Core/OCModel/DataFilter.h: -------------------------------------------------------------------------------- 1 | #ifndef _DATA_FILTER_CLASS_H__ 2 | #define _DATA_FILTER_CLASS_H__ 3 | 4 | #include "ModelDefine.h" 5 | 6 | namespace OC 7 | { 8 | namespace Modeling 9 | { 10 | class _ModelExport CDataFilter :public osg::Referenced 11 | { 12 | public: 13 | CDataFilter(void); 14 | ~CDataFilter(void); 15 | 16 | void setTimeClause(String time); 17 | String getTimeClause(); 18 | 19 | void setExtent(CRectangle rect); 20 | CRectangle getExtent(); 21 | 22 | longVector& getNodeIDList(); 23 | longVector& getLineIDList(); 24 | 25 | void setNodeWhereClause(String clause); 26 | String getNodeWhereClause(); 27 | 28 | void setLineWhereClause(String clause); 29 | String getLineWhereClause(); 30 | private: 31 | String mTimeClause; 32 | String mLineClause; 33 | String mNodeClause; 34 | CRectangle mExtent; 35 | longVector mNodeIDList; 36 | longVector mLineIDList; 37 | }; 38 | } 39 | } 40 | 41 | 42 | 43 | #endif 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/Plugins/pipe/NodeExInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_Model_NodeExInfo_H__ 2 | #define _OC_Model_NodeExInfo_H__ 3 | 4 | #include "OCModel/Modelnode.h" 5 | 6 | namespace OC 7 | { 8 | namespace Modeling 9 | { 10 | class NodeExInfo 11 | { 12 | public: 13 | NodeExInfo(PipeNode* owner); 14 | ~NodeExInfo(void); 15 | 16 | CVector3 calcModelDirection(); 17 | 18 | CVector3 getConstDirection(); 19 | void setConstDirection(CVector3 direction); 20 | 21 | ModelNode getModelNode(); 22 | void setModelNode(ModelNode model); 23 | 24 | void setModelPosition(CVector3 position); 25 | CVector3 getModelPosition(); 26 | 27 | void setGroundZ(double z); 28 | double getGroundZ(); 29 | 30 | void setCategory(String cate); 31 | String getCategory(); 32 | private: 33 | double mGroundZ; 34 | String mCategory; 35 | CVector3 mConsDirection; 36 | CVector3 mModelPosition; 37 | PipeNode* mOwner; 38 | ModelNode mModelNode; 39 | }; 40 | } 41 | } 42 | 43 | 44 | 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Core/OCesium/PntsWriter.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_PNTS_WRITER_H 2 | #define _OC_PNTS_WRITER_H 3 | 4 | #include "BaseWriter.h" 5 | #include "FeatureBatchTable.h" 6 | 7 | namespace OC 8 | { 9 | namespace Cesium 10 | { 11 | class _CesiumExport PntsWriter : public BaseWriter 12 | { 13 | public: 14 | PntsWriter(); 15 | ~PntsWriter(); 16 | void push(osg::Vec3 pos); 17 | void push_normal(osg::Vec3 normal); 18 | void push_color(uint8 r, uint8 g, uint8 b); 19 | void push_color(osg::Vec3ub color); 20 | void push_positionAndBatchId(osg::Vec3 pos, int batchId); 21 | 22 | virtual bool writeToFile(String filename); 23 | virtual bool writeToStream(std::ostream& output); 24 | 25 | osg::ref_ptr positions; 26 | osg::ref_ptr normals; 27 | osg::ref_ptr batchIdArray; 28 | osg::ref_ptr colors; 29 | uint32 batch_length = 0; 30 | FeatureBatchTable mFeatureBatchTable; 31 | }; 32 | } 33 | } 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /src/Core/OCModel/NodeExInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef _NODE_EX_INFO_H 2 | #define _NODE_EX_INFO_H 3 | 4 | #include "ModelDefine.h" 5 | #include "Modelnode.h" 6 | 7 | namespace OC 8 | { 9 | namespace Modeling 10 | { 11 | class _ModelExport NodeExInfo 12 | { 13 | public: 14 | NodeExInfo(PipeNode* owner); 15 | ~NodeExInfo(void); 16 | 17 | CVector3 calcModelDirection(); 18 | 19 | CVector3 getConstDirection(); 20 | void setConstDirection(CVector3 direction); 21 | 22 | ModelNode getModelNode(); 23 | void setModelNode(ModelNode model); 24 | 25 | void setModelPosition(CVector3 position); 26 | CVector3 getModelPosition(); 27 | 28 | void setGroundZ(double z); 29 | double getGroundZ(); 30 | 31 | void setCategory(String cate); 32 | String getCategory(); 33 | private: 34 | double mGroundZ; 35 | String mCategory; 36 | CVector3 mConsDirection; 37 | CVector3 mModelPosition; 38 | PipeNode* mOwner; 39 | ModelNode mModelNode; 40 | }; 41 | } 42 | } 43 | 44 | 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/Core/OCUtility/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(HopeMap3D_DIR)\HopeMap3DUtility 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LIBDIR := $(OSG_ANDROID_DIR)/lib 6 | 7 | LOCAL_C_INCLUDES:= $(OSG_ANDROID_DIR)/include $(OSGE_ANDROID_DIR) $(HopeMap3D_DIR) 8 | 9 | LOCAL_CPP_EXTENSION := cpp 10 | 11 | LOCAL_LDLIBS := -llog -lGLESv2 -lz -lgnustl_static 12 | 13 | LOCAL_MODULE := HopeMap3DUtility 14 | 15 | MY_CPP_LIST := $(wildcard $(LOCAL_PATH)/src/*.cpp) 16 | 17 | LOCAL_SRC_FILES := $(MY_CPP_LIST:$(LOCAL_PATH)/%=%) 18 | 19 | LOCAL_CFLAGS := -DANDROID 20 | 21 | LOCAL_CPPFLAGS := -DANDROID 22 | 23 | LOCAL_LDFLAGS := -L $(LIBDIR) \ 24 | -losgViewer \ 25 | -losgVolume \ 26 | -losgTerrain \ 27 | -losgText \ 28 | -losgShadow \ 29 | -losgSim \ 30 | -losgParticle \ 31 | -losgManipulator \ 32 | -losgGA \ 33 | -losgFX \ 34 | -losgDB \ 35 | -losgAnimation \ 36 | -losgUtil \ 37 | -losg \ 38 | -lOpenThreads \ 39 | -losgEarth \ 40 | 41 | include $(BUILD_STATIC_LIBRARY) 42 | #include $(BUILD_SHARED_LIBRARY) 43 | 44 | -------------------------------------------------------------------------------- /src/Application/OConv/Thread/ConvWorkqueue.h: -------------------------------------------------------------------------------- 1 | #include "OCMain/Environment.h" 2 | #include "OCMain/ConfigManager.h" 3 | #include "OCMain/DefaultWorkQueueStandard.h" 4 | 5 | using namespace OC; 6 | 7 | class OConvWorkqueue : public WorkQueue::ResponseHandler, public WorkQueue::RequestHandler 8 | { 9 | public: 10 | OConvWorkqueue(int threadNum = 2); 11 | ~OConvWorkqueue(void); 12 | 13 | enum RequestType 14 | { 15 | RT_MapCacherCes, 16 | RT_MapCacherTDT, 17 | }; 18 | 19 | struct TaskRequest 20 | { 21 | RequestType type; 22 | int X, Y, Z, L; 23 | String param; 24 | friend std::ostream& operator<<(std::ostream& o, const TaskRequest& r) 25 | { 26 | (void)r; return o; 27 | } 28 | }; 29 | 30 | void shutdown(); 31 | int mWorkQueueChannel; 32 | virtual void handleResponse(const WorkQueue::Response* res, const WorkQueue* srcQ); 33 | virtual WorkQueue::Response* handleRequest(const WorkQueue::Request* req, const WorkQueue* srcQ); 34 | void addRequest(TaskRequest request); 35 | WorkQueue* mWorkQueue; 36 | int taskCount = 0; 37 | }; 38 | -------------------------------------------------------------------------------- /src/Core/OCMain/DatabaseDefine.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_DATABASE_H__ 2 | #define _OC_DATABASE_H__ 3 | 4 | #include "OCMain/stl.h" 5 | #include "OCMain/osg.h" 6 | #include "OCMain/IteratorWrapper.h" 7 | #include "OCMain/DataStream.h" 8 | #include "OCUtility/StringConverter.h" 9 | #include "OCUtility/tinyxml.h" 10 | #include "OCMain/CoreConfig.h" 11 | 12 | struct sqlite3; 13 | struct sqlite3_stmt; 14 | namespace OC 15 | { 16 | class CMetaRecord; 17 | class CQueryInfo; 18 | class FeatureRecord; 19 | class IDatabase; 20 | class LayerRecord; 21 | class IPipeDatabase; 22 | class TemplateRecord; 23 | class TileFeatureRecord; 24 | class OCFieldInfo; 25 | class OCHeaderInfo; 26 | class OCGeomFieldInfo; 27 | class OCJoinFieldInfo; 28 | class OCBinaryFieldInfo; 29 | class OCBinaryField; 30 | class SQLite; 31 | } 32 | 33 | typedef enum _OC_DATATYPE 34 | { 35 | OC_DATATYPE_INTEGER, 36 | OC_DATATYPE_FLOAT, 37 | OC_DATATYPE_TEXT, 38 | OC_DATATYPE_BLOB, 39 | OC_DATATYPE_NULL, 40 | OC_DATATYPE_TIME, 41 | OC_DATATYPE_GEOM 42 | }OC_DATATYPE; 43 | 44 | #endif -------------------------------------------------------------------------------- /src/Core/OCLayer/SqliteArchive.h: -------------------------------------------------------------------------------- 1 | #ifndef _SQLITE_ARCHIVE_H_ 2 | #define _SQLITE_ARCHIVE_H_ 3 | 4 | #include "IArchive.h" 5 | 6 | namespace OC 7 | { 8 | class _LayerExport SqliteArchive : public IArchive 9 | { 10 | public: 11 | SqliteArchive(void); 12 | virtual ~SqliteArchive(void); 13 | virtual osgDB::ReaderWriter::ReadResult readImage(const String& fileName,const osgDB::ReaderWriter::Options* =NULL) const; 14 | virtual osgDB::ReaderWriter::WriteResult writeImage(const osg::Image& image, const String& fileName,const osgDB::ReaderWriter::Options* =NULL) const; 15 | public: 16 | bool open(String filename,ArchiveStatus status,const osgDB::ReaderWriter::Options* options=NULL); 17 | virtual bool writeFeature(FeatureRecord* record); 18 | void recalculate_index(); 19 | virtual bool checkUpdate(); 20 | private: 21 | mutable ObserverObjectCacher mBatchImages; 22 | 23 | //for write feature 24 | StringLongMap mShareTileRecord; 25 | StringLongMap mShareModelRecord; 26 | }; 27 | } 28 | 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/Core/OCServer/src/VolumeManager.cpp: -------------------------------------------------------------------------------- 1 | #include "VolumeManager.h" 2 | #include "OCVolume/Volume.h" 3 | 4 | namespace OC 5 | { 6 | using namespace Volume; 7 | namespace Server 8 | { 9 | String VolumeManager::getVolumeFile(const String name, const String varname, const String ext, const String dir, const String version) 10 | { 11 | String dataDir = _getServerDir(ConfigNameDataDir); 12 | String cacheDir = _getServerDir(ConfigNameCacheDir); 13 | 14 | String file_var_dotw3dm = cacheDir + name + "." + varname + ".w3dm"; 15 | 16 | String error = StringUtil::BLANK; 17 | if (!FileUtil::FileExist(file_var_dotw3dm)) 18 | { 19 | String filename = dataDir + name + "." + ext; 20 | osg::ref_ptr vo = CVolume::convert(filename, varname); 21 | if (vo.valid()) 22 | { 23 | vo->writeToW3DM(file_var_dotw3dm); 24 | } 25 | else 26 | { 27 | error = " error"; 28 | } 29 | } 30 | 31 | Singleton(LogManager).stream() << file_var_dotw3dm << error; 32 | 33 | return file_var_dotw3dm; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /src/Core/OCesium/src/gltfConfig.cpp: -------------------------------------------------------------------------------- 1 | #include "gltfConfig.h" 2 | 3 | 4 | int OC::Cesium::gltfConfig::sectionSize = 0; 5 | int OC::Cesium::gltfConfig::quantizationbits = 16; 6 | int OC::Cesium::gltfConfig::AtlasImageSize = 2048; 7 | int OC::Cesium::gltfConfig::MaxTextureSize = 0; 8 | int OC::Cesium::gltfConfig::TextrueCoordError = 10; 9 | bool OC::Cesium::gltfConfig::GeodePerId = false; 10 | bool OC::Cesium::gltfConfig::writeGltf = false; 11 | bool OC::Cesium::gltfConfig::prettyPrint = false; 12 | bool OC::Cesium::gltfConfig::mergeClampTexture = true; 13 | bool OC::Cesium::gltfConfig::mergeRepeatTexture = false; 14 | bool OC::Cesium::gltfConfig::disableLight = false; 15 | bool OC::Cesium::gltfConfig::enableWebpCompress = false; 16 | bool OC::Cesium::gltfConfig::enableKtxCompress = false; 17 | bool OC::Cesium::gltfConfig::enableDracoCompress = false; 18 | bool OC::Cesium::gltfConfig::forceDoubleSide = false; 19 | float OC::Cesium::gltfConfig::geometryErroRatio = 1.0; 20 | float OC::Cesium::gltfConfig::metallicFactor = 0.0; 21 | float OC::Cesium::gltfConfig::roughnessFactor = 0.45; -------------------------------------------------------------------------------- /src/Core/OCesium/src/GLTFObject.cpp: -------------------------------------------------------------------------------- 1 | #include "GLTFObject.h" 2 | 3 | namespace OC 4 | { 5 | namespace Cesium 6 | { 7 | GLTFObject::GLTFObject(FeatureBatchTable* featureBatchTable) 8 | :BatchGroup(featureBatchTable) 9 | { 10 | } 11 | 12 | GLTFObject::~GLTFObject() 13 | { 14 | } 15 | 16 | bool GLTFObject::writeToFile(String filename, bool isBinary) 17 | { 18 | std::fstream fout(filename.c_str(), std::ios::out | std::ios::binary); 19 | if (!fout.is_open()) 20 | return false; 21 | 22 | bool ret = writeToStream(fout, isBinary); 23 | 24 | fout.close(); 25 | 26 | return ret; 27 | } 28 | 29 | bool GLTFObject::writeToStream(std::ostream& output, bool isBinary) 30 | { 31 | submitBatch(); 32 | 33 | size_t pos0 = output.tellp(); 34 | if (_gltfHelper.writeGltfSceneToStream(output, isBinary)) 35 | { 36 | size_t pos1 = output.tellp(); 37 | mBytesLength = pos1 - pos0; 38 | } 39 | 40 | return mBytesLength != 0; 41 | } 42 | 43 | uint32 GLTFObject::bytesLength() 44 | { 45 | return mBytesLength; 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /src/Core/OCNetCDF/TransferFunction.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_VOLUME_TRANSFER_H_ 2 | #define _OC_VOLUME_TRANSFER_H_ 3 | 4 | #include "NetCDFDefine.h" 5 | 6 | namespace OC 7 | { 8 | class CTransferFunction : public osg::Referenced 9 | { 10 | public: 11 | CTransferFunction(); 12 | virtual ~CTransferFunction(); 13 | 14 | virtual void read(String filename); 15 | virtual osg::Vec4 getColor(float v) { return osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f); } 16 | }; 17 | 18 | class CImageTransferFunction : public CTransferFunction 19 | { 20 | public: 21 | CImageTransferFunction(); 22 | ~CImageTransferFunction(); 23 | 24 | virtual void read(String filename); 25 | virtual osg::Vec4 getColor(float v); 26 | 27 | osg::ref_ptr tfImage; 28 | }; 29 | 30 | class CFileTransferFunction : public CTransferFunction 31 | { 32 | public: 33 | CFileTransferFunction(); 34 | ~CFileTransferFunction(); 35 | 36 | virtual void read(String filename); 37 | virtual osg::Vec4 getColor(float v); 38 | 39 | typedef std::map ColorMap; 40 | ColorMap _colorMap; 41 | }; 42 | } 43 | 44 | #endif -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${WORKINGPATH}/OpenSceneGraph/build/include) 2 | INCLUDE_DIRECTORIES(${WORKINGPATH}/OpenSceneGraph/include) 3 | INCLUDE_DIRECTORIES(${WORKINGPATH}/osgearth/build/build_include) 4 | INCLUDE_DIRECTORIES(${WORKINGPATH}/osgearth/src) 5 | INCLUDE_DIRECTORIES(${WORKINGPATH}/src/Core) 6 | 7 | IF (Qt5Widgets_FOUND) 8 | ADD_SUBDIRECTORY(Application/Weathertoy) 9 | ENDIF() 10 | 11 | IF(WIN32) 12 | FOREACH(mylibfolder 13 | Application/OCServerApp 14 | Application/OConv 15 | Core/OCesium 16 | Core/OCModel 17 | Core/OCNetCDF 18 | Core/OCHttpServer 19 | Core/OCHttpClient 20 | Core/OCServer 21 | ) 22 | ADD_SUBDIRECTORY(${mylibfolder}) 23 | ENDFOREACH() 24 | ENDIF(WIN32) 25 | 26 | FOREACH(mylibfolder 27 | Core/OCLayer 28 | Core/OCZip 29 | Core/OCVolume 30 | Core/OCMain 31 | Core/OCUtility 32 | Linux/OCVolumeConverter 33 | ) 34 | ADD_SUBDIRECTORY(${WORKINGPATH}/src/${mylibfolder}) 35 | ENDFOREACH() 36 | 37 | INCLUDE_DIRECTORIES(${WORKINGPATH}/3rdParty/include) 38 | IF(WIN32) 39 | ADD_SUBDIRECTORY(Plugins) 40 | ENDIF(WIN32) 41 | -------------------------------------------------------------------------------- /src/Core/OCUtility/FileUtil.h: -------------------------------------------------------------------------------- 1 | #ifndef _FILE_UTIL_CLASS_H_ 2 | #define _FILE_UTIL_CLASS_H_ 3 | 4 | #include "StringUtil.h" 5 | 6 | namespace OC 7 | { 8 | class _UtilityExport FileUtil 9 | { 10 | public: 11 | enum Type 12 | { 13 | FILE_NOT_FOUND, 14 | REGULAR_FILE, 15 | DIRECTORY 16 | }; 17 | 18 | /* 19 | * return 0 File 1 Folder -1 NoteFound 20 | */ 21 | static Type FileType(String filename); 22 | 23 | static void FindFiles(const String strPath, StringVector &fileVector); 24 | 25 | static void FindModelFiles(const String strPath, StringVector &fileVector); 26 | 27 | static bool FileExist(String filename); 28 | 29 | static int FileSize(String filename); 30 | 31 | static bool FileDelete(String filename); 32 | 33 | static bool DirDelete(String filename); 34 | 35 | static bool FileWrite(String filename,std::istream& fin); 36 | 37 | static String getLowerCaseFileExtension(String filename); 38 | 39 | static bool isAceptModelType(String filename); 40 | 41 | static bool makeDirectory(String dir); 42 | 43 | static bool FileReName(String filename,String newFilename); 44 | }; 45 | } 46 | 47 | #endif -------------------------------------------------------------------------------- /src/Core/OCLayer/QueryInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_QUERY_INFO_CLASS_H__ 2 | #define _OC_QUERY_INFO_CLASS_H__ 3 | 4 | #include "LayerDefine.h" 5 | #include "OCMain/CoreConfig.h" 6 | 7 | namespace OC 8 | { 9 | class _LayerExport CQueryCallback : public osg::Referenced 10 | { 11 | public: 12 | CQueryCallback(){} 13 | ~CQueryCallback(){} 14 | 15 | virtual bool onQuery(TemplateRecord* record){return true;} 16 | }; 17 | class _LayerExport CQueryInfo : public osgDB::ReaderWriter::Options , public CCoreConfig 18 | { 19 | public: 20 | CQueryInfo(void); 21 | CQueryInfo(const CQueryInfo&,const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY); 22 | virtual ~CQueryInfo(void); 23 | 24 | META_Object(OC,CQueryInfo) 25 | 26 | static String NameTileID; 27 | static String NameClause; 28 | static String NameRectangle; 29 | static String NameLayerName; 30 | static String NamePaperRange; 31 | static String NameCreateTileRecord; 32 | static String NameQueryModelData; 33 | 34 | void setCallback(CQueryCallback* query); 35 | CQueryCallback* getCallback(); 36 | private: 37 | osg::ref_ptr mCallback; 38 | }; 39 | 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Application/Weathertoy/Bridge.cpp: -------------------------------------------------------------------------------- 1 | #include "Bridge.h" 2 | #include 3 | #include 4 | #include 5 | #include "LabViewer.h" 6 | #include "WeatherLabMenu.h" 7 | 8 | Bridge::Bridge() 9 | : QObject(NULL) 10 | { 11 | } 12 | 13 | Bridge::~Bridge() 14 | { 15 | } 16 | 17 | Bridge* Bridge::instance() 18 | { 19 | static Bridge s_obj; 20 | return &s_obj; 21 | } 22 | 23 | void Bridge::eval(QString method, QString json) 24 | { 25 | if (method == "showMinimized") 26 | { 27 | LabViewer::instance()->showMinimized(); 28 | } 29 | else if (method == "showMaximized") 30 | { 31 | if (LabViewer::instance()->isMaximized()) 32 | { 33 | LabViewer::instance()->showNormal(); 34 | } 35 | else { 36 | LabViewer::instance()->showMaximized(); 37 | } 38 | } 39 | else 40 | { 41 | if (QAction* action = LabViewer::instance()->getWeatherLabMenu()->GetAction(method)) 42 | { 43 | action->trigger(); 44 | } 45 | 46 | } 47 | } 48 | 49 | void Bridge::showMsgBox() 50 | { 51 | QMessageBox::aboutQt(0, tr("Qt")); 52 | } -------------------------------------------------------------------------------- /src/Core/OCModel/src/ModelDataQueryCallback.cpp: -------------------------------------------------------------------------------- 1 | #include "ModelDataQueryCallback.h" 2 | #include "PipeLine.h" 3 | #include "PipeNode.h" 4 | #include "IModelTable.h" 5 | 6 | namespace OC 7 | { 8 | namespace Modeling 9 | { 10 | ModelDataQueryCallback::ModelDataQueryCallback(IModelTable* table,ModelDataQueryCallback::DataType type) 11 | :mTable(table) 12 | ,mType(type) 13 | { 14 | 15 | } 16 | ModelDataQueryCallback::~ModelDataQueryCallback() 17 | { 18 | 19 | } 20 | 21 | bool ModelDataQueryCallback::onQuery(TemplateRecord* record) 22 | { 23 | IModelData* data = NULL; 24 | 25 | switch(mType) 26 | { 27 | case Type_Line: 28 | { 29 | data = PipeLine::create(record); 30 | break; 31 | } 32 | case Type_Node: 33 | { 34 | data = PipeNode::create(record); 35 | break; 36 | } 37 | case Type_Mold: 38 | { 39 | //data = GenericMoldTable::createMoldData(mTable->getName(),record); 40 | break; 41 | } 42 | default: 43 | break; 44 | } 45 | 46 | if (data != NULL) 47 | { 48 | mTable->push_data(data); 49 | } 50 | 51 | return data != NULL; 52 | } 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Core/OCesium/MapProject.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_MapProject_H__ 2 | #define _OC_MapProject_H__ 3 | 4 | #include "CesiumDefine.h" 5 | 6 | namespace OC 7 | { 8 | class _CesiumExport MapProject : public osg::Referenced 9 | { 10 | public: 11 | MapProject(String prjcs); 12 | ~MapProject(void); 13 | 14 | String getPrjcs(); 15 | void setPrjcs(String prjcs); 16 | CVector2 localTo4326(CVector2 localPoint); 17 | CVector3 localTo4326(CVector3 localPoint); 18 | const osgEarth::SpatialReference* getProjectSRS() { return local_srs; } 19 | static CVector3 worldToLonLatH(CVector3 worldposition); 20 | static CVector3 toWorld(CVector3 LonLatHeight); 21 | static CVector3 toWorld(CVector2 LonLat); 22 | static osg::Matrix computeTransform(CVector2 LonLat); 23 | static osg::Matrix computeTransform(CVector3 LonLatH); 24 | static osg::BoundingBox computeRegion(CVector3 LonLatH, double tile_w, double tile_h); 25 | static CVector2 gaussToLH(double X, double Y, bool isSix = true); 26 | private: 27 | String mPrjcs; 28 | osgEarth::SpatialReference* local_srs; 29 | osgEarth::SpatialReference* wgs84_srs; 30 | }; 31 | } 32 | 33 | #endif 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/Core/OCesium/src/CmptWriter.cpp: -------------------------------------------------------------------------------- 1 | #include "CmptWriter.h" 2 | 3 | namespace OC 4 | {namespace Cesium{ 5 | 6 | CmptWriter::CmptWriter() 7 | { 8 | 9 | } 10 | 11 | CmptWriter::~CmptWriter() 12 | { 13 | 14 | } 15 | 16 | void CmptWriter::push(BaseWriter* object) 17 | { 18 | mTiles.push_back(object); 19 | } 20 | 21 | void CmptWriter::writeCmpt(String filename) 22 | { 23 | std::fstream fout(filename.c_str(), std::ios::out | std::ios::binary); 24 | if (!fout.is_open()) 25 | return; 26 | 27 | cmptheader header; 28 | header.magic[0] = 'c', header.magic[1] = 'm', header.magic[2] = 'p', header.magic[3] = 't'; 29 | header.version = 1; 30 | header.tilesLength = getLength(); 31 | 32 | uint32 byteslength = sizeof(cmptheader); 33 | fout.seekp(byteslength); 34 | 35 | for (auto i : mTiles) 36 | { 37 | i->writeToStream(fout); 38 | byteslength += i->bytesLength(); 39 | } 40 | 41 | header.byteLength = byteslength; 42 | fout.seekp(std::ios::beg); 43 | fout.write((const char*)&header, sizeof(cmptheader)); 44 | 45 | fout.close(); 46 | } 47 | 48 | uint32 CmptWriter::getLength() 49 | { 50 | return (uint32)mTiles.size(); 51 | } 52 | 53 | }}//namespace -------------------------------------------------------------------------------- /src/Core/OCMain/JsonPackage.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_JSONPACKAGE_H__ 2 | #define _OC_JSONPACKAGE_H__ 3 | 4 | #include "BaseDefine.h" 5 | #include "json/json.h" 6 | 7 | namespace OC 8 | { 9 | class _MainExport JsonPackage 10 | { 11 | public: 12 | JsonPackage(); 13 | ~JsonPackage(); 14 | 15 | static int getInt(Json::Value& obj,String key,int defaultVal = 1); 16 | static bool getBool(Json::Value& obj,String key,bool defaultVal = false); 17 | static double getDouble(Json::Value& obj,String key,double defaultVal = 0.0); 18 | static uint32 getUInt(Json::Value& obj,String key,uint32 defaultVal = 1); 19 | static String getString(Json::Value& obj,String key,String defaultVal = StringUtil::BLANK); 20 | 21 | void addNameVal(String name,int val); 22 | void addNameVal(String name,long val); 23 | void addNameVal(String name,double val); 24 | void addNameVal(String name,String val); 25 | void addNameVal(String name, CVector2 val); 26 | void addNameVal(String name, CVector3 val); 27 | void addNameVal(String name,JsonPackage& package); 28 | 29 | String toJSON(); 30 | private: 31 | Json::Value mRoot; 32 | std::map mArrayCount; 33 | }; 34 | } 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/Core/OCMain/stl.h: -------------------------------------------------------------------------------- 1 | #ifndef __INCLUDE_STD__HEADERS_ 2 | #define __INCLUDE_STD__HEADERS_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | // STL containers 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | // STL algorithms & functions 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | // C++ Stream stuff 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | namespace OC 35 | { 36 | typedef std::string String; 37 | typedef std::wstring WString; 38 | typedef std::stringstream StringStream; 39 | typedef std::vector StringVector; 40 | typedef std::map StringMap; 41 | typedef std::vector intVector; 42 | typedef std::vector longVector; 43 | typedef std::vector doubleVector; 44 | } 45 | 46 | 47 | 48 | #pragma warning(disable:4251) 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | #endif -------------------------------------------------------------------------------- /src/Application/OConv/lic.cpp: -------------------------------------------------------------------------------- 1 | #include "ConvCommand.h" 2 | 3 | void regiter(String jsonStr) 4 | { 5 | osgDB::ReaderWriter* rw = osgDB::Registry::instance()->getReaderWriterForExtension("license"); 6 | String encodeFunc = StringUtil::replaceAll(jsonStr, "regiter", "encodekey"); 7 | String licenseKey = rw->readObject(encodeFunc).message(); 8 | 9 | String countStr = rw->readObject(jsonStr).message(); 10 | int count = StringConverter::parseInt(countStr); 11 | if (count < 1) 12 | { 13 | std::cout << "register code is not valid" << std::endl; 14 | return; 15 | } 16 | 17 | std::cout << licenseKey << std::endl; 18 | } 19 | 20 | void decodekey(String jsonStr) 21 | { 22 | osgDB::ReaderWriter* rw = osgDB::Registry::instance()->getReaderWriterForExtension("license"); 23 | String result = rw->readObject(jsonStr).message(); 24 | std::cout << result << std::endl; 25 | } 26 | 27 | void encodekey(String jsonStr) 28 | { 29 | decodekey(jsonStr); 30 | } 31 | 32 | void biosuuid(String jsonStr) 33 | { 34 | osgDB::ReaderWriter* rw = osgDB::Registry::instance()->getReaderWriterForExtension("license"); 35 | String uuid = rw->readObject("{\"function\":\"uuid\"}").message(); 36 | std::cout << uuid << std::endl; 37 | } -------------------------------------------------------------------------------- /src/Core/OCesium/glTFConverter.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLTF_CONVETER_H__ 2 | #define _GLTF_CONVETER_H__ 3 | 4 | #include "gltfAttributeCallback.h" 5 | #include "MapProject.h" 6 | 7 | namespace OC 8 | { 9 | namespace Cesium 10 | { 11 | class _CesiumExport glTFConverter : public osg::Referenced 12 | { 13 | public: 14 | glTFConverter(); 15 | ~glTFConverter(); 16 | 17 | void readAttributeMap(String filename); 18 | void readPrjFile(String filename); 19 | void setLocaltion(CVector3 location); 20 | void output(); 21 | void writeToGltf(); 22 | void writeToGlb(); 23 | bool readNodeFile(String filename, osgDB::Options* options = NULL); 24 | void optimize(osg::Node* node); 25 | void resetNode(); 26 | CVector3 mPrjOffset; 27 | osgEarth::optional mPrjCS; 28 | bool localOffset = false; 29 | bool upAxisZ = true; 30 | bool rotate = false; 31 | String outputPath; 32 | private: 33 | void init(); 34 | String mNodeFilename; 35 | CVector3 mLocation; 36 | osg::ref_ptr mNode; 37 | osg::ref_ptr mProjectTool; 38 | osg::ref_ptr mAttributeCallbak; 39 | }; 40 | } 41 | } 42 | 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Core/OCVolume/VolumeDefine.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_VOLUME_DEF_H__ 2 | #define _OC_VOLUME_DEF_H__ 3 | 4 | #ifdef _WIN32 5 | #ifndef OCVolume_EXPORTS 6 | #define _VoloumeExport __declspec(dllimport) 7 | #else 8 | #define _VoloumeExport __declspec(dllexport) 9 | #endif 10 | #else 11 | #define _VoloumeExport 12 | #endif 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | namespace OC 24 | { 25 | namespace Volume 26 | { 27 | struct w3dmheader 28 | { 29 | char magic[4]; 30 | unsigned int version; 31 | unsigned int byteLength; 32 | unsigned int featureTableJSONByteLength; 33 | unsigned int featureTableBinaryByteLength; 34 | }; 35 | 36 | class CVolume; 37 | class CVolumeObject; 38 | class CinRad; 39 | 40 | typedef unsigned char uint8; 41 | 42 | template 43 | static T Clamp(T val, T minval, T maxval) 44 | { 45 | return (std::max)((std::min)(val, maxval), minval); 46 | } 47 | 48 | } 49 | } 50 | 51 | #endif // !_OC_VOLUME_H__ 52 | -------------------------------------------------------------------------------- /src/Application/Weathertoy/WeatherLab.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(SolutionDir)bin\$(Platform)\$(Configuration)\ 5 | WindowsLocalDebugger 6 | simple0 7 | 8 | 9 | $(SolutionDir)bin\$(Platform)\Release 10 | WindowsLocalDebugger 11 | simplec 12 | 13 | 14 | $(SolutionDir)bin\$(Platform)\$(Configuration)\ 15 | WindowsLocalDebugger 16 | simple 17 | 18 | -------------------------------------------------------------------------------- /src/Core/OCHttpServer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 2 | INCLUDE_DIRECTORIES(${WORKINGPATH}/3rdParty/include) 3 | 4 | SET(LIB_NAME OCHttpServer) 5 | 6 | SET(TARGET_H 7 | WebSocket.h 8 | HttpServer.h 9 | HttpServerDefine.h 10 | MapCacher.h 11 | ) 12 | 13 | SET(TARGET_SRC 14 | src/WebSocket.cc 15 | src/HttpServer.cpp 16 | src/mapcacheController.cpp 17 | src/MapCacher.cpp 18 | src/OCserverController.cpp 19 | src/MusicAPIController.cpp 20 | ) 21 | 22 | SET(TARGET_LIBRARIES 23 | OpenThreads 24 | osg 25 | osgDB 26 | osgEarth 27 | OCUtility 28 | OCMain 29 | OCServer 30 | OCHttpClient 31 | drogon 32 | trantor 33 | jsoncpp 34 | ) 35 | 36 | SET(TARGET_EXTERNAL_LIBRARIES 37 | ws2_32 38 | Rpcrt4 39 | zlib 40 | curl 41 | ) 42 | 43 | if (MSVC_VERSION GREATER_EQUAL "1900") 44 | include(CheckCXXCompilerFlag) 45 | CHECK_CXX_COMPILER_FLAG("/std:c++17" _cpp_latest_flag_supported) 46 | if (_cpp_latest_flag_supported) 47 | add_compile_options("/std:c++17") 48 | endif() 49 | endif() 50 | 51 | IF(WIN32) 52 | ADD_DEPENDENCIES(Weathertoy ${LIB_NAME}) 53 | ADD_DEPENDENCIES(OCServerApp ${LIB_NAME}) 54 | ENDIF(WIN32) 55 | 56 | 57 | SETUP_LIBRARY(${LIB_NAME}) 58 | -------------------------------------------------------------------------------- /src/Core/OCModel/ProjectTool.h: -------------------------------------------------------------------------------- 1 | #ifndef _PROJECT_TOOL_CLASS_H__ 2 | #define _PROJECT_TOOL_CLASS_H__ 3 | 4 | #include "PipeNode.h" 5 | #include "PipeLine.h" 6 | #include "OCMain/osgearth.h" 7 | 8 | namespace OC 9 | { 10 | namespace Modeling 11 | { 12 | class _ModelExport ProjectTool : public osg::Referenced 13 | { 14 | public: 15 | ProjectTool(String prjcs); 16 | ~ProjectTool(void); 17 | 18 | void transNode2Global(PipeNode* pipeNode); 19 | void transLine2Global(PipeLine* pipeLine); 20 | 21 | String getPrjcs(); 22 | void setPrjcs(String prjcs); 23 | 24 | CVector3 localTo4326(CVector3 localPoint); 25 | const osgEarth::SpatialReference* getProjectSRS() { return local_srs; } 26 | static CVector3 worldToLonLatH(CVector3 worldposition); 27 | static CVector3 toWorld(CVector3 LonLatHeight); 28 | static CVector3 toWorld(CVector2 LonLat); 29 | static osg::Matrix computeTransform(CVector2 LonLat); 30 | static osg::Matrix computeTransform(CVector3 LonLatH); 31 | static osg::BoundingBox computeRegion(CVector3 LonLatH, double tile_w, double tile_h); 32 | private: 33 | String mPrjcs; 34 | osgEarth::SpatialReference* local_srs; 35 | osgEarth::SpatialReference* wgs84_srs; 36 | }; 37 | } 38 | } 39 | 40 | #endif 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/Core/OCModel/src/DataFilter.cpp: -------------------------------------------------------------------------------- 1 | #include "DataFilter.h" 2 | #include "PipeLine.h" 3 | #include "PipeNode.h" 4 | 5 | namespace OC 6 | { 7 | namespace Modeling 8 | { 9 | CDataFilter::CDataFilter(void) 10 | { 11 | } 12 | 13 | CDataFilter::~CDataFilter(void) 14 | { 15 | } 16 | 17 | void CDataFilter::setTimeClause(String time) 18 | { 19 | mTimeClause = time; 20 | } 21 | 22 | String CDataFilter::getTimeClause() 23 | { 24 | return mTimeClause; 25 | } 26 | 27 | CRectangle CDataFilter::getExtent() 28 | { 29 | return mExtent; 30 | } 31 | 32 | void CDataFilter::setExtent(CRectangle rect) 33 | { 34 | mExtent = rect; 35 | } 36 | 37 | longVector& CDataFilter::getNodeIDList() 38 | { 39 | return mNodeIDList; 40 | } 41 | 42 | longVector& CDataFilter::getLineIDList() 43 | { 44 | return mLineIDList; 45 | } 46 | 47 | void CDataFilter::setLineWhereClause(String clause) 48 | { 49 | mLineClause = clause; 50 | } 51 | 52 | String CDataFilter::getLineWhereClause() 53 | { 54 | return mLineClause; 55 | } 56 | 57 | void CDataFilter::setNodeWhereClause(String clause) 58 | { 59 | mNodeClause = clause; 60 | } 61 | 62 | String CDataFilter::getNodeWhereClause() 63 | { 64 | return mNodeClause; 65 | } 66 | } 67 | } 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/Core/OCesium/converter/glTFOptimize.cpp: -------------------------------------------------------------------------------- 1 | #include "glTFOptimize.h" 2 | 3 | namespace OC 4 | { 5 | namespace Cesium 6 | { 7 | glTFVisitor::glTFVisitor() 8 | : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) 9 | , removeStateset(false) 10 | { 11 | } 12 | 13 | glTFVisitor::~glTFVisitor() 14 | { 15 | } 16 | 17 | void glTFVisitor::apply(osg::Node& node) 18 | { 19 | traverse(node); 20 | } 21 | 22 | void glTFVisitor::apply(osg::StateSet& stateset) 23 | { 24 | 25 | } 26 | 27 | void glTFVisitor::apply(osg::Geode &geode) 28 | { 29 | if (geode.getStateSet()) apply(*geode.getStateSet()); 30 | 31 | unsigned int n = geode.getNumDrawables(); 32 | 33 | for (unsigned int i = 0; i < n; i++) 34 | { 35 | if (osg::Geometry* geom = dynamic_cast(geode.getDrawable(i))) 36 | { 37 | osg::Vec3Array* vertex = dynamic_cast(geom->getVertexArray()); 38 | 39 | if (vertex == NULL) 40 | { 41 | continue; 42 | } 43 | 44 | if (offset.isSet()) 45 | { 46 | for (auto& v : *vertex) 47 | { 48 | v -= offset.get(); 49 | } 50 | geom->dirtyBound(); 51 | } 52 | 53 | if (removeStateset) 54 | { 55 | geom->setStateSet(NULL); 56 | } 57 | } 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/Core/OCUtility/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 2 | 3 | SET(LIB_NAME OCUtility) 4 | 5 | SET(TARGET_H 6 | aes.h 7 | md5.h 8 | AxisAlignedBox.h 9 | ColourValue.h 10 | FileUtil.h 11 | MathUtil.h 12 | Matrix3.h 13 | Matrix4.h 14 | Plane.h 15 | PlaneBoundedVolume.h 16 | Polygon.h 17 | Quaternion.h 18 | Ray.h 19 | Rectangle.h 20 | Sphere.h 21 | StringConverter.h 22 | StringUtil.h 23 | tinystr.h 24 | tinyxml.h 25 | UtilityDefine.h 26 | Vector2.h 27 | Vector3.h 28 | Vector3i.h 29 | Vector4.h 30 | RGBAEncoder.h 31 | ) 32 | 33 | SET(TARGET_SRC 34 | src/aes.cpp 35 | src/md5.cpp 36 | src/AxisAlignedBox.cpp 37 | src/ColourValue.cpp 38 | src/FileUtil.cpp 39 | src/MathUtil.cpp 40 | src/Matrix3.cpp 41 | src/Matrix4.cpp 42 | src/Plane.cpp 43 | src/Polygon.cpp 44 | src/Quaternion.cpp 45 | src/Rectangle.cpp 46 | src/StringConverter.cpp 47 | src/StringUtil.cpp 48 | src/tinystr.cpp 49 | src/tinyxml.cpp 50 | src/tinyxmlerror.cpp 51 | src/tinyxmlparser.cpp 52 | src/Vector2.cpp 53 | src/Vector3.cpp 54 | src/Vector4.cpp 55 | src/RGBAEncoder.cpp 56 | ) 57 | 58 | ADD_DEPENDENCIES(OCMain ${LIB_NAME}) 59 | 60 | IF(WIN32) 61 | ADD_DEPENDENCIES(OCServer ${LIB_NAME}) 62 | ENDIF() 63 | 64 | SETUP_LIBRARY(${LIB_NAME}) 65 | -------------------------------------------------------------------------------- /src/Application/OConv/Geography/ShpDrawer.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_SHP_DRAWER_H__ 2 | #define _OC_SHP_DRAWER_H__ 3 | 4 | #include "OCUtility/StringConverter.h" 5 | #include "OCMain/osg.h" 6 | #include "OCMain/osgearth.h" 7 | #include "OCMain/JsonPackage.h" 8 | 9 | namespace OC 10 | { 11 | class CShpDrawer 12 | { 13 | public: 14 | CShpDrawer(); 15 | ~CShpDrawer(); 16 | 17 | void pushPoint(float x, float y) { pushPoint(CVector2(x, y)); } 18 | void pushPoint(CVector2 point); 19 | osgEarth::LineString* pushLine(); 20 | osgEarth::Polygon* pushPolygon(); 21 | void pushPointName(String name) { mPointNames.push_back(name); } 22 | void pushPolygonName(String name) { mPolygonNames.push_back(name); } 23 | void output(String path); 24 | void test(Vector2List list,String outputfile); 25 | void test(Vector3List list,String outputfile); 26 | 27 | void setExtent(float xmin,float ymin,float xmax,float ymax); 28 | private: 29 | CRectangle mExtent = CRectangle(-180, -90, 180, 90); 30 | std::vector mPolygonNames; 31 | std::vector mPointNames; 32 | std::vector > mPolygons; 33 | std::vector > mLines; 34 | std::vector > mPoints; 35 | 36 | }; 37 | } 38 | 39 | 40 | #endif // !_OC_SHP_DRAWER_H__ 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/Plugins/nc/NCArchive.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_NC_ARCHIVE_CLASS_H__ 2 | #define _OC_NC_ARCHIVE_CLASS_H__ 3 | 4 | #include "OCLayer/IArchive.h" 5 | 6 | using namespace OC; 7 | 8 | class NcArchive : public IArchive 9 | { 10 | public: 11 | NcArchive(void); 12 | ~NcArchive(void); 13 | virtual const char* libraryName() const { return "OCPlugins NC"; } 14 | virtual const char* className() const { return "NcArchive"; } 15 | virtual bool acceptsExtension(const String& extension) const { return osgDB::ReaderWriter::acceptsExtension(extension); } 16 | virtual osgDB::ReaderWriter::ReadResult readNode(std::istream& /*fin*/, const Options* = NULL) const; 17 | virtual osgDB::ReaderWriter::ReadResult readNode(const String& /*fileName*/, const osgDB::ReaderWriter::Options* = NULL) const; 18 | virtual osgDB::ReaderWriter::ReadResult readImage(const String& /*fileName*/, const osgDB::ReaderWriter::Options* = NULL) const; 19 | virtual osgDB::ReaderWriter::ReadResult readObject(const String& /*fileName*/, const osgDB::ReaderWriter::Options* = NULL) const; 20 | virtual osgDB::ReaderWriter::WriteResult writeImage(const osg::Image& /*image*/, const String& /*fileName*/, const osgDB::ReaderWriter::Options* = NULL) const; 21 | virtual osgDB::ReaderWriter::WriteResult writeImage(const osg::Image& /*image*/, std::ostream& /*fout*/, const osgDB::ReaderWriter::Options* = NULL) const; 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/Core/OCesium/I3dmWriter.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_I3DM_WRITER_H 2 | #define _OC_I3DM_WRITER_H 3 | 4 | #include "CesiumDefine.h" 5 | #include "FeatureBatchTable.h" 6 | #include "BaseWriter.h" 7 | 8 | namespace OC 9 | { 10 | namespace Cesium 11 | { 12 | class _CesiumExport I3dmWriter : public BaseWriter 13 | { 14 | public: 15 | I3dmWriter(); 16 | 17 | void push(osg::Vec3 pos, osg::Vec3 normalU, osg::Vec3 normalR); 18 | void push_position(osg::Vec3 pos); 19 | void push_scale(osg::Vec3 scale); 20 | void push_normalU(osg::Vec3 normal); 21 | void push_normalR(osg::Vec3 normal); 22 | void setNode(osg::Node* node) { mNode = node; } 23 | void setUrl(String url); 24 | String getUrl(); 25 | 26 | size_t size(); 27 | osg::ref_ptr mNode; 28 | osg::ref_ptr scales; 29 | osg::ref_ptr normalsU; 30 | osg::ref_ptr normalsR; 31 | osg::ref_ptr positions; 32 | 33 | GLTFObject* getGltfObject(); 34 | FeatureBatchTable* getFeatureBatchTable(); 35 | 36 | virtual bool writeToFile(String filename); 37 | virtual bool writeToStream(std::ostream& output); 38 | protected: 39 | ~I3dmWriter(); 40 | private: 41 | osg::ref_ptr mGltfObject; 42 | osg::ref_ptr mFeatureBatchTable; 43 | String mURL; 44 | }; 45 | } 46 | } 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /src/Core/OCLayer/ReadFileCallback.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_READFILECALLBACK_H__ 2 | #define _OC_READFILECALLBACK_H__ 3 | 4 | #include "IArchive.h" 5 | 6 | namespace OC 7 | { 8 | class _LayerExport OCReadFileCallback : public osgDB::ReadFileCallback 9 | { 10 | public: 11 | OCReadFileCallback(); 12 | ~OCReadFileCallback(); 13 | 14 | virtual osgDB::ReaderWriter::ReadResult openArchive(const String& fileName, osgDB::ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint, const osgDB::Options* options); 15 | virtual osgDB::ReaderWriter::ReadResult readObject(const String& fileName,const osgDB::Options* options); 16 | virtual osgDB::ReaderWriter::ReadResult readImage(const String& fileName,const osgDB::Options* options); 17 | virtual osgDB::ReaderWriter::ReadResult readHeightField(const String& fileName,const osgDB::Options* options); 18 | virtual osgDB::ReaderWriter::ReadResult readShader(const String& fileName,const osgDB::Options* options); 19 | virtual osgDB::ReaderWriter::ReadResult readNode(const String& filename, const osgDB::Options* options); 20 | 21 | private: 22 | osg::Node* getErrorNode(); 23 | inline bool is_error(String url); 24 | inline void mark_error(String url); 25 | StringIntMap mErrorRequests; 26 | osg::ref_ptr mErrorNode; 27 | ObserverObjectCacher mCacheArchives; 28 | }; 29 | } 30 | 31 | 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/Core/OCLayer/src/OCResource.cpp: -------------------------------------------------------------------------------- 1 | #include "OCResource.h" 2 | #include "OCMain/Environment.h" 3 | 4 | namespace OC 5 | { 6 | #if SingletonConfig == SingletonNormal 7 | template<>OCResource* CSingleton::msSingleton = NULL; 8 | #elif SingletonConfig == SingletonProcess 9 | template<>std::map CSingleton::msPidton; 10 | #endif 11 | 12 | OCResource::OCResource(void) 13 | { 14 | String filename = Singleton(Environment).getAppDir() + "data/resource.db"; 15 | String conectStr = "driver:sqlite;location:" + filename; 16 | mArchive = static_cast(osgDB::Registry::instance()->openArchive(conectStr,osgDB::ReaderWriter::READ,0,NULL).takeArchive()); 17 | } 18 | 19 | OCResource::~OCResource(void) 20 | { 21 | } 22 | 23 | IArchive* OCResource::getArchive() 24 | { 25 | return mArchive.get(); 26 | } 27 | 28 | osg::Image* OCResource::readImage(String file) 29 | { 30 | if(mArchive.valid()) 31 | { 32 | return mArchive->readImage(file).takeImage(); 33 | } 34 | 35 | return NULL; 36 | } 37 | 38 | inline bool validFile(String filename) 39 | { 40 | return FileUtil::FileExist(filename) && FileUtil::FileSize(filename) > 0; 41 | } 42 | 43 | osg::Node* OCResource::readNode(String file) 44 | { 45 | if(mArchive.valid()) 46 | { 47 | return mArchive->readNode(file).takeNode(); 48 | } 49 | 50 | return NULL; 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /src/Core/OCesium/ConvertWorkqueue.h: -------------------------------------------------------------------------------- 1 | #ifndef _CONVERT_PROCESS_WORKQUEUE_CLASS_H 2 | #define _CONVERT_PROCESS_WORKQUEUE_CLASS_H 3 | 4 | #include "OCMain/DefaultWorkQueueStandard.h" 5 | #include "CesiumTool.h" 6 | 7 | namespace OC 8 | { 9 | namespace Cesium 10 | { 11 | class ConvertWorkqueue : public WorkQueue::ResponseHandler, public WorkQueue::RequestHandler 12 | { 13 | public: 14 | ConvertWorkqueue(int threadNum = 2); 15 | ~ConvertWorkqueue(void); 16 | 17 | enum RequestType 18 | { 19 | RT_WriteDirectory, 20 | RT_Writeb3dm, 21 | RT_SplitAndWrite 22 | }; 23 | 24 | struct TaskRequest 25 | { 26 | RequestType type; 27 | String srcDir; 28 | String destDir; 29 | String file; 30 | int code; 31 | osg::ref_ptr rootNode; 32 | ObliqueConverter* converter; 33 | osg::ref_ptr parentTile; 34 | friend std::ostream& operator<<(std::ostream& o, const TaskRequest& r) 35 | { 36 | (void)r; return o; 37 | } 38 | }; 39 | 40 | void shutdown(); 41 | int mWorkQueueChannel; 42 | virtual void handleResponse(const WorkQueue::Response* res, const WorkQueue* srcQ); 43 | virtual WorkQueue::Response* handleRequest(const WorkQueue::Request* req, const WorkQueue* srcQ); 44 | void addRequest(TaskRequest request); 45 | int finished = 0; 46 | WorkQueue* mWorkQueue; 47 | }; 48 | } 49 | } 50 | 51 | 52 | #endif -------------------------------------------------------------------------------- /src/Core/OCMain/osgearth.h: -------------------------------------------------------------------------------- 1 | #ifndef _OSGEARTH_HEADER_H__ 2 | #define _OSGEARTH_HEADER_H__ 3 | #pragma warning(disable:4100) 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | //#include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Core/OCLayer/src/IFeature.cpp: -------------------------------------------------------------------------------- 1 | #include "IFeature.h" 2 | 3 | namespace OC 4 | { 5 | String IFeature::LabelFeatureType = "IFeature::Label"; 6 | String IFeature::ModelFeatureType = "IFeature::Model"; 7 | 8 | IFeature::IFeature(void) 9 | :mParent(NULL) 10 | ,mRecord(NULL) 11 | { 12 | mRecord = new IRecord; 13 | } 14 | 15 | 16 | IFeature::~IFeature(void) 17 | { 18 | } 19 | 20 | void IFeature::setID(long id) 21 | { 22 | if (mRecord.valid()) 23 | { 24 | mRecord->setID(id); 25 | } 26 | } 27 | 28 | long IFeature::getID() 29 | { 30 | if (mRecord.valid()) 31 | { 32 | return mRecord->getID(); 33 | } 34 | return -9999; 35 | } 36 | 37 | void IFeature::setFeatureName(String name) 38 | { 39 | if (mRecord.valid()) 40 | { 41 | mRecord->setFeatureName(name); 42 | } 43 | } 44 | 45 | String IFeature::getFeatureName() 46 | { 47 | if (mRecord.valid()) 48 | { 49 | return mRecord->getFeatureName(); 50 | } 51 | return StringUtil::BLANK; 52 | } 53 | 54 | ILayer* IFeature::getParent() 55 | { 56 | return mParent; 57 | } 58 | 59 | void IFeature::setParent(ILayer* layer) 60 | { 61 | mParent = layer; 62 | } 63 | 64 | void IFeature::setRecord(IRecord* record) 65 | { 66 | mRecord = record; 67 | } 68 | 69 | IRecord* IFeature::getRecrod() 70 | { 71 | return mRecord.get(); 72 | } 73 | 74 | String IFeature::getType() 75 | { 76 | return mFeatureType; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/Application/OConv/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 2 | INCLUDE_DIRECTORIES(${WORKINGPATH}/3rdParty/include) 3 | 4 | SET(LIB_NAME OConv) 5 | 6 | SET(TARGET_H 7 | Geography/ShpDrawer.h 8 | Geography/ShpDrawerHelper.h 9 | Geography/Matrix.h 10 | Geography/Utils.h 11 | Geography/Variogram.h 12 | Geography/Vector3.h 13 | Geography/Kriging.h 14 | Geography/GDALTool.h 15 | Geography/GeographyTool.h 16 | Thread/ConvWorkqueue.h 17 | ConvCommand.h 18 | RadarStationKML.h 19 | SqliteOper.h 20 | OConvMapCacher.h 21 | ) 22 | 23 | SET(TARGET_SRC 24 | Geography/ShpDrawer.cpp 25 | Geography/Kriging.cpp 26 | Geography/GDALTool.cpp 27 | Geography/GeographyTool.cpp 28 | Thread/ConvWorkqueue.cpp 29 | ConvCommand.cpp 30 | ConvCommand2.cpp 31 | tdtiles.cpp 32 | deprecated.cpp 33 | lic.cpp 34 | main.cpp 35 | RadarStationKML.cpp 36 | SqliteOper.cpp 37 | MapCacheClient.cpp 38 | OConvMapCacher.cpp 39 | ) 40 | 41 | SET(TARGET_COMMON_LIBRARIES 42 | OpenThreads 43 | osg 44 | osgDB 45 | osgUtil 46 | osgEarth 47 | OCZip 48 | OCVolume 49 | OCUtility 50 | OCMain 51 | OCesium 52 | OCLayer 53 | OCModel 54 | OCHttpServer 55 | OCHttpClient 56 | ) 57 | 58 | SET(TARGET_EXTERNAL_LIBRARIES 59 | gdal_i 60 | curl 61 | ) 62 | 63 | SETUP_APPLICATION(${LIB_NAME}) 64 | SETUP_GROUP() -------------------------------------------------------------------------------- /src/Core/OCLayer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 2 | 3 | SET(LIB_NAME OCLayer) 4 | 5 | SET(TARGET_H 6 | Feature.h 7 | FeatureEffect.h 8 | FeatureLayer.h 9 | FeatureNode.h 10 | FeatureRecord.h 11 | ILayer.h 12 | LayerConfig.h 13 | LayerDefine.h 14 | LayerManager.h 15 | MetaRecord.h 16 | QuadTree.h 17 | OCResource.h 18 | ReadFileCallback.h 19 | IArchive.h 20 | IDatabase.h 21 | IDatabaseObject.h 22 | QueryInfo.h 23 | ModelUtil.h 24 | SceneNode.h 25 | ScenePass.h 26 | IRecord.h 27 | IFeature.h 28 | ) 29 | 30 | SET(TARGET_SRC 31 | src/Feature.cpp 32 | src/FeatureEffect.cpp 33 | src/FeatureLayer.cpp 34 | src/FeatureNode.cpp 35 | src/FeatureRecord.cpp 36 | src/ILayer.cpp 37 | src/LayerConfig.cpp 38 | src/LayerManager.cpp 39 | src/MetaRecord.cpp 40 | src/QuadTree.cpp 41 | src/OCResource.cpp 42 | src/ReadFileCallback.cpp 43 | src/IArchive.cpp 44 | src/IDatabase.cpp 45 | src/IDatabaseObject.cpp 46 | src/QueryInfo.cpp 47 | src/ModelUtil.cpp 48 | src/SceneNode.cpp 49 | src/ScenePass.cpp 50 | src/IRecord.cpp 51 | src/IFeature.cpp 52 | ) 53 | 54 | SET(TARGET_LIBRARIES 55 | OpenThreads 56 | osg 57 | osgDB 58 | osgUtil 59 | OCUtility 60 | OCMain 61 | ) 62 | 63 | IF(WIN32) 64 | ADD_DEPENDENCIES(OCModel ${LIB_NAME}) 65 | ENDIF(WIN32) 66 | 67 | SETUP_LIBRARY(${LIB_NAME}) 68 | -------------------------------------------------------------------------------- /src/Core/OCModel/xmlConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_MODEL_XML_CONFIG_H__ 2 | #define _OC_MODEL_XML_CONFIG_H__ 3 | 4 | #include "TableConfig.h" 5 | #include "FieldMapping.h" 6 | 7 | namespace OC 8 | { 9 | namespace Modeling 10 | { 11 | class _ModelExport CXmlConfig 12 | { 13 | public: 14 | CXmlConfig(void); 15 | ~CXmlConfig(void); 16 | 17 | bool loadXml(String path); 18 | void save(); 19 | void decorate(IModelTable* table); 20 | 21 | //table config 22 | void removeTable(TableConfig* config); 23 | void addTable(TableConfig* config); 24 | TableConfig* findTable(String table_name); 25 | TableVectorIterator getTableVectorIterator(); 26 | 27 | //fieldmapping 28 | void changeFieldMappingName(String old,String name); 29 | void addFieldMapping(FieldMapping* fm); 30 | FieldMapping* findFieldMapping(String map_name); 31 | FieldMappingVectorIterator getFieldMappingIterator(); 32 | void setDefaultFieldMapping(String fieldmapping); 33 | String getDefaultFieldMapping(); 34 | 35 | ModelConfigMap getModelConfigMap(); 36 | 37 | 38 | protected: 39 | String mDefaultFieldMapping; 40 | TableConfigList mTableConfigList; 41 | TableConfigMap mTableConfigMap; 42 | FieldMappingList mFieldMappingList; 43 | FieldMappingMap mFieldMappingMap; 44 | bool m_load; 45 | String mXmlPath; 46 | TiXmlDocument mDocument; 47 | ModelConfigMap mModelMap; 48 | }; 49 | } 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/Plugins/shapefile/ShapeFileDatabase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "OCModel/IModelDatabase.h" 4 | #include "ogrsf_frmts.h" 5 | 6 | namespace OC 7 | { 8 | namespace Modeling 9 | { 10 | typedef std::map SourceMap; 11 | 12 | class ShapeFileDatabase:public IModelDatabase 13 | { 14 | public: 15 | ShapeFileDatabase(); 16 | ~ShapeFileDatabase(); 17 | virtual TemplateRecordList query(String table,OCHeaderInfo* headinfo,CQueryInfo* filter = NULL); 18 | virtual bool create(String url,String user = "",String psw = ""); 19 | 20 | virtual bool connect(String connectStr); 21 | virtual OCHeaderInfo* getHeadInfo(String table); 22 | virtual StringVector enumGeometryLayers(); 23 | virtual StringVector enumNets(); 24 | virtual StringVector emunFields(String table,String hdr); 25 | virtual bool getLineData(PipeTable* table); 26 | virtual bool getNodeData(PipeTable* table); 27 | void initShpDriver(); 28 | StringVector simplequery(String sqlStr); 29 | StringVector simplequery(String sqlStr,OGRDataSourceH datasrc); 30 | 31 | OGRDataSourceH open_shapefile(String file); 32 | bool initShpDriver(String strShpFile); 33 | bool writeFeature(FeatureRecord* record); 34 | private: 35 | void destroy(); 36 | OGRSFDriverH _ogrDriverHandle; 37 | String mShpPath; 38 | SourceMap mSourceMap; 39 | 40 | OGRDataSourceH m_pDataSourceOut; 41 | OGRLayerH m_pLayer; 42 | String m_strShpFile; 43 | }; 44 | } 45 | } -------------------------------------------------------------------------------- /src/Core/OCMain/Singleton.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_SINGLETON_H__ 2 | #define _OC_SINGLETON_H__ 3 | 4 | #pragma warning (disable : 4311) 5 | #pragma warning (disable : 4312) 6 | #pragma warning (disable : 4661) 7 | 8 | #include "BaseDefine.h" 9 | 10 | namespace OC { 11 | template class CSingleton 12 | { 13 | private: 14 | /** \brief Explicit private copy constructor. This is a forbidden operation.*/ 15 | CSingleton(const CSingleton &); 16 | 17 | /** \brief Private operator= . This is a forbidden operation. */ 18 | CSingleton& operator=(const CSingleton &); 19 | 20 | protected: 21 | #ifdef _WIN32 22 | static std::map msPidton; 23 | public: 24 | CSingleton( void ) 25 | { 26 | msPidton[CORE_CURRENT_PID] = static_cast< T* >( this ); 27 | } 28 | ~CSingleton( void ) 29 | {} 30 | static T& getSingleton( void ) 31 | { return ( *msPidton[CORE_CURRENT_PID] ); } 32 | static T* getSingletonPtr( void ) 33 | { return msPidton[CORE_CURRENT_PID]; } 34 | #else 35 | static T* msSingleton; 36 | public: 37 | CSingleton( void ) 38 | { 39 | msSingleton = static_cast< T* >( this ); 40 | } 41 | ~CSingleton( void ) 42 | {} 43 | static T& getSingleton( void ) 44 | { return ( *msSingleton ); } 45 | static T* getSingletonPtr( void ) 46 | { return msSingleton; } 47 | #endif 48 | 49 | }; 50 | /** @} */ 51 | /** @} */ 52 | 53 | } 54 | #if defined ( CORE_GCC_VISIBILITY ) 55 | # pragma GCC visibility pop 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/Application/OCServerApp/OCServer.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 23 | 24 | 头文件 25 | 26 | 27 | 28 | 29 | 资源文件 30 | 31 | 32 | 33 | 34 | 资源文件 35 | 36 | 37 | 资源文件 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/Core/OCZip/src/PakoZip.cpp: -------------------------------------------------------------------------------- 1 | #include "PakoZip.h" 2 | #include "zip.h" 3 | 4 | namespace OC 5 | { 6 | PakoZip::PakoZip() 7 | {} 8 | PakoZip::~PakoZip() 9 | {} 10 | 11 | #define CHUNK 32768 12 | bool PakoZip::compress(std::ostream& fout, const std::string& src) 13 | { 14 | int ret, flush = Z_FINISH; 15 | unsigned have; 16 | z_stream strm; 17 | unsigned char out[CHUNK]; 18 | 19 | int level = 8; 20 | int stategy = Z_DEFAULT_STRATEGY; 21 | 22 | /* allocate deflate state */ 23 | strm.zalloc = Z_NULL; 24 | strm.zfree = Z_NULL; 25 | strm.opaque = Z_NULL; 26 | ret = deflateInit2(&strm, level, Z_DEFLATED, 27 | -15,//15+16, // +16 to use gzip encoding 28 | 8, // default 29 | stategy); 30 | if (ret != Z_OK) return false; 31 | 32 | strm.avail_in = (uInt)src.size(); 33 | strm.next_in = (Bytef*)(&(*src.begin())); 34 | 35 | /* run deflate() on input until output buffer not full, finish 36 | compression if all of source has been read in */ 37 | do 38 | { 39 | strm.avail_out = CHUNK; 40 | strm.next_out = out; 41 | ret = deflate(&strm, flush); /* no bad return value */ 42 | 43 | if (ret == Z_STREAM_ERROR) 44 | { 45 | return false; 46 | } 47 | 48 | have = CHUNK - strm.avail_out; 49 | if (have > 0) fout.write((const char*)out, have); 50 | 51 | if (fout.fail()) 52 | { 53 | (void)deflateEnd(&strm); 54 | return false; 55 | } 56 | } while (strm.avail_out == 0); 57 | 58 | /* clean up and return */ 59 | (void)deflateEnd(&strm); 60 | return true; 61 | } 62 | } -------------------------------------------------------------------------------- /src/Application/Weathertoy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 2 | INCLUDE_DIRECTORIES(${WORKINGPATH}/3rdParty/etc) 3 | SET(LIB_NAME Weathertoy) 4 | 5 | set(CMAKE_AUTORCC ON) 6 | set(CMAKE_AUTOMOC ON) 7 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 8 | 9 | set(QRC_SOURCE_FILES resources.qrc) 10 | qt5_add_resources(QRC_FILES ${QRC_SOURCE_FILES}) 11 | SOURCE_GROUP("Resource Files" FILES ${QRC_SOURCE_FILES}) 12 | 13 | SET(TARGET_H 14 | Bridge.h 15 | LabViewer.h 16 | LabWebEngineView.h 17 | RibbonMenuWidget.h 18 | ServerThread.h 19 | WeatherLabMenu.h 20 | webuihandler.h 21 | RadarStationKML.h 22 | ) 23 | 24 | SET(TARGET_SRC 25 | Bridge.cpp 26 | LabViewer.cpp 27 | LabWebEngineView.cpp 28 | RibbonMenuWidget.cpp 29 | ServerThread.cpp 30 | WeatherLabMenu.cpp 31 | webuihandler.cpp 32 | main.cpp 33 | WeatherLab.rc 34 | ${QRC_FILES} 35 | ) 36 | SET(TARGET_COMMON_LIBRARIES 37 | OpenThreads 38 | osg 39 | osgDB 40 | osgUtil 41 | osgEarth 42 | OCZip 43 | OCVolume 44 | OCUtility 45 | OCMain 46 | OCesium 47 | OCModel 48 | OCHttpServer 49 | SARibbonBar 50 | ) 51 | SETUP_APPLICATION(${LIB_NAME}) 52 | 53 | if (MSVC) 54 | set_property(TARGET ${LIB_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY ${OUTPUT_BINDIR}) 55 | endif() 56 | 57 | qt5_use_modules( ${LIB_NAME} Widgets ) 58 | qt5_use_modules( ${LIB_NAME} Xml ) 59 | qt5_use_modules( ${LIB_NAME} WebEngine ) 60 | qt5_use_modules( ${LIB_NAME} WebView ) 61 | qt5_use_modules( ${LIB_NAME} WebEngineWidgets ) 62 | -------------------------------------------------------------------------------- /src/Core/OCesium/ObliqueConverter.h: -------------------------------------------------------------------------------- 1 | #ifndef _Oblique_CONVETER_H__ 2 | #define _Oblique_CONVETER_H__ 3 | 4 | #include "glTFOptimize.h" 5 | #include "ConvertWorkqueue.h" 6 | #include "MapProject.h" 7 | #include "OCesium/CesiumTool.h" 8 | 9 | namespace OC 10 | { 11 | namespace Cesium 12 | { 13 | class _CesiumExport ObliqueConverter 14 | { 15 | public: 16 | ObliqueConverter(int threadNum = 10); 17 | ~ObliqueConverter(); 18 | bool convert(String srcDir, String destDir, String file, int level, OC::Cesium::Tile* parentTile, osg::Node* parentNode); 19 | void readNode(String filename); 20 | bool mRWriteB3dm = false; 21 | bool mRWriteJson = false; 22 | bool resumeMode = false; 23 | bool mergeTop = false; 24 | int mMaxTileNodeNum = 32; 25 | int mMaxRootTileNodeNum = 64; 26 | int mDebugDepth = 100; 27 | String mDestDir; 28 | CVector3 mLocation = CVector3(108.9594, 34.2196, 0.0); 29 | osg::BoundingBox mRootBoundBox; 30 | CORE_AUTO_MUTEX 31 | 32 | class ObliqueAttributeCallback : public Cesium::FeatureAttributeCallback 33 | { 34 | public: 35 | ObliqueAttributeCallback(ObliqueConverter* owner); 36 | ~ObliqueAttributeCallback(); 37 | void onSetAttirubte(String name, Cesium::FeatureBatchTable* featurebatchtable); 38 | String _name; 39 | private: 40 | ObliqueConverter* _owner; 41 | }; 42 | 43 | void split(osg::Group* node, OC::Cesium::Tile* parentTile, bool shouldSplit, int depth, String destDir, int code); 44 | private: 45 | ConvertWorkqueue workqueue; 46 | }; 47 | } 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/Plugins/pipe/PipeTable.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_Model_PipeTable_H__ 2 | #define _OC_Model_PipeTable_H__ 3 | 4 | #include "OCModel/IModelTable.h" 5 | #include "NodeTable.h" 6 | #include "LineTable.h" 7 | #include "OCModel/SaveStrategy.h" 8 | 9 | namespace OC 10 | { 11 | namespace Modeling 12 | { 13 | class PipeTable : public IModelTable 14 | { 15 | public: 16 | PipeTable(ModelDataManager* owner); 17 | ~PipeTable(void); 18 | virtual PipeTable* asPipeTable(){return static_cast(this);} 19 | 20 | static PipeTable* from(IArchive* archive); 21 | 22 | virtual bool startBuild(); 23 | virtual long getSize(); 24 | 25 | NodeTable& getNodeTable(); 26 | LineTable& getLineTable(); 27 | 28 | void fixData(); 29 | 30 | bool prepare(); 31 | 32 | void setQueryMapping(FieldMapping* mapping); 33 | FieldMapping* getQueryMapping(); 34 | 35 | bool checkData(); 36 | 37 | virtual void push_data(IModelData* data); 38 | void onPush(IModelData* data); 39 | void setPushListener(ModelPushListener* listener); 40 | protected: 41 | void reset(); 42 | bool init(); 43 | bool getData(); 44 | 45 | void trans2world(); 46 | void output(); 47 | protected: 48 | osg::ref_ptr mModelPushListener; 49 | osg::ref_ptr mFieldMapping; 50 | LineTable mLineTable; 51 | NodeTable mNodeTable; 52 | CORE_FRIEND_CLASS(LineTable); 53 | CORE_FRIEND_CLASS(NodeTable); 54 | }; 55 | 56 | typedef std::map PipeTableMap; 57 | } 58 | } 59 | 60 | 61 | #endif 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/Core/OCModel/NodeTable.h: -------------------------------------------------------------------------------- 1 | #ifndef _NODE_TABLE_CLASS_H_ 2 | #define _NODE_TABLE_CLASS_H_ 3 | 4 | #include "PipeNode.h" 5 | #include "QuadTreeGenerator.h" 6 | #include "DataFilter.h" 7 | 8 | namespace OC 9 | { 10 | namespace Modeling 11 | { 12 | 13 | class _ModelExport NodeTable 14 | { 15 | public: 16 | NodeTable(PipeTable* owner); 17 | ~NodeTable(); 18 | 19 | NodeMap& getNodeMap(); 20 | NodeMapIterator getIterator(void); 21 | 22 | void push(PipeNode* node); 23 | long findID(String nodecode,CVector3 position); 24 | PipeNode* find(long gid); 25 | 26 | bool checkData(); 27 | 28 | void fixData(); 29 | 30 | void clear(); 31 | 32 | String getNameTable(); 33 | void setNameTable(String table); 34 | 35 | String getAliasName(); 36 | void setAliasName(String name); 37 | 38 | CRectangle& getExtent(); 39 | 40 | void removeInvalidData(); 41 | 42 | IModelDataList getBlockMap(); 43 | 44 | std::multimap& getCodeMap(){return mCodeIDMap;} 45 | 46 | osg::ref_ptr& getFilter(){return mDataFilter;} 47 | protected: 48 | NodeMap mNodeList; 49 | std::multimap mCodeIDMap; 50 | private: 51 | String mAliasName; 52 | String mTableName; 53 | PipeTable* mOwner; 54 | CRectangle mExtent; 55 | osg::ref_ptr mDataFilter; 56 | 57 | inline void doModelType(PipeNode* node); 58 | inline void doFeatureInfo(PipeNode* node); 59 | inline void doMaterialInfo(PipeNode* node); 60 | }; 61 | } 62 | } 63 | 64 | 65 | #endif 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/Core/OCesium/MergeTriangleOperator.h: -------------------------------------------------------------------------------- 1 | #ifndef _MERGETRIANGLEOPERATOR_H_ 2 | #define _MERGETRIANGLEOPERATOR_H_ 3 | 4 | #include 5 | 6 | namespace OC 7 | { 8 | class GltfTriangleOperator 9 | { 10 | public: 11 | osg::ref_ptr set; 12 | unsigned int offset = 0; 13 | std::map mapRepeat2; 14 | std::map mapRepeat3; 15 | 16 | inline void operator()(unsigned int p1) 17 | { 18 | 19 | } 20 | 21 | inline void operator()(unsigned int p1, unsigned int p2) 22 | { 23 | osg::Vec2i tri(p1 + offset, p2 + offset); 24 | if (mapRepeat2.find(tri) != mapRepeat2.end()) 25 | { 26 | return; 27 | } 28 | 29 | mapRepeat2[tri] = 1; 30 | 31 | set->addElement(tri.x()); 32 | set->addElement(tri.y()); 33 | } 34 | 35 | inline void operator()(unsigned int p1, unsigned int p2, unsigned int p3) 36 | { 37 | osg::Vec3i tri(p1 + offset, p2 + offset, p3 + offset); 38 | if (mapRepeat3.find(tri) != mapRepeat3.end()) 39 | { 40 | return; 41 | } 42 | 43 | mapRepeat3[tri] = 1; 44 | 45 | set->addElement(tri.x()); 46 | set->addElement(tri.y()); 47 | set->addElement(tri.z()); 48 | } 49 | }; 50 | 51 | typedef osg::TriangleLinePointIndexFunctor GltfTriangleIndexFunctor; 52 | } 53 | 54 | #endif // !1 55 | -------------------------------------------------------------------------------- /src/Plugins/pipe/NodeTable.h: -------------------------------------------------------------------------------- 1 | #ifndef _NODE_TABLE_CLASS_H_ 2 | #define _NODE_TABLE_CLASS_H_ 3 | 4 | #include "PipeNode.h" 5 | #include "OCModel/QuadTreeGenerator.h" 6 | #include "OCModel/DataFilter.h" 7 | 8 | namespace OC 9 | { 10 | namespace Modeling 11 | { 12 | 13 | class NodeTable 14 | { 15 | public: 16 | NodeTable(PipeTable* owner); 17 | ~NodeTable(); 18 | 19 | NodeMap& getNodeMap(); 20 | NodeMapIterator getIterator(void); 21 | 22 | void push(PipeNode* node); 23 | long findID(String nodecode,CVector3 position); 24 | PipeNode* find(long gid); 25 | 26 | bool checkData(); 27 | 28 | void fixData(); 29 | 30 | void clear(); 31 | 32 | String getNameTable(); 33 | void setNameTable(String table); 34 | 35 | String getAliasName(); 36 | void setAliasName(String name); 37 | 38 | CRectangle& getExtent(); 39 | 40 | void removeInvalidData(); 41 | 42 | IModelDataList getBlockMap(); 43 | 44 | std::multimap& getCodeMap(){return mCodeIDMap;} 45 | 46 | osg::ref_ptr& getFilter(){return mDataFilter;} 47 | protected: 48 | NodeMap mNodeList; 49 | std::multimap mCodeIDMap; 50 | private: 51 | String mAliasName; 52 | String mTableName; 53 | PipeTable* mOwner; 54 | CRectangle mExtent; 55 | osg::ref_ptr mDataFilter; 56 | 57 | inline void doModelType(PipeNode* node); 58 | inline void doFeatureInfo(PipeNode* node); 59 | inline void doMaterialInfo(PipeNode* node); 60 | }; 61 | } 62 | } 63 | 64 | 65 | #endif 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/Core/OCesium/internal/swap.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_SWAP_H_ 16 | #define RAPIDJSON_INTERNAL_SWAP_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(__clang__) 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(c++98-compat) 23 | #endif 24 | 25 | RAPIDJSON_NAMESPACE_BEGIN 26 | namespace internal { 27 | 28 | //! Custom swap() to avoid dependency on C++ header 29 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. 30 | \note This has the same semantics as std::swap(). 31 | */ 32 | template 33 | inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT { 34 | T tmp = a; 35 | a = b; 36 | b = tmp; 37 | } 38 | 39 | } // namespace internal 40 | RAPIDJSON_NAMESPACE_END 41 | 42 | #if defined(__clang__) 43 | RAPIDJSON_DIAG_POP 44 | #endif 45 | 46 | #endif // RAPIDJSON_INTERNAL_SWAP_H_ 47 | -------------------------------------------------------------------------------- /src/Core/OCServer/src/OCRegister.cpp: -------------------------------------------------------------------------------- 1 | #include "OCRegister.h" 2 | 3 | namespace OC 4 | { 5 | String OC::Server::OCRegister::getRegister(StringVector params) 6 | { 7 | String code = params[1]; 8 | String bios = params[2]; 9 | String year = params[3]; 10 | String month = params[4]; 11 | String day = params[5]; 12 | 13 | String jsonStr1 = "{\"function\":\"encodekey\",\"uuid\":\"{0}\",\"year\":{1},\"month\":{2},\"day\":{3}}"; 14 | String jsonStr2 = "{\"function\":\"regiter\",\"code\":\"{0}\",\"year\":{1},\"month\":{2},\"day\":{3}}"; 15 | 16 | jsonStr1 = StringUtil::replaceAll(jsonStr1, "{0}", bios); 17 | jsonStr1 = StringUtil::replaceAll(jsonStr1, "{1}", year); 18 | jsonStr1 = StringUtil::replaceAll(jsonStr1, "{2}", month); 19 | jsonStr1 = StringUtil::replaceAll(jsonStr1, "{3}", day); 20 | 21 | jsonStr2 = StringUtil::replaceAll(jsonStr2, "{0}", code); 22 | jsonStr2 = StringUtil::replaceAll(jsonStr2, "{1}", year); 23 | jsonStr2 = StringUtil::replaceAll(jsonStr2, "{2}", month); 24 | jsonStr2 = StringUtil::replaceAll(jsonStr2, "{3}", day); 25 | 26 | osgDB::ReaderWriter* rw = osgDB::Registry::instance()->getReaderWriterForExtension("license"); 27 | String licenseKey = rw->readObject(jsonStr1).message(); 28 | 29 | String countStr = rw->readObject(jsonStr2).message(); 30 | int count = StringConverter::parseInt(countStr); 31 | if (count < 1) 32 | { 33 | return "register code is not valid"; 34 | } 35 | 36 | return licenseKey; 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /src/Core/OCLayer/src/IArchive.cpp: -------------------------------------------------------------------------------- 1 | #include "IArchive.h" 2 | 3 | namespace OC 4 | { 5 | IArchive::IArchive() 6 | :mCommitNum(1000) 7 | ,mCommitCount(0) 8 | { 9 | 10 | } 11 | 12 | IArchive::~IArchive() 13 | { 14 | if (mDatabase.valid()) 15 | { 16 | mDatabase->commitTransaction(); 17 | } 18 | } 19 | 20 | IDatabase* IArchive::getDatabase() const 21 | { 22 | return mDatabase.get(); 23 | } 24 | 25 | String IArchive::getArchiveFileName() const 26 | { 27 | return mArchiveFileName; 28 | } 29 | 30 | String IArchive::getMasterFileName() const 31 | { 32 | return mMasterFileName; 33 | } 34 | 35 | void IArchive::setDirectory(const String dir) 36 | { 37 | mDirectory = dir; 38 | if (!StringUtil::endsWith(dir,"/")) 39 | { 40 | mDirectory += "/"; 41 | } 42 | } 43 | 44 | String IArchive::getDirectory() const 45 | { 46 | return mDirectory; 47 | } 48 | 49 | int IArchive::getCommitNum() 50 | { 51 | return mCommitNum; 52 | } 53 | 54 | void IArchive::setCommitNum(int num) 55 | { 56 | mCommitNum = num; 57 | } 58 | 59 | void IArchive::beginTransaction() const 60 | { 61 | mCommitCount++; 62 | if (mDatabase.valid()) 63 | { 64 | mDatabase->beginTransaction(); 65 | } 66 | } 67 | 68 | void IArchive::commitTransaction() const 69 | { 70 | if (mCommitCount >= mCommitNum && mDatabase.valid()) 71 | { 72 | mCommitCount = 0; 73 | mDatabase->commitTransaction(); 74 | } 75 | } 76 | 77 | osgDB::ReaderWriter::ReadResult IArchive::readNode(const String& fileName, const osgDB::ReaderWriter::Options* options) const 78 | { 79 | return osgDB::ReaderWriter::ReadResult::FILE_NOT_FOUND; 80 | } 81 | 82 | } -------------------------------------------------------------------------------- /src/Core/OCModel/BuildWell.h: -------------------------------------------------------------------------------- 1 | #ifndef __BuildWell_H__ 2 | #define __BuildWell_H__ 3 | #include "OCModel/ModelDefine.h" 4 | 5 | namespace OC 6 | { 7 | namespace Modeling 8 | { 9 | class BuildWell 10 | { 11 | public: 12 | BuildWell(void) 13 | { 14 | } 15 | 16 | BuildWell(const double br,const double height,const String wt,const String ct) 17 | { 18 | setRadius(br,br /* * 0.7*/); 19 | setHeight(height*3/8,height*3/8,height/4); 20 | setTexturePath(wt,ct); 21 | } 22 | void setRadius(const double br,const double tr) 23 | { 24 | mBottomRadius = br; 25 | mTopRadius = tr; 26 | } 27 | void setHeight(const double bh,const double mh,const double th) 28 | { 29 | mBottomHeight = bh; 30 | mMiddleHeight = mh; 31 | mTopHeight = th; 32 | } 33 | void setTexturePath(const String wt,const String ct) 34 | { 35 | mWellWallImage = wt; 36 | mWellCoverImage = ct; 37 | } 38 | osg::ref_ptr build(); 39 | 40 | void setImageInternal(bool inter) 41 | { 42 | mImageInternal = inter; 43 | } 44 | private: 45 | bool mImageInternal; 46 | double mBottomRadius; 47 | double mTopRadius; 48 | double mBottomHeight; 49 | double mMiddleHeight; 50 | double mTopHeight; 51 | String mWellWallImage; 52 | String mWellCoverImage; 53 | 54 | Vector3List setCircle(CVector3 center,CVector3 normal,double dr,int loop,Vector2List & texturecoor,double TextureYvalue); 55 | osg::ref_ptr createWellHatCylinder(); 56 | osg::ref_ptr createWellHat(); 57 | }; 58 | } 59 | } 60 | #endif 61 | -------------------------------------------------------------------------------- /src/Core/OCesium/gltfMaterial.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLTF_MATERAILS_H__ 2 | #define _GLTF_MATERAILS_H__ 3 | 4 | #include "gltfConfig.h" 5 | 6 | namespace OC 7 | { 8 | namespace Cesium 9 | { 10 | class _CesiumExport gltfMaterial : public osg::Object 11 | { 12 | public: 13 | gltfMaterial(){} 14 | gltfMaterial(osg::StateSet* stateSet); 15 | gltfMaterial(const gltfMaterial& eh, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) {} 16 | META_Object(OCesium, gltfMaterial); 17 | String key(); 18 | 19 | int materialsId = -1; 20 | osg::Texture* texture = NULL; 21 | osg::ref_ptr image; 22 | int min_filter = 0; 23 | int max_filter = 0; 24 | int wrap_s = 0; 25 | int wrap_t = 0; 26 | bool doubleSide = false; 27 | bool blend = false; 28 | GLenum mode = osg::PrimitiveSet::TRIANGLES; 29 | double roughnessFactor = 1.0; 30 | double metallicFactor = 1.0; 31 | osg::Vec4 diffuse = osg::Vec4(1.0, 1.0, 1.0, 1.0); 32 | osg::Vec4 ambient = osg::Vec4(0.2, 0.2, 0.2, 1.0); 33 | osg::Vec4 specular = osg::Vec4(0.0, 0.0, 0.0, 1.0); 34 | osg::ref_ptr imageData; 35 | bool KHR_materials_unlit = false; 36 | osg::Vec2 offset = osg::Vec2(0.0,0.0); 37 | osg::Vec2 scale = osg::Vec2(1.0,1.0); 38 | bool operator == (const gltfMaterial& rkMat) const; 39 | bool operator < (const gltfMaterial& rkMat) const; 40 | }; 41 | } 42 | } 43 | 44 | 45 | #endif -------------------------------------------------------------------------------- /src/Core/OCesium/BatchGroup.h: -------------------------------------------------------------------------------- 1 | #ifndef _Cesium_BATCH_GROUP_H__ 2 | #define _Cesium_BATCH_GROUP_H__ 3 | 4 | #include "BatchGeode.h" 5 | #include "FeatureBatchTable.h" 6 | #include "GltfHelper.h" 7 | 8 | namespace OC 9 | { 10 | namespace Cesium 11 | { 12 | class _CesiumExport BatchGroup : public osg::NodeVisitor 13 | { 14 | public: 15 | BatchGroup(FeatureBatchTable* featureBatchTable); 16 | virtual ~BatchGroup(); 17 | 18 | virtual void apply(osg::Geode& node); 19 | 20 | void convert(osg::Node* node); 21 | 22 | BatchGeodeList& getBatchGeodeList(){return mBatchGeodeList;} 23 | osg::BoundingBox& boundingBox() { return mBoundingBox; } 24 | protected: 25 | GltfHelper _gltfHelper; 26 | void submitImage(); 27 | bool submitBatch(); 28 | private: 29 | void assignBatch(osg::Geode* geode, osg::Matrix matrix, osg::StateSet* stateset, String referenceName); 30 | BatchGeodeMap mBatchGeodeMap; 31 | BatchGeodeList mBatchGeodeList; 32 | osg::BoundingBox mBoundingBox; 33 | std::map mNameBatchId; 34 | osg::ref_ptr mFeatureBatchTable; 35 | 36 | //debug info 37 | std::map mImageUseCount; 38 | int geodeCount = 0; 39 | }; 40 | } 41 | } 42 | 43 | 44 | #endif -------------------------------------------------------------------------------- /src/Core/OCMain/GLX/CORETimerImp.h: -------------------------------------------------------------------------------- 1 | #ifndef __GLXTimer_H__ 2 | #define __GLXTimer_H__ 3 | 4 | #include "../BaseDefine.h" 5 | 6 | namespace OC 7 | { 8 | /** Timer class */ 9 | class Timer 10 | { 11 | private: 12 | struct timeval start; 13 | clock_t zeroClock; 14 | public: 15 | Timer(); 16 | ~Timer(); 17 | 18 | /** Method for setting a specific option of the Timer. These options are usually 19 | specific for a certain implementation of the Timer class, and may (and probably 20 | will) not exist across different implementations. reset() must be called after 21 | all setOption() calls. 22 | @param 23 | strKey The name of the option to set 24 | @param 25 | pValue A pointer to the value - the size should be calculated by the timer 26 | based on the key 27 | @return 28 | On success, true is returned. 29 | @par 30 | On failure, false is returned. 31 | */ 32 | bool setOption( const String& strKey, const void* pValue ) { return false; } 33 | 34 | /** Resets timer */ 35 | void reset(); 36 | 37 | /** Returns milliseconds since initialisation or last reset */ 38 | unsigned long getMilliseconds(); 39 | 40 | /** Returns microseconds since initialisation or last reset */ 41 | unsigned long getMicroseconds(); 42 | 43 | /** Returns milliseconds since initialisation or last reset, only CPU time measured */ 44 | unsigned long getMillisecondsCPU(); 45 | 46 | /** Returns microseconds since initialisation or last reset, only CPU time measured */ 47 | unsigned long getMicrosecondsCPU(); 48 | }; 49 | } 50 | #endif -------------------------------------------------------------------------------- /src/Core/OCMain/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) 2 | 3 | SET(LIB_NAME OCMain) 4 | 5 | SET(TARGET_H 6 | json/assertions.h 7 | json/autolink.h 8 | json/config.h 9 | json/features.h 10 | json/forwards.h 11 | json/json.h 12 | json/reader.h 13 | json/value.h 14 | json/version.h 15 | json/writer.h 16 | json/json_tool.h 17 | BaseDefine.h 18 | BaseEnum.h 19 | ConfigManager.h 20 | CoreConfig.h 21 | Environment.h 22 | JsonPackage.h 23 | Singleton.h 24 | SimpleConfig.h 25 | Any.h 26 | AtomicScalar.h 27 | Common.h 28 | DataStream.h 29 | DefaultWorkQueueStandard.h 30 | Exception.h 31 | Log.h 32 | LogManager.h 33 | ThreadDefine.h 34 | Timer.h 35 | JsonHelper.h 36 | WorkQueue.h 37 | FunctionalArchive.h 38 | OCPluginTool.h 39 | ) 40 | 41 | SET(TARGET_SRC 42 | json/json_reader.cpp 43 | json/json_value.cpp 44 | json/json_writer.cpp 45 | src/ConfigManager.cpp 46 | src/CoreConfig.cpp 47 | src/Environment.cpp 48 | src/JsonPackage.cpp 49 | src/AtomicScalar.cpp 50 | src/DataStream.cpp 51 | src/DefaultWorkQueueStandard.cpp 52 | src/Exception.cpp 53 | src/Log.cpp 54 | src/LogManager.cpp 55 | src/Timer.cpp 56 | src/JsonHelper.cpp 57 | src/WorkQueue.cpp 58 | src/FunctionalArchive.cpp 59 | src/OCPluginTool.cpp 60 | ) 61 | 62 | SETUP_GROUP() 63 | 64 | SET(TARGET_LIBRARIES 65 | OpenThreads 66 | osg 67 | osgDB 68 | OCUtility 69 | ) 70 | 71 | ADD_DEFINITIONS(-DJSON_DLL_BUILD) 72 | 73 | ADD_DEPENDENCIES(OCVolume ${LIB_NAME}) 74 | IF(WIN32) 75 | ADD_DEPENDENCIES(OCNetCDF ${LIB_NAME}) 76 | ENDIF(WIN32) 77 | SETUP_LIBRARY(${LIB_NAME}) 78 | -------------------------------------------------------------------------------- /src/Linux/OCVolumeConverter/TaskWorkQueue.h: -------------------------------------------------------------------------------- 1 | #ifndef _TASK_WORKQUE_H__ 2 | #define _TASK_WORKQUE_H__ 3 | #include "OCMain/DefaultWorkQueueStandard.h" 4 | #include "WatcherManager.h" 5 | 6 | namespace OC 7 | { 8 | class TaskWorkQueue : public WorkQueue::ResponseHandler, public WorkQueue::RequestHandler 9 | { 10 | private: 11 | TaskWorkQueue(int threadNum = 2); 12 | public: 13 | ~TaskWorkQueue(); 14 | static TaskWorkQueue& instance(int threadNum = 2); 15 | enum RequestType 16 | { 17 | RT_WatchDirectory, 18 | RT_FetchDirectory, 19 | RT_NotifyCreate, 20 | RT_NotifyEndWrite, 21 | RT_NotifyMove, 22 | RT_test 23 | }; 24 | 25 | struct TaskRequest 26 | { 27 | RequestType type; 28 | String dir; 29 | friend std::ostream& operator<<(std::ostream& o, const TaskRequest& r) 30 | { 31 | (void)r; return o; 32 | } 33 | }; 34 | 35 | void shutdown(); 36 | int mWorkQueueChannel; 37 | virtual void handleResponse(const WorkQueue::Response* res, const WorkQueue* srcQ); 38 | virtual WorkQueue::Response* handleRequest(const WorkQueue::Request* req, const WorkQueue* srcQ); 39 | void addRequest(TaskRequest request); 40 | WorkQueue* mWorkQueue; 41 | WatcherManager mWatcherManager; 42 | }; 43 | } 44 | 45 | #endif -------------------------------------------------------------------------------- /src/Application/Weathertoy/LabViewer.h: -------------------------------------------------------------------------------- 1 | #ifndef OCAPP_H 2 | #define OCAPP_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "WeatherLabMenu.h" 8 | #include "ServerThread.h" 9 | #include "SARibbonBar/SARibbonMainWindow.h" 10 | 11 | class LabViewer : public SARibbonMainWindow 12 | { 13 | Q_OBJECT 14 | public: 15 | LabViewer(bool simple = false,QWidget *parent = 0); 16 | ~LabViewer(); 17 | 18 | OC::String mHostUrl; 19 | void setSize(); 20 | void openRadar(OC::String filename); 21 | void openKML(OC::String filemane); 22 | void open3DTile(OC::String filename); 23 | void openVTK(OC::String filename); 24 | OC::String localToUrl(OC::String filename); 25 | void loadPNG(OC::String filename); 26 | void showMessageBox(QString text); 27 | QSplashScreen* mSplash; 28 | public slots: 29 | QWebEngineView* getWebView(); 30 | CWeatherLabMenu* getWeatherLabMenu(); 31 | static LabViewer* instance(); 32 | void openFolder(OC::String filename); 33 | void openExtenalFile(OC::String filename); 34 | bool isSimpleMode(){return mSimpleMode;} 35 | virtual bool eventFilter(QObject* obj, QEvent* e); 36 | void loadProgress(int progress); 37 | void loadFinished(bool ok); 38 | protected: 39 | 40 | virtual bool nativeEvent(const QByteArray& eventType, void* message, long* result); 41 | private: 42 | int mPort; 43 | bool mSimpleMode; 44 | QString mAppendJS; 45 | QWidget* mRibbonMenuWidget; 46 | ServerThread* mServerThread; 47 | QWebEngineView* mWebView; 48 | CWeatherLabMenu* mWeatherLabMenu; 49 | static LabViewer* mInstrance; 50 | std::map mPathServerMap; 51 | }; 52 | 53 | #endif // OCAPP_H 54 | -------------------------------------------------------------------------------- /src/Core/OCModel/IModelDatabase.h: -------------------------------------------------------------------------------- 1 | #ifndef _IMODEL_DATABASE_CALSS_H_ 2 | #define _IMODEL_DATABASE_CALSS_H_ 3 | 4 | #include "OCMain/osg.h" 5 | #include "OCLayer/IDatabase.h" 6 | #include "IModelTable.h" 7 | #include "ModelDataQueryCallback.h" 8 | 9 | namespace OC 10 | { 11 | namespace Modeling 12 | { 13 | typedef std::map > MetaRecordMap; 14 | typedef MapIterator MetaRecordMapIterator; 15 | 16 | class _ModelExport IModelDatabase : public IDatabase 17 | { 18 | public: 19 | IModelDatabase(void); 20 | virtual ~IModelDatabase(void); 21 | 22 | virtual StringVector enumNets(){return StringVector();} 23 | virtual CCoreConfig queryNetMeta(String layerName){ return CCoreConfig();} 24 | virtual StringVector emunFields(String table,String hdr){return StringVector();} 25 | 26 | bool getData(IModelTable* table); 27 | 28 | virtual bool getLineData(PipeTable* table){return false;} 29 | virtual bool getNodeData(PipeTable* table){return false;} 30 | virtual bool getShelfData(GenericMoldTable* table){return false;} 31 | 32 | virtual bool getSubLineData(CSubLineShelfTable* table){return false;} 33 | virtual bool getSubNodeData(CSubLineShelfTable* table){return false;} 34 | 35 | virtual String getDatabaseTime(){return StringUtil::BLANK;} 36 | 37 | virtual bool dynamic_build(CTileFeatureNode* tilefeaturenode); 38 | 39 | virtual StringVector enumGeometryLayers(){return StringVector();} 40 | virtual void enumMetaTables(); 41 | TemplateRecord* findMetaTable(String layername); 42 | MetaRecordMapIterator getMetaTableIterator(); 43 | 44 | protected: 45 | MetaRecordMap mMetaRecordMap; 46 | }; 47 | } 48 | } 49 | 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /src/Plugins/functional/FuncArchive.cpp: -------------------------------------------------------------------------------- 1 | #include "FuncArchive.h" 2 | #include "OCMain/osgearth.h" 3 | 4 | FuncArchive::FuncArchive(void) 5 | { 6 | supportsExtension("func", "OC func"); 7 | } 8 | 9 | FuncArchive::~FuncArchive(void) 10 | { 11 | 12 | } 13 | 14 | String FuncArchive::invoke(StringVector params) 15 | { 16 | String command = params.size() > 0 ? params[0] : StringUtil::BLANK; 17 | 18 | return StringUtil::BLANK; 19 | } 20 | 21 | CVector2 FuncArchive::gauss2LH(CVector2 coord) 22 | { 23 | static String a = "+proj=tmerc +lat_0=0 +lon_0={%0} +k=1 +x_0=500000 +y_0=0 +ellps=IAU76 +units=m +no_defs"; 24 | int dno = (int)coord.x - (int)coord.x % 1000000; 25 | int L0 = 114; 26 | if (dno == 0) 27 | { 28 | 29 | } 30 | else 31 | { 32 | dno /= 1000000; 33 | L0 = dno > 35 ? dno * 3 : dno * 6 - 3; 34 | } 35 | coord.x -= dno * 1000000; 36 | String prjcs = StringUtil::replaceAll(a,"{%0}",StringConverter::toString(L0)); 37 | osgEarth::SpatialReference* local_srs = osgEarth::SpatialReference::get(prjcs); 38 | osgEarth::SpatialReference* wgs84_srs = osgEarth::SpatialReference::get("wgs84"); 39 | osgEarth::GeoPoint local_point(local_srs, coord.x, coord.y); 40 | osgEarth::GeoPoint wgs84_point; 41 | bool ret = local_point.transform(wgs84_srs, wgs84_point); 42 | return CVector2(wgs84_point.x(), wgs84_point.y()); 43 | } 44 | 45 | osgDB::ReaderWriter::ReadResult FuncArchive::openArchive(const String& fileName, osgDB::ReaderWriter::ArchiveStatus status, unsigned int dep, const osgDB::Options* options) const 46 | { 47 | String ext = osgDB::getLowerCaseFileExtension(fileName); 48 | if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED; 49 | return new FuncArchive; 50 | } 51 | 52 | REGISTER_OSGPLUGIN(func, FuncArchive) 53 | -------------------------------------------------------------------------------- /src/Core/OCHttpServer/src/WebSocket.cc: -------------------------------------------------------------------------------- 1 | #include "WebSocket.h" 2 | 3 | using namespace OC; 4 | 5 | struct Subscriber 6 | { 7 | std::string chatRoomName_; 8 | drogon::SubscriberID id_; 9 | }; 10 | void WebSocketTest::handleNewMessage(const WebSocketConnectionPtr &wsConnPtr, 11 | std::string &&message, 12 | const WebSocketMessageType &type) 13 | { 14 | // write your application logic here 15 | LOG_INFO << "new websocket message:" << message; 16 | if (type == WebSocketMessageType::Ping) 17 | { 18 | LOG_INFO << "recv a ping"; 19 | } 20 | else if (type == WebSocketMessageType::Text) 21 | { 22 | auto &s = wsConnPtr->getContextRef(); 23 | chatRooms_.publish(s.chatRoomName_, message); 24 | } 25 | } 26 | 27 | void WebSocketTest::handleConnectionClosed(const WebSocketConnectionPtr &conn) 28 | { 29 | LOG_INFO << "websocket closed!"; 30 | auto &s = conn->getContextRef(); 31 | chatRooms_.unsubscribe(s.chatRoomName_, s.id_); 32 | } 33 | 34 | void WebSocketTest::handleNewConnection(const HttpRequestPtr &req, 35 | const WebSocketConnectionPtr &conn) 36 | { 37 | LOG_INFO << "new websocket connection!"; 38 | conn->send("haha!!!"); 39 | Subscriber s; 40 | s.chatRoomName_ = req->getParameter("room_name"); 41 | s.id_ = chatRooms_.subscribe(s.chatRoomName_, 42 | [conn](const std::string &topic, 43 | const std::string &message) { 44 | conn->send(message); 45 | }); 46 | conn->setContext(std::make_shared(std::move(s))); 47 | } 48 | -------------------------------------------------------------------------------- /src/Core/OCMain/json/features.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef CPPTL_JSON_FEATURES_H_INCLUDED 7 | #define CPPTL_JSON_FEATURES_H_INCLUDED 8 | 9 | #if !defined(JSON_IS_AMALGAMATION) 10 | #include "forwards.h" 11 | #endif // if !defined(JSON_IS_AMALGAMATION) 12 | 13 | namespace OC { 14 | namespace Json { 15 | 16 | /** \brief Configuration passed to reader and writer. 17 | * This configuration object can be used to force the Reader or Writer 18 | * to behave in a standard conforming way. 19 | */ 20 | class _MainExport Features { 21 | public: 22 | /** \brief A configuration that allows all features and assumes all strings 23 | * are UTF-8. 24 | * - C & C++ comments are allowed 25 | * - Root object can be any JSON value 26 | * - Assumes Value strings are encoded in UTF-8 27 | */ 28 | static Features all(); 29 | 30 | /** \brief A configuration that is strictly compatible with the JSON 31 | * specification. 32 | * - Comments are forbidden. 33 | * - Root object must be either an array or an object value. 34 | * - Assumes Value strings are encoded in UTF-8 35 | */ 36 | static Features strictMode(); 37 | 38 | /** \brief Initialize the configuration like JsonConfig::allFeatures; 39 | */ 40 | Features(); 41 | 42 | /// \c true if comments are allowed. Default: \c true. 43 | bool allowComments_; 44 | 45 | /// \c true if root must be either an array or an object value. Default: \c 46 | /// false. 47 | bool strictRoot_; 48 | }; 49 | 50 | } // namespace Json 51 | } // namespace Json 52 | 53 | #endif // CPPTL_JSON_FEATURES_H_INCLUDED 54 | -------------------------------------------------------------------------------- /src/Core/OCLayer/ScenePass.h: -------------------------------------------------------------------------------- 1 | #ifndef _OC_ScenePassNode_H__ 2 | #define _OC_ScenePassNode_H__ 3 | 4 | #include "LayerDefine.h" 5 | #include "OCMain/osg.h" 6 | 7 | namespace OC 8 | { 9 | class _LayerExport CScenePassNode : public osg::Group 10 | { 11 | public: 12 | CScenePassNode() 13 | { 14 | mPassStateSet= new osg::StateSet; 15 | //mPassStateSet->addUniform(new osg::Uniform("enable_pass",osg::Uniform::BOOL,1)); 16 | } 17 | virtual ~CScenePassNode(){} 18 | 19 | osg::StateSet* getPassStateSet(){return mPassStateSet.get();} 20 | 21 | protected: 22 | osg::ref_ptr mPassStateSet; 23 | }; 24 | 25 | typedef std::vector > ScenePassNodeList; 26 | 27 | class _LayerExport CScenePassCamera : public osg::Camera 28 | { 29 | public: 30 | CScenePassCamera(void); 31 | ~CScenePassCamera(void); 32 | virtual void cull(osgUtil::CullVisitor& cv); 33 | void setCullNode(osg::Group* g); 34 | virtual void traverse(osg::NodeVisitor& nv); 35 | bool isDirty() 36 | { 37 | return !_boundingSphereComputed; 38 | } 39 | private: 40 | osg::Group* mGroup; 41 | }; 42 | 43 | class _LayerExport CScenePass : public osg::Referenced 44 | { 45 | public: 46 | CScenePass(void); 47 | virtual ~CScenePass(void); 48 | 49 | virtual void traverse(osg::Node* node, osg::NodeVisitor* nv){} 50 | 51 | osg::Camera* getCamera(){return mCamera.get();} 52 | void setCamera(osg::Camera* camera){mCamera = camera;} 53 | 54 | osg::StateSet* getStateSet(){return mStateSet.get();} 55 | void setStateSet(osg::StateSet* stateset){mStateSet = stateset;} 56 | protected: 57 | osg::ref_ptr mCamera; 58 | osg::ref_ptr mStateSet; 59 | }; 60 | 61 | typedef std::set > ScenePassSet; 62 | } 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /src/Core/OCesium/BuildingConverter.h: -------------------------------------------------------------------------------- 1 | #ifndef _Building_CONVETER_H__ 2 | #define _Building_CONVETER_H__ 3 | 4 | #include "glTFOptimize.h" 5 | #include "CesiumTool.h" 6 | #include 7 | 8 | namespace OC 9 | { 10 | namespace Cesium 11 | { 12 | class _CesiumExport BuildingConverter 13 | { 14 | public: 15 | int split(const GeoExtent& extent, OC::Cesium::Tile* parentTile, unsigned depth, String destDir); 16 | OC::Cesium::Tile* buildTile(FeatureList& list, int depth, String uri); 17 | BuildingConverter(); 18 | ~BuildingConverter(); 19 | 20 | void readShp(String filename); 21 | void output(); 22 | 23 | String nameExpression = "Id"; 24 | String heightExpression = "3.5 * [Floor]"; 25 | float constantHeight = 100.0; 26 | String mErrors; 27 | String outputPath; 28 | int splitLevel = 4; 29 | int mMaxNodeInTile = 1500; 30 | String resource_lib; 31 | StringVector mWriteAttributeList; 32 | class BuildingAttributeCallback : public Cesium::FeatureAttributeCallback 33 | { 34 | public: 35 | BuildingAttributeCallback(BuildingConverter* owner); 36 | ~BuildingAttributeCallback(); 37 | 38 | virtual void onSetAttirubte(String name, Cesium::FeatureBatchTable* table); 39 | 40 | private: 41 | BuildingConverter* _owner; 42 | }; 43 | private: 44 | void initStyleSheet(); 45 | osg::Matrix transform; 46 | unsigned maxDepth; 47 | osg::ref_ptr mFeatureSource; 48 | osg::BoundingBox mRootBoudingBox; 49 | FilterContext mFilterContext; 50 | ExtrudeGeometryFilter extrude; 51 | std::map mWritedFidMap; 52 | std::vector mGeometricError; 53 | osg::ref_ptr mBuildingAttributeCallback; 54 | }; 55 | } 56 | } 57 | #endif -------------------------------------------------------------------------------- /src/Core/OCModel/PipeTable.h: -------------------------------------------------------------------------------- 1 | #ifndef _PIPETABLE_CLASS_H_ 2 | #define _PIPETABLE_CLASS_H_ 3 | 4 | #include "IModelTable.h" 5 | #include "NodeTable.h" 6 | #include "LineTable.h" 7 | #include "SaveStrategy.h" 8 | #include "ProjectTool.h" 9 | 10 | namespace OC 11 | { 12 | namespace Modeling 13 | { 14 | class _ModelExport ModelPushListener : public osg::Referenced 15 | { 16 | public: 17 | ModelPushListener(){} 18 | virtual ~ModelPushListener(){} 19 | virtual void onPush(IModelData* data){} 20 | }; 21 | 22 | class _ModelExport PipeTable : public IModelTable 23 | { 24 | public: 25 | PipeTable(ModelDataManager* owner); 26 | ~PipeTable(void); 27 | virtual PipeTable* asPipeTable(){return static_cast(this);} 28 | 29 | static PipeTable* from(IArchive* archive); 30 | 31 | virtual bool startBuild(); 32 | virtual long getSize(); 33 | 34 | NodeTable& getNodeTable(); 35 | LineTable& getLineTable(); 36 | 37 | void fixData(); 38 | 39 | bool prepare(); 40 | 41 | void setQueryMapping(FieldMapping* mapping); 42 | FieldMapping* getQueryMapping(); 43 | 44 | bool checkData(); 45 | 46 | virtual void push_data(IModelData* data); 47 | void onPush(IModelData* data); 48 | void setPushListener(ModelPushListener* listener); 49 | protected: 50 | void reset(); 51 | bool init(); 52 | bool getData(); 53 | 54 | void trans2world(); 55 | void output(); 56 | protected: 57 | osg::ref_ptr mModelPushListener; 58 | osg::ref_ptr mFieldMapping; 59 | LineTable mLineTable; 60 | NodeTable mNodeTable; 61 | CORE_FRIEND_CLASS(LineTable); 62 | CORE_FRIEND_CLASS(NodeTable); 63 | }; 64 | 65 | typedef std::map PipeTableMap; 66 | } 67 | } 68 | 69 | 70 | #endif 71 | 72 | 73 | --------------------------------------------------------------------------------