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


C++ DLIList类代码示例

本文整理汇总了C++中DLIList的典型用法代码示例。如果您正苦于以下问题:C++ DLIList类的具体用法?C++ DLIList怎么用?C++ DLIList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: 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() );
  }
}
开发者ID:chrismullins,项目名称:cgma,代码行数:29,代码来源:PST_Data.cpp

示例2: get_facet_points

//=============================================================================
//Function:  get_facet_points (PUBLIC)
//Description:  return the list of facet points on this chollacurve
//Notes: inclusive = true will return end points as well, otherwise only
//       interior points will be returned
//Author: sjowen
//Date: 9/11/2009
//=============================================================================
void ChollaCurve::get_facet_points( DLIList<CubitPoint *> &point_list, CubitBoolean inclusive)
{
  FacetEntity *fe_ptr;
  CubitFacetEdge *edge_ptr;
  CubitPoint *pts[2];
  for (int ii=0; ii<curveEdgeList.size(); ii++)
  {
    fe_ptr = curveEdgeList.get_and_step();
    edge_ptr = dynamic_cast<CubitFacetEdge *> (fe_ptr);
    assert(edge_ptr != NULL);
    for (int jj=0; jj<2; jj++)
    {
      pts[jj] = edge_ptr->point(jj);
      if (inclusive)
      {
        point_list.append(pts[jj]);
      }
      else
      {
        if (pts[jj] != startPoint && pts[jj] != endPoint)
        {
          point_list.append(pts[jj]);
        }
      }
    }
  }
  point_list.uniquify_ordered();
}
开发者ID:chrismullins,项目名称:cgma,代码行数:36,代码来源:ChollaCurve.cpp

示例3: 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);
}
开发者ID:tenpercent,项目名称:cp-sandbox,代码行数:36,代码来源:GeometryHealerTool.cpp

示例4: assert

//-------------------------------------------------------------------------
// Purpose       : Insert an entry
//
// Special Notes : 
//
// Creator       : Jason Kraftcheck
//
// Creation Date : 12/19/01
//-------------------------------------------------------------------------
CubitStatus CompositeGeom::insert( int index, GeometryEntity* geom_ptr, 
                                   CubitSense sense )
{
  if( index < 0 )
  {
    assert( index >= 0 );
    index = 0;
  }
  else if( index > entityList.size() )
  {
    assert( index <= entityList.size() );
    index = entityList.size();
  }
  
  CompositeEntry ent;
  ent.entity  = geom_ptr;
  ent.sense   = sense;
  ent.dist_sqr = ent.measure = 0.;

  //force 0th surface to be one that has the composite attrib on it.
  DLIList<CubitSimpleAttrib> list;
  geom_ptr->get_simple_attribute(COMPOSITE_DATA_ATTRIB_NAME,list);
  if( list.size() )
    index = 0;

  entityList.insert( ent, index );

  update_cached_data();
   
  return CUBIT_SUCCESS;
}
开发者ID:chrismullins,项目名称:cgma,代码行数:40,代码来源:CompositeGeom.cpp

示例5: get_attributes

//-------------------------------------------------------------------------
// Purpose       : Get named attributes
//
// Special Notes : 
//
// Creator       : Jason Kraftcheck
//
// Creation Date : 03/03/03
//-------------------------------------------------------------------------
void CompositeGeom::get_attributes( const char* name,
                                    DLIList<CubitSimpleAttrib>& list )
{
  if (entityList.size() == 1)
  {
      // handle 8.1 attribs on single-entity 'composites'
    list.clean_out();
    entityList[0].entity->get_simple_attribute(COMPOSITE_DATA_ATTRIB_NAME,list);
    while (list.size())
    {
      CubitSimpleAttrib attrib = list.pop();
      if (attrib.int_data_list()[0] == 1)
      {
        entityList[0].entity->remove_simple_attribute_virt(attrib);
        std::vector<CubitString> s(attrib.string_data_list().begin()+1, attrib.string_data_list().end());
        std::vector<int> i(attrib.int_data_list().begin()+1, attrib.int_data_list().end());
        CubitSimpleAttrib new_attrib(&s, &attrib.double_data_list(), &i);
        entityList[0].entity->append_simple_attribute_virt(new_attrib);
      }
    }
    
    entityList[0].entity->get_simple_attribute(name, list);
  }
    
  for (CompositeAttrib* ptr = listHead; ptr; ptr = ptr->next)
    if (ptr->name() == name)
      list.append(ptr->csa());
}
开发者ID:chrismullins,项目名称:cgma,代码行数:37,代码来源:CompositeGeom.cpp

示例6: point_project

CubitStatus point_project()
{
  GeometryQueryTool *gti = GeometryQueryTool::instance();

  const char *argv = "box-w-hole.brep";
  CubitStatus status = read_geometry(1, &argv);
  if (status == CUBIT_FAILURE) exit(1);
  
  DLIList<Body*> test_bodies;
  gti->bodies(test_bodies);
  DLIList<Surface*> surfaces;
  BodySM* body = test_bodies.get()->get_body_sm_ptr();
  body->surfaces(surfaces);
  Surface* surf;
  for (int i = 0 ; i <  surfaces.size(); i++)
  {
    surf = surfaces.get_and_step();
    double d = surf->measure();
    if (d < 82.1 && d > 81.9)
      break;
  } 
  CubitVector point(1,1,-5); 
  CubitVector on_surf;
  surf->closest_point_trimmed(point, on_surf); 
  assert (fabs(on_surf.z() + 5) < 0.0001);
  assert (on_surf.y() < 1.001 && on_surf.y() > 0.999);
  assert (on_surf.x() < 2.122 && on_surf.x() > 2.121 );

  CubitVector p1(0, 1.5, -6 );
  surf->closest_point_trimmed(p1, on_surf);
  assert (fabs(on_surf.z() + 5) < 0.0001);
  assert (on_surf.y() < 2.122 && on_surf.y() > 2.121);
  assert (on_surf.x() < 0.0001 && on_surf.x() > -0.0001 );
  return CUBIT_SUCCESS;
}
开发者ID:chrismullins,项目名称:cgma,代码行数:35,代码来源:point_project.cpp

