本文整理汇总了C++中DLIList::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ DLIList::insert方法的具体用法?C++ DLIList::insert怎么用?C++ DLIList::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DLIList
的用法示例。
在下文中一共展示了DLIList::insert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: avoid_facet
CubitBoolean Faceter::avoid_facet(FaceterPointData *curr_faceter_data,
DLIList<FaceterPointData*> &order_list)
{
int ii;
CubitPoint *tmp_point;
FaceterPointData *prev = curr_faceter_data->get_prev();
FaceterPointData *next = curr_faceter_data->get_next();
//get the closest edges to this point.
CubitVector curr_v = curr_faceter_data->coordinates();
CubitVector prev_v = prev->coordinates();
CubitVector next_v = next->coordinates();
double r1 = (curr_v - prev_v).length();
double r2 = (curr_v - next_v).length();
double radius;
double angle;
if ( r1 > r2 )
radius = r1;
else
radius = r2;
gridSearchPtr->set_neighborhood_bounds(curr_v, radius);
DLIList<CubitPoint*> neighborhood_points;
DLIList<CubitPoint*> close_points, loop_list;
gridSearchPtr->get_neighborhood_points(neighborhood_points);
//Loop through and see if there are nodes in here closer
//than the r1 or r2.
FaceterPointData *tmp_faceter;
CubitVector tmp_v;
radius *= radius;
double angle1, angle2;
for (ii = neighborhood_points.size(); ii > 0; ii-- )
{
tmp_point = neighborhood_points.get_and_step();
tmp_faceter = (FaceterPointData*) tmp_point;
if ( tmp_faceter == curr_faceter_data ||
tmp_faceter == prev ||
tmp_faceter == next ||
tmp_faceter == next->get_next() ||
tmp_faceter == prev->get_prev() )
continue;
tmp_v = tmp_faceter->coordinates();
if ( (curr_v-tmp_v).length_squared() < radius )
close_points.append(tmp_point);
}
//Now of these close points if any of them make
//good trinagles for the other nodes then don't do
//this triangle...
CubitBoolean abort_facet = CUBIT_FALSE;
for ( ii = close_points.size(); ii > 0; ii-- )
{
tmp_point = close_points.get_and_step();
loop_list.clean_out();
loop_list.append(tmp_point);
loop_list.append((CubitPoint*)prev);
loop_list.append((CubitPoint*)curr_faceter_data);
loop_list.step();
interior_angle(&loop_list, angle1);
loop_list.clean_out();
loop_list.append((CubitPoint*)curr_faceter_data);
loop_list.append((CubitPoint*)next);
loop_list.append(tmp_point);
loop_list.step();
interior_angle(&loop_list, angle2);
if ( angle1 < DEGREES_TO_RADIANS(160) &&
angle2 < DEGREES_TO_RADIANS(160))
{
int tmp_debug = 1;
if ( tmp_debug )
{
GfxDebug::draw_point(prev->coordinates(), CUBIT_GREEN);
GfxDebug::draw_point(curr_faceter_data->coordinates(), CUBIT_RED);
GfxDebug::draw_point(tmp_point->coordinates(), CUBIT_BLUE);
GfxDebug::draw_point(next->coordinates(), CUBIT_MAGENTA);
loop_list.clean_out();
loop_list.append(tmp_point);
loop_list.append((CubitPoint*)prev);
loop_list.append((CubitPoint*)curr_faceter_data);
loop_list.step();
interior_angle(&loop_list, angle1);
}
abort_facet = CUBIT_TRUE;
break;
}
}
if ( abort_facet )
{
//We need to add curr_facerter_data back to the list.
order_list.insert(curr_faceter_data);
//Set the angle above 360...
angle = curr_faceter_data->get_interior_angle();
curr_faceter_data->set_interior_angle(angle + 2*CUBIT_PI);
avoidedOverlap = CUBIT_TRUE;
return CUBIT_TRUE;
}
return CUBIT_FALSE;
}