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


C++ Border类代码示例

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


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

示例1: find

bool Ball::find(Border &bo) {
	for (vbo::iterator it = lBoR.begin(); it != lBoR.end(); it++) {
		if (bo.getUpperLeft().x == (*it).getUpperLeft().x && bo.getUpperLeft().y == (*it).getUpperLeft().y
		&& bo.getBottomRight().x == (*it).getBottomRight().x && bo.getBottomRight().y == (*it).getBottomRight().y) return true;
	}
	return false;
}
开发者ID:czajkovsky,项目名称:superarkanoid,代码行数:7,代码来源:Ball.cpp

示例2: Threshold

//called once for single image processing
bool
Decoder::processTag()
{
	if(!config->ARGS_OK ) return false;
	if(tagimage == NULL) tagimage = new Tagimage(config);
	if(!tagimage->isValid()) { 
		delete tagimage; tagimage = NULL;
		return false;
	}
	if(config->VISUAL_DEBUG) config->setDebugPixmap(new Pixmap(config->TAG_IMAGE_FILE));
	Threshold* threshold = new Threshold(config, tagimage);
	threshold->computeEdgemap();
	delete tagimage; tagimage = NULL;
	delete threshold;
	Shape *shapes = new Shape[config->MAX_SHAPES];
	Shape *anchor = new Shape(config);
	Border* border = new Border(config, shapes, anchor);
	int nshapes = border->findShapes();
	delete border;
	if( nshapes >= 12  ){
		Pattern* pattern = new Pattern(config, shapes, nshapes, anchor);
		pattern->findCodeInternal(tag);
		delete pattern;
	}
	delete anchor;
	delete [] shapes;
	return true;
}
开发者ID:hackorama,项目名称:tag-video,代码行数:29,代码来源:decoder.cpp

示例3: Border

