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

C++ GetBox函数代码示例

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

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



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

示例1: GetParentNode

// Updates the position of the document based on the style properties.
void ElementDocument::UpdatePosition()
{
	// We are only positioned relative to our parent, so if we're not parented we may as well bail now.
	if (GetParentNode() == NULL)
		return;

	Vector2f position;
	// Work out our containing block; relative offsets are calculated against it.
	Vector2f containing_block = GetParentNode()->GetBox().GetSize(Box::CONTENT);

	const Property *left = GetLocalProperty(LEFT);
	const Property *right = GetLocalProperty(RIGHT);
	if (left != NULL && left->unit != Property::KEYWORD)
		position.x = ResolveProperty(LEFT, containing_block.x);
	else if (right != NULL && right->unit != Property::KEYWORD)
		position.x = (containing_block.x - GetBox().GetSize(Box::MARGIN).x) - ResolveProperty(RIGHT, containing_block.x);
	else
		position.x = GetBox().GetEdge(Box::MARGIN, Box::LEFT);

	const Property *top = GetLocalProperty(TOP);
	const Property *bottom = GetLocalProperty(BOTTOM);
	if (top != NULL && top->unit != Property::KEYWORD)
		position.y = ResolveProperty(TOP, containing_block.y);
	else if (bottom != NULL && bottom->unit != Property::KEYWORD)
		position.y = (containing_block.y - GetBox().GetSize(Box::MARGIN).y) - ResolveProperty(BOTTOM, containing_block.y);
	else
		position.y = GetBox().GetEdge(Box::MARGIN, Box::TOP);

	SetOffset(position, NULL);
}
开发者ID:Kaperstone,项目名称:warsow,代码行数:31,代码来源:ElementDocument.cpp


示例2: GetBox

void EParticlesObject::OnFrame()
{
	inherited::OnFrame();
    Fbox bb; GetBox(bb);
    if (::Render->occ_visible(bb))
	    if (m_Particles) m_Particles->OnFrame(Device.dwTimeDelta);
}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:7,代码来源:EParticlesObject.cpp


示例3: Get_Object

void Get_Object(unsigned int X, unsigned int Y) {
  cimage_order        = -1;
  box_order           = -1;
  //  CImages
  for ( _object_count = 0 ; _object_count < CurrentScreen->CImagesCount ; _object_count++ ) {
    local_cimage = GetCImage(_object_count);
    if (local_cimage->Active == 1) {
      if (IsInsideObject(X, Y, local_cimage->Left, local_cimage->Top,
                         local_cimage->Width, local_cimage->Height) == 1) {
        cimage_order = local_cimage->Order;
        exec_cimage = local_cimage;
      }
    }
  }

  //  Boxes
  for ( _object_count = 0 ; _object_count < CurrentScreen->BoxesCount ; _object_count++ ) {
    local_box = GetBox(_object_count);
    if (local_box->Active == 1) {
      if (IsInsideObject(X, Y, local_box->Left, local_box->Top,
                         local_box->Width, local_box->Height) == 1) {
        box_order = local_box->Order;
        exec_box = local_box;
      }
    }
  }

  _object_count = -1;
  if (cimage_order >  _object_count )
    _object_count = cimage_order;
  if (box_order >  _object_count )
    _object_count = box_order;
}
开发者ID:rayalex,项目名称:mikro-Blocks,代码行数:33,代码来源:Tetris_driver.c


示例4: strlen

void PictSelection::WriteComments (ostream& to) {
    to << "%!PS-Adobe-2.0 EPSF-1.2\n";

    to << "%%DocumentFonts:";
    int linelen = strlen("%%DocumentFonts:");
    const int MAXLINELEN = 256;
    IFontList* fontlist = new IFontList;
    CollectFonts(fontlist);
    for (fontlist->First(); !fontlist->AtEnd(); fontlist->Next()) {
	IFont* font = fontlist->GetCur()->GetFont();
	if (linelen + strlen(font->GetPrintFont()) + 2 <= MAXLINELEN) {
	    to << " ";
	    ++linelen;
	} else {
	    to << "\n%%+ ";
	    linelen = strlen("%%+ ");
	}
	to << font->GetPrintFont();
	linelen += strlen(font->GetPrintFont());
    }
    to << "\n";
    delete fontlist;

    to << "%%Pages: 1\n";

    Coord l, b, r, t;
    GetBox(l, b, r, t);
    to << "%%BoundingBox: " << l << " " << b << " " << r << " " << t << "\n";

    to << "%%EndComments\n\n";
    to << "50 dict begin\n\n";
}
开发者ID:axelmuhr,项目名称:Helios-NG,代码行数:32,代码来源:slpict.c


