mirror of
				https://github.com/OPM/ResInsight.git
				synced 2025-02-25 18:55:39 -06:00 
			
		
		
		
	#4348 System , cppcheck : Remove unused functions
This commit is contained in:
		@@ -7,9 +7,15 @@ unchanged	ApplicationCode\ReservoirDataModel\cvfGeometryTools.cpp	614	style	unus
 | 
			
		||||
unchanged	ApplicationCode\WellPathImportSsihub\RiuWellImportWizard.cpp	147	style	unusedFunction	false	The function 'cancelDownload' is never used.
 | 
			
		||||
unchanged	ApplicationCode\GeoMech\GeoMechDataModel\RigFemPartGrid.cpp	453	style	unusedFunction	false	The function 'cellIJKFromCoordinate' is never used.
 | 
			
		||||
unchanged	ApplicationCode\GeoMech\GeoMechDataModel\RigFemPartGrid.cpp	486	style	unusedFunction	false	The function 'cellMinMaxCordinates' is never used.
 | 
			
		||||
unchanged	ApplicationCode\UserInterface\RiuWellLogPlot.cpp	527	style	unusedFunction	false	The function 'changeEvent' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Commands\AnnotationCommands\RicTextAnnotation3dEditor.cpp	133	style	unusedFunction	false	The function 'cleanupBeforeSettingPdmObject' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Commands\AnnotationCommands\RicTextAnnotation3dEditor.cpp	73	style	unusedFunction	false	The function 'configureAndUpdateUi' is never used.
 | 
			
		||||
 | 
			
		||||
WIP
 | 
			
		||||
---
 | 
			
		||||
unchanged	ApplicationCode\UserInterface\RiuGridCrossQwtPlot.cpp	359	style	unusedFunction	false	The function 'contextMenuEvent' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Commands\HoloLensCommands\VdeCachingHashedIdFactory.cpp	233	style	unusedFunction	false	The function 'crc' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Application\Tools\RiaColorTables.cpp	580	style	unusedFunction	false	The function 'createBrightnessBasedColorTable' is never used.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Candidate for later use
 | 
			
		||||
@@ -32,17 +38,14 @@ unchanged	ApplicationCode\ReservoirDataModel\RigEclipseResultBinSorter.cpp	48	st
 | 
			
		||||
unchanged	ApplicationCode\Commands\ExportCommands\RicExportLgrFeature.cpp	684	style	unusedFunction	false	The function 'cellsIntersectingCompletion' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Commands\ExportCommands\RicExportLgrFeature.cpp	702	style	unusedFunction	false	The function 'createOrderedIntersectionList' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Commands\ExportCommands\RicExportLgrFeature.cpp	1129	style	unusedFunction	false	The function 'resetNumbering' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Commands\RicCreateTemporaryLgrFeature.cpp	350	style	unusedFunction	false	The function 'containsAnyNonMainGridCells' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Application\Tools\RiaColorTools.cpp	147	style	unusedFunction	false	The function 'contrastRatio' is never used.
 | 
			
		||||
unchanged	ApplicationCode\ProjectDataModel\Completions\RimPerforationInterval.cpp	105	style	unusedFunction	false	The function 'enableCustomEndDate' is never used.
 | 
			
		||||
unchanged	ApplicationCode\ProjectDataModel\Rim3dView.cpp	1099	style	unusedFunction	false	The function 'enablePerspectiveProjectionField' is never used.
 | 
			
		||||
unchanged	ApplicationCode\ReservoirDataModel\RigMainGrid.cpp	166	style	unusedFunction	false	The function 'findAllReservoirCellIndicesMatching2dPoint' is never used.
 | 
			
		||||
 | 
			
		||||
Backlog
 | 
			
		||||
-------
 | 
			
		||||
unchanged	ApplicationCode\UserInterface\RiuWellLogPlot.cpp	527	style	unusedFunction	false	The function 'changeEvent' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Commands\AnnotationCommands\RicTextAnnotation3dEditor.cpp	133	style	unusedFunction	false	The function 'cleanupBeforeSettingPdmObject' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Commands\AnnotationCommands\RicTextAnnotation3dEditor.cpp	73	style	unusedFunction	false	The function 'configureAndUpdateUi' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Commands\RicCreateTemporaryLgrFeature.cpp	350	style	unusedFunction	false	The function 'containsAnyNonMainGridCells' is never used.
 | 
			
		||||
unchanged	ApplicationCode\UserInterface\RiuGridCrossQwtPlot.cpp	359	style	unusedFunction	false	The function 'contextMenuEvent' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Application\Tools\RiaColorTools.cpp	147	style	unusedFunction	false	The function 'contrastRatio' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Commands\HoloLensCommands\VdeCachingHashedIdFactory.cpp	233	style	unusedFunction	false	The function 'crc' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Application\Tools\RiaColorTables.cpp	580	style	unusedFunction	false	The function 'createBrightnessBasedColorTable' is never used.
 | 
			
		||||
