• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setBounds函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GClock

 GClock(){
     setBounds((800 - 212) / 2, (600 - 50) / 2, 212, 50);
     setTitle("とけい");
     refreshDate();
     label = new Label(time, Label::CENTER);
     label->setBounds(0, 4, 200, 16);
     add(label);
     setTimer(1000);
 }
开发者ID:ShotaroTsuji,项目名称:mona,代码行数:9,代码来源:gclock.cpp


示例2: getNDim

double RateGammaInvar::optimizeParameters(double gradient_epsilon) {

	int ndim = getNDim();

	// return if nothing to be optimized
	if (ndim == 0)
		return phylo_tree->computeLikelihood();

    if (verbose_mode >= VB_MED)
        cout << "Optimizing " << name << " model parameters by " << optimize_alg << " algorithm..." << endl;

	if (optimize_alg.find("EM_RR") != string::npos) {
        return randomRestartOptimization(gradient_epsilon);
    } else if (optimize_alg.find("Brent") != string::npos || phylo_tree->aln->frac_const_sites == 0.0 || isFixPInvar() || isFixGammaShape()) {
		double lh = phylo_tree->computeLikelihood();
		cur_optimize = 0;
		double gamma_lh = RateGamma::optimizeParameters(gradient_epsilon);
		ASSERT(gamma_lh >= lh-0.1);
		cur_optimize = 1;
		double invar_lh = -DBL_MAX;
        invar_lh = RateInvar::optimizeParameters(gradient_epsilon);
		ASSERT(invar_lh >= gamma_lh-0.1);
        cur_optimize = 0;
        return invar_lh;
	} else if (optimize_alg.find("EM") != string::npos) {
        return optimizeWithEM(gradient_epsilon);
    } else if (optimize_alg.find("BFGS") != string::npos) {
        //if (freq_type == FREQ_ESTIMATE) scaleStateFreq(false);
        double *variables = new double[ndim+1];
        double *upper_bound = new double[ndim+1];
        double *lower_bound = new double[ndim+1];
        bool *bound_check = new bool[ndim+1];
        double score;

        // by BFGS algorithm
        setVariables(variables);
        setBounds(lower_bound, upper_bound, bound_check);

        score = -minimizeMultiDimen(variables, ndim, lower_bound, upper_bound, bound_check, max(gradient_epsilon, TOL_GAMMA_SHAPE));

        getVariables(variables);

        phylo_tree->clearAllPartialLH();
        score = phylo_tree->computeLikelihood();

        delete [] bound_check;
        delete [] lower_bound;
        delete [] upper_bound;
        delete [] variables;

        return score;
    } else {
        string errMsg = "Unknown optimization algorithm: " + optimize_alg;
        outError(errMsg.c_str());
        return 0.0;
    }
}
开发者ID:bqminh,项目名称:IQ-TREE,代码行数:57,代码来源:rategammainvar.cpp


示例3: setBounds

 void QIntConfigurableTileWidget::reloadConfigurableData() {
   stopSignaling = true;
   setBounds();
   int value = config->getParam(key);
   spBox.setValue(value);
   slider.setValue(value);
   stopSignaling = false;
   updatePaletteChanged();
 }
开发者ID:CentreForBioRobotics,项目名称:lpzrobots,代码行数:9,代码来源:QIntConfigurableTileWidget.cpp


示例4: Drawable

DrawableImage::DrawableImage (const DrawableImage& other)
    : Drawable (other),
      image (other.image),
      opacity (other.opacity),
      overlayColour (other.overlayColour),
      bounds (other.bounds)
{
    setBounds (other.getBounds());
}
开发者ID:COx2,项目名称:PizzaKnobFilter,代码行数:9,代码来源:juce_DrawableImage.cpp


示例5: qt_static_metacall

