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

C++ GetRow函数代码示例

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

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



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

示例1: GetRow

Screen* ScreenMgr::getScreen(ResourceID id){
	uint32_t row = GetRow(id);
	uint32_t col = GetCol(id);
	if ( row-1 >=0 && col-1 >=0 && row -1 < getRowCount() && col -1 < getColCount()){
		return screens_[GetRow(id)-1][GetCol(id)-1];
	}else return 0;
}
开发者ID:rgmabs19357,项目名称:gameseer,代码行数:7,代码来源:Screen.cpp


示例2: drawXFormPixelWithAlpha

  void drawXFormPixelWithAlpha(const uint32_t i, const uint32_t j,
                               const GRect &srcRect, const GIRect &dstRect,
                               const GBitmap &src, const GBitmap &dst,
                               const uint8_t alpha,
                               const BlendFunc blend = blend_srcover) {

    GVec3f ctxPt(static_cast<float>(dstRect.fLeft + i) + 0.5f,
                 static_cast<float>(dstRect.fTop + j) + 0.5f,
                 1.0f);

    ctxPt = m_CTMInv * ctxPt;

    if(ContainsPoint(srcRect, ctxPt[0], ctxPt[1])) {
      uint32_t x = static_cast<uint32_t>(ctxPt[0] - srcRect.fLeft);
      uint32_t y = static_cast<uint32_t>(ctxPt[1] - srcRect.fTop);

      GPixel *srcRow = GetRow(src, y);
      GPixel *dstRow = GetRow(dst, j+dstRect.fTop) + dstRect.fLeft;

      uint32_t srcA = fixed_multiply(GPixel_GetA(srcRow[x]), alpha);
      uint32_t srcR = fixed_multiply(GPixel_GetR(srcRow[x]), alpha);
      uint32_t srcG = fixed_multiply(GPixel_GetG(srcRow[x]), alpha);
      uint32_t srcB = fixed_multiply(GPixel_GetB(srcRow[x]), alpha);
      GPixel src = GPixel_PackARGB(srcA, srcR, srcG, srcB);
      dstRow[i] = blend(dstRow[i], src);
    }
  }
开发者ID:Mokosha,项目名称:COMP590,代码行数:27,代码来源:GContext.cpp


示例3: assert

	bool Board::DoesEnPassantCaptureCauseDiscoveredCheck(int square, int color)
	{
		assert(this->enPassantRights.HasEnPassant());
		int attackerColor = OtherColor(color);
		int kingSquare = GetKingSquare(color);
		int kingRow = GetRow(kingSquare);
		int pieceRow = GetRow(square);
		int dr = pieceRow - kingRow;
		ulong defenderKing = 1ULL << kingSquare;

		if (dr == 0)
		{
			ulong myRankAttacks = MoveGenerator::rankAttacks[square][GetRankStatus(square)];
			ulong theirRankAttacks = MoveGenerator::rankAttacks[enPassantRights.PawnSquare()][GetRankStatus(enPassantRights.PawnSquare())];
			ulong defenderKing = 1ULL << kingSquare;
			if ((defenderKing & myRankAttacks) != 0 || (defenderKing & theirRankAttacks) != 0)
			{
				ulong attackers = GetPieceBitBoard(Pieces::GetPiece(PieceTypes::Rook, attackerColor)) |
					GetPieceBitBoard(Pieces::GetPiece(PieceTypes::Queen, attackerColor));
				if ((myRankAttacks & attackers) != 0 || (theirRankAttacks & attackers) != 0)
				{
					return true;
				}
			}
		}
		return false;
	}
开发者ID:alanjg,项目名称:Chess,代码行数:27,代码来源:Board.cpp


示例4: switch

int RDMatrix::port(RDMatrix::Role role) const
{
  switch(role) {
    case RDMatrix::Primary:
      return GetRow("PORT").toInt();

    case RDMatrix::Backup:
      return GetRow("PORT_2").toInt();
  }
  return -1;
}
开发者ID:WMTH,项目名称:rivendell,代码行数:11,代码来源:rdmatrix.cpp


