mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
AppFwk (clang-tidy) : modernize-use-nullptr
This commit is contained in:
parent
3239c66f54
commit
cfb75ecc34
@ -90,7 +90,7 @@ cvf::Effect* EffectCache::findEffect(const EffectGenerator* generator)
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -128,7 +128,7 @@ void EffectCache::releaseUnreferencedEffects()
|
||||
{
|
||||
if (m_effectCache[i].second.p()->refCount() <= 1 )
|
||||
{
|
||||
m_effectCache[i].second = NULL;
|
||||
m_effectCache[i].second = nullptr;
|
||||
delete m_effectCache[i].first;
|
||||
m_effectCache[i].first = NULL;
|
||||
}
|
||||
|
@ -214,13 +214,13 @@ cvf::ref<cvf::Effect> EffectGenerator::generateUnCachedEffect() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void EffectGenerator::updateEffect(cvf::Effect* effect) const
|
||||
{
|
||||
CVF_ASSERT(effect != NULL);
|
||||
CVF_ASSERT(effect != nullptr);
|
||||
|
||||
// Clear effect
|
||||
|
||||
effect->setRenderStateSet(NULL);
|
||||
effect->setUniformSet(NULL);
|
||||
effect->setShaderProgram(NULL);
|
||||
effect->setRenderStateSet(nullptr);
|
||||
effect->setUniformSet(nullptr);
|
||||
effect->setShaderProgram(nullptr);
|
||||
|
||||
if (sm_renderingMode == SHADER_BASED)
|
||||
{
|
||||
@ -629,7 +629,7 @@ EffectGenerator* ScalarMapperEffectGenerator::copy() const
|
||||
cvf::ref<cvf::TextureImage>
|
||||
ScalarMapperEffectGenerator::addAlphaAndUndefStripes(const cvf::TextureImage* texImg, const cvf::Color3f& undefScalarColor, float opacityLevel)
|
||||
{
|
||||
CVF_ASSERT(texImg != NULL);
|
||||
CVF_ASSERT(texImg != nullptr);
|
||||
CVF_ASSERT(texImg->height() == 1);
|
||||
|
||||
cvf::ref<cvf::TextureImage> modTexImg = new cvf::TextureImage;
|
||||
@ -655,9 +655,9 @@ ScalarMapperEffectGenerator::addAlphaAndUndefStripes(const cvf::TextureImage* te
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool ScalarMapperEffectGenerator::isImagesEqual(const cvf::TextureImage* texImg1, const cvf::TextureImage* texImg2)
|
||||
{
|
||||
if (texImg1 == NULL && texImg2 == NULL ) return true;
|
||||
if (texImg1 == nullptr && texImg2 == nullptr ) return true;
|
||||
|
||||
if ( texImg1 != NULL && texImg2 != NULL
|
||||
if ( texImg1 != nullptr && texImg2 != nullptr
|
||||
&& texImg1->height() == texImg2->height()
|
||||
&& texImg1->width() == texImg2->width()
|
||||
&& texImg1->width() > 0 && texImg1->height() > 0
|
||||
|
@ -45,7 +45,7 @@
|
||||
namespace caf {
|
||||
|
||||
|
||||
MessagePanel* MessagePanel::sm_messagePanelInstance = NULL;
|
||||
MessagePanel* MessagePanel::sm_messagePanelInstance = nullptr;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
|
@ -170,7 +170,7 @@ QString Utils::indentString(int numSpacesToIndent, const QString& str)
|
||||
bool Utils::getSaveDirectoryAndCheckOverwriteFiles(const QString& defaultDir, std::vector<QString> fileNames, QString* saveDir)
|
||||
{
|
||||
bool overWriteFiles = false;
|
||||
(*saveDir) = QFileDialog::getExistingDirectory(NULL, "Select save directory", defaultDir);
|
||||
(*saveDir) = QFileDialog::getExistingDirectory(nullptr, "Select save directory", defaultDir);
|
||||
|
||||
std::vector<QString> filesToOverwrite;
|
||||
for (QString fileName : fileNames)
|
||||
|
@ -191,7 +191,7 @@ ref<DrawableGeo> StructGridGeometryGenerator::generateSurface()
|
||||
|
||||
CVF_ASSERT(m_vertices.notNull());
|
||||
|
||||
if (m_vertices->size() == 0) return NULL;
|
||||
if (m_vertices->size() == 0) return nullptr;
|
||||
|
||||
ref<DrawableGeo> geo = new DrawableGeo;
|
||||
geo->setFromQuadVertexArray(m_vertices.p());
|
||||
@ -208,7 +208,7 @@ ref<DrawableGeo> StructGridGeometryGenerator::generateSurface()
|
||||
ref<DrawableGeo> StructGridGeometryGenerator::createMeshDrawable()
|
||||
{
|
||||
|
||||
if (!(m_vertices.notNull() && m_vertices->size() != 0)) return NULL;
|
||||
if (!(m_vertices.notNull() && m_vertices->size() != 0)) return nullptr;
|
||||
|
||||
ref<DrawableGeo> geo = new DrawableGeo;
|
||||
geo->setVertexArray(m_vertices.p());
|
||||
@ -228,7 +228,7 @@ ref<DrawableGeo> StructGridGeometryGenerator::createMeshDrawable()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
ref<DrawableGeo> StructGridGeometryGenerator::createOutlineMeshDrawable(double creaseAngle)
|
||||
{
|
||||
if (!(m_vertices.notNull() && m_vertices->size() != 0)) return NULL;
|
||||
if (!(m_vertices.notNull() && m_vertices->size() != 0)) return nullptr;
|
||||
|
||||
cvf::OutlineEdgeExtractor ee(creaseAngle, *m_vertices);
|
||||
|
||||
@ -238,7 +238,7 @@ ref<DrawableGeo> StructGridGeometryGenerator::createOutlineMeshDrawable(double c
|
||||
ref<cvf::UIntArray> lineIndices = ee.lineIndices();
|
||||
if (lineIndices->size() == 0)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ref<PrimitiveSetIndexedUInt> prim = new PrimitiveSetIndexedUInt(PT_LINES);
|
||||
@ -279,7 +279,7 @@ ref<DrawableGeo> StructGridGeometryGenerator::createMeshDrawableFromSingleCell(c
|
||||
cvf::ref<cvf::Vec3fArray> cvfVertices = new cvf::Vec3fArray;
|
||||
cvfVertices->assign(vertices);
|
||||
|
||||
if (!(cvfVertices.notNull() && cvfVertices->size() != 0)) return NULL;
|
||||
if (!(cvfVertices.notNull() && cvfVertices->size() != 0)) return nullptr;
|
||||
|
||||
ref<DrawableGeo> geo = new DrawableGeo;
|
||||
geo->setVertexArray(cvfVertices.p());
|
||||
|
@ -58,8 +58,8 @@ class AnimationToolBar : public QToolBar
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AnimationToolBar(QWidget *parent = 0);
|
||||
AnimationToolBar(const QString &title, QWidget *parent = 0);
|
||||
explicit AnimationToolBar(QWidget *parent = nullptr);
|
||||
AnimationToolBar(const QString &title, QWidget *parent = nullptr);
|
||||
|
||||
void connectAnimationControl(caf::FrameAnimationControl* animationControl);
|
||||
|
||||
|
@ -53,7 +53,7 @@ class FrameAnimationControl : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FrameAnimationControl(QObject* parent = 0);
|
||||
explicit FrameAnimationControl(QObject* parent = nullptr);
|
||||
|
||||
void setNumFrames(int numFrames);
|
||||
int numFrames() const;
|
||||
|
@ -80,7 +80,7 @@ OpenGLWidget::OpenGLWidget(cvf::OpenGLContextGroup* contextGroup, const QGLForma
|
||||
// the construction process above has already optimistically added the new context to the existing group.
|
||||
// In this case, the newly context is basically defunct so we just shut it down (which will also remove it from the group)
|
||||
myContext->shutdownContext();
|
||||
CVF_ASSERT(myContext->group() == NULL);
|
||||
CVF_ASSERT(myContext->group() == nullptr);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -129,7 +129,7 @@ OpenGLWidget::OpenGLWidget(OpenGLWidget* shareWidget, QWidget* parent , Qt::Wind
|
||||
// the construction process above has already optimistically added the new context to the existing group.
|
||||
// In this case, the newly context is basically defunct so we just shut it down (which will also remove it from the group)
|
||||
myContext->shutdownContext();
|
||||
CVF_ASSERT(myContext->group() == NULL);
|
||||
CVF_ASSERT(myContext->group() == nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,8 +56,8 @@ namespace caf {
|
||||
class OpenGLWidget : public QGLWidget
|
||||
{
|
||||
public:
|
||||
OpenGLWidget(cvf::OpenGLContextGroup* contextGroup, const QGLFormat& format, QWidget* parent, OpenGLWidget* shareWidget = NULL, Qt::WindowFlags f = 0);
|
||||
OpenGLWidget(OpenGLWidget* shareWidget, QWidget* parent , Qt::WindowFlags f = 0);
|
||||
OpenGLWidget(cvf::OpenGLContextGroup* contextGroup, const QGLFormat& format, QWidget* parent, OpenGLWidget* shareWidget = nullptr, Qt::WindowFlags f = nullptr);
|
||||
OpenGLWidget(OpenGLWidget* shareWidget, QWidget* parent , Qt::WindowFlags f = nullptr);
|
||||
|
||||
cvf::OpenGLContext* cvfOpenGLContext() const;
|
||||
void cvfShutdownOpenGLContext();
|
||||
|
@ -113,7 +113,7 @@ cvf::ref<cvf::OpenGLContextGroup> caf::Viewer::sm_openGLContextGroup;
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::Viewer::Viewer(const QGLFormat& format, QWidget* parent)
|
||||
: caf::OpenGLWidget(contextGroup(), format, new QWidget(parent), sharedWidget()),
|
||||
m_navigationPolicy(NULL),
|
||||
m_navigationPolicy(nullptr),
|
||||
m_defaultPerspectiveNearPlaneDistance(0.05),
|
||||
m_maxClipPlaneDistance(cvf::UNDEFINED_DOUBLE),
|
||||
m_cameraFieldOfViewYDeg(40.0),
|
||||
@ -247,7 +247,7 @@ caf::Viewer* caf::Viewer::sharedWidget()
|
||||
return *(sm_viewers.begin());
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -735,7 +735,7 @@ void caf::Viewer::slotSetCurrentFrame(int frameIndex)
|
||||
|
||||
int clampedFrameIndex = clampFrameIndex(frameIndex);
|
||||
|
||||
if (m_frameScenes.at(clampedFrameIndex) == NULL) return;
|
||||
if (m_frameScenes.at(clampedFrameIndex) == nullptr) return;
|
||||
|
||||
if (m_releaseOGLResourcesEachFrame)
|
||||
{
|
||||
@ -885,7 +885,7 @@ cvf::Scene* caf::Viewer::frame(size_t frameIndex)
|
||||
if (frameIndex < m_frameScenes.size())
|
||||
return m_frameScenes[frameIndex].p();
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1103,7 +1103,7 @@ void caf::Viewer::appendAllStaticModelsToFrame(cvf::Scene* scene)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::OverlayItem* caf::Viewer::overlayItem(int winPosX, int winPosY)
|
||||
{
|
||||
if (m_mainRendering.isNull()) return NULL;
|
||||
if (m_mainRendering.isNull()) return nullptr;
|
||||
|
||||
int translatedMousePosX = winPosX;
|
||||
int translatedMousePosY = height() - winPosY;
|
||||
|
@ -55,7 +55,7 @@ cvf::ref<cvf::DrawableGeo> BoxManipulatorGeometryGenerator::createBoundingBoxMes
|
||||
calculateArrays();
|
||||
}
|
||||
|
||||
if (!(m_vertices.notNull() && m_vertices->size() != 0)) return NULL;
|
||||
if (!(m_vertices.notNull() && m_vertices->size() != 0)) return nullptr;
|
||||
|
||||
cvf::ref<cvf::DrawableGeo> geo = new cvf::DrawableGeo;
|
||||
geo->setVertexArray(m_vertices.p());
|
||||
|
@ -18055,7 +18055,7 @@ const size_t CVF_FIXED_ATLAS_FONT_LARGE_TEXTURE_IMAGE_BLOCK_COUNT = 588;
|
||||
FixedAtlasFont::FixedAtlasFont(FontSize size)
|
||||
: m_name(""),
|
||||
m_numGlyphs(0),
|
||||
m_textureImage(NULL)
|
||||
m_textureImage(nullptr)
|
||||
{
|
||||
bool fontLoaded = false;
|
||||
|
||||
@ -18160,7 +18160,7 @@ FixedAtlasFont::FixedAtlasFont(FontSize size)
|
||||
// Make sure isEmpty fails if unable to load
|
||||
if (!fontLoaded)
|
||||
{
|
||||
m_textureImage = NULL;
|
||||
m_textureImage = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -18187,11 +18187,11 @@ const cvf::String& FixedAtlasFont::name() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<cvf::Glyph> FixedAtlasFont::getGlyph(wchar_t character)
|
||||
{
|
||||
if (isEmpty()) return NULL;
|
||||
if (isEmpty()) return nullptr;
|
||||
|
||||
cvf::uint characterPos = static_cast<cvf::uint>(character) > static_cast<cvf::uint>(m_numGlyphs) ? 0 : static_cast<cvf::uint>(character);
|
||||
|
||||
cvf::ref<cvf::Glyph> glyph = NULL;
|
||||
cvf::ref<cvf::Glyph> glyph = nullptr;
|
||||
|
||||
// Glyph already available?
|
||||
MapType::iterator it = m_atlasMap.find(characterPos);
|
||||
@ -18368,7 +18368,7 @@ void FixedAtlasFont::unload()
|
||||
m_horizontalAdvances.clear();
|
||||
m_characterWidths.clear();
|
||||
m_characterHeights.clear();
|
||||
m_textureImage = NULL;
|
||||
m_textureImage = nullptr;
|
||||
}
|
||||
|
||||
} // namespace cvf
|
||||
|
@ -128,7 +128,7 @@ public:
|
||||
CVF_ASSERT(renderConfiguration);
|
||||
m_renderConfiguration = renderConfiguration;
|
||||
}
|
||||
virtual cvf::UniformSet* uniformSet() { return NULL; }
|
||||
virtual cvf::UniformSet* uniformSet() { return nullptr; }
|
||||
virtual void update(cvf::Rendering* rendering)
|
||||
{
|
||||
m_renderConfiguration->updateEffectsForRendering(rendering);
|
||||
|
Loading…
Reference in New Issue
Block a user