AnimatSerial::AnimatSerial(HardwareSerial *ss, unsigned int inTotal, unsigned int outTotal){
    index = -1;
    status = 0;
	stream = ss;
	
	inDataTotal = inTotal;
	outDataTotal = outTotal;	
	inDataCount = 0;
	outDataCount = 0;
	
	messageID  = -1;
	packetSize = 0;
	
	if(inDataTotal > 0)
	{
		inData = new AnimatData[inDataTotal];
		changed = new bool[inDataTotal];
	}
		
	if(outDataTotal > 0)
		outData = new AnimatData[outDataTotal];
		
	clearInData();
	clearChanged();
	clearOutData();
}
Exemplo n.º 2
0
void GraphDrawer::draw()
{
    startDrawing();
    drawEdges();
    drawHighlightEdges();
    drawNodes();
    drawLabels();
    clearChanged();
}
// virtual
void LLVOClouds::updateDrawable(BOOL force_damped)
{
	// Force an immediate rebuild on any update
	if (mDrawable.notNull())
	{
		mDrawable->updateXform(TRUE);
		gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
	}
	clearChanged(SHIFTED);
}
Exemplo n.º 4
0
void ShVarModel::clearChanged(ShVarItem *i_qItem)
{
	/* Hint: this does not emit any dataChanged signal */

	int j;

	if (i_qItem != m_qRootItem) {
		i_qItem->setData(DF_CHANGED, false);
	}

	for (j = 0; j < i_qItem->childCount(); j++) {
		clearChanged(i_qItem->child(j));
	}
}
Exemplo n.º 5
0
void GraphAnimationDrawer::draw()
{
    if (animationState < animationLastState - 1 && playingState != AnimationPlayingState::pause)
    {        
        framesSpentInState++;
        if (framesSpentInState % framesPerState == 0)
        {
            prepareNewState();
            animationState++;
        }
    }

    drawAlgorithmState();

    ci::gl::color(ci::Color::white());
    if (legendVisible && (legendTexture = legend.getTexture()))
    {
        ci::gl::draw(legendTexture, ci::vec2(float(windowSize.getWidth() - legendTexture->getWidth()), 
			float(windowSize.getHeight() - legendTexture->getHeight())));
    }

    drawAnimationStateNumber();
    clearChanged();
}
Exemplo n.º 6
0
void GraphicsLayer13::uploadData()
{
	clearChanged();
}
Exemplo n.º 7
0
void ShVarModel::setChangedAndScope(ShChangeableList &i_pCL, DbgRsScope &i_pSL,
		DbgRsScope &i_pSSL)
{
	int i, j, l, m;

	clearChanged(m_qRootItem);

	dumpShChangeableList(&i_pCL);

	/* Changed? */
	for (i = 0; i < i_pCL.numChangeables; i++) {
		ShChangeable *c = i_pCL.changeables[i];

		for (j = 0; j < m_qRootItem->childCount(); j++) {
			QVariant id = m_qRootItem->child(j)->data(DF_UNIQUE_ID);
			if (id == QVariant(c->id)) {
				ShVarItem *item = m_qRootItem->child(j);
				item->setData(DF_CHANGED, true);

				for (l = 0; l < c->numIndices; l++) {
					switch (c->indices[l]->type) {
					case SH_CGB_ARRAY_DIRECT:
					case SH_CGB_ARRAY_INDIRECT:
					case SH_CGB_STRUCT:
						if (c->indices[l]->index == -1) {
							item->setData(DF_CHANGED, true);
							goto ENDINDICES;
						} else {
							if (item->data(DF_CGBL_INDEX_B).isValid()) {
								if ((c->numIndices - l) >= 2) {
									item =
											item->child(
													c->indices[l]->index
															* item->data(
																	DF_CGBL_INDEX_B).toInt()
															+ c->indices[l + 1]->index);
									l++;
								}
							} else {
								item = item->child(c->indices[l]->index);
								item->setData(DF_CHANGED, true);
							}
						}
						break;
					case SH_CGB_SWIZZLE:
						for (m = 0; m < 4; m++) {
							if ((c->indices[l]->index & (1 << m)) == (1 << m)) {
								item->child(m)->setData(DF_CHANGED, true);
							}
						}
						item = NULL;
						break;
					default:
						break;
					}
				}
				ENDINDICES: setRecursiveChanged(item);
			}
		}
	}

	/* check scope */
	for (j = 0; j < m_qRootItem->childCount(); j++) {
		ShVarItem *item = m_qRootItem->child(j);
		if (item->isBuildIn()) {
			continue;
		}
		QVariant id = item->data(DF_UNIQUE_ID);
		ShVarItem::Scope oldScope =
				(ShVarItem::Scope) item->data(DF_SCOPE).toInt();
		/* check scope list */
		for (i = 0; i < i_pSL.numIds; i++) {
			int varId = i_pSL.ids[i];
			if (id == varId) {
				if (oldScope == ShVarItem::InScope) {
				} else if (oldScope == ShVarItem::NewInScope) {
					setRecursiveScope(item, ShVarItem::InScope);
				} else {
					setRecursiveScope(item, ShVarItem::NewInScope);
				}
				break;
			}
		}
		/* not in scope list */
		if (i == i_pSL.numIds) {
			/* check scope stack */
			for (i = 0; i < i_pSSL.numIds; i++) {
				int varId = i_pSSL.ids[i];
				if (id == varId) {
					setRecursiveScope(item, ShVarItem::InScopeStack);
					break;
				}
			}
			/* not in scope stack */
			if (i == i_pSSL.numIds) {
				if (oldScope == ShVarItem::LeftScope) {
					setRecursiveScope(item, ShVarItem::OutOfScope);
				} else {
					setRecursiveScope(item, ShVarItem::LeftScope);
				}
			}
		}
	}

	ShVarItem *item;
	item = m_qRootItem->child(0);
	QModelIndex indexBegin = ShVarModel::index(item->row(), DF_NAME);
	item = m_qRootItem->child(m_qRootItem->childCount() - 1);
	QModelIndex indexEnd = ShVarModel::index(item->row(), DF_LAST - 1);
	emit dataChanged(indexBegin, indexEnd);
}