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

C++ ViewEdge类代码示例

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

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



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

示例1:

int IncrementChainingTimeStampF1D::operator()(Interface1D& inter)
{
	ViewEdge *ve = dynamic_cast<ViewEdge*>(&inter);
	if (ve)
		ve->setChainingTimeStamp(ve->getChainingTimeStamp() + 1);
	return 0;
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:7,代码来源:Functions1D.cpp


示例2: integrate

 unsigned QuantitativeInvisibilityF1D::operator()(Interface1D& inter) {
   ViewEdge* ve = dynamic_cast<ViewEdge*>(&inter);
   if (ve)
     return ve->qi();
   FEdge *fe = dynamic_cast<FEdge*>(&inter);
   if(fe)
     return ve->qi();
   return integrate(_func, inter.verticesBegin(), inter.verticesEnd(), _integration);
 }
开发者ID:GodZza,项目名称:contours,代码行数:9,代码来源:Functions1D.cpp


示例3: it

int ChainSilhouetteIterator::traverse(const AdjacencyIterator& ait)
{
	AdjacencyIterator it(ait);
	ViewVertex *nextVertex = getVertex();
	// we can't get a NULL nextVertex here, it was intercepted before
	if (nextVertex->getNature() & Nature::T_VERTEX) {
		TVertex *tvertex = (TVertex *)nextVertex;
		ViewEdge *mate = (tvertex)->mate(getCurrentEdge());
		while (!it.isEnd()) {
			ViewEdge *ve = *it;
			if (ve == mate) {
				result = ve;
				return 0;
			}
			++it;
		}
		result = 0;
		return 0;
	}
	if (nextVertex->getNature() & Nature::NON_T_VERTEX) {
		//soc NonTVertex *nontvertex = (NonTVertex*)nextVertex;
		ViewEdge *newEdge(0);
		// we'll try to chain the edges by keeping the same nature...
		// the preseance order is : SILHOUETTE, BORDER, CREASE, SUGGESTIVE, VALLEY, RIDGE
		Nature::EdgeNature natures[6] = {
			Nature::SILHOUETTE,
			Nature::BORDER,
			Nature::CREASE,
			Nature::SUGGESTIVE_CONTOUR,
			Nature::VALLEY,
			Nature::RIDGE
		};
		for (unsigned int i = 0; i < 6; ++i) {
			if (getCurrentEdge()->getNature() & natures[i]) {
				int n = 0;
				while (!it.isEnd()) {
					ViewEdge *ve = *it;
					if (ve->getNature() & natures[i]) {
						++n;
						newEdge = ve;
					}
					++it;
				}
				if (n == 1) {
					result = newEdge;
				}
				else {
					result = 0;
				}
				return 0;
			}
		}
	}
	result = 0;
	return 0;
}
开发者ID:244xiao,项目名称:blender,代码行数:56,代码来源:ChainingIterators.cpp


示例4: getShapeF1D

 void getShapeF1D(Interface1D& inter, set<ViewShape*>& oShapes){
   ViewEdge* ve = dynamic_cast<ViewEdge*>(&inter);
   if (ve){
     oShapes.insert(ve->viewShape());
   }else{
     Interface0DIterator it=inter.verticesBegin(), itend=inter.verticesEnd();
     for(;it!=itend;++it)
       oShapes.insert(Functions0D::getShapeF0D(it));
   }
 }
开发者ID:GodZza,项目名称:contours,代码行数:10,代码来源:Functions1D.cpp


示例5:

 vector<ViewShape*> GetShapeF1D::operator()(Interface1D& inter) {
   vector<ViewShape*> shapesVector;
   set<ViewShape*> shapesSet;
   ViewEdge* ve = dynamic_cast<ViewEdge*>(&inter);
   if (ve){
     shapesVector.push_back(ve->viewShape());
   }else{
     Interface0DIterator it=inter.verticesBegin(), itend=inter.verticesEnd();
     for(;it!=itend;++it)
       shapesSet.insert(Functions0D::getShapeF0D(it));
     shapesVector.insert<set<ViewShape*>::iterator>(shapesVector.begin(), shapesSet.begin(), shapesSet.end());
   }
   return shapesVector;
 }
开发者ID:GodZza,项目名称:contours,代码行数:14,代码来源:Functions1D.cpp


示例6: integrate

int QuantitativeInvisibilityF1D::operator()(Interface1D &inter)
{
  ViewEdge *ve = dynamic_cast<ViewEdge *>(&inter);
  if (ve) {
    result = ve->qi();
    return 0;
  }
  FEdge *fe = dynamic_cast<FEdge *>(&inter);
  if (fe) {
    result = fe->qi();
    return 0;
  }
  result = integrate(_func, inter.verticesBegin(), inter.verticesEnd(), _integration);
  return 0;
}
开发者ID:dfelinto,项目名称:blender,代码行数:15,代码来源:Functions1D.cpp


示例7: while

 Nature::EdgeNature CurveNatureF1D::operator()(Interface1D& inter) {
   ViewEdge* ve = dynamic_cast<ViewEdge*>(&inter);
   if (ve)
     return ve->getNature();
   else{
     // we return a nature that contains every 
     // natures of the viewedges spanned by the chain.
     Nature::EdgeNature nat = Nature::NO_FEATURE;
     Interface0DIterator it = inter.verticesBegin();
     while(!it.isEnd()){
       nat |= _func(it);
       ++it;
     }
     return nat;
   }
 }
开发者ID:GodZza,项目名称:contours,代码行数:16,代码来源:Functions1D.cpp


示例8: getOccludeeF1D

 void getOccludeeF1D(Interface1D& inter, set<ViewShape*>& oShapes){
   ViewEdge* ve = dynamic_cast<ViewEdge*>(&inter);
   if (ve){
     ViewShape * aShape = ve->aShape();
     if(aShape == 0){
       oShapes.insert(0);
       return;
     }
     oShapes.insert(aShape);
   }
   else{
     Interface0DIterator it=inter.verticesBegin(), itend=inter.verticesEnd();
     for(;it!=itend;++it)
       oShapes.insert(Functions0D::getOccludeeF0D(it));
   }
 }
开发者ID:GodZza,项目名称:contours,代码行数:16,代码来源:Functions1D.cpp


示例9: getOccludersF1D

void getOccludersF1D(Interface1D& inter, set<ViewShape*>& oShapes)
{
	ViewEdge *ve = dynamic_cast<ViewEdge*>(&inter);
	if (ve) {
		vector<ViewShape*>& occluders = ve->occluders();
		oShapes.insert<vector<ViewShape*>::iterator>(occluders.begin(), occluders.end());
	}
	else {
		Interface0DIterator it = inter.verticesBegin(), itend = inter.verticesEnd();
		for (; it != itend; ++it) {
			set<ViewShape*> shapes;
			Functions0D::getOccludersF0D(it, shapes);
			for (set<ViewShape*>::iterator s = shapes.begin(), send = shapes.end(); s != send; ++s)
				oShapes.insert(*s);
		}
	}
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:17,代码来源:Functions1D.cpp


示例10: NonTVertex

ViewVertex *ViewMap::InsertViewVertex(SVertex *iVertex, vector<ViewEdge*>& newViewEdges)
{
	NonTVertex *vva = dynamic_cast<NonTVertex*>(iVertex->viewvertex());
	if (vva)
		return vva;
	// because it is not already a ViewVertex, this SVertex must have only 2 FEdges. The incoming one still belongs
	// to ioEdge, the outgoing one now belongs to newVEdge
	const vector<FEdge *>& fedges = iVertex->fedges();
	if (fedges.size() != 2) {
		cerr << "ViewMap warning: Can't split the ViewEdge" << endl;
		return NULL;
	}
	FEdge *fend(NULL), *fbegin(NULL);
	for (vector<FEdge *>::const_iterator fe = fedges.begin(), feend = fedges.end(); fe != feend; ++fe) {
		if ((*fe)->vertexB() == iVertex) {
			fend = (*fe);
		}
		if ((*fe)->vertexA() == iVertex) {
			fbegin = (*fe);
		}
		if ((fbegin != NULL) && (fend != NULL))
			break;
	}
	ViewEdge *ioEdge = fbegin->viewedge();
	ViewShape *vshape = ioEdge->viewShape();
	vva = new NonTVertex(iVertex);
	// if the ViewEdge is a closed loop, we don't create a new VEdge
	if (ioEdge->A() == 0) {
		// closed loop
		ioEdge->setA(vva);
		ioEdge->setB(vva);
		// update sshape
		vshape->sshape()->RemoveEdgeFromChain(ioEdge->fedgeA());
		vshape->sshape()->RemoveEdgeFromChain(ioEdge->fedgeB());

		ioEdge->setFEdgeA(fbegin);
		ioEdge->setFEdgeB(fend);

		// Update FEdges
		fend->setNextEdge(NULL);
		fbegin->setPreviousEdge(NULL);

		// update new View Vertex:
		vva->AddOutgoingViewEdge(ioEdge);
		vva->AddIncomingViewEdge(ioEdge);

		vshape->sshape()->AddChain(ioEdge->fedgeA());
		vshape->sshape()->AddChain(ioEdge->fedgeB());
	}
	else {
		// Create new ViewEdge
		ViewEdge *newVEdge = new ViewEdge(vva, ioEdge->B(), fbegin, ioEdge->fedgeB(), vshape);
		newVEdge->setId(Id(ioEdge->getId().getFirst(), ioEdge->getId().getSecond() + 1));
		newVEdge->setNature(ioEdge->getNature());
		//newVEdge->UpdateFEdges(); // done in the ViewEdge constructor
		// Update old ViewEdge
		ioEdge->setB(vva);
		ioEdge->setFEdgeB(fend);

		// Update FEdges
		fend->setNextEdge(NULL);
		fbegin->setPreviousEdge(NULL);

		// update new View Vertex:
		vva->AddOutgoingViewEdge(newVEdge);
		vva->AddIncomingViewEdge(ioEdge);

		NonTVertex *vvb = dynamic_cast<NonTVertex*>(newVEdge->B());
		if (vvb)
			vvb->Replace(ioEdge, newVEdge);

		// update ViewShape
		//vshape->AddEdge(newVEdge);
		// update SShape
		vshape->sshape()->AddChain(fbegin);
		// update ViewMap
		//_VEdges.push_back(newVEdge);
		newViewEdges.push_back(newVEdge);
	}

	// update ViewShape
	vshape->AddVertex(vva);

	// update ViewMap
	_VVertices.push_back(vva);

	return vva;
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:88,代码来源:ViewMap.cpp


示例11: while

ViewEdge *ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge& iWEdge)
{
	// Start a new sharp chain edges
	ViewEdge *newVEdge = new ViewEdge;
	newVEdge->setId(_currentViewId);
	++_currentViewId;
	unsigned size = 0;

	_pCurrentVShape->AddEdge(newVEdge);

	// Find first edge:
	OWXEdge firstWEdge = iWEdge;
	/* OWXEdge previousWEdge = firstWEdge; */ /* UNUSED */
	OWXEdge currentWEdge = firstWEdge;
	list<OWXEdge> edgesChain;
#if 0 /* TK 02-Sep-2012 Experimental fix for incorrect view edge visibility. */
	// bidirectional chaining
	// first direction:
	while (!stopSharpViewEdge(currentWEdge.e)) {
		edgesChain.push_back(currentWEdge);
		++size;
		currentWEdge.e->userdata = (void *)1; // processed
		// Find the next edge!
		currentWEdge = FindNextWEdge(currentWEdge);
	}
	OWXEdge endWEdge = edgesChain.back();
	// second direction
	currentWEdge = FindPreviousWEdge(firstWEdge);
	while (!stopSharpViewEdge(currentWEdge.e)) {
		edgesChain.push_front(currentWEdge);
		++size;
		currentWEdge.e->userdata = (void *)1; // processed
		// Find the previous edge!
		currentWEdge = FindPreviousWEdge(currentWEdge);
	}
#else
	edgesChain.push_back(currentWEdge);
	++size;
	currentWEdge.e->userdata = (void *)1; // processed
	OWXEdge endWEdge = edgesChain.back();
#endif
	firstWEdge = edgesChain.front();

	// build FEdges
	FEdge *feprevious = NULL;
	FEdge *fefirst = NULL;
	FEdge *fe = NULL;
	for (list<OWXEdge>::iterator we = edgesChain.begin(), weend = edgesChain.end(); we != weend; ++we) {
		fe = BuildSharpFEdge(feprevious, (*we));
		fe->setViewEdge(newVEdge);
		if (!fefirst)
			fefirst = fe;
		feprevious = fe;
	}
	// Store the chain starting edge:
	_pCurrentSShape->AddChain(fefirst);
	newVEdge->setNature(iWEdge.e->nature());
	newVEdge->setFEdgeA(fefirst);
	newVEdge->setFEdgeB(fe);

	// is it a closed loop ?
	if ((firstWEdge == endWEdge) && (size != 1)) {
		fefirst->setPreviousEdge(fe);
		fe->setNextEdge(fefirst);
		newVEdge->setA(0);
		newVEdge->setB(0);
	}
	else {
		ViewVertex *vva = MakeViewVertex(fefirst->vertexA());
		ViewVertex *vvb = MakeViewVertex(fe->vertexB());

		((NonTVertex *)vva)->AddOutgoingViewEdge(newVEdge);
		((NonTVertex *)vvb)->AddIncomingViewEdge(newVEdge);

		newVEdge->setA(vva);
		newVEdge->setB(vvb);
	}

	return newVEdge;
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:80,代码来源:ViewEdgeXBuilder.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ViewExp类代码示例发布时间:2022-05-31
下一篇:
C++ ViewDst类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap