示例#1
0
void BaseOp::stagePostFinished()
{
	if (isAborted() || m_reply == NULL) {
		DBGLOG(LOG_DEBUG, 10, QString::fromUtf8("Aborted at 'post' stage"));
		return report(WTFStatus_Aborted);
	}

	if (m_reply->error() != QNetworkReply::NoError) {
		DBGLOG(LOG_ERROR, 2, QString::fromUtf8("Network error, code=%1").arg(m_reply->error()));
		setProperty("varNetworkError", m_reply->error());
		m_reply->deleteLater();
		m_reply = NULL;
		return report(WTFStatus_NetworkError);
	}

	QByteArray responseData = m_reply->readAll();
	m_reply->deleteLater();
	m_reply = NULL;

	DBGLOG(LOG_DEBUG, 10, QString::fromUtf8("response data: %1").arg(QString::fromUtf8(responseData)));

	QVariantMap result;
	if (!parseResultXml(responseData, result)) {
		DBGLOG(LOG_DEBUG, 2, QString::fromUtf8("parseResultXml failed!"));
		result.clear();
	}

	report(processImpl(responseData, result));
}
void TypeAndConstantInference::process(ASTPtr & ast, const Context & context,
    CollectAliases & aliases,
    const AnalyzeColumns & columns,
    const AnalyzeLambdas & lambdas,
    ExecuteTableFunctions & table_functions)
{
    processImpl(ast, context, aliases, columns, info, lambdas, table_functions);
}
示例#3
0
static void processImpl(const ASTPtr & ast, CollectAliases::Aliases & aliases, CollectAliases::Kind kind, size_t keep_kind_for_depth)
{
	String alias = ast->tryGetAlias();
	if (!alias.empty())
	{
		auto it_inserted = aliases.emplace(alias, CollectAliases::AliasInfo(ast, kind));

		if (!it_inserted.second && ast->getTreeHash() != it_inserted.first->second.node->getTreeHash())
		{
			std::stringstream message;
			message << "Different expressions with the same alias " << backQuoteIfNeed(alias) << ":\n";
			formatAST(*it_inserted.first->second.node, message, 0, false, true);
			message << "\nand\n";
			formatAST(*ast, message, 0, false, true);
			message << "\n";

			throw Exception(message.str(), ErrorCodes::MULTIPLE_EXPRESSIONS_FOR_ALIAS);
		}
	}

	for (auto & child : ast->children)
	{
		if (typeid_cast<const ASTSelectQuery *>(child.get()))
		{
			/// Don't go into subqueries.
		}
		else if (typeid_cast<const ASTTableExpression *>(child.get()))
		{
			processImpl(child, aliases, CollectAliases::Kind::Table, 1);
		}
		else if (typeid_cast<const ASTArrayJoin *>(child.get()))
		{
			/// ASTArrayJoin -> ASTExpressionList -> element of expression AS alias
			processImpl(child, aliases, CollectAliases::Kind::ArrayJoin, 3);
		}
		else if (keep_kind_for_depth > 0)
		{
			processImpl(child, aliases, kind, keep_kind_for_depth - 1);
		}
		else
		{
			processImpl(child, aliases, CollectAliases::Kind::Expression, 0);
		}
	}
}
示例#4
0
void
pcl::modeler::AbstractWorker::process()
{
  for (auto &cloud_mesh_item : cloud_mesh_items_)
  {
    processImpl(cloud_mesh_item);
  }

  emit finished();

  return;
}
示例#5
0
void AnalyzeColumns::process(ASTPtr & ast, const CollectAliases & aliases, const CollectTables & tables)
{
    /// If this is SELECT query, don't go into FORMAT and SETTINGS clauses
    /// - they contain identifiers that are not columns.
    const ASTSelectQuery * select = typeid_cast<const ASTSelectQuery *>(ast.get());

    for (auto & child : ast->children)
    {
        if (select && (child.get() == select->format.get() || child.get() == select->settings.get()))
            continue;

        processImpl(child, columns, aliases, tables);
    }
}
示例#6
0
void
pcl::modeler::AbstractWorker::process()
{
  for (QList<CloudMeshItem*>::iterator cloud_mesh_items_it = cloud_mesh_items_.begin();
    cloud_mesh_items_it != cloud_mesh_items_.end();
    ++ cloud_mesh_items_it)
  {
    processImpl(*cloud_mesh_items_it);
  }

  emit finished();

  return;
}
示例#7
0
void
pcl::modeler::AbstractWorker::process()
{
  while (!cloud_actors_.empty())
  {
    sensor_msgs::PointCloud2::Ptr cloud(new sensor_msgs::PointCloud2);
    processImpl(cloud_actors_.back()->getCloud(), cloud);

    cloud_actors_.back()->updateCloud(cloud);
    cloud_actors_.pop_back();
  }

  emit finished();

  return;
}
        TyErrorId EngineBase::process(CAS& cas, ResultSpecification const& resultSpec) {
            try {
                util::Trace clTrace(util::enTraceDetailLow, UIMA_TRACE_ORIGIN, UIMA_TRACE_COMPID_ENGINE);

                if (!checkAndSetCallingSequenceProcess()) {
                    return logError(clTrace, UIMA_ERR_ENGINE_INVALID_CALLING_SEQUENCE);
                }
                // (ee) WHY DO THIS CHECK???
                //checkCASCompatibility(cas);

                // Removed code that used to skip the processing if the document
                // was empty, since not all Sofas have local text. (bll)

                return processImpl(cas, resultSpec);
            } catch (Exception& rclException) {
                getAnnotatorContext().getLogger().logError(rclException.getErrorInfo());
                //return rclException.getErrorInfo().getErrorId();
                UIMA_EXC_RETHROW(rclException, NULL);
            }

        }
