Exemple #1
0
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);
	}
Exemple #2
0
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();
		}
	}
}
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;
    }
}
Exemple #4
0
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);
	}
}
Exemple #5
0
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;
}
Exemple #6
0
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());
}
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;
}
Exemple #8
0
void Water::ReInit() {
	float c[3], d;

	if (count!=waves.Count()) {
		waves.SetCount(count);
		waves.Resize(count);
		}

	// Reseed random number generator
	srand(randSeed); 

	// Compute wave centers on sphere with radius size
	for (int i = 0; i < count; i++) {
		WaveDesc &wv = waves[i];
		c[0] = frand();
		c[1] = (type == 0) ? frand() : 0.0f;
		c[2] = frand();
		d = size/(float)sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);
		wv.cent[0] = c[0]*d;
		wv.cent[1] = c[1]*d;
		wv.cent[2] = c[2]*d;
		wv.period = (((float)(rand()&0x7FFF))/32768.0f)*
			(maxperiod-minperiod)+minperiod; 
		wv.rate = (float)sqrt(maxperiod/wv.period);
		}
	}
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;
	}
}
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();	
}
void DeclarativeTabModel::tabChanged(Tab tab)
{
    // When a tab was closed do not update anything from database as
    // loading might be on going.
    if (m_activeTabClosed && this->sender() == DBManager::instance()) {
        m_activeTabClosed = false;
        return;
    }
#ifdef DEBUG_LOGS
    qDebug() << "tab: " << tab.tabId() << m_activeTab.tabId() << tab.currentLink().thumbPath() << tab.currentLink().url() << tab.currentLink().title() << m_tabs.indexOf(tab);
#endif
    if (tab.tabId() == m_activeTab.tabId()) {
        updateActiveTab(tab);
    } else {
        int i = m_tabs.indexOf(tab); // match based on tab_id
        if (i > -1) {
            QVector<int> roles;
            Tab oldTab = m_tabs[i];
            if (oldTab.currentLink().url() != tab.currentLink().url()) {
                roles << UrlRole;
            }
            if (oldTab.currentLink().title() != tab.currentLink().title()) {
                roles << TitleRole;
            }
            if (oldTab.currentLink().thumbPath() != tab.currentLink().thumbPath()) {
                roles << ThumbPathRole;
            }
            m_tabs[i] = tab;
            QModelIndex start = index(i, 0);
            QModelIndex end = index(i, 0);
            emit dataChanged(start, end, roles);
        }
    }
}
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();
}
Exemple #13
0
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;
}
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();
}
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());
}
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();
}
Exemple #17
0
    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;
    }