int ONVIF::VideoSourceConfiguration::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 5)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 5;
    } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
        if (_id < 5)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 5;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QString*>(_v) = token(); break;
        case 1: *reinterpret_cast< QString*>(_v) = name(); break;
        case 2: *reinterpret_cast< int*>(_v) = useCount(); break;
        case 3: *reinterpret_cast< QString*>(_v) = sourceToken(); break;
        case 4: *reinterpret_cast< QRect*>(_v) = bounds(); break;
        default: break;
        }
        _id -= 5;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setToken(*reinterpret_cast< QString*>(_v)); break;
        case 1: setName(*reinterpret_cast< QString*>(_v)); break;
        case 2: setUseCount(*reinterpret_cast< int*>(_v)); break;
        case 3: setSourceToken(*reinterpret_cast< QString*>(_v)); break;
        case 4: setBounds(*reinterpret_cast< QRect*>(_v)); break;
        default: break;
        }
        _id -= 5;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 5;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 5;
    } else if (_c == QMetaObject::RegisterPropertyMetaType) {
        if (_id < 5)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 5;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
开发者ID:FatCat1411,项目名称:opencvr,代码行数:57,代码来源:moc_videosourceconfiguration.cpp


示例6: setOpaque

void pspRoomConfigGUI::setup(){
    
    setOpaque(true);
    setBounds(0, 0, 100, 100);
    addAndMakeVisible(panel);
    createWidgets();
    
    
}
开发者ID:avperrotta,项目名称:psPlayground,代码行数:9,代码来源:pspRoomConfigGUI.cpp


示例7: getPlot3d

static int getPlot3d(int iAxeUID, scicos_block * block)
{
    int iPlot3d;

    sco_data *sco = (sco_data *) * (block->work);

    // assert the sco is not NULL
    if (sco == NULL)
    {
        return 0;
    }

    // fast path for an existing object
    if (sco->scope.cachedPlot3dUID)
    {
        return sco->scope.cachedPlot3dUID;
    }

    iPlot3d = findChildWithKindAt(iAxeUID, __GO_PLOT3D__, 0);

    /*
     * Allocate if necessary
     */
    if (iPlot3d == 0)
    {
        iPlot3d = createGraphicObject(__GO_PLOT3D__);

        if (iPlot3d != 0)
        {
            createDataObject(iPlot3d, __GO_PLOT3D__);
            setGraphicObjectRelationship(iAxeUID, iPlot3d);
        }
        else
        {
            return 0;
        }
    }

    /*
     * Setup on first access
     */
    setBounds(block, iAxeUID, iPlot3d);
    setPlot3dSettings(iPlot3d);
    setDefaultValues(block, iPlot3d);

    {
        int iClipState = 1; //on
        setGraphicObjectProperty(iPlot3d, __GO_CLIP_STATE__, &iClipState, jni_int, 1);
    }

    /*
     * then cache with a local storage
     */
    sco->scope.cachedPlot3dUID = iPlot3d;
    return sco->scope.cachedPlot3dUID;
}
开发者ID:FOSSEE-Internship,项目名称:scilab,代码行数:56,代码来源:cmat3d.c


示例8: vertexCount

Mesh::Mesh(const DFFGeometry& geometry, bool autoSubmeshes)
		: vertexCount(geometry.getVertexCount()), frame(NULL)
{
	flags = 0;
	const float* vertices = geometry.getVertices();
	const float* normals = geometry.getNormals();
	const uint8_t* colors = geometry.getVertexColors();
	const float* texCoords = NULL;
	const uint8_t* boneIndices = geometry.getBoneIndices();
	const float* boneWeights = geometry.getBoneWeights();

	if (geometry.getUVSetCount() > 0) {
		texCoords = geometry.getUVCoordSet(0);
	}

	if (geometry.isTriangleStripFormat()) {
		vertexFormat = VertexFormatTriangleStrips;
	} else {
		vertexFormat = VertexFormatTriangles;
	}

	if (normals) {
		flags |= MeshNormals;
	}
	if (texCoords) {
		flags |= MeshTexCoords;
	}
	if (colors) {
		flags |= MeshVertexColors;
	}
	if (boneIndices) {
		flags |= MeshSkinData;
	}

	if (geometry.isDynamicLightingEnabled()) {
		flags |= MeshDynamicLighting;
	}

	DFFGeometry::ConstMaterialIterator it;
	for (it = geometry.getMaterialBegin() ; it != geometry.getMaterialEnd() ; it++) {
		Material* material = new Material(**it);
		addMaterial(material);
	}

	if (autoSubmeshes) {
		DFFGeometry::ConstPartIterator pit;
		for (pit = geometry.getPartBegin() ; pit != geometry.getPartEnd() ; pit++) {
			Submesh* submesh = new Submesh(this, **pit);
		}
	}

	const DFFBoundingSphere* b = geometry.getBounds();
	setBounds(b->x, b->y, b->z, b->radius);

	init(flags, vertices, normals, texCoords, colors, boneIndices, boneWeights);
}
开发者ID:alemariusnexus,项目名称:gtatools,代码行数:56,代码来源:Mesh.cpp


示例9: disposeAllCallBacks

void Movie::releaseMovie() {
	if (_video) {
		delete _video;
		_video = 0;
		disposeAllCallBacks();
		deallocateSurface();
	}

	setBounds(Common::Rect(0, 0, 0, 0));
}
开发者ID:AlbanBedel,项目名称:scummvm,代码行数:10,代码来源:movie.cpp


示例10: getLevel

void GraphNode::updateBoundaries()
{

    int level = getLevel();

    int horzShift = gv->getHorizontalShift(this);
    
    setBounds(20+horzShift*140, 20+getLevel()*40, 150, 50);

}
开发者ID:AGenews,项目名称:GUI,代码行数:10,代码来源:GraphViewer.cpp


示例11: setRadius

   CylinderMesh::CylinderMesh (Box &_bounds, float _radius, float _complexity)
   {
      setRadius (_radius) ;
      setBounds (_bounds) ;
      setCenter (_bounds.min.midpoint(_bounds.max)) ;

      complexity = _complexity ;

      construct() ;
   }
开发者ID:parhelia512,项目名称:tge-152-fork,代码行数:10,代码来源:DTSBrushMesh.cpp


示例12: init

void Symm1D::
init()
{
    _init(1);
    setBounds(0, -1.0, 1.0);

    // set tolerances
    setSteadyTolerances(1e-4, 1e-4);
    setTransientTolerances(1e-4, 1e-4);
}
开发者ID:anujg1991,项目名称:cantera,代码行数:10,代码来源:boundaries1D.cpp


示例13: setCoordinates

void Button::setParams(int x, int y, int w, int h, bool& f, const string& file)
{
	if (bounds == NULL)
		bounds = new SDL_Rect;

    setCoordinates(x,y);
    setBounds(w,h);
    setFlag(f);
    setSource(file);
}
开发者ID:j4qfrost,项目名称:Pyman,代码行数:10,代码来源:Button.cpp


示例14: add_control

bool ReaScriptWindow::addControlFromName(std::string cname, std::string objectname)
{
	if (cname == "Button")
	{
		auto c = std::make_shared<WinButton>(this, objectname);
		c->setObjectName(objectname);
		c->GenericNotifyCallback = [this, objectname](GenericNotifications)
		{
			m_dirty_controls.insert(objectname);
		};
		c->setBounds({ 5, 5, 50, 25 });
		add_control(c);
		return true;
	}
	else if (cname == "Slider")
	{
		auto c = std::make_shared<ReaSlider>(this);
		c->setObjectName(objectname);
		c->SliderValueCallback = [this, objectname](GenericNotifications, double)
		{
			m_dirty_controls.insert(objectname);
		};
		c->setBounds({ 5, 5, 50, 25 });
		add_control(c);
		return true;
	}
	else 
	{
		auto c = create_licecontrol(this, cname);
		if (c != nullptr)
		{
			c->setObjectName(objectname);
			c->GenericNotifyCallback = [this, objectname](GenericNotifications)
			{
				m_dirty_controls.insert(objectname);
			};
			c->setBounds({ 5, 5, 50, 25 });
			add_control(c);
			return true;
		}
	}
	return false;
}
开发者ID:elanhickler,项目名称:mrp1,代码行数:43,代码来源:reascriptgui.cpp


示例15: b

void PHScrollerView::setFrame(const PHRect &frame)
{
    PHPoint b(_bounds.width, _bounds.height);
    PHView::setFrame(frame);
    setBounds(bounds()/scl);
    if (content)
    {
        PHPoint c(_bounds.width, _bounds.height);
        content->setPosition((c-b)/2+content->position());
    }
}
开发者ID:dapetcu21,项目名称:Porkholt,代码行数:11,代码来源:PHScrollerView.cpp


示例16: glViewport

void Render::resizeGL(const int nWidth, const int nHeight) {
    int width = nWidth;
    int height = nHeight? nHeight: 1;
    glViewport(0, 0, width, height);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    float aspectRatio = (float)width/height;
    if (width <= height) {
        setBounds(-viewRadius, viewRadius, -viewRadius/aspectRatio,
                  viewRadius/aspectRatio);
     } else {
        setBounds(-viewRadius*aspectRatio, viewRadius*aspectRatio,
                  -viewRadius, viewRadius);
    }
    glOrtho(getLeftBound(), getRightBound(), getBottomBound(), getTopBound(),
            1.0, -1.0);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    updateGraph();
}
开发者ID:vovanmozg,项目名称:carbox2d,代码行数:20,代码来源:render.cpp


示例17: setBounds

void MVScrollBar::moveTo(int x,int y)
/****************************************************************************
*
* Function:		MVScrollBar::moveTo
* Parameters:	x,y	- Position to move the scroll bar to
*
****************************************************************************/
{
	MVView::moveTo(x,y);
	setBounds(bounds);
}
开发者ID:OS2World,项目名称:LIB-VIDEO-MGL,代码行数:11,代码来源:mscrollb.cpp


示例18: setBounds

void ComponentLayoutEditor::bindWithTarget ()
{
    if (target != NULL)
    {
        Component* t = (Component*) target.getComponent ();
        Component* p = t->getParentComponent ();
        p->addAndMakeVisible (this);
        setBounds (t->getBounds ());
        updateFrames ();
    }
}
开发者ID:rorywalsh,项目名称:cabbage,代码行数:11,代码来源:ComponentLayoutEditor.cpp


示例19: setBounds

void Drawable::setBoundsToEnclose (Rectangle<float> area)
{
    Point<int> parentOrigin;

    if (auto* parent = getParent())
        parentOrigin = parent->originRelativeToComponent;

    auto newBounds = area.getSmallestIntegerContainer() + parentOrigin;
    originRelativeToComponent = parentOrigin - newBounds.getPosition();
    setBounds (newBounds);
}
开发者ID:Neknail,项目名称:JUCE,代码行数:11,代码来源:juce_Drawable.cpp


示例20: getParent

void Drawable::setBoundsToEnclose (const Rectangle<float>& area)
{
    Drawable* const parent = getParent();
    Point<int> parentOrigin;
    if (parent != 0)
        parentOrigin = parent->originRelativeToComponent;

    const Rectangle<int> newBounds (area.getSmallestIntegerContainer() + parentOrigin);
    originRelativeToComponent = parentOrigin - newBounds.getPosition();
    setBounds (newBounds);
}
开发者ID:Labmind,项目名称:GUI,代码行数:11,代码来源:juce_Drawable.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setBrightness函数代码示例发布时间:2022-05-30
下一篇:
C++ setBoundingBox函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap