Beispiel #1
0
bool SearchSet::readSet(QString filename)
{
  m_downloadedItems.clear();
  m_outstandingItems.clear();
  
  SearchSetContentHandler handler;
  QFile xmlFile(filename);
  QXmlInputSource source(&xmlFile);
  QXmlSimpleReader reader;
  reader.setContentHandler(&handler);
  reader.parse(source);
  
  m_downloadedItems = handler.m_downloadedItems;
  m_outstandingItems = handler.m_outstandingItems;
  m_needReferencedBy = handler.m_needReferencedBy;
  
  setMaxDepth(handler.m_maxDepth.toInt());
  m_queryString = handler.m_queryString;

	m_addUSRefs = (handler.m_addUSRefs == "1");
	m_addReferencedBy = (handler.m_addReferencedBy == "1");

  emit valuesChanged(m_downloadedItems.count(), m_outstandingItems.count(), m_needReferencedBy.count());
  emit modified(false);
  return(true);
}
Beispiel #2
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
AmplitudeProcessor_Mjma::AmplitudeProcessor_Mjma()
	: AmplitudeProcessor("Mjma") {
	setSignalEnd(150.);
	setMinSNR(0);
	setMaxDist(20);
	setMaxDepth(80);
}
Beispiel #3
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
AmplitudeProcessor_Mjma::AmplitudeProcessor_Mjma(const Core::Time& trigger)
	: AmplitudeProcessor(trigger, "Mjma") {
	setSignalEnd(150.);
	setMinSNR(0);
	setMaxDist(20);
	setMaxDepth(20);
	computeTimeWindow();
}
Beispiel #4
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
AmplitudeProcessor_msbb::AmplitudeProcessor_msbb()
: AmplitudeProcessor("Ms(BB)") {
	setSignalEnd(3600.);
	setMinSNR(0);
	setMinDist(2);
	setMaxDist(160);
	setMaxDepth(100);
}
Beispiel #5
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
AmplitudeProcessor_msbb::AmplitudeProcessor_msbb(const Core::Time& trigger, double duration)
: AmplitudeProcessor(trigger, "Ms(BB)") {
	setSignalEnd(3600.);
	setMinSNR(0);
	setMinDist(2);
	setMaxDist(160);
	setMaxDepth(100);
	computeTimeWindow();
}
Beispiel #6
0
bool RosUi::services_f(rgbd_slam::rgbdslam_ros_ui_f::Request  &req,
                       rgbd_slam::rgbdslam_ros_ui_f::Response &res )
{
    ROS_INFO_STREAM("Got Service Request. Command: " << req.command << ". Value: " << req.value );
    if(req.command == "set_max"){
        Q_EMIT setMaxDepth(req.value/100.0);
        return true;
    }
    else{
        ROS_ERROR("Command is set_max");
        return false;
    }
}
Beispiel #7
0
void Renderer3DRasterization::render()
{
	setMaxDepth(1.0);

	TransformMatrix3D lookat = camera_->getLookatMatrix();
	TransformMatrix3D proj = camera_->getProjectionMatrix();
	TransformMatrix3D screen = camera_->getScreenMatrix();

	TransformMatrix3D transform = screen * proj * lookat;

	std::vector<Surface3D*> list = scene_->getTriangleList();

	std::cout << "Renderer3DRasterization: Found " << list.size() << " triangles" << std::endl;

	for (Surface3D* triangle : list)
	{
		Color color = triangle->getColor();

		// color shading according to Lambert
		// normally we need a light source, but we use camera this time

		Vector3D normal = triangle->getNormal();
		Vector3D center = triangle->getCenter();

		// get direction to camera

		Vector3D d = camera_->getCenter() - center;
		d.normalize();

		double lambert = Mathtools::dot(d, normal);

		color = color * (lambert < 0.0 ? 0.0 : lambert);

		Vector3D p0 = transform * *(triangle->getP0());
		Vector3D p1 = transform * *(triangle->getP1());
		Vector3D p2 = transform * *(triangle->getP2());

		// in case we used perspective projection: divide by homogeneous coordinate "w"
		p0.homogeneousDivide();
		p1.homogeneousDivide();
		p2.homogeneousDivide();

		
		Surface3D transformedTriangle(p0, p1, p2, &color, triangle->getTexture());
		transformedTriangle.setTextureAnchorPoints(triangle->getT0(), triangle->getT1(), triangle->getT2());

		rasterization(&transformedTriangle);
	}

}
Beispiel #8
0
void Rules::load(const string& fileName)
{
    ruleSets.clear();

    ofLogNotice() << "=================================================";
    ofLogNotice() << "Parsing " << fileName;

    ofxXmlSettings xml;
    xml.loadFile(fileName);

    string meshColourStr = xml.getAttribute("rules", "meshColour", "");
    if (meshColourStr.empty()) enableVertexColours = true;
    else
    {
        enableVertexColours = false;
        meshColour = Action::parseColour(meshColourStr);
    }

    string wireframeColourStr = xml.getAttribute("rules", "wireframeColour", "");
    if (wireframeColourStr.empty()) enableWireframe = false;
    else
    {
        enableWireframe = true;
        wireframeColour = Action::parseColour(wireframeColourStr);
    }

    setMaxDepth(xml.getAttribute("rules", "maxDepth", (int)numeric_limits<unsigned>::max()));
    setStartRule(xml.getAttribute("rules", "startRule", ""));
    string primitive = xml.getAttribute("rules", "primitive", "");
    if (!primitive.empty())
    {
        if (primitive == "triangles") mesh.setMode(OF_PRIMITIVE_TRIANGLES);
        else if (primitive == "triangle_strip") mesh.setMode(OF_PRIMITIVE_TRIANGLE_STRIP);
        else if (primitive == "triangle_fan") mesh.setMode(OF_PRIMITIVE_TRIANGLE_FAN);
        else if (primitive == "lines") mesh.setMode(OF_PRIMITIVE_LINES);
        else if (primitive == "line_strip") mesh.setMode(OF_PRIMITIVE_LINE_STRIP);
        else if (primitive == "line_loop") mesh.setMode(OF_PRIMITIVE_LINE_LOOP);
        else if (primitive == "points") mesh.setMode(OF_PRIMITIVE_POINTS);
    }
    xml.pushTag("rules");
    for (unsigned i = 0; i < xml.getNumTags("ruleSet"); ++i)
    {
        string name = xml.getAttribute("ruleSet", "name", "", i);
        xml.pushTag("ruleSet", i);
        ofLogNotice() << "Ruleset: " << name << ", num rules: " << xml.getNumTags("rule");
        for (unsigned j = 0; j < xml.getNumTags("rule"); ++j)
        {
            Rule::Ptr rule = addRule(name, xml.getAttribute("rule", "weight", 0.f, j));
            xml.pushTag("rule", j);

            for (CreatorIt it = creators.begin(); it != creators.end(); ++it)
            {
                for (unsigned k = 0; k < xml.getNumTags(it->first); ++k)
                {
                    Action::Ptr action = (this->*it->second)();
                    action->setName(it->first);
                    action->setRuleName(name);
                    action->load(xml, it->first, k);
                    rule->addAction(action);
                }
            }
            xml.popTag();
        }
        xml.popTag();
    }
}