bool SplineData::ProjectPoint(int splineIndex, Point3 p,  Point3 &hitUVW, float &d, Point3 &hitPoint, SplineMapProjectionTypes projectionType, bool onlyInsideEnvelope, int maxIterations)
{
	bool hit = false;



	float scale = 1.0f;	//scale is used to expand our envelopes on each pass so we find at least a close point
	float limit = 128.0f;

	if (onlyInsideEnvelope)
		limit = 2.0f;

	mSplineElementData[splineIndex]->mClosestSubs.SetSize(mSplineElementData[splineIndex]->GetNumberOfSubBoundingBoxes());
	mSplineElementData[splineIndex]->mClosestSubs.ClearAll();
	while (!hit && scale < limit)
	{
		Tab<int> bounds;
		//start by getting a list of samples that contain this point
		mSplineElementData[splineIndex]->Contains(p,bounds,scale);	

		if (bounds.Count())
		{
			Point3 uvw = Point3(0.0f,0.0f,0.0f);
			float closestD = -1.0f;

			int closestSeg = 0;
			for (int j = 0; j < bounds.Count(); j++)
			{	
				//get our sample index
				int index = bounds[j];

				Point3 testUVW(0.0f,0.0f,0.0f);
				float testD = 0.0f;
				
				//find the closest sample
				if (mSplineElementData[splineIndex]->ProjectPoint(p, index, testUVW, testD, hitPoint,projectionType,scale,maxIterations))
				{
					if ((testD < closestD) || (closestD == -1.0f))
					{
						hitUVW = testUVW;
						closestD = testD;
						d = testD;
						hit =  true;
						closestSeg = j;
						mSplineElementData[splineIndex]->mClosestSubs.Set(closestSeg,TRUE);
					}		
					else
					{
					}
				}
			}		
				
			
		}		
		//increase our scale in case we did not find a hit
		scale *= 2.0f;
	}
	return hit;
}
Exemple #19
0
void PrismObject::GetCollapseTypes(Tab<Class_ID> &clist,Tab<TSTR*> &nlist)
{
    Object::GetCollapseTypes(clist, nlist);
    Class_ID id = EDITABLE_SURF_CLASS_ID;
    TSTR *name = new TSTR(GetString(IDS_SM_NURBS_SURFACE));
    clist.Append(1,&id);
    nlist.Append(1,&name);
}
Exemple #20
0
void TabbedArea::addTab(const std::string &caption, gcn::Widget *widget)
{
    Tab *tab = new Tab;
    tab->setCaption(caption);
    mTabsToDelete.push_back(tab);

    addTab(tab, widget);
}
Exemple #21
0
void Water::SetNum(int i, TimeValue t, BOOL init) { 
	count = i;
	waves.SetCount(count); 
	waves.Resize(count);
//	pblock->SetValue(PB_NUM, t, i);
	pblock->SetValue(water_num, t, i);
	if (init) ReInit();
	}
