3434// ==============================================================================
3535MainComponent::MainComponent ()
3636{
37- // Test();
38-
3937 m_MapView.reset (new MapView (" View1" ));
4038 addAndMakeVisible (m_MapView.get ());
4139 m_MapView.get ()->SetGeoBase (&m_GeoBase);
@@ -249,7 +247,9 @@ juce::PopupMenu MainComponent::getMenuForIndex(int menuIndex, const juce::String
249247 menu.addCommandItem (&m_CommandManager, CommandIDs::menuToolZoom);
250248 menu.addCommandItem (&m_CommandManager, CommandIDs::menuToolPanoramax);
251249 menu.addCommandItem (&m_CommandManager, CommandIDs::menuToolStereo);
250+ #ifdef DEBUG
252251 menu.addItem (1000 , " Test" );
252+ #endif // DEBUG
253253 }
254254 else if (menuIndex == 3 )
255255 {
@@ -888,10 +888,13 @@ void MainComponent::actionListenerCallback(const juce::String& message)
888888 m_ImageViewer.get ()->SetBase (&m_GeoBase);
889889 }
890890 if (T[0 ] == " Properties" ) {
891- if (T.size () < 1 )
891+ if (T.size () < 2 )
892892 return ;
893- int index = T[1 ].getIntValue ();
894- ShowProperties ((uint32_t )index);
893+ int index = T[2 ].getIntValue ();
894+ if (T[1 ] == " Object" )
895+ ShowProperties ((uint32_t )index, true );
896+ if (T[1 ] == " Class" )
897+ ShowProperties ((uint32_t )index, false );
895898 }
896899}
897900
@@ -1018,7 +1021,7 @@ void MainComponent::RunCommandLine()
10181021 if (C != nullptr ) {
10191022 if (C->NbVector () == 1 ) {
10201023 m_GeoBase.SelectFeature (C->Vector ((uint32_t )0 ));
1021- ShowProperties (0 );
1024+ ShowProperties (0 , true );
10221025 }
10231026 }
10241027 }
@@ -1053,7 +1056,7 @@ bool MainComponent::ShowHideSidePanel()
10531056// ==============================================================================
10541057void MainComponent::AboutIGNMap ()
10551058{
1056- juce::String version = " 0.1.2 " ;
1059+ juce::String version = " 0.1.3 " ;
10571060 juce::String info = " Compilation : " + juce::String (__DATE__) + " , " + juce::String (__TIME__);
10581061 juce::String message = " IGNMap 3 Version : " + version + " \n\n " + info + " \n\n " ;
10591062 message += " JUCE Version : " + juce::String (JUCE_MAJOR_VERSION) + " ."
@@ -1544,6 +1547,8 @@ void MainComponent::ShowHidePanel(juce::Component* component)
15441547// ==============================================================================
15451548void MainComponent::Test ()
15461549{
1550+ AddMvtServer (" https://data.geopf.fr/tms/1.0.0/IGNF_NUAGES-DE-POINTS-LIDAR-HD-produit" , " pbf" , " " , 256 , 256 , 16 );
1551+
15471552 /* Creation d'un differentiel MNS*/
15481553 /*
15491554 XFrame F = m_MapView.get()->GetViewFrame();
@@ -1758,34 +1763,6 @@ void MainComponent::Test()
17581763 return;
17591764 */
17601765
1761- /* Connexion Panoramax */
1762- XGeoPref pref;
1763- XFrame F, geoF = XGeoProjection::FrameGeo (pref.Projection ());
1764- pref.ConvertDeg (XGeoProjection::RGF93, pref.Projection (), geoF.Xmin , geoF.Ymin , F.Xmin , F.Ymin );
1765- pref.ConvertDeg (XGeoProjection::RGF93, pref.Projection (), geoF.Xmax , geoF.Ymax , F.Xmax , F.Ymax );
1766-
1767- std::string url = " https://panoramax.ign.fr/api/map" ;
1768- std::string ext = " mvt" ;
1769- std::string style = " https://panoramax.ign.fr/api/map/style.json" ;
1770- int zoom = 15 ;
1771-
1772- // std::string url = "data.geopf.fr/tms/1.0.0/PCI";
1773- // std::string ext = "pbf";
1774- // std::string style = "https://data.geopf.fr/annexes/ressources/vectorTiles/styles/PCI/pci.json";
1775- MvtLayer* mvt = new MvtLayer (url, ext, 256 , 256 , zoom);
1776- mvt->SetFrame (F);
1777- mvt->LoadStyle (style);
1778- if (!GeoTools::RegisterObject (&m_GeoBase, mvt, " MVT" , " MVT" , url)) {
1779- delete mvt;
1780- return ;
1781- }
1782-
1783- m_MapView.get ()->SetFrame (m_GeoBase.Frame ());
1784- m_MapView.get ()->RenderMap (false , true , false , false , false , true );
1785- m_ImageViewer.get ()->SetBase (&m_GeoBase);
1786- return ;
1787-
1788-
17891766 /*
17901767 juce::String filename;
17911768 if (filename.isEmpty())
@@ -1830,10 +1807,14 @@ void MainComponent::Test()
18301807// ==============================================================================
18311808// Affiche les proprietes d'un objet
18321809// ==============================================================================
1833- void MainComponent::ShowProperties (uint32_t index)
1810+ void MainComponent::ShowProperties (uint32_t index, bool typeVector )
18341811{
1835- XGeoVector* V = m_GeoBase.Selection (index);
1836- if (V == nullptr )
1812+ XGeoObject* obj = nullptr ;
1813+ if (typeVector)
1814+ obj = m_GeoBase.Selection (index);
1815+ else
1816+ obj = m_GeoBase.Class (index);
1817+ if (obj == nullptr )
18371818 return ;
18381819 ObjectViewer* viewer = nullptr ;
18391820 for (size_t i = 0 ; i < m_ToolWindows.size (); i++) {
@@ -1849,7 +1830,7 @@ void MainComponent::ShowProperties(uint32_t index)
18491830 viewer->setVisible (true );
18501831 m_ToolWindows.push_back (viewer);
18511832 }
1852- viewer->SetSelection (V );
1833+ viewer->SetSelection (obj );
18531834}
18541835
18551836// ==============================================================================
0 commit comments