示例5: GetPosition

void Pacman::Debug()
{
	std::cout << std::endl;
	std::cout << "<<< Pacmans' Data >>>" << std::endl;
	std::cout << "actual position: (" << GetPosition().x  << ", " << GetPosition().y << ")" << std::endl;
	std::cout << "grid position: (" << GetRow() << "," << GetColumn() << ")" << std::endl;
	std::cout << "map tile: " << map->getTile(GetRow(), GetColumn()) << std::endl;
	std::cout << std::endl;
	std::cout << "<<< END Pacmans' Data >>>" << std::endl;
	std::cout << std::endl;
}
开发者ID:JohnBali,项目名称:Pac-Man,代码行数:11,代码来源:Pacman.cpp


示例6: ToResourceID

ResourceID ScreenMgr::occupyScreenOut( ResourceID inputid){
	Screen* screen = screens_[GetRow(inputid)-1][GetCol(inputid)-1];
	for ( auto it = screen->outPort753_.begin(); it != screen->outPort753_.end(); ++it){
		if ( it->second == 0){
			ResourceID wnode = ToResourceID( GetInput(inputid), GetOutput(it->first), GetRow(inputid), GetCol(inputid));
			it->second = wnode;
			return wnode;
		}
	}
	return 0;
}
开发者ID:rgmabs19357,项目名称:gameseer,代码行数:11,代码来源:Screen.cpp


示例7: connInOutRequest

void Screen::connInOutRequest(ResourceID inputid, ResourceID wnode){
	if ( qbox_){
		QboxDataMap value;
		value["out"] = QString::number(GetOutput(wnode) ).toStdString();
		if ( GetCol(inputid) == GetCol(wnode) && GetRow(inputid) == GetRow(wnode)){
			value["in"] = QString::number(GetInput(inputid) ).toStdString();
		}else{
			value["in"] = QString::number(GetInput(wnode) ).toStdString();
		}
		qbox_->addAsyncRequest( PSetSwitchInputReq::uri , std::bind( ignoreCallback, std::placeholders::_1, std::placeholders::_2), value);
	}
}
开发者ID:rgmabs19357,项目名称:gameseer,代码行数:12,代码来源:Screen.cpp


示例8: connInOutRequestCB

bool Screen::connInOutRequestCB(ResourceID inputid, ResourceID wnode, QboxCallback callback, uint32_t , QboxDataMap& v){
	if ( qbox_){
		QboxDataMap value;
		value["out"] = QString::number(GetOutput(wnode) ).toStdString();
		if ( GetCol(inputid) == GetCol(wnode) && GetRow(inputid) == GetRow(wnode)){
			value["in"] = QString::number(GetInput(inputid) ).toStdString();
		}else{
			value["in"] = QString::number(GetInput(wnode) ).toStdString();
		}
		qbox_->addAsyncRequest( PSetSwitchInputReq::uri , callback, value);
		return true;
	}
	return false;
}
开发者ID:rgmabs19357,项目名称:gameseer,代码行数:14,代码来源:Screen.cpp


示例9: GetRow

void Matrix3x3::Renormalization()
{
	Vector3D Xorth, Yorth, Zorth, X = GetRow(0), Y = GetRow(1);
	double Error = X * Y;
	Xorth = X - Y * Error;
	Yorth = Y - X * Error;
	Zorth = Vector3D::Cross(Xorth, Yorth);
	// Normalize via Taylor expansion
	Xorth = Xorth * 0.5d * (3.0d - Xorth * Xorth);
	Yorth = Yorth * 0.5d * (3.0d - Yorth * Yorth);
	Zorth = Zorth * 0.5d * (3.0d - Zorth * Zorth);
	SetRow(0, Xorth);
	SetRow(1, Yorth);
	SetRow(2, Zorth);
}
开发者ID:BluPhoenix,项目名称:Quadcopter,代码行数:15,代码来源:vector.cpp


