Skip to content

Commit bded2b5

Browse files
committedJun 3, 2016
Remove QgsBillboardRegistry
1 parent 6a46e71 commit bded2b5

File tree

10 files changed

+0
-304
lines changed

10 files changed

+0
-304
lines changed
 

‎python/core/core.sip

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
%Include qgsaggregatecalculator.sip
2525
%Include qgsattributeaction.sip
2626
%Include qgsattributetableconfig.sip
27-
%Include qgsbillboardregistry.sip
2827
%Include qgsbrowsermodel.sip
2928
%Include qgsclipper.sip
3029
%Include qgscolorscheme.sip

‎python/core/qgsbillboardregistry.sip

Lines changed: 0 additions & 71 deletions
This file was deleted.

‎python/core/qgsproject.sip

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,6 @@ class QgsProject : QObject
275275

276276
QgsRelationManager* relationManager() const;
277277

278-
/** Return the project's billboard manager instance pointer
279-
* @note added in QGIS 2.16
280-
*/
281-
QgsBillBoardRegistry* billboardRegistry() const;
282-
283278
/** Return pointer to the root (invisible) node of the project's layer tree
284279
* @note added in 2.4
285280
*/

‎src/core/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ SET(QGIS_CORE_SRCS
8181
qgsactionmanager.cpp
8282
qgsaggregatecalculator.cpp
8383
qgsattributetableconfig.cpp
84-
qgsbillboardregistry.cpp
8584
qgsbrowsermodel.cpp
8685
qgscachedfeatureiterator.cpp
8786
qgscacheindex.cpp
@@ -452,7 +451,6 @@ ENDIF(NOT MSVC)
452451

453452
SET(QGIS_CORE_MOC_HDRS
454453
qgsapplication.h
455-
qgsbillboardregistry.h
456454
qgsbrowsermodel.h
457455
qgscontexthelp.h
458456
qgscoordinatetransform.h

‎src/core/qgsbillboardregistry.cpp

Lines changed: 0 additions & 47 deletions
This file was deleted.

‎src/core/qgsbillboardregistry.h

Lines changed: 0 additions & 97 deletions
This file was deleted.

‎src/core/qgsproject.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
#include "qgsproject.h"
1919

20-
#include "qgsbillboardregistry.h"
2120
#include "qgsdatasourceuri.h"
2221
#include "qgsexception.h"
2322
#include "qgslayertree.h"
@@ -366,7 +365,6 @@ QgsProject::QgsProject()
366365
, mBadLayerHandler( new QgsProjectBadLayerDefaultHandler() )
367366
, mRelationManager( new QgsRelationManager( this ) )
368367
, mRootGroup( new QgsLayerTreeGroup )
369-
, mBillboardRegistry( new QgsBillBoardRegistry( this ) )
370368
{
371369
clear();
372370

@@ -385,7 +383,6 @@ QgsProject::~QgsProject()
385383
delete mBadLayerHandler;
386384
delete mRelationManager;
387385
delete mRootGroup;
388-
delete mBillboardRegistry;
389386

390387
// note that QScopedPointer automatically deletes imp_ when it's destroyed
391388
} // QgsProject dtor

‎src/core/qgsproject.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class QDomDocument;
4141
class QDomElement;
4242
class QDomNode;
4343

44-
class QgsBillBoardRegistry;
4544
class QgsLayerTreeGroup;
4645
class QgsLayerTreeRegistryBridge;
4746
class QgsMapLayer;
@@ -317,11 +316,6 @@ class CORE_EXPORT QgsProject : public QObject
317316

318317
QgsRelationManager* relationManager() const;
319318

320-
/** Return the project's billboard manager instance pointer
321-
* @note added in QGIS 2.16
322-
*/
323-
QgsBillBoardRegistry* billboardRegistry() const { return mBillboardRegistry; }
324-
325319
/** Return pointer to the root (invisible) node of the project's layer tree
326320
* @note added in 2.4
327321
*/
@@ -512,8 +506,6 @@ class CORE_EXPORT QgsProject : public QObject
512506

513507
QgsLayerTreeRegistryBridge* mLayerTreeRegistryBridge;
514508

515-
QgsBillBoardRegistry* mBillboardRegistry;
516-
517509
//! map of transaction group: QPair( providerKey, connString ) -> transactionGroup
518510
QMap< QPair< QString, QString>, QgsTransactionGroup*> mTransactionGroups;
519511

‎src/plugins/globe/globe_plugin.cpp

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#include <symbology-ng/qgsrendererv2.h>
4444
#include <symbology-ng/qgssymbolv2.h>
4545
#include <qgspallabeling.h>
46-
#include <qgsbillboardregistry.h>
4746

4847
#include <QAction>
4948
#include <QDir>
@@ -67,8 +66,6 @@
6766
#include <osgEarth/Registry>
6867
#include <osgEarth/TileSource>
6968
#include <osgEarth/Version>
70-
#include <osgEarthAnnotation/AnnotationSettings>
71-
#include <osgEarthAnnotation/PlaceNode>
7269
#include <osgEarthDrivers/engine_mp/MPTerrainEngineOptions>
7370
#include <osgEarthUtil/Controls>
7471
#include <osgEarthUtil/EarthManipulator>
@@ -278,9 +275,6 @@ void GlobePlugin::initGui()
278275
mQGisIface->registerMapLayerPropertiesFactory( mLayerPropertiesFactory );
279276

280277
connect( mActionToggleGlobe, SIGNAL( triggered( bool ) ), this, SLOT( setGlobeEnabled( bool ) ) );
281-
// connect( mQGisIface->mapCanvas(), SIGNAL( annotationItemChanged( QgsAnnotationItem* ) ), this, SLOT( updateAnnotationItem( QgsAnnotationItem* ) ) );
282-
connect( QgsProject::instance()->billboardRegistry(), SIGNAL( itemAdded( QgsBillBoardItem* ) ), this, SLOT( addBillboard( QgsBillBoardItem* ) ) );
283-
connect( QgsProject::instance()->billboardRegistry(), SIGNAL( itemRemoved( QgsBillBoardItem* ) ), this, SLOT( removeBillboard( QgsBillBoardItem* ) ) );
284278
connect( mLayerPropertiesFactory, SIGNAL( layerSettingsChanged( QgsMapLayer* ) ), this, SLOT( layerChanged( QgsMapLayer* ) ) );
285279
connect( this, SIGNAL( xyCoordinates( const QgsPoint & ) ), mQGisIface->mapCanvas(), SIGNAL( xyCoordinates( const QgsPoint & ) ) );
286280
connect( mQGisIface->mainWindow(), SIGNAL( projectRead() ), this, SLOT( projectRead() ) );
@@ -387,14 +381,6 @@ void GlobePlugin::run()
387381

388382
mRootNode->addChild( osgEarth::Util::Controls::ControlCanvas::get( mOsgViewer ) );
389383

390-
mAnnotationsGroup = new osg::Group();
391-
mRootNode->addChild( mAnnotationsGroup );
392-
foreach ( QgsBillBoardItem* item, QgsProject::instance()->billboardRegistry()->items() )
393-
{
394-
addBillboard( item );
395-
}
396-
osgEarth::Annotation::AnnotationSettings::setOcclusionCullingHeightAdjustment( 50 );
397-
398384
mOsgViewer->setSceneData( mRootNode );
399385

400386
mOsgViewer->addEventHandler( new QueryCoordinatesHandler( this ) );
@@ -959,17 +945,6 @@ void GlobePlugin::updateLayers()
959945
}
960946
}
961947
}
962-
foreach ( const QString& layerId, mAnnotations.keys() )
963-
{
964-
if ( !layerId.isEmpty() )
965-
{
966-
bool visible = selectedLayers.contains( layerId );
967-
foreach ( const osg::ref_ptr<osgEarth::Annotation::PlaceNode>& node, mAnnotations[layerId].values() )
968-
{
969-
node->setNodeMask( visible ? ~0 : 0 );
970-
}
971-
}
972-
}
973948

