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


C++ Vertex_iterator::info方法代码示例

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


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

示例1: callOnVertices

/**
 * Calls the given function on all vertices that are on a boundary and have a normal and curvature
 * @param callback The function to call
 * @param material The material type (default ROCK)
 */
void StoneWeatherer::callOnVertices( void ( *callback )( const Vertex & v ), Contents material ) const {

	for ( Vertex_iterator it = newDT->finite_vertices_begin(); it != newDT->finite_vertices_end(); ++it ) {

		if ( it->info().kill <= BORDER && ( it->info().flag & material ) ) {

			callback( *it );
		}
	}
}
开发者ID:aphill70,项目名称:Capstone-Winter--12,代码行数:15,代码来源:StoneWeatherer.cpp

示例2: doOneCustomStep

/**
 * Executes one custom timestep
 * @param averageEdgeLength The function to compute the average edge length for a given vertex
 * @param getOffsetPoint Computes the new location of the given point
 * @return The results of running the timestep
 */
stepResults StoneWeatherer::doOneCustomStep( double ( *averageEdgeLength )( const Vertex_handle & v ), Point( *getOffsetPoint )( const Point & p, const VertexData & d, const StoneWeatherer * caller ) ) {

	CGAL::Timer timestamp;
	stepResults result;
	result.secondsTotal = 0.0;
	timestamp.start();
	timestamp.reset();
	
	/**
	 * Maps circumcenters to where they really came from
	 */
	 map<Point,Point> pointMap;

	// Generate the correct-resolution offset points
	vector<Point> newPoints;
	int n;
	int i;
	int j;
	Vertex_handle vhi;
	Vertex_handle vhj;
	double dist2;
	Point a;
	Point b;
	Point c;
	VertexData d;

	// Put in midPoints of edges as needed, and flag redundant vertices
	for ( Cell_iterator it = newDT->finite_cells_begin(); it != newDT->finite_cells_end(); ++it ) {

		if ( it->info() != AIR ) {
			
			for ( n = 0; n < 4; ++n ) {

				if ( it->neighbor( n )->info() != it->info() || newDT->is_infinite( it->neighbor( n ) ) ) {

					for ( i = 1; i < 4; ++i ) {

						Vertex_handle vhi = it->vertex( n ^ i );

						for ( j = i + 1; j < 4; ++j ) {

							Vertex_handle vhj = it->vertex( n ^ j );

							// Only check each edge once...
							if ( vhi < vhj ) {

								dist2 = ( vhi->point() - vhj->point() ).squared_length();

								if ( dist2 > maxSquareDistance( averageEdgeLength, vhi, vhj ) ) {

									// Don't split non-live edges
									a = vhi->point();
									b = vhj->point();

									if ( !live( a.x(), a.y(), a.z() ) && !live( b.x(), b.y(), b.z() ) ) {

										continue;
									}

									// Split edge
									a = CGAL::ORIGIN + ( ( a - CGAL::ORIGIN ) + ( b - CGAL::ORIGIN ) ) * 0.5;
									d = VertexData::midPoint( vhi->info(), vhj->info() );
									
									//// If the vertex is shared by both objects, split it
									//if ( ( d.flag & ROCK ) && ( d.flag & MORE_ROCK ) ) {

									//	VertexData d1;
									//	VertexData d2;
									//	splitVertexData( d, d1, d2 );
									//	
									//	Point a1 = jitterPoint( a );
									//	Point a2 = jitterPoint( a );
									//	
									//	c = getOffsetPoint( a1, d1, this );
									//	newPoints.push_back( c );
									//	pointMap.insert( pair<Point,Point>( c, a1 ) );

									//	c = getOffsetPoint( a2, d2, this );
									//	newPoints.push_back( c );
									//	pointMap.insert( pair<Point,Point>( c, a2 ) );
									//}
									//else {

										c = getOffsetPoint( a, d, this );
										newPoints.push_back( c );
										pointMap.insert( pair<Point,Point>( c, a ) );
									//}
								}
								else if ( vhi->info().kill != TOO_CLOSE && dist2 < minSquareDistance( averageEdgeLength, vhi, vhj ) ) {

									// The higher-address endpoint
									vhj->info().kill = TOO_CLOSE;
								}
							}
//.........这里部分代码省略.........
开发者ID:aphill70,项目名称:Capstone-Winter--12,代码行数:101,代码来源:StoneWeatherer.cpp

示例3: setVertexInfo

/**
 * Sets the new vertex info for the vertices in the new mesh
 */
void StoneWeatherer::setVertexInfo() {

	// Clear everything
	for ( Vertex_iterator it = newDT->finite_vertices_begin(); it != newDT->finite_vertices_end(); ++it ) {

		it->info().clear();
	}

	int i;

	// Label the vertices to keep (those defining boundaries between materials, where "infinite" means "air")
	for ( All_Cell_iterator it = newDT->all_cells_begin(); it != newDT->all_cells_end(); ++it ) {

		if ( newDT->is_infinite( it ) ) {

			for ( i = 0; i < 4; ++i ) {

				it->vertex( i )->info().flag |= AIR;
			}
		}
		else {

			for ( i = 0; i < 4; ++i ) {

				it->vertex( i )->info().flag |= it->info();
			}
		}
	}

	// Simplify the labels for mesh simplification later
	for ( Vertex_iterator it = newDT->finite_vertices_begin(); it != newDT->finite_vertices_end(); ++it ) {

		switch ( it->info().flag ) {

			case AIR | DIRT | ROCK | MORE_ROCK:

				// border
			case AIR | DIRT | ROCK:

				// border

			case AIR | DIRT | MORE_ROCK:

				// border

			case AIR | ROCK | MORE_ROCK:

				// border

			case DIRT | ROCK | MORE_ROCK:

				// border

			case AIR | ROCK:

				// border

			case AIR | DIRT:

				// border

			case AIR | MORE_ROCK:

				// border

			case ROCK | DIRT:

				// border

			case DIRT | MORE_ROCK:

				// border

			case ROCK | MORE_ROCK:

				// border

				it->info().kill = BORDER;
				break;

			default:

				it->info().kill = FLOATER;
		}
	}

	int n;

	// Accumulate face normals for border faces
	for ( Cell_iterator it = newDT->finite_cells_begin(); it != newDT->finite_cells_end(); ++it ) {

		if ( it->info() != AIR ) {

			for ( n = 0; n < 4; ++n ) {

				if ( it->neighbor( n )->info() < it->info() || newDT->is_infinite( it->neighbor( n ) ) ) {

//.........这里部分代码省略.........
开发者ID:aphill70,项目名称:Capstone-Winter--12,代码行数:101,代码来源:StoneWeatherer.cpp


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