示例5: Serialize

void CBoxHolder::Serialize(CArchive &ar)
{
	CBox* box=NULL;
	int n;
	CString st;
	CObject::Serialize(ar);
	if (ar.IsStoring()){
		n=m_Children.GetSize();
		ar << n;
		for (int i=0; i<n; i++){
			box=GetBox(i);
			st=box->Signature();
			if (st=="")
				st=box->ClassName();
			TRACE("Serialize Class Name: %s\n", st);
			ar << st;
			box->Serialize(ar);
		}
	}
	else{
		ar >> n;
		for (int i=0; i<n; i++){
			ar >> st;
			box=CFactory::instance(st);
			if (box==NULL)
				AfxThrowArchiveException(CArchiveException::generic,"");
			box->Serialize(ar);
			AddBox(box);
		}
	}
}
开发者ID:vunh76,项目名称:MathEditor,代码行数:31,代码来源:BoxHolder.cpp


示例6: GetBox

void EditBoxCollection::track_cancel()
{
    for(int i = 0; i < Count(); i++)
    {
        GetBox(i)->track_cancel();
    }
}
开发者ID:OS2World,项目名称:APP-EDITOR-FAST_Editor_Lite,代码行数:7,代码来源:boxcoll.cpp


示例7: GetBox

void * DropDown::GetItemData(INT32 ItemIndex)
{
	wxOwnerDrawnComboBox * pGadget = GetBox();
	if (!pGadget)
		return NULL;
	return m_pPopup->GetItemClientData(ItemIndex);
}
开发者ID:vata,项目名称:xarino,代码行数:7,代码来源:dropdown.cpp


示例8: CBaseLuaWidget

