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


C++ Facet::halfedge方法代码示例

本文整理汇总了C++中Facet::halfedge方法的典型用法代码示例。如果您正苦于以下问题:C++ Facet::halfedge方法的具体用法?C++ Facet::halfedge怎么用?C++ Facet::halfedge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Facet的用法示例。


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

示例1: splitFacet

Halfedge_handle DegradeAnObject::splitFacet(Facet fs, int index) {
	Halfedge_handle hh1 = fs.halfedge();
	Halfedge_handle hh2 = fs.halfedge()->next();
	Halfedge_handle hh3 = fs.halfedge()->next()->next();
	splitEdgesOfFacet(fs, index);
	Halfedge_handle h = barycentricMesh(fs, index);
	noTVertice(hh1, hh2, hh3, index);
	return h;
}
开发者ID:guil-prin,项目名称:notreDame,代码行数:9,代码来源:DegradeAnObject.cpp

示例2: barycentricMesh

Halfedge_handle DegradeAnObject::barycentricMesh(Facet fs, int index) {
	std::vector<Point_3> points;
	Halfedge_handle hh = fs.halfedge();
	Point_3 p1 = hh->vertex()->point();
	points.push_back(p1);
	hh = hh->next();
	while(hh->vertex()->point() != p1) {
		points.push_back(hh->vertex()->point());
		hh = hh->next();
	}
	Halfedge_handle h = polys[index].create_center_vertex(fs.halfedge());
	h->vertex()->point() = meanPoints(points);
	return h;
}
开发者ID:guil-prin,项目名称:notreDame,代码行数:14,代码来源:DegradeAnObject.cpp

示例3: B

// Constructs HDS for a pane from element connectivity array.
void 
RFC_Pane_overlay::build_hds() {
  RFC_assertion( _base);
  if ( _base->size_of_nodes() == 0) return;

  HDS_builder  B(_hds,true);

  B.begin_surface( _base->size_of_nodes(), _base->size_of_elements());
  // insert the vertices
  for (Size i=0; i<_base->size_of_nodes(); ++i) 
  { B.add_vertex( Vertex::Point()); }

  Element_node_enumerator ene( _base, 1);

  for (int i=_base->size_of_elements(); i>0; --i, ene.next()) {
    B.begin_facet();
    for ( int k=0, ne=ene.size_of_edges(); k<ne; ++k) {
      B.add_vertex_to_facet( ene[k]-1);
    }
    B.end_facet();
  }

  B.end_surface();

  // Normalize border vertices such that every border vertex point to its
  // incident border halfedge.
  _hds.normalize_border_vertices();

  // Insert the vertices in edge/face centers for quadratic elements
  if ( _quadratic) {
    Facet *fs = &*_hds.facets_begin();

    Element_node_enumerator ene( _base, 1);
    for (int i=_base->size_of_elements(); i>0; --i, ene.next(), ++fs) {
      int nn = ene.size_of_nodes();
      int ne = ene.size_of_edges();

      Halfedge *h = fs->halfedge();
      for ( int k=ne; k<ne+ne; ++k) {
	Vertex *v = get_vertex_from_id( ene[k]);
	v->set_halfedge( h);
	h = h->next();
      }
      if ( nn == 9) {
	Vertex *v = get_vertex_from_id( ene[8]);
	v->set_halfedge( fs->halfedge());
      }
    }
  }
}
开发者ID:IllinoisRocstar,项目名称:RocstarBasement,代码行数:51,代码来源:RFC_Window_overlay.C

示例4: Plane

 typename Facet::Plane_3 operator()( Facet& f) {
     typename Facet::Halfedge_handle h = f.halfedge();
     typedef typename Facet::Plane_3  Plane;
     return Plane( h->vertex()->point(),
                   h->next()->vertex()->point(),
                   h->next()->next()->vertex()->point());
 }
开发者ID:Asuzer,项目名称:cgal,代码行数:7,代码来源:polyhedron_prog_planes.cpp

示例5: putAPointOnAFacet

// Place un point p sur la face fs, et relie p aux sommets de fs.
Halfedge_handle DegradeAnObject::putAPointOnAFacet(Point_3 p, int index) {
	Facet fs;
	getFacetFromPoint(p, fs, index);
	Halfedge_handle h = polys[index].create_center_vertex(fs.halfedge());
	h->vertex()->point() = p;
	return h;
}
开发者ID:guil-prin,项目名称:notreDame,代码行数:8,代码来源:DegradeAnObject.cpp

示例6: cross_product

    typename Facet::Plane_3 operator()( Facet& f) 
	{
		typename Facet::Halfedge_handle h = f.halfedge();
        // Facet::Plane_3 is the normal vector type. We assume the
        // CGAL Kernel here and use its global functions.
        return CGAL::cross_product( h->next()->vertex()->point() - h->vertex()->point(),
									h->next()->next()->vertex()->point() - h->next()->vertex()->point() );
    }
开发者ID:ASDen,项目名称:CGsp,代码行数:8,代码来源:CGsp.cpp

示例7:

// Récupère la liste de tous les points d'une face
std::vector<Point_3> DegradeAnObject::getAllPointsFromFacet(Facet f) {
	std::vector<Point_3> pts;
	Halfedge_handle hh = f.halfedge();
	pts.push_back(hh->vertex()->point());
	hh = hh->next();
	while(hh->vertex()->point() != pts[0]) {
		pts.push_back(hh->vertex()->point());
		hh = hh->next();
	}
	return pts;
}
开发者ID:guil-prin,项目名称:notreDame,代码行数:12,代码来源:DegradeAnObject.cpp

示例8: splitEdgesOfFacet

