Beispiel #1
0
void WatchVector::attachFpData(PixelBox *f, QString name)
{
    int idx;

    if (!f) {
        return;
    }

    if (!getNumFreeMappings()) {
        return;
    }

    if (getIndexFromPixelBox(f) != -1) {
        return;
    }
    
    /* Fill empty slot with attachment */
    idx = getFirstFreeMapping();
    m_pData[idx] = f;
    m_qName[idx] = name;
    m_nActiveMappings++;

    connect(f, SIGNAL(dataChanged()), this, SLOT(updateData()));
    connect(f, SIGNAL(dataDeleted()), this, SLOT(detachData()));
    connect(this->m_pImageView, SIGNAL(minMaxAreaChanged(const QRect&)), 
        f, SLOT(setMinMaxArea(const QRect&)));
    connect(this->m_pImageView, SIGNAL(setMappingBounds()), this,
        SLOT(updateAllMinMax()));        
    connect(f, SIGNAL(minMaxAreaChanged()), this, SLOT(onMinMaxAreaChanged()));


    addMappingOptions(idx);
    updateGUI();
}
void WatchGeoDataTree::attachData(VertexBox *currentData, VertexBox *vertexData,
		QString name)
{
	if (!currentData || !vertexData) {
		return;
	}

	if (m_dataModel->addData(currentData, vertexData, name)) {
		addMappingOptions(m_dataModel->getDataColumnCount() - 1);
		updateGUI();
	}
}