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


C++ setBounds函数代码示例

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


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


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