unchanged	ApplicationCode\GeoMech\GeoMechVisualization\RivFemPartGeometryGenerator.cpp	106	style	unusedFunction	false	The function 'createOutlineMeshDrawable' is never used.
 | 
			
		||||
unchanged	ApplicationCode\ModelVisualization\RivWellConnectionFactorGeometryGenerator.cpp	202	style	unusedFunction	false	The function 'createStarGeometry' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Commands\SummaryPlotCommands\RicSummaryCurveCalculatorEditor.cpp	119	style	unusedFunction	false	The function 'createWidget' is never used.
 | 
			
		||||
@@ -56,9 +59,7 @@ unchanged	ApplicationCode\UserInterface\RiuDragDrop.cpp	254	style	unusedFunction
 | 
			
		||||
unchanged	ApplicationCode\FileInterface\RifEclipseSummaryTools.cpp	123	style	unusedFunction	false	The function 'dumpMetaData' is never used.
 | 
			
		||||
unchanged	ApplicationCode\FileInterface\RifJsonEncodeDecode.cpp	45	style	unusedFunction	false	The function 'dumpToFile' is never used.
 | 
			
		||||
unchanged	ApplicationCode\GeoMech\OdbReader\RifOdbReader.cpp	551	style	unusedFunction	false	The function 'elementSet' is never used.
 | 
			
		||||
unchanged	ApplicationCode\ProjectDataModel\Completions\RimPerforationInterval.cpp	105	style	unusedFunction	false	The function 'enableCustomEndDate' is never used.
 | 
			
		||||
unchanged	ApplicationCode\ProjectDataModel\Rim3dView.cpp	1099	style	unusedFunction	false	The function 'enablePerspectiveProjectionField' is never used.
 | 
			
		||||
unchanged	ApplicationCode\ReservoirDataModel\RigMainGrid.cpp	166	style	unusedFunction	false	The function 'findAllReservoirCellIndicesMatching2dPoint' is never used.
 | 
			
		||||
 | 
			
		||||
unchanged	ApplicationCode\Application\RiaEclipseFileNameTools.cpp	73	style	unusedFunction	false	The function 'findRelatedDataFile' is never used.
 | 
			
		||||
unchanged	ApplicationCode\Commands\HoloLensCommands\VdeArrayDataPacket.cpp	221	style	unusedFunction	false	The function 'fromRawPacketBuffer' is never used.
 | 
			
		||||
unchanged	ApplicationCode\GeoMech\GeoMechDataModel\RigFemPartGrid.cpp	503	style	unusedFunction	false	The function 'gridPointCoordinate' is never used.
 | 
			
		||||
 
 | 
			
		||||
@@ -141,20 +141,6 @@ cvf::Color3f RiaColorTools::fromQColorTo3f(QColor color)
 | 
			
		||||
    return cvf::Color3f(color.redF(), color.greenF(), color.blueF());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
