本文整理汇总了C++中Tab类的典型用法代码示例。如果您正苦于以下问题:C++ Tab类的具体用法?C++ Tab怎么用?C++ Tab使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Tab类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnumDependents
void BonesDefMod::RebuildPaintNodes()
{
//this sends all our dependant nodes to the painter
MyEnumProc dep;
EnumDependents(&dep);
Tab<INode *> nodes;
for (int i = 0; i < nodes.Count(); i++)
{
ObjectState os = nodes[i]->EvalWorldState(GetCOREInterface()->GetTime());
if ( (os.obj->NumPoints() != painterData[i].bmd->VertexData.Count()) ||
(painterData[i].bmd->isPatch) || (painterData[i].bmd->inputObjectIsNURBS) )
{
int ct = painterData[i].bmd->VertexData.Count();
Tab<Point3> pointList;
pointList.SetCount(ct);
Matrix3 tm = nodes[i]->GetObjectTM(GetCOREInterface()->GetTime());
for (int j =0; j < ct; j++)
{
pointList[j] = painterData[i].bmd->VertexData[j]->LocalPosPostDeform*tm;
}
pPainterInterface->LoadCustomPointGather(ct, pointList.Addr(0), nodes[i]);
}
}
pPainterInterface->UpdateMeshes(TRUE);
}
示例2: ComposeStackedTab
void FileTabs::ComposeStackedTab(Tab& tab, const Tab& stacked_tab, const Font &font, Color ink, int style)
{
tab.AddImage(TabBarImg::STSEP);
if (stackedicons && tab.HasIcon()) {
tab.AddImage(style == CTRL_HOT ? stacked_tab.img : (greyedicons ? DisabledImage(stacked_tab.img) : stacked_tab.img))
.Clickable();
}
else {
WString txt = IsString(stacked_tab.value) ? stacked_tab.value : StdConvert().Format(stacked_tab.value);
int extpos = txt.ReverseFind('.');
Color c = (style == CTRL_HOT) ? extcolor : SColorDisabled();
if (extpos >= 0) {
tab.AddText(
txt.Mid(extpos + 1),
font,
c
).Clickable();
}
else {
tab.AddText("-", font, c).Clickable();
}
}
}
示例3: CollectMeshFaces
void CModelExporter::ExportMeshVertex(IGameNode* /*pNode*/, IGameMesh* pMesh, IGameMaterial* pMat, size_t uMatID, BOOL bMultiMat)
{
pMesh->SetUseWeightedNormals();
pMesh->InitializeData();
Tab<FaceEx*> faceTab;
CollectMeshFaces(faceTab, pMesh, uMatID, bMultiMat);
size_t uFaceCount = faceTab.Count();
size_t uVertexCount = uFaceCount * 3;
m_serializer << uVertexCount;
BOOL bDiffusemap = GetTextureMap(pMat, ID_DI) == NULL ? FALSE : TRUE;
BOOL bNormalmap = GetTextureMap(pMat, ID_BU) == NULL ? FALSE : TRUE;
BOOL bSpecularmap = GetTextureMap(pMat, ID_SS) == NULL ? FALSE : TRUE;
BOOL bLightmap = GetTextureMap(pMat, ID_AM) == NULL ? FALSE : TRUE;
float centerX = 0;
float centerY = 0;
float centerZ = 0;
for(size_t i = 0; i < uFaceCount; ++i)
{
FaceEx* pFace = faceTab[i];
for(int j = 0; j < 3; ++j)
{
DWORD mapIndex[3];
Point3 ptUV;
int indexUV = pFace->texCoord[j];
int nChannel = 0;
if(bDiffusemap || bNormalmap || bSpecularmap)
{
IGameTextureMap* pMap = GetTextureMap(pMat, ID_DI);
nChannel = pMap->GetMapChannel();
}
else if(bLightmap)
{
IGameTextureMap* pMap = GetTextureMap(pMat, ID_AM);
nChannel = pMap->GetMapChannel();
}
if(pMesh->GetMapFaceIndex(nChannel, pFace->meshFaceIndex, mapIndex))
ptUV = pMesh->GetMapVertex(nChannel, mapIndex[j]);
else
ptUV = pMesh->GetMapVertex(nChannel, indexUV);
int indexPos = pFace->vert[j];
Point3 pos = pMesh->GetVertex(indexPos);
m_serializer << pos.x << pos.y << pos.z;
m_serializer << ptUV.x << ptUV.y;
centerX += pos.x;
centerY += pos.y;
centerZ += pos.z;
}
}
if (uFaceCount > 0)
{
centerX /= (uFaceCount * 3);
centerY /= (uFaceCount * 3);
centerZ /= (uFaceCount * 3);
m_serializer << centerX << centerY << centerZ;
}
}
示例4: ComposeTab
void AutoHideBar::ComposeTab(Tab& tab, const Font &font, Color ink, int style)
{
DockableCtrl *d;
WString txt;
const Value &q = tab.value;
ink = (style == CTRL_DISABLED) ? SColorDisabled : ink;
if (IsTypeRaw<DockCont *>(q)) {
DockCont *c = ValueTo<DockCont *>(q);
d = &c->GetCurrent();
txt = c->GetTitle();
}
else {
ASSERT(IsTypeRaw<DockableCtrl *>(q));
d = ValueTo<DockableCtrl *>(q);
txt = d->GetTitle();
}
if(icons)
{
tab.AddImage((style == CTRL_DISABLED) ? DisabledImage(d->GetIcon()) : d->GetIcon());
}
if (showtext)
{
tab.AddText(txt, font, ink);
}
}
示例5: Do
void PolyOpExtrudeEdge::Do (MNMesh & mesh) {
MNChamferData chamData;
chamData.InitToMesh(mesh);
Tab<Point3> tUpDir;
tUpDir.SetCount (mesh.numv);
// Topology change:
if (!mesh.ExtrudeEdges (MN_USER, &chamData, tUpDir)) return;
// Apply map changes based on base width:
int i;
Tab<UVVert> tMapDelta;
for (int mapChannel=-NUM_HIDDENMAPS; mapChannel<mesh.numm; mapChannel++) {
if (mesh.M(mapChannel)->GetFlag (MN_DEAD)) continue;
chamData.GetMapDelta (mesh, mapChannel, mWidth, tMapDelta);
UVVert *pMapVerts = mesh.M(mapChannel)->v;
if (!pMapVerts) continue;
for (i=0; i<mesh.M(mapChannel)->numv; i++) pMapVerts[i] += tMapDelta[i];
}
// Apply geom changes based on base width:
Tab<Point3> tDelta;
chamData.GetDelta (mWidth, tDelta);
for (i=0; i<mesh.numv; i++) mesh.v[i].p += tDelta[i];
// Move the points up:
for (i=0; i<tUpDir.Count(); i++) mesh.v[i].p += tUpDir[i]*mHeight;
}
示例6: tabToolTip
void TabWidget::saveData(DataFileParser *file)
{
file->writeVal(m_id);
if(m_tab_ids.empty())
{
file->writeVal((quint32)0);
return;
}
file->writeVal(count());
for(int i = 0; i < count(); ++i)
{
Tab *tab = (Tab*)widget(i);
if(tab->isWorkTab())
{
file->writeBlockIdentifier("tabWidgetTab");
QString name = tabToolTip(i);
int idx = name.lastIndexOf(" - ");
if(idx != -1)
name = name.left(idx);
file->writeString(name);
((WorkTab*)tab)->saveData(file);
}
}
file->writeBlockIdentifier("tabWidgetIdx");
file->writeVal(currentIndex());
}
示例7: qDebug
bool DeclarativeTabModel::activateTab(const int &index)
{
if (index >= 0 && index < m_tabs.count()) {
Tab newActiveTab = m_tabs.at(index);
#ifdef DEBUG_LOGS
qDebug() << "active tab: " << index << newActiveTab.currentLink().url();
#endif
beginRemoveRows(QModelIndex(), index, index);
m_tabs.removeAt(index);
endRemoveRows();
// Current active tab back to model data.
if (m_activeTab.isValid()) {
#ifdef DEBUG_LOGS
qDebug() << "insert to first index: " << m_activeTab.currentLink().url() << m_activeTab.currentLink().title() << m_activeTab.currentLink().thumbPath();
#endif
beginInsertRows(QModelIndex(), 0, 0);
m_tabs.insert(0, m_activeTab);
endInsertRows();
}
updateActiveTab(newActiveTab);
return true;
}
return false;
}
示例8:
void
SATGroup::_BottomNeighbours(WindowAreaList& neighbourWindows,
WindowArea* parent)
{
float startPos = parent->LeftBottomCrossing()->VerticalTab()->Position();
float endPos = parent->RightBottomCrossing()->VerticalTab()->Position();
Tab* tab = parent->LeftBottomCrossing()->HorizontalTab();
const CrossingList* crossingList = tab->GetCrossingList();
for (int i = 0; i < crossingList->CountItems(); i++) {
Corner* corner = crossingList->ItemAt(i)->LeftBottomCorner();
if (corner->status != Corner::kUsed)
continue;
WindowArea* area = corner->windowArea;
float pos1 = area->LeftBottomCrossing()->VerticalTab()->Position();
float pos2 = area->RightBottomCrossing()->VerticalTab()->Position();
if (pos1 < endPos && pos2 > startPos)
neighbourWindows.AddItem(area);
if (pos2 > endPos)
break;
}
}
示例9: GetCrossSection
void SplineData::RotateSelectedCrossSections(Quat q)
{
Tab<int> selSplines;
Tab<int> selCrossSections;
GetSelectedCrossSections(selSplines,selCrossSections);
//move the cross sections
for (int i = 0; i < selSplines.Count(); i++)
{
int splineIndex = selSplines[i];
int crossSectionIndex = selCrossSections[i];
SplineCrossSection *section = GetCrossSection(splineIndex,crossSectionIndex);
Matrix3 sTM = section->mTM;
sTM.NoScale();
sTM.NoTrans();
Quat tq = TransformQuat(sTM,q);
//no back into our initial space
tq = TransformQuat(section->mIBaseTM,tq);
section->mQuat += tq;
}
RecomputeCrossSections();
}
示例10: HitTestCrossSection
BOOL SplineData::HitTestCrossSection(GraphicsWindow *gw, HitRegion hr, SplineMapProjectionTypes projType, Tab<int> &hitSplines, Tab<int> &hitCrossSections)
{
hitSplines.SetCount(0);
hitCrossSections.SetCount(0);
DWORD limit = gw->getRndLimits();
gw->setRndLimits(( limit | GW_PICK) & ~GW_ILLUM);
gw->setHitRegion(&hr);
//loop through splines
for (int splineIndex = 0; splineIndex < mSplineElementData.Count();splineIndex++)
{
if (mSplineElementData[splineIndex]->IsSelected())
{
for (int crossSectionIndex = 0; crossSectionIndex < NumberOfCrossSections(splineIndex); crossSectionIndex++)
{
SplineCrossSection section = mSplineElementData[splineIndex]->GetCrossSection(crossSectionIndex);
Matrix3 crossSectionTM = section.mTM;
gw->setTransform(crossSectionTM);
gw->clearHitCode();
mSplineElementData[splineIndex]->DisplayCrossSections(gw, crossSectionIndex,projType );
if (gw->checkHitCode())
{
hitSplines.Append(1,&splineIndex,10);
hitCrossSections.Append(1,&crossSectionIndex,10);
}
}
}
}
return hitSplines.Count();
}
示例11: Q_ASSERT
bool TabWidget::closeTab(int index)
{
if(index < 0 || m_tab_ids.size() <= (uint)index)
{
Q_ASSERT(false);
return false;
}
quint32 id = m_tab_ids[index];
Tab *tab = dynamic_cast<Tab*>(widget(index));
if(!tab)
{
Q_ASSERT(false);
return false;
}
if(!tab->onTabClose())
return false;
if(id & IDMASK_CHILD)
{
sWorkTabMgr.removeChildTab((ChildTab*)tab);
}
else
{
disconnect((WorkTab*)tab, SIGNAL(statusBarMsg(QString,int)), this, SIGNAL(statusBarMsg(QString,int)));
sWorkTabMgr.removeTab((WorkTab*)tab);
}
changeMenu(currentIndex());
checkEmpty();
return true;
}
示例12: TabBarEventArgs
void TabBarElement::mousedown(int mouseButton, int x, int y) {
TabBarElement *tabBar = this;
x = tabBar->getAbsoluteBounds() != NULL ? x - tabBar->getAbsoluteBounds()->x : x;
y = tabBar->getAbsoluteBounds() != NULL ? y - tabBar->getAbsoluteBounds()->y : y;
FontStyle *font = (FontStyle *)tabBar->getAttributeObj("font");
int left = 0;
for(std::vector<Tab *>::iterator it = tabBar->getTabs()->begin(); it != tabBar->getTabs()->end(); ++it) {
Tab *tab = (Tab *)static_cast<Tab *>(*it);
string *title = tab->getName();
string *id = tab->getId();
string *uri = tab->getUri();
GraphicsContext *g = tabBar->createGraphics();
rectangle strSize = g->measureString((char *)title->c_str(), font);
int width = 20 + 100 + 20;
if (x > left && x < left + width) {
tabBar->activeTab = tab;
TabBarEventArgs *args = new TabBarEventArgs(tab);
tabBar->notify(string("tabselected"), (SPType *)tabBar, (EventArgs *)args);
cout << title->c_str();
break;
}
left += width;
}
tabBar->invalidate();
}
示例13: while
void TabBarElement::Draw(int x, int y, GraphicsContext *g) {
if (this->absoluteBounds == NULL)
this->absoluteBounds = new rectangle;
this->absoluteBounds->x = x;
this->absoluteBounds->y = y;
this->absoluteBounds->width = this->getWidth();
this->absoluteBounds->height = this->getHeight();
g->fillRectangle(x, y, this->getWidth(), this->getHeight(), (Color *)this->getAttributeObj("bgcolor"));
int left = 0;
std::vector<Tab *>::iterator it = this->getTabs()->begin();
do {
Color *fgColor = (Color *)this->getAttributeObj("fgcolor");
Tab *tab = (Tab *)static_cast<Tab *>(*it);
string *title = tab->getName();
string *id = tab->getId();
rectangle strSize = g->measureString((char *)title->c_str(), font);
int width = 20 + 100 + 20;
if (this->activeTab == tab) {
fgColor = (Color *)this->getAttributeObj("active_tab_fgcolor");
Color *bgColor = (Color *)this->getAttributeObj("active_tab_bgcolor");
g->fillRectangle(x + left, y, width, this->getHeight(), bgColor);
}
g->drawString((char *)title->c_str(), font, fgColor, left + x + 20, y + (this->getHeight() / 2) - (strSize.height / 2), strSize.width, strSize.height);
left += width;
++it;
} while (it != this->getTabs()->end());
}
示例14: tabbar_mousedown
int tabbar_mousedown(SPType *sender, EventArgs *e) {
TabBarElement *tabBar = (TabBarElement *)sender;
MouseEventArgs *me = (MouseEventArgs *)e;
int x = tabBar->getAbsoluteBounds() != NULL ? me->getX() - tabBar->getAbsoluteBounds()->y : me->getX();
int y = tabBar->getAbsoluteBounds() != NULL ? me->getY() - tabBar->getAbsoluteBounds()->y : me->getY();
int left = 0;
;
for(std::vector<Tab *>::iterator it = tabBar->tabs->begin(); it != tabBar->tabs->end(); ++it) {
Tab *tab = (Tab *)dynamic_cast<Tab *>(*it);
string *title = tab->getName();
string *id = tab->getId();
string *uri = tab->getUri();
FontStyle *font = (FontStyle *)tabBar->getAttributeObj("font");
GraphicsContext *g = tabBar->createGraphics();
rectangle strSize = g->measureString((char *)title->c_str(), font);
int width = 20 + strSize.width + 20;
if (x > left && x < left + width) {
tabBar->activeTab = tab;
TabBarEventArgs *args = new TabBarEventArgs(tab);
tabBar->notify(string("tabselected"), (SPType *)tabBar, (EventArgs *)args);
}
left += width;
}
tabBar->invalidate();
}
示例15: GetComponents
bool GetComponents()
{
fSelectedNodes.ZeroCount();
fSharedComps.ZeroCount();
Interface *ip = GetCOREInterface();
int nodeCount = ip->GetSelNodeCount();
if (nodeCount == 0)
return false;
// Get the components shared among the selected nodes
int i;
fSelectedNodes.SetCount(nodeCount);
for (i = 0; i < nodeCount; i++)
fSelectedNodes[i] = ip->GetSelNode(i);
INodeTab sharedComps;
if (plSharedComponents(fSelectedNodes, sharedComps) == 0)
return false;
// Put the shared components in a list
fSharedComps.SetCount(sharedComps.Count());
for (i = 0; i < sharedComps.Count(); i++)
fSharedComps[i] = ((plMaxNode*)sharedComps[i])->ConvertToComponent();
return true;
}