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


C++ column函数代码示例

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


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

示例1: getNumContacts

/*
        void ContactDynamics::updateBasisMatrix() {
            mB = MatrixXd::Zero(getNumTotalDofs(), getNumContacts() * getNumContactDirections());
            for (int i = 0; i < getNumContacts(); i++) {
                ContactPoint& c = mCollisionChecker->getContact(i);
                Vector3d p = c.point;
                int skelID1 = mBodyIndexToSkelIndex[c.bdID1];
                int skelID2 = mBodyIndexToSkelIndex[c.bdID2];

                MatrixXd B21;
                MatrixXd B12;
                if (!mSkels[skelID1]->getImmobileState()) {
                    int index1 = mIndices[skelID1];
                    int NDOF1 = c.bd1->getSkel()->getNumDofs();
                    B21 = getTangentBasisMatrix(p, c.normal);
                    MatrixXd J21 = getJacobian(c.bd1, p);

                    mB.block(index1, i * getNumContactDirections(), NDOF1, getNumContactDirections()) = J21.transpose() * B21;

                    //  cout << "B21: " << B21 << endl;
                }

                if (!mSkels[skelID2]->getImmobileState()) {
                    int index2 = mIndices[skelID2];
                    int NDOF2 = c.bd2->getSkel()->getNumDofs();
                    if (B21.rows() == 0)
                        B12 = getTangentBasisMatrix(p, -c.normal);
                    else
                        B12 = -B21;
                    MatrixXd J12 = getJacobian(c.bd2, p);
                    mB.block(index2, i * getNumContactDirections(), NDOF2, getNumContactDirections()) = J12.transpose() * B12;

                    //  cout << "B12: " << B12 << endl;

                }
            }
            return;
        }
        */
MatrixXd ContactDynamics::getContactMatrix() const {
    int numDir = getNumContactDirections();
    MatrixXd E(MatrixXd::Zero(getNumContacts() * numDir, getNumContacts()));
    MatrixXd column(MatrixXd::Ones(numDir, 1));
    for (int i = 0; i < getNumContacts(); i++) {
        E.block(i * numDir, i, numDir, 1) = column;
    }
    //        return E / (mDt * mDt);
    return E;
}
开发者ID:ehuang3,项目名称:dart,代码行数:49,代码来源:ContactDynamics.cpp

示例2: Q_ASSERT

void BindEnum::handleViewResponse(const QVariantMap& values)
{
	Q_ASSERT( mViewer && mEditor );
	Q_ASSERT( values.contains(column()) );

	QVariant data = values.value(column());

	Q_ASSERT( data.canConvert<int>() );

	int index = data.toInt();
	index = mEditor->findData(index);
	if(index == -1)
		index = mEditor->findData(mDefaultValue);

	Q_ASSERT(index != -1);

	mEditor->setCurrentIndex(index);
	mViewer->setText( mEditor->itemText(index) );
}
开发者ID:erikku,项目名称:frosty,代码行数:19,代码来源:BindEnum.cpp

示例3: bleep

/*
 * Obleeperate characters in hardcopy
 * open with \'s.
 */
void
bleep(int i, char *cp)
{

	i -= column(cp);
	do
		ex_putchar('\\' | QUOTE);
	while (--i >= 0);
	rubble = 1;
}
开发者ID:n-t-roff,项目名称:ex-3.6,代码行数:14,代码来源:ex_vops2.c

示例4: column

void Launcher::List::Columns::Save(Configuration& cfg) const
{
    if (const uint n=selected.Size())
    {
        Configuration::Section column( cfg["launcher"]["view"]["columns"]["column"] );

        for (uint i=0; i < n; ++i)
            column[i].Str() = cfgStrings[selected[i]];
    }
}
开发者ID:BGCX261,项目名称:zlndx-emu-svn-to-git,代码行数:10,代码来源:NstDialogLauncherColumns.cpp

示例5: column

math::Vector<2> TransformationMatrix::prod(math::const_VectorRef<2> vec) const
{
	math::Vector<2> result;
	for (std::size_t c = 0; c < 2; c++) {
		math::const_VectorRef<2> col = column(c).ptr();
		for (std::size_t r = 0; r < 2; r++)
			result(r) += col(r) * vec(c);
	}
	return result;
}
开发者ID:michpolicht,项目名称:gpx,代码行数:10,代码来源:TransformationMatrix.cpp