示例7: 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);
  }
}
开发者ID:chrismullins,项目名称:cgma,代码行数:7,代码来源:DagDrawingTool.cpp

示例8: 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;
}
开发者ID:chrismullins,项目名称:cgma,代码行数:36,代码来源:ChollaSkinTool.cpp

示例9: merge_unique

  /*! 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;
          }
        }
      }
    }
开发者ID:chrismullins,项目名称:cgma,代码行数:43,代码来源:DLIList.hpp

示例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;
}
开发者ID:chrismullins,项目名称:cgma,代码行数:26,代码来源:SimplifyTool.cpp

示例11: get_geometry_query_engine

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);
         }
     }
  }
}
开发者ID:tenpercent,项目名称:cp-sandbox,代码行数:34,代码来源:OCCSurface.cpp

示例12: is_sheet

//-------------------------------------------------------------------------
// Purpose       : Check if shell is a sheet.
//
// Special Notes : 
//
// Creator       : Jason Kraftcheck
//
// Creation Date : 01/15/04
//-------------------------------------------------------------------------
CubitBoolean Shell::is_sheet()
{
  DLIList<RefFace*> faces;
  ref_faces(faces);
  while (faces.size())
    if ( ! faces.pop()->is_nonmanifold(this) )
      return CUBIT_FALSE;
  return CUBIT_TRUE;
}  
开发者ID:chrismullins,项目名称:cgma,代码行数:18,代码来源:Shell.cpp

示例13: assert

//----------------------------------------------------------------
// Function: to update the core Surface
//           for any movement  or Boolean operation of the body.
// Author: Jane Hu
//----------------------------------------------------------------
CubitStatus OCCSurface::update_OCC_entity( BRepBuilderAPI_Transform *aBRepTrsf,
                                         BRepAlgoAPI_BooleanOperation *op)
{
  assert(aBRepTrsf != NULL || op != NULL);

  TopoDS_Shape shape;
  if (aBRepTrsf)
    shape = aBRepTrsf->ModifiedShape(*get_TopoDS_Face());
  else
  {
    TopTools_ListOfShape shapes;
    shapes.Assign(op->Modified(*get_TopoDS_Face()));
    if(shapes.Extent() == 0)
         shapes.Assign(op->Generated(*get_TopoDS_Face()));
    if (shapes.Extent() == 1)
      shape = shapes.First();
    else if(shapes.Extent() > 1)
    {
      //update all attributes first.
      TopTools_ListIteratorOfListOfShape it;
      it.Initialize(shapes);
      for(; it.More(); it.Next())
      {
        shape = it.Value();
        OCCQueryEngine::instance()->copy_attributes(*get_TopoDS_Face(), shape);
      }
      shape = shapes.First();
    }
    else if(op->IsDeleted(*get_TopoDS_Face()))
      ;
    else
      return CUBIT_SUCCESS;
  }
 
  TopoDS_Face surface; 
  if(!shape.IsNull())
    surface = TopoDS::Face(shape);

  if (aBRepTrsf) 
  {
    //set the loops
    DLIList<OCCLoop *> loops;
    this->get_loops(loops);
    for (int i = 1; i <= loops.size(); i++)
    {
       OCCLoop *loop = loops.get_and_step();
       loop->update_OCC_entity(aBRepTrsf, op);
    }
    OCCQueryEngine::instance()->update_OCC_map(*myTopoDSFace, surface);
  }

  else if(op)
    update_OCC_entity(*myTopoDSFace, surface, op);

  return CUBIT_SUCCESS;
}
开发者ID:tenpercent,项目名称:cp-sandbox,代码行数:61,代码来源:OCCSurface.cpp

示例14: clean_up_attribs

//-------------------------------------------------------------------------
// Purpose       : Clean out composite attributes.
//
// Special Notes : 
//
// Creator       : Jason Kraftcheck
//
// Creation Date : 07/01/03
//-------------------------------------------------------------------------
void CompositeGeom::clean_up_attribs( GeometryEntity* ent )
{
  DLIList<CubitSimpleAttrib> list;
  ent->get_simple_attribute(COMPOSITE_DATA_ATTRIB_NAME,list);
  while (list.size())
  {
    CubitSimpleAttrib csa = list.pop();
    ent->remove_simple_attribute_virt(csa);
  }
}
开发者ID:chrismullins,项目名称:cgma,代码行数:19,代码来源:CompositeGeom.cpp

示例15: validate

int PST_Edge::validate( DLIList<PST_Edge*>& edges, CubitBoolean print )
{
  DLIList<PST_Face*> faces;
  PST_Edge::faces( edges, faces );
  
  int result = 0;
  for( int f = faces.size(); f--; )
    result += faces.get_and_step()->validate(print);
  return result;
}
开发者ID:chrismullins,项目名称:cgma,代码行数:10,代码来源:PST_Data.cpp


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