資源簡(jiǎn)介
三維數(shù)字城市citygml庫源代碼,標(biāo)準(zhǔn)。數(shù)字城市,GIS,數(shù)字城市

代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
class?PickingHandler?:?public?osgGA::GUIEventHandler?{
public:
????PickingHandler()?{
????????m_xMouseCoordAtLastPress?=?-1;
????????m_yMouseCoordAtLastPress?=?-1;
????}
????//?EventHandler?interface
????virtual?bool?handle(const?osgGA::GUIEventAdapter&?ea?osgGA::GUIActionAdapter&?aa?osg::object*?osg::NodeVisitor*)?{
????????if?(ea.getEventType()?==?osgGA::GUIEventAdapter::RELEASE?&&?ea.getButton()?==?osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON)?{
????????????if?(m_xMouseCoordAtLastPress?!=?ea.getX()?||?m_yMouseCoordAtLastPress?!=?ea.getY())?{
????????????????return?false;
????????????}
????????????return?printDescriptionOfIntersectedDrawable(ea?aa);
????????}?else?if?(ea.getEventType()?==?osgGA::GUIEventAdapter::PUSH?&&?ea.getButton()?==?osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON)?{
????????????m_xMouseCoordAtLastPress?=?ea.getX();
????????????m_yMouseCoordAtLastPress?=?ea.getY();
????????}
????????return?false;
????}
private:
????bool?printDescriptionOfIntersectedDrawable(const?osgGA::GUIEventAdapter&?ea?osgGA::GUIActionAdapter&?aa)?{
????????osgUtil::LineSegmentIntersector::Intersections?intersections;
#if?OSG_VERSION_GREATER_OR_EQUAL(332)
????????????if?(!aa.computeIntersections(ea?intersections))?{
????????????????return?false;
????????????}
#else
???????????return?false;
#endif
????????osgUtil::LineSegmentIntersector::Intersection?firstIntersection?=?*intersections.begin();
????????if?(firstIntersection.drawable?==?nullptr)?{
????????????return?false;
????????}
#if?OSG_VERSION_GREATER_OR_EQUAL(332)
????????if?(firstIntersection.drawable->getNumDescriptions()?==?0)?{
????????????std::cout?<“Intersected?drawable?has?no?description:“?<????????????return?true;
????????}
????????std::cout?<“Description?of?intersected?drawable:“?<????????for?(const?std::string&?desc?:?firstIntersection.drawable->getDescriptions())?{
????????????std::cout?<“??“?<????????}
#else
????????std::cout?<getName()<#endif
????????std::cout?<
????????return?true;
????}
????int?m_xMouseCoordAtLastPress;
????int?m_yMouseCoordAtLastPress;
};
int?main(int?argc?char?*argv[])
{
????osg::setNotifyLevel(osg::WARN);
????std::cout?<“Using?plugin?directory:?“?<????osgDB::Registry::instance()->getLibraryFilePathList().push_front(PLUGIN_BIN_DIR);
????osgDB::Registry::instance()->addFileExtensionAlias(“gml“?“citygml“);
????if?(argc?2)?{
????????std::cerr?<“No?citygml?file?specified...“?<
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-11-16?16:36??libcitygml-2.0.7\
?????文件?????????206??2017-11-16?16:36??libcitygml-2.0.7\.gitignore
?????文件?????????631??2017-11-16?16:36??libcitygml-2.0.7\.travis.yml
?????文件???????10319??2017-11-16?16:36??libcitygml-2.0.7\CMakeLists.txt
?????目錄???????????0??2017-11-16?16:36??libcitygml-2.0.7\CMakeModules\
?????文件????????3002??2017-11-16?16:36??libcitygml-2.0.7\CMakeModules\FindCityGML.cmake
?????文件????????3422??2017-11-16?16:36??libcitygml-2.0.7\CMakeModules\FindXerces.cmake
?????文件?????????896??2017-11-16?16:36??libcitygml-2.0.7\CMakeModules\citygml_api.h.in
?????文件?????????899??2017-11-16?16:36??libcitygml-2.0.7\CMakeModules\cmake_uninstall.cmake.in
?????文件???????26521??2017-11-16?16:36??libcitygml-2.0.7\LICENSE
?????文件????????2977??2017-11-16?16:36??libcitygml-2.0.7\README.md
?????文件????????2172??2017-11-16?16:36??libcitygml-2.0.7\SpecsToCheck.md
?????文件????????3435??2017-11-16?16:36??libcitygml-2.0.7\TODO.md
?????文件???????84505??2017-11-16?16:36??libcitygml-2.0.7\citygml_to_libcitygml_mapping.graphml
?????目錄???????????0??2017-11-16?16:36??libcitygml-2.0.7\data\
?????文件???????10725??2017-11-16?16:36??libcitygml-2.0.7\data\b1_lod2_cs_w_sem.gml
?????文件????????6517??2017-11-16?16:36??libcitygml-2.0.7\data\b1_lod2_s.gml
?????文件??????932125??2017-11-16?16:36??libcitygml-2.0.7\data\berlin_open_data_sample_data.citygml
?????目錄???????????0??2017-11-16?16:36??libcitygml-2.0.7\debian_sc
?????文件??????????10??2017-11-16?16:36??libcitygml-2.0.7\debian_sc
?????文件???????49837??2017-11-16?16:36??libcitygml-2.0.7\libcitygml_classdiagram.graphml
?????目錄???????????0??2017-11-16?16:36??libcitygml-2.0.7\osgplugin\
?????文件????????1447??2017-11-16?16:36??libcitygml-2.0.7\osgplugin\CMakeLists.txt
?????文件????????4258??2017-11-16?16:36??libcitygml-2.0.7\osgplugin\CitygmlOsgViewer.cpp
?????文件???????19084??2017-11-16?16:36??libcitygml-2.0.7\osgplugin\ReaderWriterCityGML.cpp
?????目錄???????????0??2017-11-16?16:36??libcitygml-2.0.7\sources\
?????文件??????????63??2017-11-16?16:36??libcitygml-2.0.7\sources\.gitignore
?????文件????????7392??2017-11-16?16:36??libcitygml-2.0.7\sources\CMakeLists.txt
?????文件?????????299??2017-11-16?16:36??libcitygml-2.0.7\sources\citygml.pc.cmake
?????目錄???????????0??2017-11-16?16:36??libcitygml-2.0.7\sources\include\
?????目錄???????????0??2017-11-16?16:36??libcitygml-2.0.7\sources\include\citygml\
............此處省略114個(gè)文件信息
- 上一篇:linux 線程池封裝類
- 下一篇:個(gè)人通訊錄系統(tǒng)uml圖
評(píng)論
共有 條評(píng)論