void DegradeAnObject::splitEdgesOfFacet(Facet fs, int index) {
	Halfedge_handle hh = fs.halfedge();
	Point_3 p1 = hh->vertex()->point();
	Point_3 p2 = hh->next()->vertex()->point();
	Point_3 p3 = hh->next()->next()->vertex()->point();
	Halfedge_handle hh1 = polys[index].split_edge(hh);
	hh1->vertex()->point() = meanPoints(p1, p3);
	hh = hh->next();
	Halfedge_handle hh2 = polys[index].split_edge(hh);
	hh2->vertex()->point() = meanPoints(p2, p1);
	hh = hh->next();
	Halfedge_handle hh3 = polys[index].split_edge(hh);
	hh3->vertex()->point() = meanPoints(p2, p3);
}
开发者ID:guil-prin,项目名称:notreDame,代码行数:14,代码来源:DegradeAnObject.cpp

示例9: refineFacetMesh

void DegradeAnObject::refineFacetMesh(Point_3 p, Facet &fs, double epsilon, int index) {
	Facet chkF;
	Halfedge_handle h = splitFacet(fs, index);
	//std::cout << getFacetFromPoint(p, chkF, index) << std::endl;
	if(getFacetFromPoint(p, chkF, index)) {
		if(distanceBetweenPointAndFacet(p, chkF.halfedge()->vertex()->point()) > epsilon) {
			refineFacetMesh(p, chkF, epsilon, index);
		}
		else {
			impactAFace(chkF, index);
		}
	}
	else {
		impactAFace(fs, index);
	}
}
开发者ID:guil-prin,项目名称:notreDame,代码行数:16,代码来源:DegradeAnObject.cpp

示例10: impactTheFacetArea

// Réalise un impact sur la face fs à partir d'une liste de points à déplacer, répartis par couronne (pts[0] = première couronne intérieure, pts[0][0] = premier point de la première couronne)
void DegradeAnObject::impactTheFacetArea(std::vector< std::vector<Point_3> > pts, Facet fs, double ray, int index) {
	double str = 0.02;
	Vector_3 normal = normalizeVector(getNormalOfFacet(fs));
	Kernel::Plane_3 pl(fs.halfedge()->vertex()->point(), normal);
	for(int i = 0 ; i < pts.size() ; i++) {
		for(int j = 0 ; j < pts[i].size() ; j++) {
			bool chk = false;
			Point_iterator pi = polys[index].points_begin();
			while(!chk) {
				++pi;
				if(*pi == pts[i][j]) {
					*pi = Point_3(pi->x() - (impactStrengh(str, i))*normal.x(), pi->y() - (impactStrengh(str, i))*normal.y(), pi->z() - (impactStrengh(str, i))*normal.z());
					chk = true;
				}
			}
		}
	}
}
开发者ID:guil-prin,项目名称:notreDame,代码行数:19,代码来源:DegradeAnObject.cpp

示例11: normalizeVector

// Génère des points autour du point d'impact prévu
std::vector<Point_3> DegradeAnObject::generatePointsOnFacet(Point_3 p, double ray, Facet fs, int nbPts) {
	std::vector<Point_3> pts;
	Vector_3 normal = normalizeVector(getNormalOfFacet(fs));
	Kernel::Plane_3 pl(fs.halfedge()->vertex()->point(), normal);
	Vector_3 orth = (pl.base1()) * ray;
	Vector_3 smallOrth;
	Point_3 chkPt;
	chkPt = p + orth;
	pts.push_back(chkPt);
	Facet test;
	double teta = M_PI/(nbPts/2.0);
	for(int i = 1 ; i < nbPts ; i++) {
		orth = rotationVector(orth, normal, teta);
		chkPt = p + orth;
		pts.push_back(chkPt);
	}
	return pts;
}
开发者ID:guil-prin,项目名称:notreDame,代码行数:19,代码来源:DegradeAnObject.cpp

示例12: meanPoints

// Casse les arêtes d'une face triangulaire en 2 et les place au centre de son arête. Retourne la liste des pointeurs de ce point
std::vector<Halfedge_handle> DegradeAnObject::splitEdgesOfFacet(Facet fs, int index) {
	Halfedge_handle hh = fs.halfedge();
	std::vector<Halfedge_handle> hhs;
	Point_3 p1 = hh->vertex()->point();
	Point_3 p2 = hh->next()->vertex()->point();
	Point_3 p3 = hh->next()->next()->vertex()->point();
	Halfedge_handle hh1 = polys[index].split_edge(hh);
	hh1->vertex()->point() = meanPoints(p1, p3);
	hhs.push_back(hh1);
	hh = hh->next();
	Halfedge_handle hh2 = polys[index].split_edge(hh);
	hh2->vertex()->point() = meanPoints(p2, p1);
	hhs.push_back(hh2);
	hh = hh->next();
	Halfedge_handle hh3 = polys[index].split_edge(hh);
	hh3->vertex()->point() = meanPoints(p2, p3);
	hhs.push_back(hh3);
	return hhs;
}
开发者ID:guil-prin,项目名称:notreDame,代码行数:20,代码来源:DegradeAnObject.cpp

示例13: getNormalOfFacet

// Retourne le vecteur normal d'une face
Vector_3 DegradeAnObject::getNormalOfFacet(Facet fs) {
	Vector_3 normal = CGAL::cross_product(fs.halfedge()->next()->vertex()->point() - fs.halfedge()->vertex()->point(), fs.halfedge()->next()->next()->vertex()->point() - fs.halfedge()->next()->vertex()->point());
	return normal;
}
开发者ID:guil-prin,项目名称:notreDame,代码行数:5,代码来源:DegradeAnObject.cpp


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