Skip to content

Commit

Permalink
Initialize pointers to nullptr in headers
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 5, 2017
1 parent dcc6725 commit d9952b6
Show file tree
Hide file tree
Showing 48 changed files with 108 additions and 108 deletions.
4 changes: 2 additions & 2 deletions src/3d/chunks/qgschunkboundsentity_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class LineMeshGeometry : public Qt3DRender::QGeometry
void setVertices( QList<QVector3D> vertices );

private:
Qt3DRender::QAttribute *mPositionAttribute;
Qt3DRender::QBuffer *mVertexBuffer;
Qt3DRender::QAttribute *mPositionAttribute = nullptr;
Qt3DRender::QBuffer *mVertexBuffer = nullptr;
QList<QVector3D> mVertices;

};
Expand Down
2 changes: 1 addition & 1 deletion src/3d/chunks/qgschunkboundsentity_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class QgsChunkBoundsEntity : public Qt3DCore::QEntity
void setBoxes( const QList<QgsAABB> &bboxes );

private:
AABBMesh *mAabbMesh;
AABBMesh *mAabbMesh = nullptr;
};

/// @endcond
Expand Down
8 changes: 4 additions & 4 deletions src/3d/chunks/qgschunkedentity_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,19 @@ class QgsChunkedEntity : public Qt3DCore::QEntity

protected:
//! root node of the quadtree hierarchy
QgsChunkNode *mRootNode;
QgsChunkNode *mRootNode = nullptr;
//! A chunk has been loaded recently? let's display it!
bool mNeedsUpdate;
//! max. allowed screen space error
float mTau;
//! maximum allowed depth of quad tree
int mMaxLevel;
//! factory that creates loaders for individual chunk nodes
QgsChunkLoaderFactory *mChunkLoaderFactory;
QgsChunkLoaderFactory *mChunkLoaderFactory = nullptr;
//! queue of chunks to be loaded
QgsChunkList *mChunkLoaderQueue;
QgsChunkList *mChunkLoaderQueue = nullptr;
//! queue of chunk to be eventually replaced
QgsChunkList *mReplacementQueue;
QgsChunkList *mReplacementQueue = nullptr;
//! list of nodes that are being currently used for rendering
QList<QgsChunkNode *> mActiveNodes;
//! number of nodes omitted during frustum culling - for the curious ones
Expand Down
4 changes: 2 additions & 2 deletions src/3d/chunks/qgschunklist_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class QgsChunkList
void insertLast( QgsChunkListEntry *entry );

private:
QgsChunkListEntry *mHead;
QgsChunkListEntry *mTail;
QgsChunkListEntry *mHead = nullptr;
QgsChunkListEntry *mTail = nullptr;
int mCount;
};

Expand Down
2 changes: 1 addition & 1 deletion src/3d/chunks/qgschunkqueuejob_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class QgsChunkQueueJob : public QObject
void finished();

protected:
QgsChunkNode *mNode;
QgsChunkNode *mNode = nullptr;
};

