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


C++ Extension类代码示例

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


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

示例1: mapConf

Config
EarthFileSerializer2::serialize(const MapNode* input, const std::string& referrer) const
{
    Config mapConf("map");
    mapConf.set("version", "2");

    if ( !input || !input->getMap() )
        return mapConf; 

    const Map* map = input->getMap();
    MapFrame mapf( map );

    // the map and node options:
    Config optionsConf = map->getInitialMapOptions().getConfig();
    optionsConf.merge( input->getMapNodeOptions().getConfig() );
    mapConf.add( "options", optionsConf );

    // the layers
    LayerVector layers;
    mapf.getLayers(layers);

    for (LayerVector::const_iterator i = layers.begin(); i != layers.end(); ++i)
    {
        const Layer* layer = i->get();

        Config layerConf = layer->getConfig();
        if (!layerConf.empty())
        {
            mapConf.add(layerConf);
        }
    }

    typedef std::vector< osg::ref_ptr<Extension> > Extensions;
    for(Extensions::const_iterator i = input->getExtensions().begin(); i != input->getExtensions().end(); ++i)
    {
        Extension* e = i->get();
        Config conf = e->getConfigOptions().getConfig();
        if ( !conf.key().empty() )
        {
            mapConf.add( conf );
        }
    }

    Config ext = input->externalConfig();
    if ( !ext.empty() )
    {
        ext.key() = "external";
        mapConf.add( ext );
    }

    // Re-write pathnames in the Config so they are relative to the new referrer.
    if ( _rewritePaths && !referrer.empty() )
    {
        RewritePaths rewritePaths( referrer );
        rewritePaths.setRewriteAbsolutePaths( _rewriteAbsolutePaths );
        rewritePaths.apply( mapConf );
    }

    return mapConf;
}
开发者ID:ldelgass,项目名称:osgearth,代码行数:60,代码来源:EarthFileSerializer2.cpp

示例2: reallocate_thumb

void Slider::reallocate_thumb(const Allocation& a) {
    Patch& thumb = *impl_->thumb_patch_;
    Extension ext;
    ext.clear();
    thumb.allocate(canvas(), a, ext);
    thumb.redraw();
}
开发者ID:thickforest,项目名称:SLS-1.02,代码行数:7,代码来源:slider.c

示例3: main

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Extension exten;
      exten.show();
    return a.exec();
}
开发者ID:JustFFunny,项目名称:WorkSpace,代码行数:7,代码来源:main.cpp

示例4: full_allocate

void BoxImpl::full_allocate(AllocationInfo& info) {
    Canvas* c = info.canvas();
    GlyphIndex n = box_->count();
    Allocation* a = info.component_allocations();
    Requisition* r = new Requisition[n];
    GlyphIndex i;
    for (i = 0; i < n; i++) {
        Glyph* g = box_->component(i);
        if (g != nil) {
            g->request(r[i]);
        }
    }
    layout_->allocate(info.allocation(), n, r, a);
    delete [] r;

    Extension& box = info.extension();
    Extension child;
    for (i = 0; i < n; i++) {
        Glyph* g = box_->component(i);
        if (g != nil) {
            child.clear();
            g->allocate(c, a[i], child);
            box.merge(child);
        }
    }
}
开发者ID:PNCG,项目名称:neuron,代码行数:26,代码来源:box.cpp

示例5: updatePluginInformations

/** ***************************************************************************/
void SettingsWidget::updatePluginInformations(const QModelIndex & current) {
    // Hidde the placehodler text
    QLayoutItem *i = ui.widget_pluginInfos->layout()->takeAt(1);
    delete i->widget();
    delete i;

    if (extensionManager_->extensionSpecs()[current.row()]->state() == ExtensionSpec::State::Loaded){
        Extension *extension = dynamic_cast<Extension*>(extensionManager_->extensionSpecs()[current.row()]->instance());
        if (!extension){
            qWarning() << "Cannot cast an object of extension spec to an extension!";
            return; // Should no happen
        }
        QWidget *pw = extension->widget();
        if ( pw->layout() != nullptr)
            pw->layout()->setMargin(0);
        ui.widget_pluginInfos->layout()->addWidget(pw);// Takes ownership
        ui.label_pluginTitle->setText(extension->name());
        ui.label_pluginTitle->show();
    }
    else{
        QString msg("Plugin not loaded.\n%1");
        QLabel *lbl = new QLabel(msg.arg(extensionManager_->extensionSpecs()[current.row()]->lastError()));
        lbl->setEnabled(false);
        lbl->setAlignment(Qt::AlignCenter);
        ui.widget_pluginInfos->layout()->addWidget(lbl);
        ui.label_pluginTitle->hide();
    }
}
开发者ID:BoltsJ,项目名称:albert,代码行数:29,代码来源:settingswidget.cpp

示例6: set_damage_area

void XYView::set_damage_area(Canvas* c) {
    Extension e;
    c->restrict_damage(0.,0., c->width(), c->height());
    c->damage_area(e);
    const float off = c->to_coord(1);
    c->transformer().inverse_transform(e.left()-off, e.bottom()-off, xd1_, yd1_);
    c->transformer().inverse_transform(e.right()+off, e.top()+off, xd2_, yd2_);
}
开发者ID:vortexlaboratory,项目名称:neuron,代码行数:8,代码来源:xyview.cpp

示例7: addExtension

void Engine::addExtension(const Str& name, const Extension& extension)
{
    Extension result = extension;

    result.data = result.init(this, result.data);

    extensions.set(name, result);
}
开发者ID:pendingchaos,项目名称:WIP12,代码行数:8,代码来源:engine.cpp