CLuaImage::CLuaImage(const char *file) : CBaseLuaWidget(""), m_bHasImage(false)
{
    m_pPixBuf = gdk_pixbuf_new_from_file(file, NULL);

    if (m_pPixBuf)
    {
        int w = gdk_pixbuf_get_width(m_pPixBuf);
        int h = gdk_pixbuf_get_height(m_pPixBuf);
        int neww, newh;

        if ((w > MaxImageW()) || (h > MaxImageH()))
        {
            GetScaledImageSize(w, h, MaxImageW(), MaxImageH(), neww, newh);
            GdkPixbuf *tmp = gdk_pixbuf_scale_simple(m_pPixBuf, neww, newh, GDK_INTERP_BILINEAR);
            g_object_unref(m_pPixBuf);
            m_pPixBuf = tmp;
        }

        if (m_pPixBuf)
        {
            GtkWidget *img = gtk_image_new_from_pixbuf(m_pPixBuf);
            g_object_unref(m_pPixBuf);
            gtk_widget_show(img);
            gtk_container_add(GTK_CONTAINER(GetBox()), img);
            m_bHasImage = true;
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:nixstaller-svn,代码行数:28,代码来源:luaimage.cpp


示例9: GetBox

boolean FillPolygonObj::Intersects (BoxObj& ub) {
    BoxObj b;
    
    GetBox(b);
    if (!b.Intersects(ub)) {
	return false;
    }
    if (b.Within(ub)) {
	return true;
    }
    LineObj bottom(ub._left, ub._bottom, ub._right, ub._bottom);

    if (Intersects(bottom)) {
	return true;
    }

    LineObj right(ub._right, ub._bottom, ub._right, ub._top);

    if (Intersects(right)) {
	return true;
    }

    LineObj top(ub._right, ub._top, ub._left, ub._top);

    if (Intersects(top)) {
	return true;
    }

    LineObj left(ub._left, ub._top, ub._left, ub._bottom);

    return Intersects(left);
}
开发者ID:barak,项目名称:ivtools-cvs,代码行数:32,代码来源:geomobjs.c


示例10: box

// This function adds an object to an existing bounding volume hierarchy.
// It first constructs a bounding box for the new object, then finds the
// optimal place to insert it into the hierachy using branch-and-bound, and
// finally inserts it at the determined location, updating all the costs
// associated with the nodes in the hierarchy as a side-effect.
void abvh::Insert( const Object *obj, double relative_cost )
    {
    AABB box( GetBox( *obj ) );
    double bound = 0.0;
    node *n   = new node;
    n->bbox   = box;
    n->object = obj;
    n->SA     = SurfaceArea( box );
    n->EC     = 1.0;
    n->SEC_   = relative_cost;
    n->AIC    = relative_cost * n->SA;
    n->SAIC   = 0.0; // There are no child volumes yet.

    // If this is the first node being added to the hierarchy,
    // it becomes the root.
    if( root == NULL ) { root = n; return; }

    // Look for the optimal place to add the new node.
    // The branch-and-bound procedure will figure out where
    // to put it so as to cause the smallest increase in the
    // estimated cost of the tree.
    bound = Infinity;
    node *insert_here = NULL;
    Branch_and_Bound( root, n, insert_here, bound );
    // Now actually insert the node in the optimal place.
    insert_here->AddChild( n );
    }
开发者ID:patback66,项目名称:COEN148,代码行数:32,代码来源:abvh.cpp


示例11: texture_dimensions

void ElementImage::GenerateGeometry()
{
	// Release the old geometry before specifying the new vertices.
	geometry.Release(true);

	std::vector< Rocket::Core::Vertex >& vertices = geometry.GetVertices();
	std::vector< int >& indices = geometry.GetIndices();

	vertices.resize(4);
	indices.resize(6);

	// Generate the texture coordinates.
	Vector2f texcoords[2];
	if (using_coords)
	{
		Vector2f texture_dimensions((float) texture.GetDimensions(GetRenderInterface()).x, (float) texture.GetDimensions(GetRenderInterface()).y);
		if (texture_dimensions.x == 0)
			texture_dimensions.x = 1;
		if (texture_dimensions.y == 0)
			texture_dimensions.y = 1;

		texcoords[0].x = (float) coords[0] / texture_dimensions.x;
		texcoords[0].y = (float) coords[1] / texture_dimensions.y;

		texcoords[1].x = (float) coords[2] / texture_dimensions.x;
		texcoords[1].y = (float) coords[3] / texture_dimensions.y;
	}
	else
	{
		texcoords[0] = Vector2f(0, 0);
		texcoords[1] = Vector2f(1, 1);
	}

    const Property* element_colour = GetProperty(BACKGROUND_COLOR);
    float opacity = GetProperty<float>(OPACITY);

    Colourb quad_colour = Colourb(255, 255, 255);
    if (element_colour)
    {
        Colourb background_colour = element_colour->Get<Colourb>();

        // Should be a non-transparent background
        if (background_colour.alpha != 0)
            quad_colour = background_colour;
    }

    // Apply opacity
    quad_colour.alpha = (byte)(opacity * (float)quad_colour.alpha);

	Rocket::Core::GeometryUtilities::GenerateQuad(&vertices[0],									// vertices to write to
												  &indices[0],									// indices to write to
												  Vector2f(0, 0),					            // origin of the quad
												  GetBox().GetSize(Rocket::Core::Box::CONTENT),	// size of the quad
												  quad_colour,		                            // colour of the vertices
												  texcoords[0],									// top-left texture coordinate
												  texcoords[1]);								// top-right texture coordinate

	geometry_dirty = false;
}
开发者ID:aquawicket,项目名称:libRocket,代码行数:59,代码来源:ElementImage.cpp


示例12: GetObject

static errcode GetObject(FILE * dfile, SceneHandle scene) {
  char objtype[80];
 
  fscanf(dfile, "%s", objtype);
  if (!stringcmp(objtype, "END_SCENE")) {
    return PARSEEOF; /* end parsing */
  }
  if (!stringcmp(objtype, "TEXDEF")) {
    return GetTexDef(dfile);
  }	
  if (!stringcmp(objtype, "TEXALIAS")) {
    return GetTexAlias(dfile);
  }
  if (!stringcmp(objtype, "BACKGROUND")) {
    return GetBackGnd(dfile);
  }
  if (!stringcmp(objtype, "CYLINDER")) {
    return GetCylinder(dfile);
  }
  if (!stringcmp(objtype, "FCYLINDER")) {
    return GetFCylinder(dfile);
  }
  if (!stringcmp(objtype, "POLYCYLINDER")) {
    return GetPolyCylinder(dfile);
  }
  if (!stringcmp(objtype, "SPHERE")) {
    return GetSphere(dfile);
  }
  if (!stringcmp(objtype, "PLANE")) {
    return GetPlane(dfile);
  }
  if (!stringcmp(objtype, "RING")) {
    return GetRing(dfile);
  }
  if (!stringcmp(objtype, "BOX")) {
    return GetBox(dfile);
  }
  if (!stringcmp(objtype, "SCALARVOL")) {
    return GetVol(dfile);
  }
  if (!stringcmp(objtype, "TRI")) {
    return GetTri(dfile);
  }
  if (!stringcmp(objtype, "STRI")) {
    return GetSTri(dfile);
  }
  if (!stringcmp(objtype, "LIGHT")) {
    return GetLight(dfile);
  }
  if (!stringcmp(objtype, "SCAPE")) {
    return GetLandScape(dfile);
  }
  if (!stringcmp(objtype, "TPOLYFILE")) {
    return GetTPolyFile(dfile);
  }

  fprintf(stderr, "Found bad token: %s expected an object type\n", objtype);
  return PARSEBADSYNTAX;
}
开发者ID:annulen,项目名称:tbb-examples-premake,代码行数:59,代码来源:parse.cpp


示例13: IntersectOut

bool LLRegion::IntersectOut(const LLBBox &box) const
{
    // First do faster test of bounding boxes
    if(GetBox().IntersectOut(box))
        return true;

    return NoIntersection(box);
}
开发者ID:chucksk,项目名称:OpenCPN,代码行数:8,代码来源:LLRegion.cpp


示例14: GetBox

// internal test to see if regions don't intersect (optimization)
bool LLRegion::NoIntersection(const LLRegion& region) const
{
    if(Empty() || region.Empty())
        return true;
    
    LLBBox box = GetBox(), rbox = region.GetBox();
    return box.IntersectOut(rbox) || NoIntersection(rbox) || region.NoIntersection(box);
}
开发者ID:chucksk,项目名称:OpenCPN,代码行数:9,代码来源:LLRegion.cpp


示例15: DrawScreen

void DrawScreen(TScreen *aScreen) {
 unsigned int order;
  unsigned short rotation;
  unsigned short cimage_idx;
  TCImage *local_cimage;
  unsigned short box_idx;
  TBox *local_box;

  object_pressed = 0;
  order = 0;
  cimage_idx = 0;
  box_idx = 0;
  CurrentScreen = aScreen;

  if ((display_width != CurrentScreen->Width) || (display_height != CurrentScreen->Height)) {
    rotation = TFTIntern_GetDisplayRotation();
    if (display_width > CurrentScreen->Width) {
      if (rotation == _TFT_INTERN_ROTATE_270)
        rotation = _TFT_INTERN_ROTATE_0;
      else
        rotation++;
    } else {
      if (rotation == _TFT_INTERN_ROTATE_0)
        rotation = _TFT_INTERN_ROTATE_270;
      else
        rotation--;
    }
    TFTIntern_SetDisplayRotation(rotation);
    TSC2006_SetDisplaySize(CurrentScreen->Width, CurrentScreen->Height);
    TFTIntern_Fill_Screen(CurrentScreen->Color);
    display_width = CurrentScreen->Width;
    display_height = CurrentScreen->Height;
  }
  else
    TFTIntern_Fill_Screen(CurrentScreen->Color);


  while (order < CurrentScreen->ObjectsCount) {
    if (box_idx < CurrentScreen->BoxesCount) {
      local_box = GetBox(box_idx);
      if (order == local_box->Order) {
        box_idx++;
        order++;
        DrawBox(local_box);
      }
    }

    if (cimage_idx < CurrentScreen->CImagesCount) {
      local_cimage = GetCImage(cimage_idx);
      if (order == local_cimage->Order) {
        cimage_idx++;
        order++;
        DrawCImage(local_cimage);
      }
    }

  }
}
开发者ID:rayalex,项目名称:mikro-Blocks,代码行数:58,代码来源:Tetris_driver.c


示例16: GetBox

CString CBoxHolder::ToMathML()
{
	int i;
	CString tab="";
	CString st;
	BOOL bObmit=(GetChildrenCount()==1 && GetBox(0)->ClassName()!="MSymbol");
	if (!bObmit)
		st=tab + "<mrow>" + crlf;
	else
		st="";
	for (i=0; i<GetChildrenCount(); i++)
		if (!bObmit)
			st+=GetBox(i)->ToMathML(1) + crlf;
		else
			st+=GetBox(i)->ToMathML(0);
	if (!bObmit)
		st+=tab + "</mrow>";
	return st;
}
开发者ID:vunh76,项目名称:MathEditor,代码行数:19,代码来源:BoxHolder.cpp


示例17: D3DXVECTOR2

void CGutsRockmanBullet::Update(CTimer* gameTime)
{
		if (!_isAtFirst)
		{
			if (_master->_isThrowRock||_master->_currentSkill!=Skill::GUTS)
			{
				if (_master->_currentSkill == Skill::GUTS)
				{
					_master->_canFire = true;
					_spriteStatus = ID_SPRITE_BULLET_ROCKMAN_GUTS_SMALL;
					_sprite = ResourceManager::GetSprite(_spriteStatus);
				}
				D3DXVECTOR2 v = D3DXVECTOR2(135.0f / 1000.0f, 5.0f / 1000.0f);
				if (!_master->_isRight)
					v.x *= -1.0f;

				CBulletRockman *bullet1 = new CBulletRockman(v + D3DXVECTOR2(48.0f / 1000.0f, 5.0f / 1000.0f), _position + D3DXVECTOR2(-8, 8), ID_BULLET_ROCKMAN_GUTS, ResourceManager::GetSprite(ID_SPRITE_BULLET_ROCKMAN_GUTS_SMALL), DAME_BULLET_GUTS_ROCKMAN);
				CBulletRockman *bullet2 = new CBulletRockman(v + D3DXVECTOR2(32.0f / 1000.0f, 10.0f / 1000.0f), _position + D3DXVECTOR2(8, 8), ID_BULLET_ROCKMAN_GUTS, ResourceManager::GetSprite(ID_SPRITE_BULLET_ROCKMAN_GUTS_SMALL), DAME_BULLET_GUTS_ROCKMAN);
				CBulletRockman *bullet3 = new CBulletRockman(v + D3DXVECTOR2(16.0f / 1000.0f, 0.0f / 1000.0f), _position + D3DXVECTOR2(-8, -8), ID_BULLET_ROCKMAN_GUTS, ResourceManager::GetSprite(ID_SPRITE_BULLET_ROCKMAN_GUTS_SMALL), DAME_BULLET_GUTS_ROCKMAN);
				CBulletRockman *bullet4 = new CBulletRockman(v + D3DXVECTOR2(8.0f / 1000.0f, 5.0f), _position + D3DXVECTOR2(8, -8), ID_BULLET_ROCKMAN_GUTS, ResourceManager::GetSprite(ID_SPRITE_BULLET_ROCKMAN_GUTS_SMALL), DAME_BULLET_GUTS_ROCKMAN);

				_master->_bullets.push_back(bullet1);
				_master->_bullets.push_back(bullet2);
				_master->_bullets.push_back(bullet3);
				_master->_bullets.push_back(bullet4);

				Die();

			}
			_position = _master->_position + D3DXVECTOR2(0, _master->GetBox()._height / 2 + GetBox()._height / 2);
		}
		else
		{
			_deltaTime += gameTime->GetTime();
			if (_deltaTime >= 50)
			{
				_isAtFirst = false;
				_deltaTime = 0;
				_position = _master->_position + D3DXVECTOR2(0, _master->GetBox()._height / 2 + GetBox()._height / 2);
			}
		}
	UpdateBox();
}
开发者ID:hyubyn,项目名称:RockMan-Summer,代码行数:43,代码来源:CGutsRockManBullet.cpp


示例18: select

void EditBoxCollection::select(EditBox* new_box)
{
    for(int i = 0; i < Count(); i++)
    {
        if(new_box == GetBox(i))
        {
            select(i);
            break;
        }
    }
}
开发者ID:OS2World,项目名称:APP-EDITOR-FAST_Editor_Lite,代码行数:11,代码来源:boxcoll.cpp


示例19: locate

EditBox* EditBoxCollection::locate(int num)
{
    for(int i = 0; i < Count(); i++)
    {
        if(GetBox(i)->number() == num)
        {
            select(i);
            break;
        }
    }
    return current();
}
开发者ID:OS2World,项目名称:APP-EDITOR-FAST_Editor_Lite,代码行数:12,代码来源:boxcoll.cpp


示例20: FrustumPick

bool CGroupObject::FrustumPick(const CFrustum& frustum)
{
    if (m_Objects.empty()){
        Fbox 		bb;
        GetBox		(bb);
        u32 mask	= u32(-1); 
        return (frustum.testAABB(bb.data(),mask));
    }else{
        for (ObjectIt it=m_Objects.begin(); it!=m_Objects.end(); it++)
            if ((*it)->FrustumPick(frustum)) return true;
    }
    return false;
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:13,代码来源:GroupObject.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetBuddyHwnd函数代码示例发布时间:2022-05-30
下一篇:
C++ GetBoundingBox函数代码示例发布时间: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