/** \ingroup 3d
Expand Down
8 changes: 4 additions & 4 deletions src/3d/qgs3dmapscene.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ class _3D_EXPORT Qgs3DMapScene : public Qt3DCore::QEntity
private:
const Qgs3DMapSettings &mMap;
//! Provides a way to have a synchronous function executed each frame
Qt3DLogic::QFrameAction *mFrameAction;
QgsCameraController *mCameraController;
QgsTerrainEntity *mTerrain;
Qt3DLogic::QFrameAction *mFrameAction = nullptr;
QgsCameraController *mCameraController = nullptr;
QgsTerrainEntity *mTerrain = nullptr;
//! Forward renderer provided by 3D window
Qt3DExtras::QForwardRenderer *mForwardRenderer;
Qt3DExtras::QForwardRenderer *mForwardRenderer = nullptr;
QList<QgsChunkedEntity *> mChunkEntities;
//! Keeps track of entities that belong to a particular layer
QMap<QgsMapLayer *, Qt3DCore::QEntity *> mLayerEntities;
Expand Down
42 changes: 21 additions & 21 deletions src/3d/qgscameracontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class _3D_EXPORT QgsCameraController : public Qt3DCore::QEntity

private:
//! Camera that is being controlled
Qt3DRender::QCamera *mCamera;
Qt3DRender::QCamera *mCamera = nullptr;
//! used for computation of translation when dragging mouse
QRect mViewport;
//! height of terrain when mouse button was last pressed - for camera control
Expand Down Expand Up @@ -114,37 +114,37 @@ class _3D_EXPORT QgsCameraController : public Qt3DCore::QEntity
QPoint mLastMousePos;

//! Delegates mouse events to the attached MouseHandler objects
Qt3DInput::QMouseDevice *mMouseDevice;
Qt3DInput::QMouseDevice *mMouseDevice = nullptr;

Qt3DInput::QKeyboardDevice *mKeyboardDevice;
Qt3DInput::QKeyboardDevice *mKeyboardDevice = nullptr;

Qt3DInput::QMouseHandler *mMouseHandler;
Qt3DInput::QMouseHandler *mMouseHandler = nullptr;

//! Allows us to define a set of actions that we wish to use
//! (it is a component that can be attached to 3D scene)
Qt3DInput::QLogicalDevice *mLogicalDevice;
Qt3DInput::QLogicalDevice *mLogicalDevice = nullptr;

Qt3DInput::QAction *mLeftMouseButtonAction;
Qt3DInput::QActionInput *mLeftMouseButtonInput;
Qt3DInput::QAction *mLeftMouseButtonAction = nullptr;
Qt3DInput::QActionInput *mLeftMouseButtonInput = nullptr;

Qt3DInput::QAction *mMiddleMouseButtonAction;
Qt3DInput::QActionInput *mMiddleMouseButtonInput;
Qt3DInput::QAction *mMiddleMouseButtonAction = nullptr;
Qt3DInput::QActionInput *mMiddleMouseButtonInput = nullptr;

Qt3DInput::QAction *mRightMouseButtonAction;
Qt3DInput::QActionInput *mRightMouseButtonInput;
Qt3DInput::QAction *mRightMouseButtonAction = nullptr;
Qt3DInput::QActionInput *mRightMouseButtonInput = nullptr;

Qt3DInput::QAction *mShiftAction;
Qt3DInput::QActionInput *mShiftInput;
Qt3DInput::QAction *mShiftAction = nullptr;
Qt3DInput::QActionInput *mShiftInput = nullptr;

Qt3DInput::QAxis *mWheelAxis;
Qt3DInput::QAnalogAxisInput *mMouseWheelInput;
Qt3DInput::QAxis *mWheelAxis = nullptr;
Qt3DInput::QAnalogAxisInput *mMouseWheelInput = nullptr;

Qt3DInput::QAxis *mTxAxis;
Qt3DInput::QAxis *mTyAxis;
Qt3DInput::QButtonAxisInput *mKeyboardTxPosInput;
Qt3DInput::QButtonAxisInput *mKeyboardTyPosInput;
Qt3DInput::QButtonAxisInput *mKeyboardTxNegInput;
Qt3DInput::QButtonAxisInput *mKeyboardTyNegInput;
Qt3DInput::QAxis *mTxAxis = nullptr;
Qt3DInput::QAxis *mTyAxis = nullptr;
Qt3DInput::QButtonAxisInput *mKeyboardTxPosInput = nullptr;
Qt3DInput::QButtonAxisInput *mKeyboardTyPosInput = nullptr;
Qt3DInput::QButtonAxisInput *mKeyboardTxNegInput = nullptr;
Qt3DInput::QButtonAxisInput *mKeyboardTyNegInput = nullptr;
};

#endif // QGSCAMERACONTROLLER_H
6 changes: 3 additions & 3 deletions src/3d/qgstessellatedpolygongeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class QgsTessellatedPolygonGeometry : public Qt3DRender::QGeometry
private:
QList<QgsPolygonV2 *> mPolygons;

Qt3DRender::QAttribute *mPositionAttribute;
Qt3DRender::QAttribute *mNormalAttribute;
Qt3DRender::QBuffer *mVertexBuffer;
Qt3DRender::QAttribute *mPositionAttribute = nullptr;
Qt3DRender::QAttribute *mNormalAttribute = nullptr;
Qt3DRender::QBuffer *mVertexBuffer = nullptr;

bool mWithNormals;
};
Expand Down
2 changes: 1 addition & 1 deletion src/3d/symbols/qgsline3dsymbol_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class QgsLine3DSymbolEntityNode : public Qt3DCore::QEntity
private:
Qt3DRender::QGeometryRenderer *renderer( const Qgs3DMapSettings &map, const QgsLine3DSymbol &symbol, const QgsVectorLayer *layer, const QgsFeatureRequest &req );

QgsTessellatedPolygonGeometry *mGeometry;
QgsTessellatedPolygonGeometry *mGeometry = nullptr;
};

/// @endcond
Expand Down
2 changes: 1 addition & 1 deletion src/3d/symbols/qgspolygon3dsymbol_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class QgsPolygon3DSymbolEntityNode : public Qt3DCore::QEntity
private:
Qt3DRender::QGeometryRenderer *renderer( const Qgs3DMapSettings &map, const QgsPolygon3DSymbol &symbol, const QgsVectorLayer *layer, const QgsFeatureRequest &request );

QgsTessellatedPolygonGeometry *mGeometry;
QgsTessellatedPolygonGeometry *mGeometry = nullptr;
};

/// @endcond
Expand Down
2 changes: 1 addition & 1 deletion src/3d/terrain/qgsdemterraintileloader_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Qt3DCore::QEntity *QgsDemTerrainTileLoader::createEntity( Qt3DCore::QEntity *par

// create transform

Qt3DCore::QTransform *transform;
Qt3DCore::QTransform *transform = nullptr;
transform = new Qt3DCore::QTransform();
entity->addComponent( transform );

Expand Down
4 changes: 2 additions & 2 deletions src/3d/terrain/qgsdemterraintileloader_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ class QgsDemHeightMapGenerator : public QObject

private:
//! raster used to build terrain
QgsRasterLayer *mDtm;
QgsRasterLayer *mDtm = nullptr;

//! cloned provider to be used in worker thread
QgsRasterDataProvider *mClonedProvider;
QgsRasterDataProvider *mClonedProvider = nullptr;

QgsTilingScheme mTilingScheme;

Expand Down
2 changes: 1 addition & 1 deletion src/3d/terrain/qgsflatterraingenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Qt3DCore::QEntity *FlatTerrainChunkLoader::createEntity( Qt3DCore::QEntity *pare

// create transform

Qt3DCore::QTransform *transform;
Qt3DCore::QTransform *transform = nullptr;
transform = new Qt3DCore::QTransform();
entity->addComponent( transform );

Expand Down
2 changes: 1 addition & 1 deletion src/3d/terrain/qgsterrainentity_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class TerrainMapUpdateJobFactory : public QgsChunkQueueJobFactory
}

private:
QgsTerrainTextureGenerator *mTextureGenerator;
QgsTerrainTextureGenerator *mTextureGenerator = nullptr;
};


Expand Down
8 changes: 4 additions & 4 deletions src/3d/terrain/qgsterrainentity_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ class QgsTerrainEntity : public QgsChunkedEntity

const Qgs3DMapSettings &mMap;
//! picker of terrain to know height of terrain when dragging
Qt3DRender::QObjectPicker *mTerrainPicker;
QgsTerrainTextureGenerator *mTextureGenerator;
QgsCoordinateTransform *mTerrainToMapTransform;
Qt3DRender::QObjectPicker *mTerrainPicker = nullptr;
QgsTerrainTextureGenerator *mTextureGenerator = nullptr;
QgsCoordinateTransform *mTerrainToMapTransform = nullptr;

std::unique_ptr<TerrainMapUpdateJobFactory> mUpdateJobFactory;

Expand All @@ -104,7 +104,7 @@ class TerrainMapUpdateJob : public QgsChunkQueueJob
void onTileReady( int jobId, const QImage &image );

private:
QgsTerrainTextureGenerator *mTextureGenerator;
QgsTerrainTextureGenerator *mTextureGenerator = nullptr;
int mJobId;
};

Expand Down
2 changes: 1 addition & 1 deletion src/3d/terrain/qgsterraintexturegenerator_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class QgsTerrainTextureGenerator : public QObject
struct JobData
{
int jobId;
QgsMapRendererSequentialJob *job;
QgsMapRendererSequentialJob *job = nullptr;
QgsRectangle extent;
QString debugText;
};
Expand Down
2 changes: 1 addition & 1 deletion src/3d/terrain/qgsterraintileloader_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void QgsTerrainTileLoader::createTextureComponent( QgsTerrainTileEntity *entity
texture->addTextureImage( textureImage );
texture->setMinificationFilter( Qt3DRender::QTexture2D::Linear );
texture->setMagnificationFilter( Qt3DRender::QTexture2D::Linear );
Qt3DExtras::QTextureMaterial *material;
Qt3DExtras::QTextureMaterial *material = nullptr;
#if QT_VERSION >= 0x050900
material = new Qt3DExtras::QTextureMaterial;
material->setTexture( texture );
Expand Down
2 changes: 1 addition & 1 deletion src/3d/terrain/qgsterraintileloader_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class QgsTerrainTileLoader : public QgsChunkLoader
void onImageReady( int jobId, const QImage &image );

private:
QgsTerrainEntity *mTerrain;
QgsTerrainEntity *mTerrain = nullptr;
QgsRectangle mExtentMapCrs;
QString mTileDebugText;
int mTextureJobId;
Expand Down
10 changes: 5 additions & 5 deletions src/3d/terrain/quantizedmeshgeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ class QuantizedMeshGeometry : public Qt3DRender::QGeometry
static void downloadTileIfMissing( int tx, int ty, int tz );

private:
Qt3DRender::QBuffer *mVertexBuffer;
Qt3DRender::QBuffer *mIndexBuffer;
Qt3DRender::QAttribute *mPositionAttribute;
Qt3DRender::QAttribute *mTexCoordAttribute;
Qt3DRender::QAttribute *mIndexAttribute;
Qt3DRender::QBuffer *mVertexBuffer = nullptr;
Qt3DRender::QBuffer *mIndexBuffer = nullptr;
Qt3DRender::QAttribute *mPositionAttribute = nullptr;
Qt3DRender::QAttribute *mTexCoordAttribute = nullptr;
Qt3DRender::QAttribute *mIndexAttribute = nullptr;
};

#endif // QUANTIZEDMESHGEOMETRY_H
4 changes: 2 additions & 2 deletions src/3d/terrain/quantizedmeshterraingenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class QuantizedMeshTerrainChunkLoader : public TerrainChunkLoader

// create transform

Qt3DCore::QTransform *transform;
Qt3DCore::QTransform *transform = nullptr;
transform = new Qt3DCore::QTransform();
entity->addComponent( transform );

Expand All @@ -83,7 +83,7 @@ class QuantizedMeshTerrainChunkLoader : public TerrainChunkLoader
}

protected:
QuantizedMeshTile *qmt;
QuantizedMeshTile *qmt = nullptr;
QgsMapSettings mapSettings;
int tx, ty, tz;
QgsRectangle tileRect;
Expand Down
8 changes: 4 additions & 4 deletions src/app/3d/qgs3dmapcanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ class Qgs3DMapCanvas : public QWidget

private:
//! 3D window with all the 3D magic inside
Qt3DExtras::Qt3DWindow *mWindow3D;
Qt3DExtras::Qt3DWindow *mWindow3D = nullptr;
//! Container QWidget that encapsulates mWindow3D so we can use it embedded in ordinary widgets app
QWidget *mContainer;
QWidget *mContainer = nullptr;
//! Description of the 3D scene
Qgs3DMapSettings *mMap;
Qgs3DMapSettings *mMap = nullptr;
//! Root entity of the 3D scene
Qgs3DMapScene *mScene;
Qgs3DMapScene *mScene = nullptr;
};

#endif // QGS3DMAPCANVAS_H
4 changes: 2 additions & 2 deletions src/app/3d/qgs3dmapcanvasdockwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class Qgs3DMapCanvasDockWidget : public QgsDockWidget
void onMainCanvasColorChanged();

private:
Qgs3DMapCanvas *mCanvas;
QgsMapCanvas *mMainCanvas;
Qgs3DMapCanvas *mCanvas = nullptr;
QgsMapCanvas *mMainCanvas = nullptr;
};

#endif // QGS3DMAPCANVASDOCKWIDGET_H
4 changes: 2 additions & 2 deletions src/app/3d/qgs3dmapconfigwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class Qgs3DMapConfigWidget : public QWidget, private Ui::Map3DConfigWidget
void updateMaxZoomLevel();

private:
Qgs3DMapSettings *mMap;
QgsMapCanvas *mMainCanvas;
Qgs3DMapSettings *mMap = nullptr;
QgsMapCanvas *mMainCanvas = nullptr;
};

#endif // QGS3DMAPCONFIGWIDGET_H
2 changes: 1 addition & 1 deletion src/app/3d/qgsvectorlayer3drendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ QgsVectorLayer3DRenderer *QgsVectorLayer3DRendererWidget::renderer()
int pageIndex = widgetStack->currentIndex();
if ( pageIndex == 1 || pageIndex == 2 || pageIndex == 3 )
{
QgsAbstract3DSymbol *sym;
QgsAbstract3DSymbol *sym = nullptr;
if ( pageIndex == 1 )
sym = new QgsLine3DSymbol( widgetLine->symbol() );
else if ( pageIndex == 2 )
Expand Down
12 changes: 6 additions & 6 deletions src/app/3d/qgsvectorlayer3drendererwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ class QgsVectorLayer3DRendererWidget : public QgsMapLayerConfigWidget
void onEnabledClicked();

private:
QCheckBox *chkEnabled;
QStackedWidget *widgetStack;
QgsLine3DSymbolWidget *widgetLine;
QgsPoint3DSymbolWidget *widgetPoint;
QgsPolygon3DSymbolWidget *widgetPolygon;
QLabel *widgetUnsupported;
QCheckBox *chkEnabled = nullptr;
QStackedWidget *widgetStack = nullptr;
QgsLine3DSymbolWidget *widgetLine = nullptr;
QgsPoint3DSymbolWidget *widgetPoint = nullptr;
QgsPolygon3DSymbolWidget *widgetPolygon = nullptr;
QLabel *widgetUnsupported = nullptr;

std::unique_ptr<QgsVectorLayer3DRenderer> mRenderer;
};
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposermanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class QgsLayoutManagerModel : public QAbstractListModel
void compositionRemoved( const QString &name );
void compositionRenamed( QgsComposition *composition, const QString &newName );
private:
QgsLayoutManager *mLayoutManager;
QgsLayoutManager *mLayoutManager = nullptr;
};

/** A dialog that shows the existing composer instances. Lets the user add new
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout/qgslayoutdesignerdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner
QMap< QString, QToolButton * > mItemGroupToolButtons;
QMap< QString, QMenu * > mItemGroupSubmenus;

QgsLayoutAppMenuProvider *mMenuProvider;
QgsLayoutAppMenuProvider *mMenuProvider = nullptr;

QgsDockWidget *mItemDock = nullptr;
QgsPanelWidgetStack *mItemPropertiesStack = nullptr;
Expand Down
Loading

0 comments on commit d9952b6

Please sign in to comment.