ColorPickerRGB::ColorPickerRGB()
{
UI::DockPanel* p = new DockPanel;

	for (int i = 0; i < 3; i++)
	{
		DockPanel* p2 = new DockPanel;
		{
			{
				Border* pBorder = new Border(new Thickness(1));
				m_edit[i] = new TextEdit;
				m_edit[i]->set_Width(32);
				pBorder->set_Child(m_edit[i]);
				DockPanel::SetDock(pBorder, DockPanel::Right);
				p2->AddChild(pBorder);
			}

			{
				m_slider[i] = new ColorSlider;
				m_slider[i]->set_Height(20);
				DockPanel::SetDock(m_slider[i], DockPanel::Fill);
				p2->AddChild(m_slider[i]);
			}
		}
		DockPanel::SetDock(p2, DockPanel::Top);
		p->AddChild(p2);
	}


	set_VisualTree(p);
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:31,代码来源:ColorPickerRGB.cpp

示例4: find

bool Ball::find(Border &bo) {
	for (vbo::iterator it = lBoR.begin(); it != lBoR.end(); it++) {
		if (bo.return_rectangle().upperleft.x == (*it).return_rectangle().upperleft.x && bo.return_rectangle().upperleft.y == (*it).return_rectangle().upperleft.y
		&& bo.return_rectangle().bottomright.x == (*it).return_rectangle().bottomright.x && bo.return_rectangle().bottomright.y == (*it).return_rectangle().bottomright.y) return true;
	}
	return false;
}
开发者ID:czajkovsky,项目名称:superarkanoid,代码行数:7,代码来源:Ball.cpp

示例5: setFrameThickness

	void BoxSkin::setFrameThickness( Border frame )
	{
		bool hadFrame = (m_frame.width() + m_frame.height() > 0 );
		bool hasFrame = (frame.width() + frame.height() > 0);
	
		m_frame = frame;
	
		if( hadFrame != hasFrame )
			_updateOpaqueFlag();
	}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例6: onContact

void NPC::onContact (b2Contact* contact, IEntity* entity)
{
	IEntity::onContact(contact, entity);

	if (!isDying())
		return;

	if (!entity->isBorder())
		return;

	Border *b = static_cast<Border*>(entity);
	const float y = getPos().y;
	if (b->isBottom() || y > b->getPos().y) {
		_remove = true;
	}
}
开发者ID:ptitSeb,项目名称:caveexpress,代码行数:16,代码来源:NPC.cpp

示例7:

	BoxSkin::BoxSkin( Color color, Border frame, Color frameColor )
	{
	    m_frame = frame;
	
		for( int i = 0 ; i < StateEnum_Nb ; i++ )
		{
			m_color[i] = color;
			m_frameColor[i] = frameColor;
		}
	
		bool hasFrame = (frame.width() + frame.height() > 0 );
		if( color.a == 255 && (!hasFrame || frameColor.a == 255) )
			m_bOpaque = true;
		else
			m_bOpaque = false;
	}
开发者ID:,项目名称:,代码行数:16,代码来源:

示例8: assert

//called more than once in video frame processing
bool
Decoder::processFrame(unsigned char *data, int width, int height)
{
	assert(data != NULL) ;
	assert( (data+(width*height)) != NULL) ;

	//1. Skip frame 
	if(fuzzy->selectFrame(config->V_SKIP_FRAMES) == false) {
		if(fuzzy->tagIsActive()) markCode(data, width, height, 0);
		return false;
	}

	//2.Check Motion 
	if(fuzzy->motionDetect(data, width, height) == false) { 
		if(fuzzy->tagIsActive()) markCode(data, width, height, 0);
		return false;
	}

	//3. Process Tag
	config->V_GRID_WIDTH = width;
	config->V_GRID_HEIGHT = height;
	//config->setDebugPixmap(new Pixmap("debug.jpg"));
	for(int i=0; i<12; i++) tag[i] = -1;
	Threshold* threshold = new Threshold(config, data, width, height);
	threshold->computeEdgemap();
	delete threshold;
	resetVMap(width*height);
	Shape *shapes = new Shape[config->MAX_SHAPES];
	Shape *anchor = new Shape(config);
	Border* border = new Border(config, shapes, anchor);
	int nshapes = border->findShapes();
	delete border;
	if( nshapes >= 12  ){
		Pattern* pattern = new Pattern(config, shapes, nshapes, anchor);
		pattern->findCodeExternal(tag);
		delete pattern;
	}
		
	delete anchor;
	delete [] shapes;
	bool tagvalidity = fuzzy->validateTag(tag);
	if(tagvalidity) markCode(data, width, height, 1);
	return tagvalidity;
}
开发者ID:hackorama,项目名称:tag-video,代码行数:45,代码来源:decoder.cpp

示例9: Border

//-----------------------------------------------------------------------------
// Purpose: create the Border objects from the scheme data
//-----------------------------------------------------------------------------
void CScheme::LoadBorders()
{
	m_pkvBorders = m_pData->FindKey("Borders", true);
	{for ( KeyValues *kv = m_pkvBorders->GetFirstSubKey(); kv != NULL; kv = kv->GetNextKey())
	{
		if (kv->GetDataType() == KeyValues::TYPE_STRING)
		{
			// it's referencing another border, ignore for now
		}
		else
		{
			int i = m_BorderList.AddToTail();

			Border *border = new Border();
			border->SetName(kv->GetName());
			border->ApplySchemeSettings(this, kv);

			m_BorderList[i].border = border;
			m_BorderList[i].bSharedBorder = false;
			m_BorderList[i].borderSymbol = kv->GetNameSymbol();
		}
	}}

	// iterate again to get the border references
	for ( KeyValues *kv = m_pkvBorders->GetFirstSubKey(); kv != NULL; kv = kv->GetNextKey())
	{
		if (kv->GetDataType() == KeyValues::TYPE_STRING)
		{
			// it's referencing another border, find it
			Border *border = (Border *)GetBorder(kv->GetString());
//			const char *str = kv->GetName();
			Assert(border);

			// add an entry that just references the existing border
			int i = m_BorderList.AddToTail();
			m_BorderList[i].border = border;
			m_BorderList[i].bSharedBorder = true;
			m_BorderList[i].borderSymbol = kv->GetNameSymbol();
		}
	}
	
	m_pBaseBorder = GetBorder("BaseBorder");
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:46,代码来源:Scheme.cpp

示例10: glGetDoublev

void Component::draw(Graphics* const TheGraphics, Real32 Opacity) const
{
    //If not visible then don't draw
    if (!getVisible())
        return;

    //Grab the initial transformation
    GLdouble InitMat[16];
    glGetDoublev(GL_MODELVIEW_MATRIX, InitMat);

    //Translate to my position
    glTranslatef(getPosition().x(), getPosition().y(), 0);

    if(setupClipping(TheGraphics))
    {

        //Activate My Border Drawing constraints
        Border* DrawnBorder = getDrawnBorder();
        if(DrawnBorder != NULL)
        {
            DrawnBorder->activateInternalDrawConstraints(TheGraphics,0,0,getSize().x(),getSize().y());
        }


        //Draw My Background
        drawBackground(TheGraphics, getDrawnBackground(), Opacity);

        //Draw Internal
        drawInternal(TheGraphics, Opacity);

        //Make sure the clipping is reset
        setupClipping(TheGraphics);

        //Draw My Foreground
        drawForeground(TheGraphics, getDrawnForeground(), Opacity);

        //Draw all parts that should not be clipped against
        drawUnclipped(TheGraphics, Opacity);
    }

    //Reset the transformation
    glLoadMatrixd(InitMat);
}
开发者ID:Himbeertoni,项目名称:OpenSGToolbox,代码行数:43,代码来源:OSGComponent.cpp

示例11: setBoundsQuietly

void StatusBar::onResize(ResizeEvent& ev)
{
  setBoundsQuietly(ev.getBounds());

  Border border = this->border();
  Rect rc = ev.getBounds();
  bool docControls = (rc.w > 300*ui::guiscale());
  if (docControls) {
    int prefWidth = m_docControls->getPreferredSize().w;
    int toolBarWidth = ToolBar::instance()->getPreferredSize().w;

    rc.x += rc.w - prefWidth - border.right() - toolBarWidth;
    rc.w = prefWidth;

    m_docControls->setVisible(m_doc != nullptr);
    m_docControls->setBounds(rc);
  }
  else
    m_docControls->setVisible(false);
}
开发者ID:riggtravis,项目名称:aseprite,代码行数:20,代码来源:status_bar.cpp

示例12: getBorder

bool Frame::resizeFrame(point_type w, point_type h) {
    Border* left   = getBorder(BORDER_LEFT);
    Border* right  = getBorder(BORDER_RIGHT);
    Border* top    = getBorder(BORDER_TOP);
    Border* bottom = getBorder(BORDER_BOTTOM);

    if(!left || !right || !top || !bottom) return false;

    return resize(
               left->getWidth() + right->getWidth() + w,
               top->getHeight() + bottom->getHeight() + h
           );
}
开发者ID:nusus,项目名称:osg,代码行数:13,代码来源:Frame.cpp

示例13: AssertCompatibleTo

	void BinaryBoard::Fill(BgraFrame *src)
	{
		AssertCompatibleTo(src);

		Clear();

		if (src->IsBlank())
		{
			return;
		}

		Border b = { INT_MAX, INT_MAX, INT_MIN, INT_MIN };

		char const Mask0 = (char)0x01, Mask8 = (char)0x80;
		for (int y = 0; y < boardSize.h; ++y)
		{
			char* line = buffer + stride * y;
			char mask = Mask0;
			for (int x = 0; x < boardSize.w; ++x, mask = (mask == Mask8) ? Mask0 : (mask << 1))
			{
				Rect blockCrop { x * blockSize, y * blockSize, blockSize, blockSize };
				bool isCropBlank = IsCropBlank(src, blockCrop);
				line[x >> BitPerByteIndex] |= (isCropBlank ? 0 : mask);
				if (!isCropBlank)
				{
					b.left = (b.left > x) ? x : b.left;
					b.right = (b.right < x) ? x : b.right;
					b.top = (b.top > y) ? y : b.top;
					b.bottom = (b.bottom < y) ? y : b.bottom;
				}
			}
		}

		if (b.right >= 0)
		{
			cropCache = Rect::FromOuterBorder(b.ToOuterBorder()) * blockSize;
		}

		return;
	}
开发者ID:subelf,项目名称:Spp2Pgs,代码行数:40,代码来源:BinaryBoard.cpp

示例14: setBoundsQuietly

void StatusBar::onResize(ResizeEvent& ev)
{
  setBoundsQuietly(ev.getBounds());

  Border border = getBorder();
  Rect rc = ev.getBounds();
  bool frameControls = (rc.w > 300*ui::guiscale());

  if (frameControls) {
    m_slider->setVisible(rc.w > 400*ui::guiscale());
    int prefWidth = m_commandsBox->getPreferredSize().w;
    int toolBarWidth = ToolBar::instance()->getPreferredSize().w;

    rc.x += rc.w - prefWidth - border.right() - toolBarWidth;
    rc.w = prefWidth;

    m_commandsBox->setVisible(true && m_hasDoc);
    m_commandsBox->setBounds(rc);
  }
  else
    m_commandsBox->setVisible(false);
}
开发者ID:dejavvu,项目名称:aseprite,代码行数:22,代码来源:status_bar.cpp

示例15: SetBorderLine

void CMyExcel::SetBorderLine(short Xposition,MyBorder XBorder)
{
	long Row,Col;
	Row=GetRowS();
	Col=GetColS();
	if(Row==1)
		if(Xposition==xlInsideHorizontal) return;
	if(Col==1)
		if(Xposition==xlInsideVertical) return;
	LPDISPATCH  lpDisp=NULL;
	lpDisp=MyRange.GetBorders();   
	Borders   bds;   
	bds.AttachDispatch(lpDisp);   
	Border   bd;   
	lpDisp=bds.GetItem((long)Xposition);   
	bd.AttachDispatch(lpDisp);   
	bd.SetLineStyle((_variant_t)(short)XBorder.LineStyle);
	bd.SetColor((_variant_t)(long)XBorder.Color);
	bd.SetWeight((_variant_t)(short)XBorder.Weight);
	bd.ReleaseDispatch();
	bds.ReleaseDispatch();
}
开发者ID:likebeta,项目名称:code-snippets,代码行数:22,代码来源:MyExcel.cpp


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