示例10: GetColumn

double FDSMesh::GetKnotValue(const double &x, const double &y) const
{
    /// To Do: exception / warning when no knot is available for the pedestrian position
    int col=0;
    int row=0;

    /// Which knot is the nearest one to (x,y)?

    GetColumn(x, col);
    GetRow(row, y);

    //std::cout << _matrix[row][col].GetValue() << std::endl;
    double value;

    // Exception if a mesh can not provide an appropriately located value
    if(row < _matrix.size() && col < _matrix[0].size())
          value = _matrix[row][col].GetValue();
    else
        // needs to be fixed!!!
          value = 0.0;//std::numeric_limits<double>::quiet_NaN();

//    if(_matrix[row][col].GetValue() == 0.) {
//        std::cout << "(" << row << " , " << col <<  ")" << std::endl;
//    }

    return value;

}
开发者ID:chraibi,项目名称:jpscore,代码行数:28,代码来源:FireMesh.cpp


示例11:

void
InfoBoxesConfigWidget::RefreshEditContentDescription()
{
  DataFieldEnum &df = (DataFieldEnum &)GetDataField(CONTENT);
  WndFrame &description = (WndFrame &)GetRow(DESCRIPTION);
  description.SetText(df.GetHelp() != nullptr ? df.GetHelp() : _T(""));
}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:7,代码来源:dlgConfigInfoboxes.cpp


示例12: GetRow

void MyListModel::DeleteItems( const wxDataViewItemArray &items )
{
    unsigned i;
    wxArrayInt rows;
    for (i = 0; i < items.GetCount(); i++)
    {
        unsigned int row = GetRow( items[i] );
        if (row < m_textColValues.GetCount())
            rows.Add( row );
    }

    if (rows.GetCount() == 0)
    {
        // none of the selected items were in the range of the items
        // which we store... for simplicity, don't allow removing them
        wxLogError( "Cannot remove rows with an index greater than %d", m_textColValues.GetCount() );
        return;
    }

    // Sort in descending order so that the last
    // row will be deleted first. Otherwise the
    // remaining indeces would all be wrong.
    rows.Sort( my_sort_reverse );
    for (i = 0; i < rows.GetCount(); i++)
        m_textColValues.RemoveAt( rows[i] );

    // This is just to test if wxDataViewCtrl can
    // cope with removing rows not sorted in
    // descending order
    rows.Sort( my_sort );
    RowsDeleted( rows );
}
开发者ID:euler0,项目名称:Helium,代码行数:32,代码来源:mymodels.cpp


示例13: Epetra_Vector

//=============================================================================
double Epetra_MsrMatrix::NormOne() const {

  if (NormOne_>-1.0) return(NormOne_);

  if (!Filled()) EPETRA_CHK_ERR(-1); // Matrix must be filled.

  Epetra_Vector * x = new Epetra_Vector(RowMatrixRowMap()); // Need temp vector for column sums
  
  Epetra_Vector * xp = 0;
  Epetra_Vector * x_tmp = 0;
  

  // If we have a non-trivial importer, we must export elements that are permuted or belong to other processors
  if (RowMatrixImporter()!=0) {
    x_tmp = new Epetra_Vector(RowMatrixColMap()); // Create temporary import vector if needed
    xp = x_tmp;
  }
  int i, j;

  for (i=0; i < NumMyCols_; i++) (*xp)[i] = 0.0;

  for (i=0; i < NumMyRows_; i++) {
    int NumEntries = GetRow(i);
    for (j=0; j < NumEntries; j++) (*xp)[Indices_[j]] += fabs(Values_[j]);
  }
  if (RowMatrixImporter()!=0) x->Export(*x_tmp, *RowMatrixImporter(), Add); // Fill x with Values from temp vector
  x->MaxValue(&NormOne_); // Find max
  if (x_tmp!=0) delete x_tmp;
  delete x;
  UpdateFlops(NumGlobalNonzeros());
  return(NormOne_);
}
开发者ID:cakeisalie,项目名称:oomphlib_003,代码行数:33,代码来源:Epetra_MsrMatrix.cpp


