QList<QString> QgsGraduatedSymbolRendererV2::usedAttributes()
{
  QSet<QString> attributes;

  // mAttrName can contain either attribute name or an expression.
  // Sometimes it is not possible to distinguish between those two,
  // e.g. "a - b" can be both a valid attribute name or expression.
  // Since we do not have access to fields here, try both options.
  attributes << mAttrName;

  QgsExpression testExpr( mAttrName );
  if ( !testExpr.hasParserError() )
    attributes.unite( testExpr.referencedColumns().toSet() );

  if ( mRotation.data() ) attributes.unite( mRotation->referencedColumns().toSet() );
  if ( mSizeScale.data() ) attributes.unite( mSizeScale->referencedColumns().toSet() );

  QgsRangeList::const_iterator range_it = mRanges.constBegin();
  for ( ; range_it != mRanges.constEnd(); ++range_it )
  {
    QgsSymbolV2* symbol = range_it->symbol();
    if ( symbol )
    {
      attributes.unite( symbol->usedAttributes() );
    }
  }
  return attributes.toList();
}
示例#2
0
bool Game::cop_testMotionNum() {
	debug(DBG_OPCODES, "Game::cop_testMotionNum");
	bool ret = true;
	int index = findObjectByName(_objectScript.currentObjectNum, _objectScript.testObjectNum, &_objectScript.objectFound);
	if (index == -1) {
		ret = false;
	}
	if (ret) {
		SceneObject *so = derefSceneObject(index);
		if (so->statePrev != 0) {
			int16 _dx = so->motionNum2 - _animationsTable[_sceneObjectMotionsTable[so->motionNum1].animNum].firstMotionIndex;
			int16 _ax = 0;
			if (_objectScript.objectFound) {
				if (_sceneObjectMotionsTable[so->motionNum1].animNum != _sceneObjectMotionsTable[so->motionInit].animNum) {
					_ax = _animationsTable[_sceneObjectMotionsTable[so->motionNum1].animNum].unk26;
				}
			}
			if (testExpr(_ax + _dx + 1)) {
				return true;
			}
		}
		if (index == _objectScript.testObjectNum) {
			_objectScript.dataOffset = _objectScript.testDataOffset;
			assert(0); // XXX
		} else {
			ret = false;
		}
	}
	return ret;
}
QList<QString> QgsHeatmapRenderer::usedAttributes()
{
  QSet<QString> attributes;

  // mAttrName can contain either attribute name or an expression.
  // Sometimes it is not possible to distinguish between those two,
  // e.g. "a - b" can be both a valid attribute name or expression.
  // Since we do not have access to fields here, try both options.
  attributes << mWeightExpressionString;

  QgsExpression testExpr( mWeightExpressionString );
  if ( !testExpr.hasParserError() )
    attributes.unite( testExpr.referencedColumns().toSet() );

  return attributes.toList();
}
示例#4
0
bool Game::cop_testObjectVar() {
	debug(DBG_OPCODES, "Game::cop_testObjectVar()");
	bool ret = true;
	int var = _objectScript.fetchNextWord();
	int index = findObjectByName(_objectScript.currentObjectNum, _objectScript.testObjectNum, &_objectScript.objectFound);
	if (index == -1) {
		ret = false;
	}
	if (ret) {
		SceneObject *so = derefSceneObject(index);
		assert(var >= 0 && var < 10);
		if (!testExpr(so->varsTable[var])) {
			if (index == _objectScript.testObjectNum) {
				_objectScript.dataOffset = _objectScript.testDataOffset;
				assert(0); // XXX
			} else {
				ret = false;
			}
		}
//_logExpr = false;
	}
	return ret;
}
示例#5
0
bool Game::cop_testObjectFrameNum() {
	debug(DBG_OPCODES, "Game::cop_testObjectFrameNum");
	bool ret = true;
	int index = findObjectByName(_objectScript.currentObjectNum, _objectScript.testObjectNum, &_objectScript.objectFound);
	if (index == -1) {
		ret = false;
	}
	if (ret) {
		SceneObject *so = derefSceneObject(index);
		if (so->statePrev != 0) {
			int16 val = so->frameNum - _sceneObjectMotionsTable[so->motionNum2].firstFrameIndex + 1;
			if (testExpr(val)) {
				return true;
			}
		}
		if (index == _objectScript.testObjectNum) {
			_objectScript.dataOffset = _objectScript.testDataOffset;
			assert(0); // XXX
		} else {
			ret = false;
		}
	}
	return ret;
}
示例#6
0
bool Game::cop_testLastDialogue() {
	debug(DBG_OPCODES, "Game::cop_testLastDialogue");
	return testExpr(_lastDialogueEndedId) && _dialogueEndedFlag != 0;
}
示例#7
0
bool Game::cop_testVar() {
	debug(DBG_OPCODES, "Game::cop_testVar()");
	int var = _objectScript.fetchNextWord();
	bool ret = testExpr(_varsTable[var]);
	return ret;
}
示例#8
0
bool Game::cop_testMouseYPos() {
	debug(DBG_OPCODES, "Game::cop_testMouseYPos");
	return testExpr(_stub->_pi.mouseY);
}