本文整理汇总了C++中DLIList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ DLIList::size方法的具体用法?C++ DLIList::size怎么用?C++ DLIList::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DLIList
的用法示例。
在下文中一共展示了DLIList::size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: points
void PST_Edge::points( DLIList<PST_Edge*>& edges, DLIList<PST_Point*>& points )
{
int e;
for( e = edges.size(); e--; )
{
PST_Edge* edge_ptr = edges.get_and_step();
edge_ptr->start_point()->private_mark_ = 1;
edge_ptr->end_point()->private_mark_ = 1;
}
for( e = edges.size(); e--; )
{
PST_Edge* edge_ptr = edges.get_and_step();
PST_Point* sp = edge_ptr->start_point();
PST_Point* ep = edge_ptr->end_point();
if( sp->private_mark_ )
{
sp->private_mark_ = 0;
points.append( sp );
}
if( ep->private_mark_ )
{
ep->private_mark_ = 0;
points.append( ep );
}
}
}
示例2: get_TopoDS_Shape
void OCCBody::get_TopoDS_Shape(TopoDS_Shape *& shape)
{
if (myTopoDSShape && !myTopoDSShape->IsNull())
{
assert(myTopoDSShape->ShapeType() == TopAbs_COMPOUND);
shape = myTopoDSShape;
}
else
{
DLIList<Lump*> lumps = this->lumps();
DLIList<OCCShell*> shells = this->shells();
DLIList<OCCSurface*> surfaces = this->my_sheet_surfaces();
if(lumps.size() + shells.size() + surfaces.size() == 1)
{
if(lumps.size() == 1)
{
OCCLump* lump = CAST_TO(lumps.get(), OCCLump);
assert(lump != NULL);
shape = CAST_TO(lump, OCCLump)->get_TopoDS_Solid();
}
else if(shells.size() == 1)
shape = shells.get()->get_TopoDS_Shell();
else
shape = surfaces.get()->get_TopoDS_Face();
}
else
shape = NULL;
}
}
示例3: size
/*! This function is like merge_unique(), except that the type of object
stored by \a merge_list is not the same as this list's type. The type of
object stored in the other list must be able to be static_cast<> to this
list's type.
\param merge_list The list whose elements will be incorporated into this list.
\param merge_list_unique A flag indicating whether to skip a check for
uniqueness between elements of \a merge_list.
\sa merge_unique()
*/
template<typename Y> inline void casting_merge_unique(const DLIList<Y>& merge_list,
bool merge_list_unique = false)
{
// Save the current index of the merge_list
int old_size = size();
int i, j, check_index;
X new_item;
// The resulting list will be at least as large as the larger of the two lists.
// Reserve space so we don't have to reallocate so often. Note that if
// this list is already bigger than merge_list, the reserve won't
// make the list shorter.
reserve(merge_list.size());
for ( i = 0; i < merge_list.size(); i++)
{
// Get the item from the merge_list and insert it into "this"
// list if it doesn't already exist there.
new_item = static_cast<X>(merge_list[i]);
check_index = merge_list_unique ? old_size : size();
// Append the new item and then remove it if necessary.
append(new_item);
for ( j = 0; j < check_index; j++ )
{
if ( listArray[j] == new_item )
{
listArray.resize(listArray.size()-1);
break;
}
}
}
}
示例4: edges
void PST_Edge::edges( DLIList<PST_Point*>& pts, DLIList<PST_Edge*>& edges )
{
int p;
for( p = pts.size(); p--; )
{
PST_Point* pt = pts.get_and_step();
PST_Edge* edge = pt->edge();
if( edge ) do
{
edge->private_mark_ = 1;
edge = edge->next( pt );
} while( edge != pt->edge() );
}
for( p = pts.size(); p--; )
{
PST_Point* pt = pts.get_and_step();
PST_Edge* edge = pt->edge();
if( edge ) do
{
if( edge->private_mark_ )
{
edge->private_mark_ = 0;
edges.append( edge );
}
edge = edge->next( pt );
} while( edge != pt->edge() );
}
}
示例5: faces
void PST_Edge::faces( DLIList<PST_Edge*>& edges, DLIList<PST_Face*>& faces )
{
int e;
for( e = edges.size(); e--; )
{
PST_Edge* edge_ptr = edges.get_and_step();
if( edge_ptr->forward()->face() )
edge_ptr->forward()->face()->private_mark_ = 1;
if( edge_ptr->reverse()->face() )
edge_ptr->reverse()->face()->private_mark_ = 1;
}
for( e = edges.size(); e--; )
{
PST_Edge* edge_ptr = edges.get_and_step();
PST_Face* fface_ptr = edge_ptr->forward()->face();
PST_Face* rface_ptr = edge_ptr->reverse()->face();
if( fface_ptr && fface_ptr->private_mark_ )
{
fface_ptr->private_mark_ = 0;
faces.append( fface_ptr );
}
if( rface_ptr && rface_ptr->private_mark_ )
{
rface_ptr->private_mark_ = 0;
faces.append( rface_ptr );
}
}
}
示例6: update_OCC_entity
//----------------------------------------------------------------
// Function: private function to update the core compound and
// for any movement of the body.
// Note: input shape must have the same number of Compound
// as the body's lumps number.
// Author: Jane Hu
//----------------------------------------------------------------
CubitStatus OCCBody::update_OCC_entity( BRepBuilderAPI_ModifyShape *aBRepTrsf,
BRepAlgoAPI_BooleanOperation *op)
{
assert(aBRepTrsf != NULL || op != NULL);
TopoDS_Compound compsolid;
TopoDS_Shape shape;
shape = aBRepTrsf->Shape();
if(aBRepTrsf && myTopoDSShape)
{
compsolid = TopoDS::Compound(shape);
if(OCCQueryEngine::instance()->OCCMap->IsBound(*myTopoDSShape) )
OCCQueryEngine::instance()->update_OCC_map(*myTopoDSShape, shape);
else if (!shape.IsEqual(*myTopoDSShape))
set_TopoDS_Shape(compsolid);
}
//Boolean operation works only on one lump body
//set the lumps
DLIList<Lump *> lumps;
lumps = this->lumps();
for (int i = 1; i <= lumps.size(); i++)
{
OCCLump *lump = CAST_TO(lumps.get_and_step(), OCCLump);
lump->update_OCC_entity(aBRepTrsf, op);
}
for(int i = 0; i < mySheetSurfaces.size(); i++)
{
OCCSurface* surface = mySheetSurfaces.get_and_step();
surface->update_OCC_entity(aBRepTrsf, op);
}
for(int i = 0; i <myShells.size() ; i++)
{
OCCShell* occ_shell = myShells.get_and_step();
occ_shell->update_OCC_entity(aBRepTrsf,op);
}
if (aBRepTrsf && !compsolid.IsNull())
set_TopoDS_Shape(compsolid);
update_bounding_box();
//unset marks.
DLIList<OCCCurve*> curves;
DLIList<OCCPoint*> points;
get_all_curves(curves);
get_all_points(points);
for(int i = 0; i < curves.size(); i++)
curves.get_and_step()->set_myMarked(CUBIT_FALSE);
for(int i = 0; i < points.size(); i++)
points.get_and_step()->set_myMarked(CUBIT_FALSE);
return CUBIT_SUCCESS;
}
示例7: measure
//-------------------------------------------------------------------------
// Purpose : Returns the volume of the Lump
//
// Special Notes :
//
// Creator :
//
// Creation Date :
//-------------------------------------------------------------------------
double FacetLump::measure()
{
DLIList<CubitFacet*> bounding_facets;
DLIList<CubitPoint*> bounding_points;
DLIList<FacetSurface*> surfaces;
Surface *curr_surface;
FacetSurface *facet_surface;
//if this is a sheet body... return 0.0
//Body *tmp_body = CAST_TO(myBodyPtr->topology_entity(), Body);
if( is_sheet() )
return 0.0;
int ii;
get_surfaces(surfaces);
if (surfaces.size() > 0)
{
for ( ii = surfaces.size(); ii > 0; ii-- )
{
curr_surface = surfaces.get_and_step();
facet_surface = CAST_TO(curr_surface, FacetSurface);
if ( facet_surface == NULL )
{
PRINT_ERROR("Facet lump has surfaces that aren't facets?");
return 1;
}
facet_surface->get_my_facets(bounding_facets, bounding_points);
}
}
double volume, curr_facet_area, summation = 0.0;
CubitFacet *curr_facet;
CubitVector normal_of_curr_facet, vector_of_point;
CubitPoint *point_1, *point_2, *point_3;
for( int jj = bounding_facets.size(); jj > 0; jj-- )
{
curr_facet = bounding_facets.get_and_step();
curr_facet_area = curr_facet->area(); // Current facet's area
normal_of_curr_facet = curr_facet->normal(); // Current facet's normal
curr_facet->points(point_1, point_2, point_3); // Current facet's points
vector_of_point = point_1->coordinates(); // One point's vector
summation += ( double(vector_of_point % normal_of_curr_facet) * curr_facet_area);
}
volume = summation / 3;
return volume;
}
示例8: process_rounds
void SimplifyTool::process_rounds(RefVolume* ref_volume,
double min_radius,
double max_radius)
{
DLIList<RefEdge*> edges;
ref_volume->ref_edges(edges);
DLIList<RefFace*> rounds;
// a edge must have curvature within the tolerance
for(int j = edges.size();j--;)
{
RefEdge* edge = edges.get_and_step();
CubitVector loc,tan,curv;
edge->closest_point(edge->curve_center(),loc,&tan,&curv);
double curv_mag = curv.length();
if(curv_mag > GEOMETRY_RESABS &&
1.0/curv_mag >= min_radius &&
1.0/curv_mag <= max_radius)
{
DLIList<RefFace*> new_rounds;
edge->ref_faces(new_rounds);
rounds+=new_rounds;
}
}
rounds.uniquify_unordered();
for(int i = rounds.size();i--;)
{
// cull any flat surfaces
RefFace* curr_face = rounds.get_and_step();
double curve_0,curve_1;
curr_face->get_principal_curvatures(curr_face->center_point(),curve_0,curve_1);
curve_0 = fabs(curve_0);
curve_1 = fabs(curve_1);
if((curve_0 > GEOMETRY_RESABS &&
1.0/curve_0 >= min_radius &&
1.0/curve_0 <= max_radius) ||
(curve_1 > GEOMETRY_RESABS &&
1.0/curve_1 >= min_radius &&
1.0/curve_1 <= max_radius))
{
GfxDebug::highlight_ref_face(curr_face);
}
}
}
示例9: list_entity_ids
void CubitUtil::list_entity_ids( const char *pre_string,
const DLIList<CubitEntity*> &entity_list,
int width, const char *post_string,
int sort, int unique,
int tab, const char *sep_string,
const char *post_string_none )
{
DLIList <int> id_list( entity_list.size() );
for ( int i=0; i<entity_list.size(); i++ )
id_list.append( entity_list.next(i)->id() );
list_entity_ids( pre_string, id_list, width, post_string, sort,
unique, tab, sep_string, post_string_none );
}
示例10: simplify_volumes
CubitStatus SimplifyTool::simplify_volumes(DLIList<RefVolume*> ref_volume_list,
double surf_angle_in,
DLIList<RefFace*> respect_face_list,
DLIList<RefEdge*> respect_edge_list,
CubitBoolean respect_rounds,
CubitBoolean respect_imprints,
CubitBoolean local_normals,
CubitBoolean preview)
{
ref_volume_list.uniquify_unordered();
for(int i = ref_volume_list.size();i--;)
simplify_volume(
ref_volume_list.get_and_step(),
surf_angle_in,
respect_face_list,
respect_edge_list,
respect_rounds,
respect_imprints,
local_normals,
preview);
if(preview)
GfxDebug::flush();
return CUBIT_SUCCESS;
}
示例11: same_healer_engine
//-----------------------------------------------------------------------------
// Purpose : Determines if entities are from the same engine.
//
// Creator : Tyronne Lim (CAT)
//
// Creation Date : 08/01/03
//-----------------------------------------------------------------------------
CubitBoolean GeometryHealerTool::same_healer_engine( DLIList<RefEntity*> &ref_entity_list,
CubitBoolean check_children ) const
{
DLIList<RefEntity*> complete_entity_list;
//Check the check_children option and check all the children if necessary
if (check_children)
{
//Make a complete list of all the RefEntities and their children
DLIList<RefEntity*> temp = ref_entity_list;
RefEntity* ref_entity_ptr;
for (int i = 0; i < ref_entity_list.size(); i++)
{
ref_entity_ptr = ref_entity_list.get_and_step();
complete_entity_list.clean_out();
ref_entity_ptr->get_all_child_ref_entities(complete_entity_list);
temp += complete_entity_list;
}
complete_entity_list.clean_out();
complete_entity_list.merge_unique(temp);
}
//Now make sure all the RefEntities are from the same geometry engine
DLIList<TopologyEntity*> te_list;
CAST_LIST(complete_entity_list, te_list, TopologyEntity);
return same_healer_engine(te_list);
}
示例12: check_surf_pairs
CubitBoolean AutoMidsurfaceTool::check_surf_pairs(double min_thick, double max_thick,
DLIList<RefFace*> check_list, Body* body_in )
{
double total_area = 0.0;
DLIList<RefVolume*> vol_list;
body_in->ref_volumes(vol_list);
double total_vol = 0;
for(int vol_cnt = 0; vol_cnt < vol_list.size(); vol_cnt++)
{
CubitVector cg;
double temp_volume;
vol_list[vol_cnt]->mass_properties(cg,temp_volume);
total_vol += temp_volume;
}
for(int i = 0;i<check_list.size();i++)
total_area += check_list[i]->area();
total_area/=2.0;
if(min_thick*total_area < total_vol && max_thick*total_area > total_vol)
return CUBIT_TRUE;
return CUBIT_FALSE;
}
示例13: ChollaCurve
//==================================================================================
//Function: skin_1d (PUBLIC)
//Description: creates a skin of the given facet entities.
//==================================================================================
CubitStatus ChollaSkinTool::skin_1d(DLIList<FacetEntity*> &facet_list,
ChollaCurve *&facet_curve_mesh_ptr)
{
CubitStatus rv = CUBIT_SUCCESS;
// create a ChollaCurve if we have to (only if this is a 1D facet)
if (!facet_curve_mesh_ptr)
{
FacetEntity *edge_ptr = facet_list.get();
TDGeomFacet *td_gm = TDGeomFacet::get_geom_facet( edge_ptr );
facet_curve_mesh_ptr = new ChollaCurve( td_gm->get_block_id() );
// associate all of the tooldata on the faces of this surf with the
// new ChollaCurve
int ii;
for (ii=0; ii<facet_list.size(); ii++)
{
edge_ptr = facet_list.get_and_step();
facet_curve_mesh_ptr->add_facet( edge_ptr );
td_gm = TDGeomFacet::get_geom_facet( edge_ptr );
td_gm->add_cholla_curve( facet_curve_mesh_ptr );
}
}
// Note: the start and end points of this curve will be defined in
// ChollaCurve::split_curve. The BlockPointMesh objects at these points
// will be defined in MeshGeometryCreator::classify_node
return rv;
}
示例14: printDag
void DagDrawingTool::printDag(DLIList<ModelEntity*> &entity_list, int depth)
{
int i;
for (i = entity_list.size(); i > 0; i--) {
printDag(entity_list.get_and_step(), depth);
}
}
示例15: get_parents_virt
void OCCSurface::get_parents_virt( DLIList<TopologyBridge*>& parents )
{
if(myShell) //shell or sheet body
{
parents.append(myShell);
return;
}
OCCQueryEngine* oqe = (OCCQueryEngine*) get_geometry_query_engine();
OCCBody * body = NULL;
DLIList <OCCBody* > *bodies = oqe->BodyList;
TopTools_IndexedDataMapOfShapeListOfShape M;
for(int i = 0; i < bodies->size(); i++)
{
body = bodies->get_and_step();
TopExp::MapShapesAndAncestors(*(body->get_TopoDS_Shape()),
TopAbs_FACE, TopAbs_SHELL, M);
if(!M.Contains(*(get_TopoDS_Face())))
continue;
const TopTools_ListOfShape& ListOfShapes =
M.FindFromKey(*(get_TopoDS_Face()));
if (!ListOfShapes.IsEmpty())
{
TopTools_ListIteratorOfListOfShape it(ListOfShapes) ;
for (;it.More(); it.Next())
{
TopoDS_Shell Shell = TopoDS::Shell(it.Value());
int k = oqe->OCCMap->Find(Shell);
parents.append((OCCShell*)(oqe->OccToCGM->find(k))->second);
}
}
}
}