[vtkusers] Can we add a check to see if we have at least 2 nodes when vtkContourWidget is in Manipulate state?

Mengda Wu wumengda at gmail.com
Fri Jan 22 10:40:11 EST 2016


Hi all,

   I would like to set the state of vtkContourWidget to Manipulate at
initialize and add the nodes programmably instead of interactively.
Everything is fine but I have to check the there are at least 2 nodes in
the following, otherwise AddNodeOnContour will crash

So I hope you can change the following function to

void vtkContourWidget::SelectAction( vtkAbstractWidget *w )
{

................
................

  switch ( self->WidgetState )
    {
    case vtkContourWidget::Start:
    case vtkContourWidget::Define:
................
................
    case vtkContourWidget::Manipulate:
      {
      if ( rep->ActivateNode( X, Y ) )
        {
................
................
        }
      else if ( rep->GetNumberOfNodes()>1 && rep->AddNodeOnContour( X, Y )
)   //Ensure the number of nodes is at least 2
        {
................
................
        }
................
................
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160122/1ef86b94/attachment.html>


More information about the vtkusers mailing list