Esempio n. 1
0
void
NeuronsStackView::updateOutputs() {

	util::rect<double> oldSize = _painter->getSize();

	if (_neuronsModified) {

		_painter->setNeurons(_neurons);

		_neuronsModified = false;
	}

	if (_currentNeuronModified) {

		_painter->showNeuron(*_currentNeuron);

		_currentNeuronModified = false;
	}

	util::rect<double> newSize = _painter->getSize();

	if (oldSize == newSize) {

		LOG_ALL(neuronsstackviewlog) << "neurons size did not change -- sending ContentChanged" << std::endl;

		_contentChanged();

	} else {

		LOG_ALL(neuronsstackviewlog) << "neurons size did change -- sending SizeChanged" << std::endl;

		_sizeChanged();
	}
}
void
ImageStackView::updateOutputs() {

	util::rect<double> oldSize = _painter->getSize();

	_painter->setImageStack(_stack);
	_painter->setCurrentSection(_section);

	util::rect<double> newSize = _painter->getSize();

	if (oldSize == newSize) {

		LOG_ALL(imagestackviewlog) << "image size did not change -- sending ContentChanged" << std::endl;

		_contentChanged();

	} else {

		LOG_ALL(imagestackviewlog) << "image size did change -- sending SizeChanged" << std::endl;

		_sizeChanged();
	}

	if (_stack->size() == 0)
		return;

	// prepare current image data
	_currentImageData.reshape(vigra::MultiArray<2, float>::size_type(_stack->width(), _stack->height()));

	// copy current image data
	_currentImageData = *(*_stack)[_section];

	// set content of output
	*_currentImage = _currentImageData;
}
void
SegmentsStackView::updateOutputs() {

	util::rect<double> oldSize = _painter->getSize();

	// set new or modified segments
	if (_segmentsModified) {

		_painter->setSegments(_segments);

		_segmentsModified = false;
	}

	// query visible segments
	_painter->getVisibleSegments(*_visibleSegments);

	LOG_ALL(segmentsstackviewlog) << "there are " << _visibleSegments->size() << " visible segments" << std::endl;

	// get new size of painter
	util::rect<double> newSize = _painter->getSize();

	if (oldSize == newSize) {

		LOG_ALL(segmentsstackviewlog) << "segments size did not change -- sending ContentChanged" << std::endl;

		_contentChanged();

	} else {

		LOG_ALL(segmentsstackviewlog) << "segments size did change -- sending SizeChanged" << std::endl;

		_sizeChanged();
	}
}
Esempio n. 4
0
void
TextView::onUpdate(const pipeline::Update& signal) {

	LOG_ALL(textviewlog) << "got an update signal" << std::endl;

	if (_dirty) {

		LOG_ALL(textviewlog) << "I'm dirty, resetting my text" << std::endl;

		_painter->setText(_text);
		_dirty = false;

		LOG_ALL(textviewlog) << "sending size changed signal" << std::endl;

		_sizeChanged();
	}
}
void
ImageStackView::updateOutputs() {

	util::rect<double> oldSize = _painter->getSize();

	_painter->setImageStack(_stack);
	_painter->setCurrentSection(*_section);

	util::rect<double> newSize = _painter->getSize();

	if (oldSize == newSize) {

		LOG_ALL(imagestackviewlog) << "image size did not change -- sending ContentChanged" << std::endl;

		_contentChanged();

	} else {

		LOG_ALL(imagestackviewlog) << "image size did change -- sending SizeChanged" << std::endl;

		_sizeChanged();
	}

	if (_stack->size() == 0)
		return;

	// prepare current image data
	if (!_currentImage)
		_currentImage = new Image(_stack->width(), _stack->height());
	else
		_currentImage->reshape(_stack->width(), _stack->height());

	// copy current image data
	*_currentImage = *(*_stack)[*_section];

	// set last known mouse down position
	*_clickX = _mouseDownX;
	*_clickY = _mouseDownY;
}