示例6: assign_attributes

 void assign_attributes(RecordPtr<Record> ptr, const wayward::data_franca::Spectator& data) {
   auto record_type = get_type<Record>();
   for (size_t i = 0; i < record_type->num_properties(); ++i) {
     auto prop = record_type->property_at(i);
     auto col = prop->column();
     if (data.has_key(col)) {
       prop->deserialize(*ptr, data[col]);
     }
   }
 }
开发者ID:senior7515,项目名称:w,代码行数:10,代码来源:assign_attributes.hpp

示例7: column

QVariant KexiComboBoxBase::value()
{
    KexiTableViewData *relData = column() ? column()->relatedData() : 0;
    KexiDB::LookupFieldSchema *lookupFieldSchema = 0;
    if (relData) {
        if (m_internalEditorValueChanged) {
            //we've user-entered text: look for id
//TODO: make error if matching text not found?
            int rowToHighlight;
            return valueForString(m_userEnteredValue.toString(), &rowToHighlight, 1, 0, true/*allowNulls*/);
        } else {
            //use 'related table data' model
            KexiDB::RecordData *record = popup() ? popup()->tableView()->selectedItem() : 0;
            return record ? record->at(0) : origValue();
        }
    } else if ((lookupFieldSchema = this->lookupFieldSchema())) {
        if (lookupFieldSchema->boundColumn() == -1)
            return origValue();
        KexiDB::RecordData *record = popup() ? popup()->tableView()->selectedItem() : 0;
        if (/*!record &&*/ m_internalEditorValueChanged && !m_userEnteredValue.toString().isEmpty()) { //
            //try to select a row using the user-entered text
            if (!popup()) {
                QVariant prevUserEnteredValue = m_userEnteredValue;
                createPopup(false);
                m_userEnteredValue = prevUserEnteredValue;
            }
            record = selectItemForEnteredValueInLookupTable(m_userEnteredValue);
        }
        return record ? record->at(lookupFieldSchema->boundColumn()) : QVariant();
    } else if (popup()) {
        //use 'enum hints' model
        const int row = popup()->tableView()->currentRow();
        if (row >= 0)
            return QVariant(row);
    }

    if (valueFromInternalEditor().toString().isEmpty())
        return QVariant();
    /*! \todo don't return just 1st row, but use autocompletion feature
          and: show message box if entered text does not match! */
    return origValue(); //unchanged
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:42,代码来源:kexicomboboxbase.cpp

示例8: ListView_SetExtendedListViewStyle

TableViewImpl * TableViewImpl::clone() const
{
    auto result = std::make_unique<TableViewImpl>(getParentHandle(),getControlData());    
    ListView_SetExtendedListViewStyle(result->hWnd,ListView_GetExtendedListViewStyle(hWnd));
    result->imageListImpl = imageListImpl;
    for( int c = 0; c != colCount; ++c ) {
        result->addColumn(column(c));
    }
    result->setRows(rowCount);
    return result.release();
}
开发者ID:thinlizzy,项目名称:die-tk,代码行数:11,代码来源:TableViewWin32.cpp

示例9: QString

QString KDReports::ErrorDetails::message() const
{
    if ( !hasError() )
        return QString();

    if ( d->m_line != -1 )
        return QObject::tr("Error on line %1, column %2: %3").arg(line()).arg(column()).arg(driverMessage());

    else
        return driverMessage();
}
开发者ID:EPIFIT,项目名称:KDReports,代码行数:11,代码来源:KDReportsErrorDetails.cpp

示例10: createUI

void createUI(NVGcontext *vg, float w, float h)
{
    int col;

    uiClear();

    {
        int root = uiItem(); 
        // position root element
        uiSetLayout(root,UI_LEFT|UI_TOP);
        uiSetMargins(root,50,50,0,0);
        uiSetSize(root,250,400);
    }

    col = column(0);
    uiSetLayout(col, UI_TOP|UI_HFILL);

    button(col, __LINE__, BND_ICONID(6,3), "Item 1", demohandler);
    button(col, __LINE__, BND_ICONID(6,3), "Item 2", demohandler);

    {
        int h = hgroup(col);
        radio(h, __LINE__, BND_ICONID(6,3), "Item 3.0", &enum1);
        radio(h, __LINE__, BND_ICONID(0,10), NULL, &enum1);
        radio(h, __LINE__, BND_ICONID(1,10), NULL, &enum1);
        radio(h, __LINE__, BND_ICONID(6,3), "Item 3.3", &enum1);
    }

    {
        int colr;
        int rows = row(col);
        int coll = vgroup(rows);
        label(coll, -1, "Items 4.0:");
        coll = vgroup(coll);
        button(coll, __LINE__, BND_ICONID(6,3), "Item 4.0.0", demohandler);
        button(coll, __LINE__, BND_ICONID(6,3), "Item 4.0.1", demohandler);
        colr = vgroup(rows);
        uiSetFrozen(colr, option1);
        label(colr, -1, "Items 4.1:");
        colr = vgroup(colr);
        slider(colr, __LINE__, "Item 4.1.0", &progress1);
        slider(colr,__LINE__, "Item 4.1.1", &progress2);
    }

    button(col, __LINE__, BND_ICONID(6,3), "Item 5", NULL);

    check(col, __LINE__, "Frozen", &option1);
    check(col, __LINE__, "Item 7", &option2);
    check(col, __LINE__, "Item 8", &option3);

    textbox(col, (UIhandle)textbuffer, textbuffer, 32);

    uiLayout();
}
开发者ID:clems71,项目名称:island,代码行数:54,代码来源:main.c

示例11: lindent

int
lindent(line *addr)
{
	register int i;
	char *swcurs = wcursor;
	line *swdot = wdot;

again:
	if (addr > one) {
		register char *cp;
		register int cnt = 0;

		addr--;
		getline(*addr);
		for (cp = linebuf; *cp; cp++)
			if (*cp == '(')
				cnt++;
			else if (*cp == ')')
				cnt--;
		cp = vpastwh(linebuf);
		if (*cp == 0)
			goto again;
		if (cnt == 0)
			return (whitecnt(linebuf));
		addr++;
	}
	wcursor = linebuf;
	linebuf[0] = 0;
	wdot = addr;
	dir = -1;
	llimit = one;
	lf = (void (*)(int))lindent;
	if (!lskipbal("()"))
		i = 0;
	else if (wcursor == linebuf)
		i = 2;
	else {
		register char *wp = wcursor;

		dir = 1;
		llimit = wdot;
		if (!lnext() || !ltosolid() || !lskipatom()) {
			wcursor = wp;
			i = 1;
		} else
			i = 0;
		i += column(wcursor) - 1;
		if (!inopen)
			i--;
	}
	wdot = swdot;
	wcursor = swcurs;
	return (i);
}
开发者ID:n-t-roff,项目名称:heirloom-ex-vi,代码行数:54,代码来源:ex_vops3.c

示例12: inv

SquareMatrix SqMRO_InverseLUDecomp::operator()() const {

	SquareMatrix inv(*m_thisMatrix);
	RowVector indices(getRows()), column(getRows());
	unsigned int i, j;
	double sign;

	inv.luDecomposition(indices, &sign);

	for (j = 0; j < getColumns(); j++) {
		column.zero();
		column(j) = 1;
		inv.luBackSubstitution(indices, column);
		for (i = 0; i < getRows(); i++) {
			inv(i,j) = column(i);
		}
	}

	return inv;
}
开发者ID:kppf,项目名称:macsimjx,代码行数:20,代码来源:matrix_operator.cpp

示例13: vsetcurs

/*
 * Compute the column position implied by the cursor at ``nc'',
 * and move the cursor there.
 */
void
vsetcurs(register char *nc)
{
	register int col;

	col = column(nc);
	if (linebuf[0])
		col--;
	vgotoCL(col);
	cursor = vcolbp;
}
开发者ID:JamesLinus,项目名称:LiteBSD-Ports,代码行数:15,代码来源:ex_vput.c

示例14: index_cursor_changed

//------------------------------------------------------------------------------
void DbMySQLTableEditorIndexPage::index_cursor_changed() {
  Gtk::TreeModel::Path path;
  Gtk::TreeView::Column *column(0);

  _indexes_tv->get_cursor(path, column);

  bec::NodeId node = _indexes_model->get_node_for_path(path);

  _index_node = node;
  update_index_details();
}
开发者ID:pk-codebox-evo,项目名称:mysql-workbench,代码行数:12,代码来源:mysql_table_editor_index_page.cpp

示例15: column

void StarPuzzle::applyChanges() {
    std::map<int, int>::iterator iter = m_changes.begin();
    int newPos;
    for (; iter != m_changes.end(); iter++) {
    	newPos = iter->first;
        m_stars[newPos] = m_stars[iter->second];
        m_stars[iter->second] = NULL;
        m_stars[newPos]->moveTo(m_left + column(newPos) * STAR_WIDTH, m_bottom + row(newPos) * STAR_HEIGHT);
    }
    m_changes.clear();
}
开发者ID:Asheng321,项目名称:PopStar,代码行数:11,代码来源:StarPuzzle.cpp


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