当前位置: 首页>>代码示例>>C++>>正文


C++ el函数代码示例

本文整理汇总了C++中el函数的典型用法代码示例。如果您正苦于以下问题:C++ el函数的具体用法?C++ el怎么用?C++ el使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了el函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: el

QDomElement
OutputFileParams::toXml(QDomDocument& doc, QString const& name) const
{
    if (isValid()) {
        QDomElement el(doc.createElement(name));
        el.setAttribute("size", QString::number(m_size));
        el.setAttribute("mtime", QString::number(m_mtime));
        return el;
    } else {
        return QDomElement();
    }
}
开发者ID:4sp1r3,项目名称:scantailor,代码行数:12,代码来源:OutputFileParams.cpp

示例2: el

Matrix::Matrix(const Matrix & mt):r(mt.r),c(mt.c)
{
    elm = new double*[r];
    for (int i = 0; i < r; i++) {
        elm[i] = new double[c];
    }
    for (int i = 0; i < r; i++) {
        for (int j = 0; j < c; j++) {
            el(i,j) = mt.el(i,j);
        }
    }
}
开发者ID:yamire,项目名称:COMP2012H_PA3,代码行数:12,代码来源:matrix.cpp

示例3: marshaller

QDomElement
Params::toXml(QDomDocument& doc, QString const& name) const
{
	XmlMarshaller marshaller(doc);
	
	QDomElement el(doc.createElement(name));
	el.setAttribute("mode", m_mode == MODE_AUTO ? "auto" : "manual");
	el.appendChild(marshaller.rectF(m_contentRect, "content-rect"));
	el.appendChild(marshaller.sizeF(m_contentSizeMM, "content-size-mm"));
	el.appendChild(m_deps.toXml(doc, "dependencies"));
	return el;
}
开发者ID:4sp1r3,项目名称:scantailor,代码行数:12,代码来源:Params.cpp

示例4: el

bool
xml_inresp_t::is_fault (int *code, str *msg) const
{
  ptr<const xml_element_t> e;
  ptr<const xml_method_response_t> r;
  ptr<const xml_fault_t> f;

  // comment out debug statement
  // warn << "obj: "<< el ()->xml_typename () << "\n"; 

  if (el () && 
      (r = el ()->to_xml_method_response ()) && 
      (e = r->body ()) &&
      (f = e->to_xml_fault ())) {
    xml_obj_const_t o (f);
    *code = o("faultCode");
    *msg = o("faultString");
    return true;
  }
  return false;
}
开发者ID:LeadsPlus,项目名称:okws,代码行数:21,代码来源:xmlobj.C

示例5: el

 int MenuBar::calculateWidth(SizeConstraint inSizeConstraint) const
 {
     int result = 0;
     std::vector<Element *> items;
     el()->getElementsByTagName(XMLMenuItem::TagName(), items);
     for (size_t idx = 0; idx != items.size(); ++idx)
     {
         MenuItem * item = items[idx]->component()->downcast<MenuItem>();
         result += item->calculateWidth(inSizeConstraint) + Defaults::menuBarSpacing();
     }
     return result;
 }
开发者ID:nContreras40,项目名称:xulwin,代码行数:12,代码来源:Menu.cpp

示例6: has_key

void agg_renderer<T0,T1>::process(dot_symbolizer const& sym,
                                  mapnik::feature_impl & feature,
                                  proj_transform const& prj_trans)
{
    double width = 0.0;
    double height = 0.0;
    bool has_width = has_key(sym,keys::width);
    bool has_height = has_key(sym,keys::height);
    if (has_width && has_height)
    {
        width = get<double>(sym, keys::width, feature, common_.vars_, 0.0);
        height = get<double>(sym, keys::height, feature, common_.vars_, 0.0);
    }
    else if (has_width)
    {
        width = height = get<double>(sym, keys::width, feature, common_.vars_, 0.0);
    }
    else if (has_height)
    {
        width = height = get<double>(sym, keys::height, feature, common_.vars_, 0.0);
    }
    double rx = width/2.0;
    double ry = height/2.0;
    double opacity = get<double>(sym, keys::opacity, feature, common_.vars_, 1.0);
    color const& fill = get<mapnik::color>(sym, keys::fill, feature, common_.vars_, mapnik::color(128,128,128));
    ras_ptr->reset();
    agg::rendering_buffer buf(current_buffer_->raw_data(),current_buffer_->width(),current_buffer_->height(),current_buffer_->width() * 4);
    using blender_type = agg::comp_op_adaptor_rgba_pre<agg::rgba8, agg::order_rgba>;
    using pixfmt_comp_type = agg::pixfmt_custom_blend_rgba<blender_type, agg::rendering_buffer>;
    using renderer_base = agg::renderer_base<pixfmt_comp_type>;
    using renderer_type = agg::renderer_scanline_aa_solid<renderer_base>;
    pixfmt_comp_type pixf(buf);
    pixf.comp_op(static_cast<agg::comp_op_e>(get<composite_mode_e>(sym, keys::comp_op, feature, common_.vars_, src_over)));
    renderer_base renb(pixf);
    renderer_type ren(renb);
    agg::scanline_u8 sl;
    ren.color(agg::rgba8_pre(fill.red(), fill.green(), fill.blue(), int(fill.alpha() * opacity)));
    agg::ellipse el(0,0,rx,ry);
    unsigned num_steps = el.num_steps();
    for (geometry_type const& geom : feature.paths()) {
        double x,y,z = 0;
        unsigned cmd = 1;
        geom.rewind(0);
        while ((cmd = geom.vertex(&x, &y)) != mapnik::SEG_END) {
            if (cmd == SEG_CLOSE) continue;
            prj_trans.backward(x,y,z);
            common_.t_.forward(&x,&y);
            el.init(x,y,rx,ry,num_steps);
            ras_ptr->add_path(el);
            agg::render_scanlines(*ras_ptr, sl, ren);
        }
    }
}
开发者ID:NavtechInc,项目名称:mapnik,代码行数:53,代码来源:process_dot_symbolizer.cpp