974949
mTileSource->setLayerSet( drapedLayers );
975950
refreshQGISMapLayer( fullExtent );
@@ -1039,44 +1014,6 @@ void GlobePlugin::layerChanged( QgsMapLayer* mapLayer )
10391014
}
10401015
}
10411016

1042-
void GlobePlugin::addBillboard( QgsBillBoardItem* item )
1043-
{
1044-
if ( mOsgViewer )
1045-
{
1046-
if ( mAnnotations.contains( item->layerId ) )
1047-
{
1048-
mAnnotationsGroup->removeChild( mAnnotations[item->layerId][item] );
1049-
mAnnotations[item->layerId].take( item ) = 0;
1050-
}
1051-
const QgsPoint& p = item->worldPos;
1052-
osgEarth::GeoPoint geop( osgEarth::SpatialReference::get( "wgs84" ), p.x(), p.y(), 0, osgEarth::ALTMODE_RELATIVE );
1053-
1054-
const QImage& image = item->image;
1055-
unsigned char* imgbuf = new unsigned char[image.bytesPerLine() * image.height()];
1056-
std::memcpy( imgbuf, image.bits(), image.bytesPerLine() * image.height() );
1057-
osg::Image* osgImage = new osg::Image;
1058-
osgImage->setImage( image.width(), image.height(), 1, 4, // width, height, depth, internal_format
1059-
GL_BGRA, GL_UNSIGNED_BYTE, imgbuf, osg::Image::USE_NEW_DELETE );
1060-
osgImage->flipVertical();
1061-
osgEarth::Style pin;
1062-
pin.getOrCreateSymbol<osgEarth::IconSymbol>()->setImage( osgImage );
1063-
1064-
osg::ref_ptr<osgEarth::Annotation::PlaceNode> placeNode = new osgEarth::Annotation::PlaceNode( mMapNode, geop, "", pin );
1065-
placeNode->setOcclusionCulling( true );
1066-
mAnnotations[item->layerId][item] = placeNode;
1067-
mAnnotationsGroup->addChild( placeNode );
1068-
}
1069-
}
1070-
1071-
void GlobePlugin::removeBillboard( QgsBillBoardItem* item )
1072-
{
1073-
if ( mOsgViewer && mAnnotations.contains( item->layerId ) )
1074-
{
1075-
mAnnotationsGroup->removeChild( mAnnotations[item->layerId][item] );
1076-
mAnnotations[item->layerId].take( item ) = 0;
1077-
}
1078-
}
1079-
10801017
void GlobePlugin::setGlobeEnabled( bool enabled )
10811018
{
10821019
if ( enabled )
@@ -1112,7 +1049,6 @@ void GlobePlugin::reset()
11121049
mFeatureQueryTool = 0;
11131050
mViewerWidget = 0;
11141051
mDockWidget = 0;
1115-
mAnnotationsGroup = 0;
11161052
mImagerySources.clear();
11171053
mElevationSources.clear();
11181054
#ifdef GLOBE_SHOW_TILE_STATS

‎src/plugins/globe/globe_plugin.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class QAction;
3131
class QDateTime;
3232
class QDockWidget;
3333
class QgsAnnotationItem;
34-
class QgsBillBoardItem;
3534
class QgsGlobeAnnotation;
3635
class QgsGlobeLayerPropertiesFactory;
3736
class QgsGlobePluginDialog;
@@ -152,9 +151,6 @@ class GLOBE_EXPORT GlobePlugin : public QObject, public QgisPlugin
152151
osg::ref_ptr<osgEarth::Util::FeatureQueryTool> mFeatureQueryTool;
153152
osg::ref_ptr<osgEarth::Util::Controls::LabelControl> mStatsLabel;
154153

155-
osg::Group* mAnnotationsGroup;
156-
QMap<QString, QMap<QgsBillBoardItem*, osg::ref_ptr<osgEarth::Annotation::PlaceNode> > > mAnnotations;
157-
158154
void setupProxy();
159155
void addControl( osgEarth::Util::Controls::Control* control, int x, int y, int w, int h, osgEarth::Util::Controls::ControlEventHandler* handler );
160156
void addImageControl( const std::string &imgPath, int x, int y, osgEarth::Util::Controls::ControlEventHandler* handler = 0 );
@@ -168,8 +164,6 @@ class GLOBE_EXPORT GlobePlugin : public QObject, public QgisPlugin
168164
void projectRead();
169165
void applySettings();
170166
void layerChanged( QgsMapLayer* mapLayer = 0 );
171-
void addBillboard( QgsBillBoardItem* item );
172-
void removeBillboard( QgsBillBoardItem* item );
173167
void refreshQGISMapLayer( QgsRectangle rect = QgsRectangle() );
174168
void updateTileStats( int queued, int tot );
175169

0 commit comments

Comments
 (0)
Please sign in to comment.