cgma
|
#include <VGLoopTool.hpp>
Static Public Member Functions | |
static double | loop_angle_metric (COEDGE *first_coedge) |
static void | get_loop_polyline (COEDGE *first_coedge, std::vector< CubitVector > &result_set) |
Static Private Member Functions | |
static CubitStatus | get_loop_polygon (COEDGE *first_coedge, DLIList< CubitVector * > &polygon_points) |
Definition at line 25 of file VGLoopTool.hpp.
CubitStatus VGLoopTool< SURFACE, LOOP, COEDGE, CURVE, POINT >::get_loop_polygon | ( | COEDGE * | first_coedge, |
DLIList< CubitVector * > & | polygon_points | ||
) | [static, private] |
Definition at line 594 of file VGLoopTool.cpp.
{ if( !first_coedge ) return CUBIT_FAILURE; DLIList<CubitVector*> interior; CubitSense sense; polygon.clean_out(); COEDGE* coedge = first_coedge; do { polygon.append( new CubitVector( coedge->start_point()->coordinates() ) ); interior.clean_out(); if( !coedge->get_curve()->get_interior_extrema( interior, sense ) ) { while( polygon.size() ) delete polygon.pop(); return CUBIT_FAILURE; } if( sense != coedge->sense() ) interior.reverse(); polygon += interior; coedge = coedge->next(); } while( coedge != first_coedge ); return CUBIT_SUCCESS; }
void VGLoopTool< SURFACE, LOOP, COEDGE, CURVE, POINT >::get_loop_polyline | ( | COEDGE * | first_coedge, |
std::vector< CubitVector > & | result_set | ||
) | [static] |
Definition at line 676 of file VGLoopTool.cpp.
{ COEDGE* coedge = first_coedge; GMem gmem; list.resize(0); do { coedge->get_curve()->get_geometry_query_engine()-> get_graphics( coedge->get_curve(), &gmem ); int num_pts = gmem.pointListCount; if ( num_pts > 1 ) { int start = list.size(); list.resize( start + num_pts - 1 ); std::vector<CubitVector>::iterator itor = list.begin() + start; if ( coedge->sense() == CUBIT_FORWARD ) { GPoint* pitor = gmem.point_list(); GPoint* pend = pitor + num_pts - 1; for ( ; pitor != pend; ++pitor ) { itor->set( pitor->x, pitor->y, pitor->z ); ++itor; } } else { GPoint* pend = gmem.point_list(); GPoint* pitor = pend + num_pts - 1; for ( ; pitor != pend; --pitor ) { itor->set( pitor->x, pitor->y, pitor->z ); ++itor; } } } coedge = coedge->next(); } while ( coedge != first_coedge ); }
double VGLoopTool< SURFACE, LOOP, COEDGE, CURVE, POINT >::loop_angle_metric | ( | COEDGE * | first_coedge | ) | [static] |
Definition at line 637 of file VGLoopTool.cpp.
{ if( !first_coedge ) return 0.0; assert( first_coedge && first_coedge->get_loop() && first_coedge->get_loop()->get_surface() ); DLIList<CubitVector*> polygon; get_loop_polygon( first_coedge, polygon ); double result = 0.0; CubitVector *point[3], segment[2], normal; point[0] = polygon.step_and_get(); point[1] = polygon.step_and_get(); segment[0] = *point[1] - *point[0]; for( int i = polygon.size(); i--; ) { point[2] = polygon.step_and_get(); segment[1] = *point[1] - *point[2]; first_coedge->get_loop()->get_surface()->closest_point( *point[1], 0, &normal ); result += normal.vector_angle( segment[1], segment[0] ); point[1] = point[2]; segment[0] = -segment[1]; } result /= CUBIT_PI; result -= polygon.size(); while( polygon.size() ) delete polygon.pop(); return result; }