Skip to content

Commit

Permalink
COMP: Fix misc -Wunused-* warnings
Browse files Browse the repository at this point in the history
Referenced below are the commits were the warnings were originally
introduced:

* vtkMRMLDisplayNode:
  - r28511 (ENH: Add folder display property override to more displayable managers)

* vtkMRMLModelDisplayableManager:
  - r28509 (ENH: Refactor visibility of displayable nodes in hierarchies)

* vtkSlicerMarkupsLogic:
  - r28390 (BUG: Fixed markups curve surface computation for concave surfaces)

* vtkMRMLMarkupsCurveNode:
  - r28508 (BUG: Fix markups curve interpolation)
  - r28585 (ENH: Add markups curve resample feature with optional snap to model surface)

* qMRMLTreeView, vtkSlicerModelsLogic:
  - r28510 (ENH: Remove model hierarchy nodes)

From: Jean-Christophe Fillion-Robin <[email protected]>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@28674 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information
jcfr committed Dec 12, 2019
1 parent 60f6f94 commit 75f085d
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 43 deletions.
4 changes: 2 additions & 2 deletions Libs/MRML/Core/vtkMRMLDisplayNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ void vtkMRMLDisplayNode::ReadXMLAttributes(const char** atts)
}
}
vtkMRMLReadXMLEndMacro();

