[vtkusers] How to compare vtk widget
Jose Barreto
jose.de.paula at live.com
Mon Oct 10 12:33:18 EDT 2016
I use something like this:
list<vtkSmartPointer<vtkAbstractWidget>> vectorWindget;
vtkTextoSetaWidget* texto0 = vtkTextoSetaWidget::New();
vtkTextoSetaWidget* texto1 = vtkTextoSetaWidget::New();
vtkReguaWidget* regua0 = vtkReguaWidget::New();
vtkReguaWidget* regua1 = vtkReguaWidget::New();
vectorWindget.push_back(texto0);
vectorWindget.push_back(texto1);
vectorWindget.push_back(regua0);
vectorWindget.push_back(regua1);
//procura o texto 1
for (std::list<vtkSmartPointer<vtkAbstractWidget>>::iterator it =
vectorWindget.begin(); it != vectorWindget.end(); ++it)
{
if (it->GetPointer() != nullptr)
{
if ((gcnew
String(it->GetPointer()->GetClassName()))->Equals("vtkTextoSetaWidget")
&&
(XDicom::Anotacoes::vtkTextoSetaWidget::SafeDownCast(it->GetPointer()) ==
texto1))
{
vectorWindget.remove(texto1);
break;
}
}
}
My list has objects as vtkabstractwidget because I have more than one type
of widget it.
so check if the class name and the same for which I am convertanto to avoid
mistakes.
--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-compare-vtk-widget-tp5740710p5740716.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list