您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetBoundingBox函数代码示例

51自学网 2021-06-01 21:04:26
  C++
这篇教程C++ GetBoundingBox函数代码示例写得很实用,希望能帮到您。

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

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

示例1: GetPosition

void cCreditsString::Initialize(){   sf::Vector3<double> l_Position = GetPosition();   l_Position.x += (GetBoundingBox().width/2) - m_CreditText.getLocalBounds().width / 2;   l_Position.x = static_cast<int32_t>(l_Position.x);   m_CreditText.setPosition(l_Position.x, l_Position.y);   l_Position = GetPosition();   l_Position.x += (GetBoundingBox().width/2) - m_CreditText2.getLocalBounds().width / 2;   l_Position.x = static_cast<int32_t>(l_Position.x);   l_Position.y +=      m_CreditText.getLocalBounds().height      + m_CreditText.getLocalBounds().top      + 100;   m_CreditText2.setPosition(l_Position.x, l_Position.y);   l_Position.x = GetPosition().x;   l_Position.x += (GetBoundingBox().width/2) - m_pSfmlLogo->GetBoundingBox().width / 2;   l_Position.y +=      m_CreditText2.getLocalBounds().height      + m_CreditText2.getLocalBounds().top      + 10;   m_pSfmlLogo->SetPosition(l_Position, kNormal, false);   m_pSfmlLogo->Initialize();   // Set the position relative to the camera   float l_X = GetResources()->GetWindow()->getSize().x - m_ContinueString.getLocalBounds().width - 10;   float l_Y = GetResources()->GetWindow()->getSize().y - m_ContinueString.getCharacterSize() - 10;   m_ContinueString.setPosition(l_X, l_Y);}
开发者ID:corbinat,项目名称:NativeBlocks,代码行数:30,


示例2: SitFlush

void cAiBlock::Collision(cObject* a_pOther){   if (a_pOther->GetType() == GetType())   {      SitFlush(a_pOther);      m_AiLabel.setPosition(         static_cast<int32_t>(GetPosition().x + GetBoundingBox().width / 2 - m_AiLabel.getLocalBounds().width / 2),         static_cast<int32_t>(GetPosition().y + GetBoundingBox().height / 2 - m_AiLabel.getCharacterSize() / 2.0 - 10)         );      SetVelocityY(0, kNormal);      sMessage l_Message;      l_Message.m_From = GetUniqueId();      l_Message.m_Category =GetResources()->GetMessageDispatcher()->Any();      l_Message.m_Key = GetResources()->GetMessageDispatcher()->Any();      l_Message.m_Value = "Settled";      GetResources()->GetMessageDispatcher()->PostMessage(l_Message);      m_Falling = false;      PlaySound("Media/Sounds/BigFall.ogg");   }}
开发者ID:corbinat,项目名称:NativeBlocks,代码行数:25,


示例3: GetBoundingBox

void cAiBlock::Initialize(){   m_AiLabel.setPosition(      static_cast<int32_t>(GetPosition().x + GetBoundingBox().width / 2 - m_AiLabel.getLocalBounds().width / 2),      static_cast<int32_t>(GetPosition().y + GetBoundingBox().height / 2 - m_AiLabel.getCharacterSize() / 2.0 - 10)      );}
开发者ID:corbinat,项目名称:NativeBlocks,代码行数:8,


示例4: BOX2I

const BOX2I DIMENSION::ViewBBox() const{    BOX2I dimBBox = BOX2I( VECTOR2I( GetBoundingBox().GetPosition() ),                           VECTOR2I( GetBoundingBox().GetSize() ) );    dimBBox.Merge( m_Text.ViewBBox() );    return dimBBox;}
开发者ID:RocFan,项目名称:kicad-source-mirror,代码行数:8,


示例5: GetBoundingBox

bool PCB_TARGET::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const{    EDA_RECT arect = aRect;    arect.Inflate( aAccuracy );    if( aContained )        return arect.Contains( GetBoundingBox() );    else        return GetBoundingBox().Intersects( arect );}
开发者ID:cpavlina,项目名称:kicad,代码行数:10,


示例6: GetBoundingBox

void cButton::Step(uint32_t a_ElapsedMiliSec){   if (m_Label.getString() != "")   {      m_Label.setPosition(         static_cast<int32_t>(GetPosition().x + GetBoundingBox().left + GetBoundingBox().width / 2.0 - m_Label.getLocalBounds().width / 2.0),          static_cast<int32_t>(GetPosition().y + GetBoundingBox().height / 2.0 - (m_Label.getLocalBounds().height + m_Label.getLocalBounds().top + 10) / 2.0)         );   }}
开发者ID:corbinat,项目名称:NativeBlocks,代码行数:10,


示例7: GetBoundingBox

bool SCH_BUS_ENTRY_BASE::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const{    EDA_RECT rect = aRect;    rect.Inflate( aAccuracy );    if( aContained )        return rect.Contains( GetBoundingBox() );    return rect.Intersects( GetBoundingBox() );}
开发者ID:cpavlina,项目名称:kicad,代码行数:11,


示例8: SetVelocityY

void cAiBlock::Step(uint32_t a_ElapsedMiliSec){   if (m_Falling)   {      SetVelocityY(1500, kNormal);      m_AiLabel.setPosition(         static_cast<int32_t>(GetPosition().x + GetBoundingBox().width / 2 - m_AiLabel.getLocalBounds().width / 2),         static_cast<int32_t>(GetPosition().y + GetBoundingBox().height / 2 - m_AiLabel.getCharacterSize() / 2.0 - 10)         );   }}
开发者ID:corbinat,项目名称:NativeBlocks,代码行数:11,


示例9: cPxAABB

 void CPhysXMultiBodyObjectModel::CalculateBoundingBox() {    if(m_vecBodies.empty()) return;    /* Initialize the AABB to be a copy of the AABB of the first actor */    physx::PxBounds3 cPxAABB(m_vecBodies[0].Body.getWorldBounds());    /* Go through the bodies and grow the AABB with other bodies */    for(size_t i = 1; i < m_vecBodies.size(); ++i) {       cPxAABB.include(m_vecBodies[1].Body.getWorldBounds());    }    /* Update the ARGoS bounding box */    PxVec3ToCVector3(cPxAABB.minimum, GetBoundingBox().MinCorner);    PxVec3ToCVector3(cPxAABB.maximum, GetBoundingBox().MaxCorner); }
开发者ID:NavQ,项目名称:argos3,代码行数:12,


示例10: RegisterAnchorMethod

 void CDynamics2DSingleBodyObjectModel::SetBody(cpBody* pt_body,                                                Real f_height) {    /* Set the body and its data field for ray queries */    m_ptBody = pt_body;    m_ptBody->data = this;    /* Register the origin anchor update method */    RegisterAnchorMethod(GetEmbodiedEntity().GetOriginAnchor(),                         &CDynamics2DSingleBodyObjectModel::UpdateOriginAnchor);    /* Calculate the bounding box */    GetBoundingBox().MinCorner.SetZ(GetEmbodiedEntity().GetOriginAnchor().Position.GetZ());    GetBoundingBox().MaxCorner.SetZ(GetEmbodiedEntity().GetOriginAnchor().Position.GetZ() + f_height);    CalculateBoundingBox(); }
开发者ID:NavQ,项目名称:argos3,代码行数:13,


示例11: GetBoundingBox

/** * Calculate the AABB in the global coordinate frame */void CBulletSphereModel::CalculateBoundingBox(){	GetBoundingBox().MinCorner.Set(					GetEmbodiedEntity().GetOriginAnchor().Position.GetX() - (entity->GetRadius()),					GetEmbodiedEntity().GetOriginAnchor().Position.GetY() - (entity->GetRadius()),					GetEmbodiedEntity().GetOriginAnchor().Position.GetZ()			);	GetBoundingBox().MaxCorner.Set(					GetEmbodiedEntity().GetOriginAnchor().Position.GetX() + (entity->GetRadius()),					GetEmbodiedEntity().GetOriginAnchor().Position.GetY() + (entity->GetRadius()),					GetEmbodiedEntity().GetOriginAnchor().Position.GetZ() + entity->GetRadius()			);}
开发者ID:richard-redpath,项目名称:bullet-for-argos,代码行数:16,


示例12: switch

bool DRAWSEGMENT::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const{    wxPoint p1, p2;    int radius;    float theta;    EDA_RECT arect = aRect;    arect.Inflate( aAccuracy );    switch( m_Shape )    {    case S_CIRCLE:        // Test if area intersects or contains the circle:        if( aContained )            return arect.Contains( GetBoundingBox() );        else            return arect.Intersects( GetBoundingBox() );        break;    case S_ARC:        radius = hypot( (double)( GetEnd().x - GetStart().x ),                        (double)( GetEnd().y - GetStart().y ) );        theta  = std::atan2( GetEnd().y - GetStart().y , GetEnd().x - GetStart().x );        //Approximate the arc with two lines. This should be accurate enough for selection.        p1.x   = radius * std::cos( theta + M_PI/4 ) + GetStart().x;        p1.y   = radius * std::sin( theta + M_PI/4 ) + GetStart().y;        p2.x   = radius * std::cos( theta + M_PI/2 ) + GetStart().x;        p2.y   = radius * std::sin( theta + M_PI/2 ) + GetStart().y;        if( aContained )            return arect.Contains( GetEnd() ) && aRect.Contains( p1 ) && aRect.Contains( p2 );        else            return arect.Intersects( GetEnd(), p1 ) || aRect.Intersects( p1, p2 );        break;    case S_SEGMENT:        if( aContained )            return arect.Contains( GetStart() ) && aRect.Contains( GetEnd() );        else            return arect.Intersects( GetStart(), GetEnd() );        break;    default:        ;    }    return false;}
开发者ID:p12tic,项目名称:kicad-source-mirror,代码行数:49,


示例13: GetBoundingBox

bool SCH_FIELD::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const{    // Do not hit test hidden fields.    if( !IsVisible() || IsVoid() )        return false;    EDA_RECT rect = aRect;    rect.Inflate( aAccuracy );    if( aContained )        return rect.Contains( GetBoundingBox() );    return rect.Intersects( GetBoundingBox() );}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:15,


示例14: wxASSERT

void LIB_TEXT::Plot( PLOTTER* plotter, const wxPoint& offset, bool fill,                     const TRANSFORM& aTransform ){    wxASSERT( plotter != NULL );    EDA_RECT bBox = GetBoundingBox();    // convert coordinates from draw Y axis to libedit Y axis    bBox.RevertYAxis();    wxPoint txtpos = bBox.Centre();    /* The text orientation may need to be flipped if the     * transformation matrix causes xy axes to be flipped. */    int t1  = ( aTransform.x1 != 0 ) ^ ( GetTextAngle() != 0 );    wxPoint pos = aTransform.TransformCoordinate( txtpos ) + offset;    // Get color    COLOR4D color;    if( plotter->GetColorMode() )       // Used normal color or selected color        color = IsSelected() ? GetItemSelectedColor() : GetDefaultColor();    else        color = COLOR4D::BLACK;    plotter->Text( pos, color, GetShownText(),                   t1 ? TEXT_ANGLE_HORIZ : TEXT_ANGLE_VERT,                   GetTextSize(), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER,                   GetPenSize(), IsItalic(), IsBold() );}
开发者ID:cpavlina,项目名称:kicad,代码行数:28,


示例15: MemStackMark

void FLightSceneInfo::AddToScene(){	const FLightSceneInfoCompact& LightSceneInfoCompact = Scene->Lights[Id];	// Only need to create light interactions for lights that can cast a shadow, 	// As deferred shading doesn't need to know anything about the primitives that a light affects	if (Proxy->CastsDynamicShadow() 		|| Proxy->CastsStaticShadow() 		// Lights that should be baked need to check for interactions to track unbuilt state correctly		|| Proxy->HasStaticLighting()		// ES2 path supports dynamic point lights in the base pass using forward rendering, so we need to know the primitives		|| (Scene->GetFeatureLevel() < ERHIFeatureLevel::SM4 && Proxy->GetLightType() == LightType_Point && Proxy->IsMovable()))	{		// Add the light to the scene's light octree.		Scene->LightOctree.AddElement(LightSceneInfoCompact);		// TODO: Special case directional lights, no need to traverse the octree.		// Find primitives that the light affects in the primitive octree.		FMemMark MemStackMark(FMemStack::Get());		for(FScenePrimitiveOctree::TConstElementBoxIterator<SceneRenderingAllocator> PrimitiveIt(				Scene->PrimitiveOctree,				GetBoundingBox()				);			PrimitiveIt.HasPendingElements();			PrimitiveIt.Advance())		{			CreateLightPrimitiveInteraction(LightSceneInfoCompact, PrimitiveIt.GetCurrentElement());		}	}}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:31,


示例16: GetBoundingBox

void wxSFControlShape::UpdateControl(){    if( m_pControl )    {        int x = 0, y = 0;		        wxRect minBB = m_pControl->GetMinSize();        wxRect rctBB = GetBoundingBox().Deflate(m_nControlOffset, m_nControlOffset);        if( rctBB.GetWidth() < minBB.GetWidth() )        {            rctBB.SetWidth(minBB.GetWidth());            m_nRectSize.x = minBB.GetWidth() + 2*m_nControlOffset;        }        if( rctBB.GetHeight() < minBB.GetHeight() )        {            rctBB.SetHeight(minBB.GetHeight());            m_nRectSize.y = minBB.GetHeight() + 2*m_nControlOffset;        }        GetParentCanvas()->CalcUnscrolledPosition(0, 0, &x, &y);        // set the control's dimensions and position according to the parent control shape        m_pControl->SetSize(rctBB.GetWidth(), rctBB.GetHeight());        m_pControl->Move(rctBB.GetLeft() - x, rctBB.GetTop() - y);    }}
开发者ID:292388900,项目名称:codelite,代码行数:28,


示例17: RayIntersect

	bool AnimatedObject::RayIntersect(XMVECTOR origin, XMVECTOR direction, float& pDist)	{		if(XNA::IntersectRayAxisAlignedBox(origin, direction, &GetBoundingBox(), &pDist))			return true;		else			return false;	}
开发者ID:simplerr,项目名称:Graphics-Library,代码行数:7,


示例18: GetDefaultLineThickness

void SCH_TEXT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& aOffset,                     GR_DRAWMODE DrawMode, EDA_COLOR_T Color ){    EDA_COLOR_T color;    int         linewidth = ( m_Thickness == 0 ) ? GetDefaultLineThickness() : m_Thickness;    linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold );    if( Color >= 0 )        color = Color;    else        color = ReturnLayerColor( m_Layer );    GRSetDrawMode( DC, DrawMode );    wxPoint text_offset = aOffset + GetSchematicTextOffset();    EXCHG( linewidth, m_Thickness );            // Set the minimum width    EDA_TEXT::Draw( panel, DC, text_offset, color, DrawMode, FILLED, UNSPECIFIED_COLOR );    EXCHG( linewidth, m_Thickness );            // set initial value    if( m_isDangling )        DrawDanglingSymbol( panel, DC, m_Pos + aOffset, color );    // Enable these line to draw the bounding box (debug tests purposes only)#if 0    {        EDA_RECT BoundaryBox = GetBoundingBox();        GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN );    }#endif}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:31,


示例19: commit

int ALIGN_DISTRIBUTE_TOOL::doAlignRight(){    const SELECTION& selection = m_selectionTool->GetSelection();    if( selection.Size() <= 1 )        return 0;    BOARD_COMMIT commit( getEditFrame<PCB_BASE_FRAME>() );    commit.StageItems( selection, CHT_MODIFY );    // Compute the rightmost point of selection - it will be the edge of alignment    int right = selection.Front()->GetBoundingBox().GetRight();    for( int i = 1; i < selection.Size(); ++i )    {        int currentRight = selection[i]->GetBoundingBox().GetRight();        if( right < currentRight )      // X increases when going right            right = currentRight;    }    // Move the selected items    for( auto i : selection )    {        auto item = static_cast<BOARD_ITEM*>( i );        int difference = right - item->GetBoundingBox().GetRight();        item->Move( wxPoint( difference, 0 ) );    }    commit.Push( _( "Align to right" ) );    return 0;}
开发者ID:cpavlina,项目名称:kicad,代码行数:35,


示例20: GetBoundingBox

void LIB_FIELD::Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,                      const TRANSFORM& aTransform ){    if( IsVoid() )        return;    /* Calculate the text orientation, according to the component     * orientation/mirror */    int orient = m_Orient;    if( aTransform.y1 )  // Rotate component 90 deg.    {        if( orient == TEXT_ORIENT_HORIZ )            orient = TEXT_ORIENT_VERT;        else            orient = TEXT_ORIENT_HORIZ;    }    EDA_RECT BoundaryBox = GetBoundingBox();    EDA_TEXT_HJUSTIFY_T hjustify = GR_TEXT_HJUSTIFY_CENTER;    EDA_TEXT_VJUSTIFY_T vjustify = GR_TEXT_VJUSTIFY_CENTER;    wxPoint textpos = aTransform.TransformCoordinate( BoundaryBox.Centre() )                      + aOffset;    aPlotter->Text( textpos, GetDefaultColor(), m_Text, orient, m_Size,                    hjustify, vjustify,                    GetPenSize(), m_Italic, m_Bold );}
开发者ID:johnbeard,项目名称:kicad-source-mirror,代码行数:28,


示例21: cpShapeGetBB

 void CDynamics2DSingleBodyObjectModel::CalculateBoundingBox() {    cpBB tBoundingBox = cpShapeGetBB(m_ptBody->shapeList);    for(cpShape* pt_shape = m_ptBody->shapeList->next;        pt_shape != NULL;        pt_shape = pt_shape->next) {       cpBB* ptBB = &pt_shape->bb;       if(ptBB->l < tBoundingBox.l) tBoundingBox.l = ptBB->l;       if(ptBB->b < tBoundingBox.b) tBoundingBox.b = ptBB->b;       if(ptBB->r > tBoundingBox.r) tBoundingBox.r = ptBB->r;       if(ptBB->t > tBoundingBox.t) tBoundingBox.t = ptBB->t;    }    GetBoundingBox().MinCorner.SetX(tBoundingBox.l);    GetBoundingBox().MinCorner.SetY(tBoundingBox.b);    GetBoundingBox().MaxCorner.SetX(tBoundingBox.r);    GetBoundingBox().MaxCorner.SetY(tBoundingBox.t); }
开发者ID:NavQ,项目名称:argos3,代码行数:16,


示例22: GetBoundingBox

//-----------------------------------------------------------------------------// Returns the 8 frustum corners//-----------------------------------------------------------------------------Vector* Frustum::GetCorners(){    GetBoundingBox();    return m_vCorners;} // GetCorners
开发者ID:kochol,项目名称:kge,代码行数:10,


示例23: BSPHERE

BSPHERE MESHINSTANCE::GetBoundingSphere(){	if(m_pMesh == NULL || m_pMesh->m_pMesh == NULL)return BSPHERE();	if(m_pMesh->m_pMesh->GetFVF() != ObjectVertex::FVF)		// XYZ and NORMAL and UV		return BSPHERE();	BBOX bBox = GetBoundingBox();	BSPHERE bSphere;	D3DXMATRIX World = GetWorldMatrix();	bSphere.center = (bBox.max + bBox.min) / 2.0f;	ObjectVertex* vertexBuffer = NULL;	m_pMesh->m_pMesh->LockVertexBuffer(0,(void**)&vertexBuffer);	//Get radius	for(int i=0;i<(int)m_pMesh->m_pMesh->GetNumVertices();i++)	{		D3DXVECTOR3 pos;		D3DXVec3TransformCoord(&pos, &vertexBuffer[i]._pos, &World);		float l = D3DXVec3Length(&(pos - bSphere.center));		if(l > bSphere.radius)			bSphere.radius = l;	}	m_pMesh->m_pMesh->UnlockVertexBuffer();	return bSphere;}
开发者ID:Alriightyman,项目名称:RTS,代码行数:29,


示例24: GetTransform

void CScriptPlayerActor::Render(const CStateManager& mgr) const {  bool phazonSuit = x2e8_suitRes.GetCharacterNodeId() == 3;  if (phazonSuit) {    // Draw into alpha buffer    CModelFlags flags = xb4_drawFlags;    flags.x4_color = zeus::skWhite;    flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly;    CModelData::EWhichModel which = CModelData::GetRenderingModel(mgr);    x64_modelData->Render(which, x34_transform, x90_actorLights.get(), flags);  }  CPhysicsActor::Render(mgr);  if (x314_beamModelData && !x314_beamModelData->IsNull() && x64_modelData && !x64_modelData->IsNull()) {    zeus::CTransform modelXf = GetTransform() * x64_modelData->GetScaledLocatorTransform("GUN_LCTR");    CModelFlags flags(5, 0, 3, zeus::skWhite);    flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly;    x314_beamModelData->Render(mgr, modelXf, x90_actorLights.get(), flags);    flags.m_extendedShader = EExtendedShader::Lighting;    flags.x4_color = zeus::CColor{1.f, xb4_drawFlags.x4_color.a()};    x314_beamModelData->Render(mgr, modelXf, x90_actorLights.get(), flags);  }  if (phazonSuit) {    zeus::CVector3f vecFromCam =        GetBoundingBox().center() - mgr.GetCameraManager()->GetCurrentCamera(mgr)->GetTranslation();    float radius = zeus::clamp(0.25f, (6.f - vecFromCam.magnitude()) / 6.f, 2.f);    float offsetX = std::sin(x34c_phazonOffsetAngle);    float offsetY = std::sin(x34c_phazonOffsetAngle) * 0.5f;    g_Renderer->DrawPhazonSuitIndirectEffect(zeus::CColor(0.1f, 1.f), x338_phazonIndirectTexture, zeus::skWhite,                                             radius, 0.05f, offsetX, offsetY);  }}
开发者ID:AxioDL,项目名称:urde,代码行数:33,


示例25: BoundingBox

ON_BoundingBox ON_Geometry::BoundingBox() const{  ON_BoundingBox bbox;  if ( !GetBoundingBox( bbox.m_min, bbox.m_max, false ) )    bbox.Destroy();  return bbox;}
开发者ID:ckvk,项目名称:opennurbs,代码行数:7,



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


C++ GetBox函数代码示例
C++ GetBottom函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。