示例7: main

int main()
{
	int control = 1; 
	int w = 1; 
	int *d, *path; 
	int n, m; 
	cout << "Please input the number of the city:" << endl; 
	cin >> n; 
	cout << "Please input the number of the flight:" << endl; 
	cin >> m; 
	
	d = new int[n]; 
	path = new int[n];

	extLGraph<int> el(n); 
	int u, v; 
	for(int i = 0; i < m; i++)
	{
		cout << "Please input the start point and end point of the " << i+1 << " flight:" << endl; 
		cin >> u >> v; 
		cout << el.insert(u, v, w) << endl; 
	}
	
	while(control)
	{
		for (int i = 0; i < n; i++) d[i] = INF;
		memset(path, 0, sizeof(path));
		cout << "Please input the start and destination of you travel:"; 
		cin >> u >> v; 
		el.dijkstra(u, d, path); 
		
		if(d[v] != 0 && d[v] < INF)
		{	
			cout << "The length of the route that takes the least transition is:" << d[v] << endl; 
			cout << "And the route is:"; 
			int *p = new int [d[v]]; 
			int t = path[v]; 
			for(int i = 0; i < d[v]; i++){
				p[i] = t; 
				t = path[t]; 
			}
			for(int i = d[v]-1; i >= 0; i--){
				cout << " " << p[i]; 
			}
			cout << " " << v; 
		}
		else
			cout << "Between the two places is no route! or The start and end is same!"; 
		cout << endl << endl << "Enter 1 to continue or 0 to exit."; 
		cin >> control; 
	}
	return 0; 
} 
开发者ID:HsuJv,项目名称:Note,代码行数:53,代码来源:main.cpp

示例8: bug_b

int
bug_b(MENU_ARGS)
{
  char c;

  decaln();

  cup(1, 1);
  el(0);
  printf("Line 11 should be double-wide, line 12 should be cleared.");

  cup(2, 1);
  el(0);
  printf("Then, the letters A-P should be written at the beginning");

  cup(3, 1);
  el(0);
  printf("of lines 12-%d, and the empty line and A-E are scrolled away.", max_lines);

  cup(4, 1);
  el(0);
  printf("If the bug is present, some lines are confused, look at K-P.");

  cup(11, 1);
  decdwl();
  decstbm(12, max_lines);

  cup(12, 1);
  el(0);
  printf("Here we go... ");
  holdit();

  cup(12, 1);
  ri();         /* Bug comes here */
  for (c = 'A'; c <= 'P'; c++)
    printf("%c\n", c);  /* Bug shows here */
  holdit();
  decstbm(0, 0);  /* No scr. region */
  return MENU_NOHOLD;
}
开发者ID:hharte,项目名称:vttest,代码行数:40,代码来源:main.c

示例9: if

//To print the complex matrix in a formatted way:
//It first converts the complex number in to strings (the display of complex number is the same as the one above)
//and store them in a 2D string array. Then find the longest number in every column, padding the rest to the same
//length by spaces. This can make the matrix look better.
void CplxMatrix::printMatrix() const{
    std::string **output;
    output = new std::string*[r];
    for (int i = 0; i < r; i++) {
        output[i] = new std::string[c];
    }
    for (int i = 0; i < r; i++) {
        for (int j = 0; j < c; j++) {
            std::string realstr = patch::to_string(el(i,j).re);
            realstr.erase (realstr.find_last_not_of('0') + 1, std::string::npos );
            std::string imstr = patch::to_string(el(i, j).im);
            imstr.erase (imstr.find_last_not_of('0') + 1, std::string::npos );
            if (el(i, j).im!=0&&el(i, j).re!=0) {
                output[i][j] = realstr+((el(i, j).im<0)?"":"+")+imstr+"i"+" ";
            }else if(el(i, j).im==0&&el(i, j).re!=0){
                output[i][j] = realstr + " ";
            }else if(el(i, j).im!=0&&el(i, j).re==0){
                output[i][j] = imstr + "i ";
            }else{
                output[i][j] = "0.";
            }
        }
    }
    int maxlength = 0;
    for (int i = 0; i < r; i++) {
        for (int j = 0; j < c; j++) {
            if (output[i][j].length() > maxlength) {
                maxlength = (int)output[i][j].length();
            }
        }
    }
    for (int i = 0; i < r; i++) {
        for (int j = 0; j < c; j++) {
            std::cout<< std::left << std::setw(maxlength) << std::setfill(' ')
            << output[i][j];
        }
        std::cout<<std::endl;
    }
    for (int i = 0; i < r; i++) {
        delete[] output[i];
    }
    delete[] output;
    output = 0;
}
开发者ID:yamire,项目名称:COMP2012H_PA3,代码行数:48,代码来源:matrix.cpp