示例14: GetRow

//=============================================================================
int Epetra_MsrMatrix::InvRowSums(Epetra_Vector& x) const {
//
// Put inverse of the sum of absolute values of the ith row of A in x[i].
//

  if (!OperatorRangeMap().SameAs(x.Map())) EPETRA_CHK_ERR(-2); // x must have the same distribution as the range of A

  int ierr = 0;
  int i, j;
  for (i=0; i < NumMyRows_; i++) {
    int NumEntries = GetRow(i); // Copies ith row of matrix into Values_ and Indices_
    double scale = 0.0;
    for (j=0; j < NumEntries; j++) scale += fabs(Values_[j]);
    if (scale<Epetra_MinDouble) {
      if (scale==0.0) ierr = 1; // Set error to 1 to signal that zero rowsum found (supercedes ierr = 2)
      else if (ierr!=1) ierr = 2;
      x[i] = Epetra_MaxDouble;
    }
    else
      x[i] = 1.0/scale;
  }
  UpdateFlops(NumGlobalNonzeros());
  EPETRA_CHK_ERR(ierr);
  return(0);
}
开发者ID:cakeisalie,项目名称:oomphlib_003,代码行数:26,代码来源:Epetra_MsrMatrix.cpp


示例15: if

// Gets the dimensions of the colour cell given by (row,col)
BOOL CColourPopup::GetCellRect(int nIndex, const LPRECT& rect)
{
    if (nIndex == CUSTOM_BOX_VALUE)
    {
        ::SetRect(rect, 
                  m_CustomTextRect.left,  m_CustomTextRect.top,
                  m_CustomTextRect.right, m_CustomTextRect.bottom);
        return TRUE;
    }
    else if (nIndex == DEFAULT_BOX_VALUE)
    {
        ::SetRect(rect, 
                  m_DefaultTextRect.left,  m_DefaultTextRect.top,
                  m_DefaultTextRect.right, m_DefaultTextRect.bottom);
        return TRUE;
    }

    if (nIndex < 0 || nIndex >= m_nNumColours)
        return FALSE;

    rect->left = GetColumn(nIndex) * m_nBoxSize + m_nMargin;
    rect->top  = GetRow(nIndex) * m_nBoxSize + m_nMargin;

    // Move everything down if we are displaying a default text area
    if (m_strDefaultText.GetLength()) 
        rect->top += (m_nMargin + m_DefaultTextRect.Height());

    rect->right = rect->left + m_nBoxSize;
    rect->bottom = rect->top + m_nBoxSize;

    return TRUE;
}
开发者ID:BackupTheBerlios,项目名称:iris-svn,代码行数:33,代码来源:ColourPopup.cpp


示例16: block_cut

static	void	block_cut()
{
	EditLine	*ed,*ed_next;
	int 	x_st, x_ed;
	char	buf[MAXEDITLINE+1];

	if (bkm.blkm==BLKM_y && bkm.y_st<GetLastNumber())
		lists_delete(bkm.y_st, bkm.y_ed-1);else
		{
		 ed=GetList(bkm.y_st);
		 block_range(bkm.y_st, &bkm, &x_st, &x_ed);
		 strcpy(buf, ed->buffer);
		 buf[x_st]='\0';

		 ed_next=GetList(bkm.y_ed);
		 block_range(bkm.y_ed, &bkm, &x_st, &x_ed);
		 strcat(buf, ed_next->buffer+x_ed);

		 Realloc(ed, buf);

		 if (bkm.y_st+1<=bkm.y_ed)
		 	lists_delete(bkm.y_st+1, bkm.y_ed);
		}

	SetFileChangeFlag();
	csr_lenew();

	csr_setdy(GetRow()+bkm.y_st-GetLineOffset());
	csr_setly(bkm.y_st);

	if (bkm.blkm==BLKM_x)
		csr_setlx(bkm.x_st);
}
开发者ID:smorimura,项目名称:ne,代码行数:33,代码来源:block.c


