Skip to content

Commit

Permalink
Add the missing Modified() throughout the vtkArmatureWidget
Browse files Browse the repository at this point in the history
Without them, the widget will never notify that it was modified.

Issue #13640
  • Loading branch information
vovythevov committed Nov 2, 2012
1 parent afafd91 commit 9b7896d
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions Libs/VTK/Widgets/vtkArmatureWidget.cxx
Expand Up @@ -202,7 +202,7 @@ void vtkArmatureWidget::CreateDefaultRepresentation()
if (!armatureRepresentation)
{
armatureRepresentation = vtkArmatureRepresentation::New();
this->WidgetRep = armatureRepresentation;
this->SetRepresentation(armatureRepresentation);

This comment has been minimized.

Copy link
@finetjul

finetjul Nov 2, 2012

Contributor

are you sure there is no memory leak ? where is armaturerepresentation decremented ? For each new there should be 1 delete (except when using smartpointer)

}
}

Expand Down Expand Up @@ -274,7 +274,6 @@ ::CreateBone(vtkBoneWidget* parent, const vtkStdString& name)
return newBone;
}


//----------------------------------------------------------------------------
vtkBoneWidget* vtkArmatureWidget::CreateBone(vtkBoneWidget* parent,
double tail[3],
Expand Down Expand Up @@ -337,6 +336,8 @@ ::AddBone(vtkBoneWidget* bone, vtkBoneWidget* parent, bool linkedWithParent)

this->Bones->push_back(newNode);
newNode->Bone->SetDebugBoneID(this->Bones->size()); // Debug

this->Modified();
}

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -408,6 +409,8 @@ void vtkArmatureWidget::SetWidgetState(int state)
break;
}
}

this->Modified();
}

//----------------------------------------------------------------------------
Expand All @@ -424,6 +427,8 @@ void vtkArmatureWidget::SetShowAxes(int show)
{
(*it)->Bone->SetShowAxes(this->ShowAxes);
}

this->Modified();
}

//----------------------------------------------------------------------------
Expand All @@ -440,6 +445,8 @@ void vtkArmatureWidget::SetShowParenthood(int parenthood)
{
(*it)->Bone->SetShowParenthood(this->ShowParenthood);
}

this->Modified();
}

//----------------------------------------------------------------------------
Expand All @@ -463,6 +470,8 @@ void vtkArmatureWidget::SetBonesRepresentation(int representationType)
{
this->SetBoneRepresentation((*it)->Bone, this->BonesRepresentationType);
}

this->Modified();
}

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -581,6 +590,8 @@ bool vtkArmatureWidget::RemoveBone(vtkBoneWidget* bone)
this->RemoveBoneObservers((*it)->Bone);
(*it)->Bone->Delete();
this->Bones->erase(it);

this->Modified();
return true;
}
}
Expand Down Expand Up @@ -626,6 +637,8 @@ ::SetBoneLinkedWithParent(vtkBoneWidget* bone, bool linked)
node->Bone->SetWorldHeadRest(node->Parent->Bone->GetWorldTailRest());
}
}

this->Modified();
}

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -737,9 +750,9 @@ void vtkArmatureWidget
::UpdateChildrenWidgetStateToRest(ArmatureTreeNode* parentNode)
{
if (!parentNode)
{
return;
}
{
return;
}

for (ChildrenNodeIteratorType it = parentNode->Children.begin();
it != parentNode->Children.end(); ++it)
Expand All @@ -758,9 +771,9 @@ void vtkArmatureWidget
::UpdateChildrenWidgetStateToPose(ArmatureTreeNode* parentNode)
{
if (!parentNode)
{
return;
}
{
return;
}

for (ChildrenNodeIteratorType it = parentNode->Children.begin();
it != parentNode->Children.end(); ++it)
Expand Down

0 comments on commit 9b7896d

Please sign in to comment.