Skip to Content.
Sympa Menu

cgal-discuss - Re:[cgal-discuss] get vertex handle from a facet

Subject: CGAL users discussion list

List archive

Re:[cgal-discuss] get vertex handle from a facet


Chronological Thread 
  • From: 聂志峰 <>
  • To:
  • Subject: Re:[cgal-discuss] get vertex handle from a facet
  • Date: Tue, 16 Jan 2007 14:15:54 +0800 (CST)

Hello,does anyone have Farin's paper"Smooth interpolation to scattered 3D data"?
 
 
 

在2007-01-14,chen wenyu <> 写道:

Hi,

How can I get the vertex handle from a facet.

Facet f = ....;

// how to get the three vertex handles of this facet f


For example:

-------------------------------------------------------

// examples/Alpha_shapes_3/example_weight.C

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Weighted_alpha_shape_euclidean_traits_3.h>
#include <CGAL/Regular_triangulation_3.h>
#include <CGAL/Alpha_shape_3.h>
#include <list>

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;

typedef CGAL::Weighted_alpha_shape_euclidean_traits_3<K> Gt;

typedef CGAL::Alpha_shape_vertex_base_3<Gt>         Vb;
typedef CGAL::Alpha_shape_cell_base_3<Gt>           Fb;
typedef CGAL::Triangulation_data_structure_3<Vb,Fb> Tds;
typedef CGAL::Regular_triangulation_3<Gt,Tds>       Triangulation_3;
typedef CGAL::Alpha_shape_3<Triangulation_3>        Alpha_shape_3;

typedef Alpha_shape_3::Cell_handle          Cell_handle;
typedef Alpha_shape_3::Vertex_handle        Vertex_handle;
typedef Alpha_shape_3::Facet                Facet;
typedef Alpha_shape_3::Edge                 Edge;
typedef Gt::Weighted_point                  Weighted_point;
typedef Gt::Bare_point                      Bare_point;

int main()
{
  std::list<Weighted_point> lwp;

  //input : a small molecule
  lwp.push_back(Weighted_point(Bare_point( 1, -1, -1), 4));
  lwp.push_back(Weighted_point(Bare_point(-1,  1, -1), 4));
  lwp.push_back(Weighted_point(Bare_point(-1, -1,  1), 4));
  lwp.push_back(Weighted_point(Bare_point( 1,  1,  1), 4));
  lwp.push_back(Weighted_point(Bare_point( 2,  2,  2), 1));

  //build alpha_shape  in GENERAL mode and set alpha=0
  Alpha_shape_3  as(lwp.begin(), lwp.end(), 0, Alpha_shape_3::GENERAL);

  //explore the 0-shape - It is dual to the boundary of the union.
  std::list<Cell_handle> cells;
  std::list<Facet>       facets;
  std::list<Edge>        edges;
  as.get_alpha_shape_cells(std::back_inserter(cells),
			   Alpha_shape_3::INTERIOR);
  as.get_alpha_shape_facets(std::back_inserter(facets),
			    Alpha_shape_3::REGULAR);
  as.get_alpha_shape_facets(std::back_inserter(facets),
			    Alpha_shape_3::SINGULAR);
  as.get_alpha_shape_edges(std::back_inserter(edges),
			   Alpha_shape_3::SINGULAR);
//start here
 std::list<Facet>::iterator fbeg = facetr.begin();
 std::list<Facet>::iterator fend = facetr.end(); 
 
 for (int i = 0; fbeg != fend; fbeg++)
 {
   Facet f = (Facet)fbeg;
     ........................
     // how to get the three vertex handles of this facet 
 }
}


下载 Live Messenger 8.0





独家!网易3G免费邮,还赠送280兆网盘 www.126.com


Archive powered by MHonArc 2.6.16.

Top of Page