示例17: if

BOOL COptionTreeColorPopUp::GetCellRect(int nIndex, const LPRECT& rect)
{
	// Get cell rect
    if (nIndex == OT_COLOR_CUSTOMBOXVALUE)
    {
        ::SetRect(rect, m_rcCustomTextRect.left,  m_rcCustomTextRect.top, m_rcCustomTextRect.right, m_rcCustomTextRect.bottom);
		
		return TRUE;
    }
    else if (nIndex == OT_COLOR_DEFAULTBOXVALUE)
    {
        ::SetRect(rect, m_rcDefaultTextRect.left,  m_rcDefaultTextRect.top, m_rcDefaultTextRect.right, m_rcDefaultTextRect.bottom);

        return TRUE;
    }

    if (nIndex < 0 || nIndex >= m_nNumColors)
	{
        return FALSE;
	}

    rect->left = GetColumn(nIndex) * m_nBoxSize + m_nMargin;
    rect->top  = GetRow(nIndex) * m_nBoxSize + m_nMargin;

    // Move everything down if we are displaying a default text area
    if (m_strDefaultText.GetLength()) 
	{
        rect->top += (m_nMargin + m_rcDefaultTextRect.Height());
	}

    rect->right = rect->left + m_nBoxSize;
    rect->bottom = rect->top + m_nBoxSize;

    return TRUE;
}
开发者ID:gaopan461,项目名称:acoral,代码行数:35,代码来源:OptionTreeColorPopUp.cpp


示例18: while

	QModelIndex MergeModel::mapFromSource (const QModelIndex& sourceIndex) const
	{
		if (!sourceIndex.isValid ())
			return {};

		QList<QModelIndex> hier;
		auto parent = sourceIndex;
		while (parent.isValid ())
		{
			hier.prepend (parent);
			parent = parent.parent ();
		}

		auto currentItem = Root_;
		for (const auto& idx : hier)
		{
			currentItem = currentItem->FindChild (idx);
			if (!currentItem)
			{
				qWarning () << Q_FUNC_INFO
						<< "no next item for"
						<< idx
						<< hier;
				return {};
			}
		}

		return createIndex (currentItem->GetRow (), sourceIndex.column (), currentItem.get ());
	}
开发者ID:ForNeVeR,项目名称:leechcraft,代码行数:29,代码来源:mergemodel.cpp


示例19: GetRow

void CResolverUIModel::DeleteItem(const wxDataViewItem &item)
{
  unsigned int row = GetRow(item);
  if (m_model.deleteEntry(row)) {
    RowDeleted(row);
  }
}
开发者ID:Sonderstorch,项目名称:c-mon,代码行数:7,代码来源:resolverpage.cpp


示例20: GetRow

void CTimeBarListModel::DeleteItems( const wxDataViewItemArray &items )
{
    wxArrayInt rows;
    for (unsigned i = 0; i < items.GetCount(); i++)
    {
        unsigned int row = GetRow( items[i] );
        if (row < m_textColValues.GetCount())
            rows.Add( row );
    }

    if (rows.GetCount() > 0)
    {
        // Sort in descending order so that the last
        // row will be deleted first. Otherwise the
        // remaining indeces would all be wrong.
        rows.Sort([](int *v1, int *v2)
        {
            return *v2-*v1;
        });
        for (unsigned i = 0; i < rows.GetCount(); i++)
        {
            m_textColValues.RemoveAt( rows[i] );
            m_view.RemoveAt( rows[i] );
            m_lock.RemoveAt( rows[i] );
        }
        // This is just to test if wxDataViewCtrl can
        // cope with removing rows not sorted in
        // descending order
        rows.Sort([](int *v1, int *v2)
        {
            return *v1-*v2;
        });
        RowsDeleted( rows );
    }
}
开发者ID:nobitalwm,项目名称:FCEngine,代码行数:35,代码来源:DataViewListModel.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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