///
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
float RiaColorTools::contrastRatio(cvf::Color3f color1, cvf::Color3f color2)
 | 
			
		||||
{
 | 
			
		||||
    float L1 = relativeLuminance(color1);
 | 
			
		||||
    float L2 = relativeLuminance(color2);
 | 
			
		||||
 | 
			
		||||
    float Lmin = std::min(L1, L2);
 | 
			
		||||
    float Lmax = std::max(L1, L2);
 | 
			
		||||
 | 
			
		||||
    return (Lmax + 0.05) / (Lmin + 0.05);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
///
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
 
 | 
			
		||||
@@ -42,7 +42,7 @@ public:
 | 
			
		||||
    static QColor       toQColor(cvf::Color3f color, float alpha = 1.0f);
 | 
			
		||||
    static QColor       toQColor(cvf::Color4f color);
 | 
			
		||||
    static cvf::Color3f fromQColorTo3f(QColor);
 | 
			
		||||
    static float        contrastRatio(cvf::Color3f color1, cvf::Color3f color2);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    static float relativeLuminance(cvf::Color3f backgroundColor);
 | 
			
		||||
    static float calculateNonLinearColorValue(float colorFraction);
 | 
			
		||||
 
 | 
			
		||||
@@ -99,14 +99,6 @@ void RimPerforationInterval::setCustomStartDate(const QDate& date)
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
///
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void RimPerforationInterval::enableCustomEndDate(bool enable)
 | 
			
		||||
{
 | 
			
		||||
    m_useCustomEndDate = enable;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
///
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
 
 | 
			
		||||
@@ -52,7 +52,6 @@ public:
 | 
			
		||||
    void                                enableCustomStartDate(bool enable);
 | 
			
		||||
    void                                setCustomStartDate(const QDate& date);
 | 
			
		||||
 | 
			
		||||
    void                                enableCustomEndDate(bool enable);
 | 
			
		||||
    void                                setCustomEndDate(const QDate& date);
 | 
			
		||||
 | 
			
		||||
    void                                setDiameter(double diameter);
 | 
			
		||||
 
 | 
			
		||||
@@ -394,19 +394,6 @@ QString RimGridCrossPlotDataSet::timeStepString() const
 | 
			
		||||
    return "";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
///
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
std::vector<QString> RimGridCrossPlotDataSet::groupStrings() const
 | 
			
		||||
{
 | 
			
		||||
    std::vector<QString> groupStrings;
 | 
			
		||||
    for (auto curve : m_crossPlotCurves())
 | 
			
		||||
    {
 | 
			
		||||
        groupStrings.push_back(legendConfig()->categoryNameFromCategoryValue(curve->groupIndex()));
 | 
			
		||||
    }
 | 
			
		||||
    return groupStrings;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
///
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
 
 | 
			
		||||
@@ -113,7 +113,6 @@ public:
 | 
			
		||||
    QString              caseNameString() const;
 | 
			
		||||
    QString              axisVariableString() const;
 | 
			
		||||
    QString              timeStepString() const;
 | 
			
		||||
    std::vector<QString> groupStrings() const;
 | 
			
		||||
 | 
			
		||||
    std::map<NameComponents, QString> nameComponents() const;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1093,15 +1093,6 @@ void Rim3dView::disablePerspectiveProjectionField()
 | 
			
		||||
    RiaFieldhandleTools::disableWriteAndSetFieldHidden(&isPerspectiveView);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
///
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
void Rim3dView::enablePerspectiveProjectionField()
 | 
			
		||||
{
 | 
			
		||||
    isPerspectiveView.uiCapability()->setUiHidden(false);
 | 
			
		||||
    isPerspectiveView.xmlCapability()->setIOWritable(true);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
/// 
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
 
 | 
			
		||||
@@ -166,7 +166,6 @@ protected:
 | 
			
		||||
    virtual void                            setDefaultView();
 | 
			
		||||
    void                                    disableGridBoxField();
 | 
			
		||||
    void                                    disablePerspectiveProjectionField();
 | 
			
		||||
    void                                    enablePerspectiveProjectionField();
 | 
			
		||||
    cvf::Mat4d                              cameraPosition() const;
 | 
			
		||||
    cvf::Vec3d                              cameraPointOfInterest() const;
 | 
			
		||||
    RimViewNameConfig*                      nameConfig() const;
 | 
			
		||||
 
 | 
			
		||||
@@ -160,36 +160,6 @@ size_t RigMainGrid::findReservoirCellIndexFromPoint(const cvf::Vec3d& point) con
 | 
			
		||||
    return cellContainingPoint;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
///
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
std::vector<size_t> RigMainGrid::findAllReservoirCellIndicesMatching2dPoint(const cvf::Vec2d& point2d) const
 | 
			
		||||
{
 | 
			
		||||
    cvf::BoundingBox gridBoundingVox = boundingBox();
 | 
			
		||||
    cvf::Vec3d       highestPoint(point2d, gridBoundingVox.max().z());
 | 
			
		||||
    cvf::Vec3d       lowestPoint(point2d, gridBoundingVox.min().z());
 | 
			
		||||
 | 
			
		||||
    cvf::BoundingBox rayBBox;
 | 
			
		||||
    rayBBox.add(highestPoint);
 | 
			
		||||
    rayBBox.add(lowestPoint);
 | 
			
		||||
 | 
			
		||||
    std::vector<size_t> cellIndices;
 | 
			
		||||
    m_mainGrid->findIntersectingCells(rayBBox, &cellIndices);
 | 
			
		||||
 | 
			
		||||
    cvf::Vec3d hexCorners[8];
 | 
			
		||||
    for (size_t cellIndex : cellIndices)
 | 
			
		||||
    {
 | 
			
		||||
        m_mainGrid->cellCornerVertices(cellIndex, hexCorners);
 | 
			
		||||
 | 
			
		||||
        if (RigHexIntersectionTools::lineIntersectsHexCell(highestPoint, lowestPoint, hexCorners))
 | 
			
		||||
        {
 | 
			
		||||
            cellIndices.push_back(cellIndex);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return cellIndices;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
///
 | 
			
		||||
//--------------------------------------------------------------------------------------------------
 | 
			
		||||
 
 | 
			
		||||
@@ -58,7 +58,6 @@ public:
 | 
			
		||||
    const RigCell&                          cellByGridAndGridLocalCellIdx(size_t gridIdx, size_t gridLocalCellIdx) const;
 | 
			
		||||
    size_t                                  reservoirCellIndexByGridAndGridLocalCellIndex(size_t gridIdx, size_t gridLocalCellIdx) const;
 | 
			
		||||
    size_t                                  findReservoirCellIndexFromPoint(const cvf::Vec3d& point) const;
 | 
			
		||||
    std::vector<size_t>                     findAllReservoirCellIndicesMatching2dPoint(const cvf::Vec2d& point2d) const;
 | 
			
		||||
    void                                    addLocalGrid(RigLocalGrid* localGrid);
 | 
			
		||||
    
 | 
			
		||||
    size_t                                  gridCountOnFile() const;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user