this->EndModify(disabledModify);
}

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -277,8 +279,6 @@ void vtkMRMLDisplayNode::Copy(vtkMRMLNode *anode)
//----------------------------------------------------------------------------
void vtkMRMLDisplayNode::PrintSelf(ostream& os, vtkIndent indent)
{
int idx;

Superclass::PrintSelf(os,indent);

vtkMRMLPrintBeginMacro(os, indent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,6 @@ void vtkMRMLModelDisplayableManager::UpdateModelMesh(vtkMRMLDisplayableNode *dis
vtkProp3D* prop = nullptr;

int clipping = displayNode->GetClipping();
int visibility = (displayNode->GetVisibility() == 1 && displayNode->GetVisibility3D() == 1 ? 1 : 0);
vtkAlgorithmOutput *meshConnection = nullptr;
if (this->IsModelDisplayable(modelDisplayNode))
{
Expand Down
15 changes: 1 addition & 14 deletions Libs/MRML/Widgets/qMRMLTreeView.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -845,24 +845,11 @@ void qMRMLTreeView::toggleVisibility(const QModelIndex& index)
vtkMRMLNode* node = this->sortFilterProxyModel()->mrmlNodeFromIndex(index);
vtkMRMLDisplayNode* displayNode =
vtkMRMLDisplayNode::SafeDownCast(node);
vtkMRMLDisplayableNode* displayableNode =
vtkMRMLDisplayableNode::SafeDownCast(node);
vtkMRMLDisplayableHierarchyNode* displayableHierarchyNode =
vtkMRMLDisplayableHierarchyNode::SafeDownCast(node);

vtkMRMLSelectionNode* selectionNode = vtkMRMLSelectionNode::SafeDownCast(
this->mrmlScene()->GetNodeByID("vtkMRMLSelectionNodeSingleton"));

if (selectionNode && displayableHierarchyNode)
{
vtkMRMLDisplayNode *hierDisplayNode = displayableHierarchyNode->GetDisplayNode();
int visibility = 1;
if (hierDisplayNode)
{
visibility = (hierDisplayNode->GetVisibility() ? 0 : 1);
}
}
else if (selectionNode && displayNode)
if (selectionNode && displayNode)
{
displayNode->SetVisibility(displayNode->GetVisibility() ? 0 : 1);
}
Expand Down
3 changes: 1 addition & 2 deletions Modules/Loadable/Markups/Logic/vtkSlicerMarkupsLogic.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ double vtkSlicerMarkupsLogic::GetClosedCurveSurfaceArea(vtkMRMLMarkupsClosedCurv
}

//---------------------------------------------------------------------------
bool vtkSlicerMarkupsLogic::FitSurfaceProjectWarp(vtkPoints* curvePoints, vtkPolyData* surface, double radiusScalingFactor/*=1.0*/)
bool vtkSlicerMarkupsLogic::FitSurfaceProjectWarp(vtkPoints* curvePoints, vtkPolyData* surface, double vtkNotUsed(radiusScalingFactor)/*=1.0*/)
{
if (!curvePoints || !surface)
{
Expand Down Expand Up @@ -1691,7 +1691,6 @@ bool vtkSlicerMarkupsLogic::FitPlaneToPoints(vtkPoints* curvePoints, vtkMatrix4x
pointCoords.row(1).array() -= centroid(1);
pointCoords.row(2).array() -= centroid(2);
Eigen::BDCSVD<Eigen::MatrixXd> svd(pointCoords, Eigen::ComputeFullU);
const Eigen::MatrixXd& u = svd.matrixU();

transformToBestFitPlane->Identity();
for (int row = 0; row < 3; row++)
Expand Down
17 changes: 0 additions & 17 deletions Modules/Loadable/Markups/MRML/vtkMRMLMarkupsCurveNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ bool vtkMRMLMarkupsCurveNode::ConstrainPointsToSurface(vtkPoints* originalPoints
rayEndPoint[2] = originalPoint[2] + rayDirection[2] * rayLength;

double t = 0.0;
double firstIntersectionPoint[3] = { 0.0 };
double pcoords[3] = { 0.0 };
int subId = 0;
vtkIdType cellId = 0;
Expand Down Expand Up @@ -596,19 +595,16 @@ bool vtkMRMLMarkupsCurveNode::GetPositionAndClosestPointIndexAlongCurve(double f
if (numberOfCurvePoints == 0)
{
vtkGenericWarningMacro("vtkMRMLMarkupsCurveNode::GetPositionAlongCurve failed: invalid input points");
foundClosestPointIndex = -1;
return false;
}
if (startCurvePointId < 0 || startCurvePointId >= numberOfCurvePoints)
{
vtkGenericWarningMacro("vtkMRMLMarkupsCurveNode::GetPositionAlongCurve failed: startCurvePointId is out of range");
foundClosestPointIndex = -1;
return false;
}
if (numberOfCurvePoints == 1 || distanceFromStartPoint == 0)
{
curvePoints->GetPoint(startCurvePointId, foundCurvePosition);
foundClosestPointIndex = startCurvePointId;
if (distanceFromStartPoint > 0.0)
{
vtkGenericWarningMacro("vtkMRMLMarkupsCurveNode::GetPositionAlongCurve failed: non-zero distance"
Expand Down Expand Up @@ -640,7 +636,6 @@ bool vtkMRMLMarkupsCurveNode::GetPositionAndClosestPointIndexAlongCurve(double f
{
if (vtkMRMLMarkupsCurveNode::GetCurveLength(curvePoints, closedCurve) == 0.0)
{
foundClosestPointIndex = -1;
return false;
}
curveConfirmedToBeNonZeroLength = true;
Expand All @@ -652,7 +647,6 @@ bool vtkMRMLMarkupsCurveNode::GetPositionAndClosestPointIndexAlongCurve(double f
{
// reached end of curve before getting at the requested distance
// return closest
foundClosestPointIndex = (pointId < 0 ? 0 : numberOfCurvePoints - 1);
curvePoints->GetPoint(startCurvePointId, foundCurvePosition);
return false;
}
Expand All @@ -671,14 +665,6 @@ bool vtkMRMLMarkupsCurveNode::GetPositionAndClosestPointIndexAlongCurve(double f
foundCurvePosition[i] = nextPoint[i] +
remainingDistanceFromStartPoint * (nextPoint[i] - previousPoint[i]) / lastSegmentLength;
}
if (fabs(remainingDistanceFromStartPoint) <= fabs(remainingDistanceFromStartPoint + lastSegmentLength))
{
foundClosestPointIndex = pointId;
}
else
{
foundClosestPointIndex = pointId-1;
}
break;
}

Expand Down Expand Up @@ -1014,7 +1000,6 @@ vtkIdType vtkMRMLMarkupsCurveNode::GetClosestPointPositionAlongCurveWorld(const
closestPosWorld[0] = closestCurvePoint[0];
closestPosWorld[1] = closestCurvePoint[1];
closestPosWorld[2] = closestCurvePoint[2];
vtkIdType lineIndex = closestCurvePointIndex;

// See if we can find any points closer along the curve
double relativePositionAlongLine = -1.0; // between 0.0-1.0 if between the endpoints of the line segment
Expand All @@ -1030,7 +1015,6 @@ vtkIdType vtkMRMLMarkupsCurveNode::GetClosestPointPositionAlongCurveWorld(const
closestPosWorld[0] = closestPointOnLine[0];
closestPosWorld[1] = closestPointOnLine[1];
closestPosWorld[2] = closestPointOnLine[2];
lineIndex = closestCurvePointIndex - 1;
}
}
if (closestCurvePointIndex + 1 < points->GetNumberOfPoints())
Expand All @@ -1043,7 +1027,6 @@ vtkIdType vtkMRMLMarkupsCurveNode::GetClosestPointPositionAlongCurveWorld(const
closestPosWorld[0] = closestPointOnLine[0];
closestPosWorld[1] = closestPointOnLine[1];
closestPosWorld[2] = closestPointOnLine[2];
lineIndex = closestCurvePointIndex;
}
}
return true;
Expand Down
7 changes: 0 additions & 7 deletions Modules/Loadable/Models/Logic/vtkSlicerModelsLogic.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -545,13 +545,6 @@ void vtkSlicerModelsLogic::SetAllModelsVisibility(int flag)
return;
}

vtkMRMLSelectionNode *selectionNode = nullptr;
if (this->GetMRMLScene())
{
selectionNode = vtkMRMLSelectionNode::SafeDownCast(
this->GetMRMLScene()->GetNodeByID("vtkMRMLSelectionNodeSingleton"));
}

int numModels = this->GetMRMLScene()->GetNumberOfNodesByClass("vtkMRMLModelNode");

// go into batch processing mode
Expand Down

0 comments on commit 75f085d

Please sign in to comment.