Exemple #22
0
Rect Tab_Impl::get_client_rect()
{
	Rect hr = tab_header->get_geometry();
	Rect g = tab->get_geometry().get_size();
	g.top = hr.bottom;
	Rect content = tab->get_content_box();
	return content;
}
int SplineData::HitTest(ViewExp *vpt,INode *node, ModContext *mc, Matrix3 tm, HitRegion hr, int flags, SplineMapProjectionTypes projType, BOOL selectCrossSection )
{
	if ( ! vpt || ! vpt->IsAlive() )
	{
		// why are we here?
		DbgAssert(!_T("Doing HitTest() on invalid viewport!"));
		return FALSE;
	}

	int res = 0;

	GraphicsWindow *gw = vpt->getGW();
	DWORD limit = gw->getRndLimits();
	gw->setRndLimits(( limit | GW_PICK) & ~GW_ILLUM);
	if (selectCrossSection)
	{
		Tab<int> hitSplines;
		Tab<int> hitCrossSections;

		if (HitTestCrossSection(gw, hr,  projType, hitSplines,hitCrossSections))
		{
			for (int i = 0; i < hitSplines.Count(); i++)
			{
				int splineIndex = hitSplines[i];
				int crossSectionIndex = hitCrossSections[i];
				if ( (mSplineElementData[splineIndex]->CrossSectionIsSelected(crossSectionIndex) && (flags&HIT_SELONLY)) ||
					!(flags&(HIT_UNSELONLY|HIT_SELONLY)))
					vpt->LogHit(node,mc,crossSectionIndex,splineIndex,NULL);
				else if ( (!mSplineElementData[splineIndex]->CrossSectionIsSelected(crossSectionIndex) && (flags&HIT_UNSELONLY)) ||
					!(flags&(HIT_UNSELONLY|HIT_SELONLY)))
					vpt->LogHit(node,mc,crossSectionIndex,splineIndex,NULL);
			}
		}
	}
	else
	{
		for (int splineIndex = 0; splineIndex < mSplineElementData.Count();splineIndex++)
		{
			gw->clearHitCode();
			mSplineElementData[splineIndex]->Display(gw,Matrix3(1),projType );
			if (gw->checkHitCode())
			{
				if ( (mSplineElementData[splineIndex]->IsSelected() && (flags&HIT_SELONLY)) ||
					!(flags&(HIT_UNSELONLY|HIT_SELONLY)))
					vpt->LogHit(node,mc,0,splineIndex,NULL);
				else if ( (!mSplineElementData[splineIndex]->IsSelected() && (flags&HIT_UNSELONLY)) ||
					!(flags&(HIT_UNSELONLY|HIT_SELONLY)))
					vpt->LogHit(node,mc,0,splineIndex,NULL);
			}

		}

	}

	gw->setRndLimits(limit);
	return res;
}
Exemple #24
0
void MainWindow::addTab()
{
	Tab* tab = new Tab(ui.tabWidget);
	ui.tabWidget->addTab(tab, tr("Tab %1").arg(ui.tabWidget->count() + 1));
	QAction* act = ui.tabWidget->addTabAction(ui.tabWidget->indexOf(tab), tr("Close"), tab, SLOT(close()), tr("Ctrl+W"));
	tab->addAction(act);
	ui.tabWidget->setCurrentWidget(tab);
	connect(tab, SIGNAL(somethingHappened(const QString&)), statusBar(), SLOT(showMessage(const QString&)));
}
Exemple #25
0
void TabbedArea::setSelectedTab(gcn::Tab *tab)
{
    gcn::TabbedArea::setSelectedTab(tab);

    Tab *newTab = dynamic_cast<Tab*>(tab);

    if (newTab)
        newTab->setCurrent();
}
Exemple #26
0
void PolyOperation::CopyBasics (PolyOperation *pCopyTo)
{
	pCopyTo->mSelection = mSelection;
	Tab<int> paramList;
	GetParameters (paramList);
	for (int i=0; i<paramList.Count (); i++) {
		int id = paramList[i];
		memcpy (pCopyTo->Parameter(id), Parameter(id), ParameterSize(id));
	}
}
void VentanaClienteDinamica::agregarData(Tab& t) {
    // Mapa de consultas
    agregarConsultantesTab(t.getConsultantes());

    // Set padre
    t.setPadre(this);

    // vector< Tab* >
    tabs.push_back(&t);
}
Exemple #28
0
int TabWidget::pullTab(int index, TabWidget *origin)
{
    QString name = origin->tabText(index);

    Tab *tab = (Tab*)origin->unregisterTab(index);
    int idx = addTab(tab, name, tab->isWorkTab() ? ((WorkTab*)tab)->getId() : ((ChildTab*)tab)->getId());
    origin->checkEmpty();
    tab->setWindowId(tabView()->getWindowId());
    return idx;
}
bool DeclarativeTabModel::tabSort(const Tab &t1, const Tab &t2)
{
    int i1 = s_tabOrder.indexOf(t1.tabId());
    int i2 = s_tabOrder.indexOf(t2.tabId());
    if (i2 == -1) {
        return true;
    } else {
        return i1 < i2;
    }
}
Exemple #30
0
Point3*	UnwrapMod::fnGetNormal(int faceIndex)
	{
	//check for type
	ModContextList mcList;		
	INodeTab nodes;
	
	Point3 norm(0.0f,0.0f,0.0f);

	n = norm;
	if (!ip) return &n;
	ip->GetModContexts(mcList,nodes);

	int objects = mcList.Count();

	

	faceIndex--;


	if (objects != 0)
		{
		MeshTopoData *md = (MeshTopoData*)mcList[0]->localData;

		if (md == NULL) 
			{
			return NULL;
			}


		Tab<Point3> objNormList;
		BuildNormals(md,objNormList);
		if ((faceIndex >= 0) && (faceIndex < objNormList.Count()))
			norm = objNormList[faceIndex];
		else
			{
			faceIndex = 0;
			int ct = 1;
			for (int i =0; i < md->faceSel.GetSize(); i++)
				{
				if (md->faceSel[i])
					{
					faceIndex = i;
					norm = objNormList[faceIndex];
					TSTR normstr;
					normstr.printf("norm%d = Point3 %f %f %f",ct,norm.x,norm.y,norm.z);
					ct++;
					macroRecorder->ScriptString(normstr);
					macroRecorder->EmitScript();
					}
				}
			}
		}
	n = norm;
	return &n;
	}