示例8: draw

void Background::draw(Canvas* c, const Allocation& a) const {
    Extension ext;
    ext.set(c, a);
    if (c->damaged(ext)) {
        c->fill_rect(a.left(), a.bottom(), a.right(), a.top(), color_);
    }
    MonoGlyph::draw(c, a);
}
开发者ID:neurodebian,项目名称:iv-hines,代码行数:8,代码来源:background.cpp

示例9: getDimCount

Extension Spectrum::getExtension() const
{
	Dimension dim = getDimCount();
	Extension ext;
	for( Dimension d = 0; d < dim; d++ )
		ext.push_back( getScale( d ).getSampleCount() );
	return ext;
}
开发者ID:Wushaowei001,项目名称:NAF,代码行数:8,代码来源:Spectrum.cpp

示例10: VLOG

void UnprocessedStatement::process(Ruleset &r) {
  Extension extension;
  Mixin mixin;
  Declaration* declaration;

#ifdef WITH_LIBGLOG
  VLOG(2) << "Statement: " << getTokens()->toString();
#endif
  
  // process extends statement
  if (getExtension(extension.getTarget())) {
    extension.setExtension(r.getSelector());
    getLessRuleset()->getContext()->addExtension(extension);
    return;
  }
  
  mixin.setStylesheet(getLessRuleset()->getLessStylesheet());
  
  // process mixin
  if (mixin.parse(*getTokens()) &&
      mixin.insert(*r.getStylesheet(), *getLessRuleset()->getContext(),
                   &r, getLessRuleset())) {

  } else {
    declaration = r.createDeclaration();
    
    if (processDeclaration(declaration)) {
    
#ifdef WITH_LIBGLOG
      VLOG(2) << "Declaration: " <<
        declaration->getProperty() << ": " << declaration->getValue().toString();
#endif
    
      getLessRuleset()->getContext()->processValue(declaration->getValue());

#ifdef WITH_LIBGLOG
      VLOG(2) << "Processed declaration: " <<
        declaration->getProperty() << ": " << declaration->getValue().toString();
#endif
    
    } else {
      r.deleteDeclaration(*declaration);
      throw new ParseException(getTokens()->toString(),
                               "variable, mixin or declaration.",
                               getTokens()->front().line,
                               getTokens()->front().column,
                               getTokens()->front().source);
    }
  }

#ifdef WITH_LIBGLOG
  VLOG(3) << "Statement done";
#endif
}
开发者ID:jkasky,项目名称:clessc,代码行数:54,代码来源:UnprocessedStatement.cpp

示例11: assert

void
MetaBlock::parseLuaSection(xmlNodePtr node, std::auto_ptr<Block> &block) {
    Extension *ext = ExtensionList::instance()->extension(node, false);
    if (NULL == ext) {
        OperationMode::instance()->processError("Lua module is not loaded");
        return;
    }
    block = ext->createBlock(owner(), node);
    assert(block.get());
    block->parse();
}
开发者ID:bacek,项目名称:xscript,代码行数:11,代码来源:meta_block.cpp

示例12: canvas

void Slider::reallocate_thumb(const Allocation& a) {
    Patch& thumb = *impl_->thumb_patch_;
    Canvas* c = canvas();
    c->push_transform();
    c->transformer(transformer());
    Extension ext;
    ext.clear();
    thumb.allocate(c, a, ext);
    c->pop_transform();
    thumb.redraw();
}
开发者ID:PNCG,项目名称:neuron,代码行数:11,代码来源:slider.cpp

示例13: f_phpversion

Variant f_phpversion(const String& extension /* = null_string */) {
  Extension *ext;

  if (!extension) {
    return k_PHP_VERSION;
  }

  if ((ext = Extension::GetExtension(extension)) != nullptr &&
      strcmp(ext->getVersion(), NO_EXTENSION_VERSION_YET) != 0) {
    return ext->getVersion();
  }

  return false;
}
开发者ID:btiwaree,项目名称:hhvm,代码行数:14,代码来源:ext_options.cpp

示例14: square

void Extension::square(Extension& ext) {
	this->a.add(ext.getA(), ext.getC());
	this->a.multiply(this->a, this->a);
	
	this->b.add(ext.getB(), ext.getD());
	this->b.multiply(this->b, this->b);
	
	this->a.add(this->a, this->b);
	
	this->c.multiply(ext.getC(), ext.getC());
	
	this->d.multiply(ext.getD(), ext.getD());
	this->d.add(this->d, this->c);

/*
	Element m0, m1, m2, m3;
	
	m0.square(ext.getA());
	m1.square(ext.getB());
	m2.square(ext.getC());
	m3.square(ext.getD());

	this->a.add(m0, m1);
	this->a.add(this->a, m2);
	this->a.add(this->a, m3);

	this->b.add(m1, m3);

	this->c.set(m2);

	this->d.add(m2, m3);
*/
}
开发者ID:xdiegool,项目名称:gezel-elliptic-curve-crypto,代码行数:33,代码来源:extension.cpp

示例15: drag

void Slider::drag(const Event& e) {
    SliderImpl& s = *impl_;
    if (!s.aborted_ && s.dragging_) {
        if (!s.showing_old_thumb_ && s.old_thumb_ != nil) {
            s.showing_old_thumb_ = true;
            Extension ext;
            ext.clear();
            s.old_thumb_->allocate(
                canvas(), s.thumb_patch_->allocation(), ext
            );
        }
        move_to(e.pointer_x() - s.xoffset_, e.pointer_y() - s.yoffset_);
    }
}
开发者ID:thickforest,项目名称:SLS-1.02,代码行数:14,代码来源:slider.c


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