Esempio n. 1
0
void VtkVisTabWidget::on_scaleZ_textChanged(const QString &text)
{
	bool ok = true;
	double scale = text.toDouble(&ok);

	// If z scale becomes zero, the object becomes invisible
	if (ok && scale != 0.0)
	{
		_item->setScale(1.0, 1.0, scale);

		for (int i = 0; i < _item->childCount(); i++)
		{
			VtkVisPipelineItem* childItem = _item->child(i);
			if (childItem)
			{
				VtkCompositeColorByHeightFilter* colorFilter =
				        dynamic_cast<VtkCompositeColorByHeightFilter*>
				        (childItem->compositeFilter());
				if (colorFilter)
					VtkColorByHeightFilter::SafeDownCast(
					        colorFilter->GetOutputAlgorithm())->
					SetTableRangeScaling(scale);
			}
		}

		emit requestViewUpdate();
	}
}