本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
示例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;
}
}
示例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;
}
示例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;
}
示例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");
}
示例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);
}
示例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);
}
示例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
);
}
示例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;
}
示例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);
}
示例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();
}