示例10: el

void StelSphericalIndexMultiRes::insert(StelRegionObjectP regObj)
{
	NodeElem el(regObj);
	int i;
	for (i=1;i<MAX_INDEX_LEVEL&&cosRadius[i]<el.cap.d;++i) {;}
	RootNode* node = treeForRadius[i-1];
	if (node==NULL)
	{
		node=new RootNode(cosRadius[i-1], maxObjectsPerNode, i-1);
		treeForRadius[i-1]=node;
	}
	node->insert(el, 0);
}
开发者ID:Astrocoderguy,项目名称:stellarium,代码行数:13,代码来源:StelSphericalIndexMultiRes.cpp

示例11: el

Element AssetTemplate::create( const QString & name, const Element & parent, const Project & project )
{
	RecordList rl;
	Element e = Element::createFromTemplate( *this, rl );
	ElementList el( rl );
	el.setProjects( project );
	el.commit();
	e.setProject( project );
	e.setParent( parent );
	e.setName( name );
	e.commit();
	return e;
}
开发者ID:attila3d,项目名称:arsenalsuite,代码行数:13,代码来源:assettemplatebase.cpp

示例12: _l

// Construct a tree parity machine with given dimensions
TreeParityMachine::TreeParityMachine(std::size_t k, std::size_t n, std::size_t l): _l(l) {
    std::random_device rd;	// Create random device
	std::mt19937 el(rd());	// Use 32 bit mersenne twister
	std::uniform_int_distribution<int> udist(-_l,_l);
	
    for(int i=0; i<k; i++){
        std::vector<int> temp;
        for(int j=0; j<n; j++){
            temp.push_back(udist(el));
        }
        _w.push_back(temp);
    }
}
开发者ID:permutationlock,项目名称:neural_crypto,代码行数:14,代码来源:tpm.cpp

示例13: marshaller

QDomElement
OutputImageParams::PartialXform::toXml(QDomDocument& doc, QString const& name) const
{
	XmlMarshaller marshaller(doc);
	
	QDomElement el(doc.createElement(name));
	el.appendChild(marshaller.string(Utils::doubleToString(m_11), "m11"));
	el.appendChild(marshaller.string(Utils::doubleToString(m_12), "m12"));
	el.appendChild(marshaller.string(Utils::doubleToString(m_21), "m21"));
	el.appendChild(marshaller.string(Utils::doubleToString(m_22), "m22"));
	
	return el;
}
开发者ID:DikBSD,项目名称:STE,代码行数:13,代码来源:OutputImageParams.cpp

示例14: simple_bce_erases

/*
 * Clear around the box for simple_bce_test().
 */
static void
simple_bce_erases(BOX *box)
{
  int i;

  cup(box->top - 1, min_cols / 2);
  ed(1);        /* clear from home to cursor */
  cuf(1);
  el(0);        /* clear from cursor to end of line */

  cup(box->bottom + 1, min_cols / 2);
  ed(0);        /* clear from cursor to end */
  cub(1);
  el(1);        /* clear to beginning of line */

  for (i = box->top; i <= box->bottom; i++) {
    cup(i, box->left - 1);
    el(1);
    cup(i, box->right + 1);
    el(0);
  }
}
开发者ID:Brybry,项目名称:wTerm,代码行数:25,代码来源:color.c

示例15: setTextColor

void Logger::msg(QString s, int level) {
	setTextColor(Qt::lightGray);
	append(QTime::currentTime().toString("hh:mm:ss")+": ");
	moveCursor(QTextCursor::End);
	switch (level) {
		case 0: setTextColor(Qt::black); break;
		case 1: setTextColor(Qt::gray); break;
		case 99: setTextColor(Qt::red); break;
	}
	insertPlainText(s);
	repaint();
	QEventLoop el(this);
	el.processEvents(QEventLoop::ExcludeUserInputEvents);
}
开发者ID:UhtredBosch,项目名称:mesecina,代码行数:14,代码来源:Logger.cpp


注:本文中的el函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。