示例#9
0
void CollectAliases::process(const ASTPtr & ast)
{
	processImpl(ast, aliases, Kind::Expression, 0);
}
示例#10
0
void AnalyzeLambdas::process(ASTPtr & ast)
{
    LambdaScopes lambda_scopes;
    for (auto & child : ast->children)
        processImpl(child, lambda_scopes, nullptr, higher_order_functions);
}
示例#11
0
			/**
			 * \brief Form a quantized image pyramid from a source image.
			 *
			 * \param[in] src  The source image. Type depends on the modality.
			 * \param[in] mask Optional mask. If not empty, unmasked pixels are set to zero
			 *                 in quantized image and cannot be extracted as features.
			 */
			Ptr<QuantizedPyramid> process(const Mat& src,
				const Mat& mask = Mat()) const
			{
				return processImpl(src, mask);
			}
unsigned Connection::threadProc( void *param ) {
	while( !shouldExit(10) ) {
		processImpl();
	}
	return 0;
}
    void RaycastingProcessor::updateResult(DataContainer& data) {
        ImageRepresentationGL::ScopedRepresentation img(data, p_sourceImageID.getValue());
        ScopedTypedData<RenderData> entryPoints(data, p_entryImageID.getValue());
        ScopedTypedData<RenderData> exitPoints(data, p_exitImageID.getValue());
        ScopedTypedData<CameraData> camera(data, p_camera.getValue());

        if (img != nullptr && entryPoints != nullptr && exitPoints != nullptr && camera != nullptr) {
            if (img->getDimensionality() == 3) {
                // little hack to support LOD texture lookup for the gradients:
                // if texture does not yet have mipmaps, create them.
                const cgt::Texture* tex = img->getTexture();
                if (tex->getFilter() != cgt::Texture::MIPMAP) {
                    const_cast<cgt::Texture*>(tex)->setFilter(cgt::Texture::MIPMAP);
                    glGenerateMipmap(GL_TEXTURE_3D);
                    glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
                    glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
                    LGL_ERROR;
                }

                _shader->activate();
                _shader->setIgnoreUniformLocationError(true);

                // Compute min/max depth if needed by shader
                if (_shader->getUniformLocation("_minDepth") != -1) {
                    _shader->deactivate();
                    float minDepth = _minReduction->reduce(entryPoints->getDepthTexture()).front();
                    _shader->activate();

                    _shader->setUniform("_minDepth", minDepth);
                }
                if (_shader->getUniformLocation("_maxDepth") != -1) {
                    _shader->deactivate();
                    float maxDepth = _maxReduction->reduce(exitPoints->getDepthTexture()).front();
                    _shader->activate();

                    _shader->setUniform("_maxDepth", maxDepth);
                }

                decorateRenderProlog(data, _shader);
                _shader->setUniform("_viewportSizeRCP", 1.f / cgt::vec2(getEffectiveViewportSize()));
                _shader->setUniform("_jitterStepSizeMultiplier", p_jitterStepSizeMultiplier.getValue());

                // compute sampling step size relative to volume size
                float samplingStepSize = 1.f / (p_samplingRate.getValue() * cgt::max(img->getSize()));
                _shader->setUniform("_samplingStepSize", samplingStepSize);

                // compute and set camera parameters
                const cgt::Camera& cam = camera->getCamera();
                float n = cam.getNearDist();
                float f = cam.getFarDist();
                _shader->setUniform("_cameraPosition", cam.getPosition());
                _shader->setUniform("const_to_z_e_1", 0.5f + 0.5f*((f+n)/(f-n)));
                _shader->setUniform("const_to_z_e_2", ((f-n)/(f*n)));
                _shader->setUniform("const_to_z_w_1", ((f*n)/(f-n)));
                _shader->setUniform("const_to_z_w_2", 0.5f*((f+n)/(f-n))+0.5f);
                _shader->setIgnoreUniformLocationError(false);

                // bind input textures
                cgt::TextureUnit volumeUnit, entryUnit, exitUnit, tfUnit;
                img->bind(_shader, volumeUnit, "_volume", "_volumeTextureParams");
                p_transferFunction.getTF()->bind(_shader, tfUnit);

                if (! _bindEntryExitDepthTextures) {
                    entryPoints->bindColorTexture(_shader, entryUnit, "_entryPoints", "_entryParams");
                    exitPoints->bindColorTexture(_shader, exitUnit, "_exitPoints", "_exitParams");
                    processImpl(data, img);
                }
                else {
                    cgt::TextureUnit entryUnitDepth, exitUnitDepth;
                    entryPoints->bind(_shader, entryUnit, entryUnitDepth, "_entryPoints", "_entryPointsDepth", "_entryParams");
                    exitPoints->bind(_shader, exitUnit, exitUnitDepth, "_exitPoints", "_exitPointsDepth", "_exitParams");
                    processImpl(data, img);
                }

                decorateRenderEpilog(_shader);
                _shader->deactivate();
                cgt::TextureUnit::setZeroUnit();
                LGL_ERROR;
            }
            else {
                LERROR("Input image must have dimensionality of 3.");
            }
        }
        else {
            LDEBUG("No suitable input image found.");
        }
    }