LCOV - code coverage report
Current view: top level - geom/cgm - RefGroup.hpp (source / functions) Hit Total Coverage
Test: coverage_sk.info Lines: 6 8 75.0 %
Date: 2020-06-30 00:58:45 Functions: 3 4 75.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : //- Class:       RefGroup
       2                 :            : //- Description: The RefGroup class contains the reference entity structure
       3                 :            : //-              for bodies. It contains the standard information such as
       4                 :            : //-              meshed status, etc.
       5                 :            : //- Owner:       Ted Blacker
       6                 :            : //- Checked by:  Greg Sjaardema, 2/28/94
       7                 :            : //- Version: $Id: 
       8                 :            : 
       9                 :            : #ifndef REFGROUP_HPP
      10                 :            : #define REFGROUP_HPP
      11                 :            : 
      12                 :            : #include "RefCollection.hpp"
      13                 :            : #include "CubitObserver.hpp"
      14                 :            : 
      15                 :            : class CubitBox;
      16                 :            : template <class X> class DLIList;
      17                 :            : class RefGroup;
      18                 :            : class RefVolume;
      19                 :            : class RefFace;
      20                 :            : class RefEdge;
      21                 :            : class RefVertex;
      22                 :            : class RefEntity; 
      23                 :            : 
      24                 :            : class CUBIT_GEOM_EXPORT RefGroup : public RefCollection,
      25                 :            :                  public CubitObserver
      26                 :            : {       
      27                 :            : 
      28                 :            : public:
      29                 :            : 
      30                 :            :   friend class RefEntityFactory;
      31                 :            :     //- the factory is allowed to call the (private) constructors
      32                 :            : 
      33                 :            :   friend class TDCAGE;
      34                 :            :   
      35                 :            : protected:  /* Delete using RefGroup::delete_group(..) */
      36                 :            :   virtual ~RefGroup();
      37                 :            :     //- Class destructor
      38                 :            : 
      39                 :            : public:
      40                 :            : 
      41                 :         88 :   static const char* get_class_name()
      42                 :            :      {
      43                 :         88 :        return "Group";
      44                 :            :      }
      45                 :            : 
      46                 :         88 :   virtual const char* class_name() const
      47                 :            :      {
      48                 :         88 :        return get_class_name();
      49                 :            :      }
      50                 :            :   
      51                 :            :   int maximum_dimension();
      52                 :            :     //- This routine returns the maximum dimension of its owned subentities.
      53                 :            :     //- The 'only' kludge is that if one of its subentities is a RefGroup, it
      54                 :            :     //- must call 'maximum_dimension' on that entity instead of dimension().
      55                 :            : 
      56                 :       8612 :   virtual const std::type_info& entity_type_info() const
      57                 :       8612 :       { return typeid(RefGroup); }
      58                 :            :     //- return the type for this geometryEntity
      59                 :            :     
      60                 :          0 :   DagType dag_type() const
      61                 :          0 :     { return DagType::invalid_type(); }
      62                 :            : 
      63                 :            :   virtual CubitStatus add_ref_entity(RefEntity *ref_entity, bool emit_event = false);
      64                 :            :   virtual CubitStatus add_ref_entity(DLIList<RefEntity*>& entity_list, bool emit_event = false);
      65                 :            :   virtual CubitStatus remove_ref_entity(RefEntity *ref_entity,
      66                 :            :                                         bool emit_event = false);
      67                 :            :   virtual CubitStatus remove_ref_entity(DLIList<RefEntity*>& entity_list,
      68                 :            :                                         bool emit_event = false);
      69                 :            :   
      70                 :            :     //- add or remove one or more ref entities to/from this group
      71                 :            : 
      72                 :            :   virtual void get_sub_entities(DLIList<RefEntity*> &entity_list);
      73                 :            :     //- appends all ref entities owned by this entity and recurses
      74                 :            :     //- down to dimension 0
      75                 :            : 
      76                 :            :   virtual void is_mergeable(AutoMergeStatus val);
      77                 :            :   bool is_mergeable() { return RefEntity::is_mergeable(); }
      78                 :            :   
      79                 :            :   int remove_all_ref_entities();
      80                 :            :   //- remove all geometry entities in the group.  
      81                 :            :   //- Returns number of items removed.
      82                 :            : 
      83                 :            :   virtual void get_parent_ref_entities(DLIList<RefEntity*>&);
      84                 :            :     //- appends all ref entities that own this to entity_list.
      85                 :            :     //- Goes up just one dimension.
      86                 :            : 
      87                 :            :   virtual void get_child_ref_entities(DLIList<RefEntity*>& entity_list);
      88                 :            :     //- appends all immediate ref entities owned by this entity on entity_list
      89                 :            :     //- Goes down just one dimension.
      90                 :            :   
      91                 :            :   RefEntity* get_child_ref_entity_by_index(const std::type_info& entity_type, int index);
      92                 :            :     //- Gets the ref entity of type entity_type at specified index in the list.
      93                 :            : 
      94                 :            :   int get_num_child_ref_entities_by_type(const std::type_info &entity_type);
      95                 :            :     //- Gets the number of ref entities of type entity_type in the list.
      96                 :            : 
      97                 :            :   virtual void get_child_entities(DLIList<CubitEntity*>& cub_entity_list);
      98                 :            :     //- appends all immediate ref entities owned by this entity on entity_list
      99                 :            :     //- Goes down just one dimension.
     100                 :            : 
     101                 :            :   void expand_group( DLIList<RefEntity*>& entity_list ); 
     102                 :            :     //- appends all the ref entities owned by this group.  It will go down
     103                 :            :     //- until there are no ref-groups in the entity_list.
     104                 :            : 
     105                 :            :   virtual CubitBox bounding_box();
     106                 :            :   virtual CubitVector center_point();
     107                 :            :   
     108                 :            :   int subtract(RefGroup *group_to_subtract, RefGroup *target_group);
     109                 :            :     //- subtract group_to_subtract from this group
     110                 :            :   
     111                 :            :   int intersect(RefGroup *other_group, RefGroup *target_group);
     112                 :            :     //- intersect other_group with this one
     113                 :            :   
     114                 :            :   int unite(RefGroup *other_group, RefGroup *target_group);
     115                 :            :     //- unite other_group with this one
     116                 :            : 
     117                 :            :   virtual int validate();
     118                 :            :     //- Return number of problems detected, 0 if none.
     119                 :            :   
     120                 :            :   //virtual void draw (int color);
     121                 :            :     //- draw the group's contained entities
     122                 :            : 
     123                 :            :   static CubitStatus delete_group (RefGroup *group_ptr,
     124                 :            :                                    CubitBoolean propagate = CUBIT_FALSE);
     125                 :            :     //- deletes a specified group from the global group list
     126                 :            :     //- if the boolean "propagate" is true, the groups sub_groups are 
     127                 :            :     //- deleted also; as well as the sub_group's groups, etc..
     128                 :            : 
     129                 :            :   static void delete_all_groups ();
     130                 :            :     //- deletes all the groups from the model (except for 'picked_group' and 'drawn_group')
     131                 :            : 
     132                 :            :   static void get_contained_groups (RefGroup *group_ptr,
     133                 :            :                                     DLIList<RefGroup*> &contained_groups);
     134                 :            :     //- gets the groups owned by group_ptr, as well as any other groups
     135                 :            :     //- owned by these groups, etc..  Current group (group_ptr) is also 
     136                 :            :     //- added to the list.
     137                 :            : 
     138                 :            :   static void get_groups_within( CubitEntity* cubit_entity_ptr, 
     139                 :            :                                  DLIList<RefGroup*> &groups_within,
     140                 :            :                                  const CubitBoolean recursive = CUBIT_TRUE);
     141                 :            :   static void get_groups_within( RefEntity* ref_entity_ptr, 
     142                 :            :                                  DLIList<RefGroup*> &groups_within,
     143                 :            :                                  const CubitBoolean recursive = CUBIT_TRUE);
     144                 :            :   static void get_groups_within( RefGroup* ref_group_ptr, 
     145                 :            :                                  DLIList<RefGroup*> &groups_within,
     146                 :            :                                  const CubitBoolean recursive = CUBIT_TRUE);
     147                 :            :     //- Finds those groups which contain the input entity, at any level
     148                 :            :     //-  (i.e., if group 2 contains group 3 which contains the entity, then
     149                 :            :     //-  group 2 and group 3 will be returned in the output list).
     150                 :            : 
     151                 :            :   void notify_observer(const CubitEvent *observer_event);
     152                 :            :     //- handle notify observer function
     153                 :            : 
     154                 :            : protected:
     155                 :            : 
     156                 :            :   DLIList<RefEntity*>  entityList;
     157                 :            :   
     158                 :            :   int recursionMark;
     159                 :            :   
     160                 :            :   RefGroup(int proe_type); 
     161                 :            :     // For Pro/E parts and assemblies (avoids notify). 1=assembly, 2=part
     162                 :            :     //- Class contructors
     163                 :            : 
     164                 :            :   RefGroup(const char* name = NULL, int id = 0);
     165                 :            :   RefGroup (DLIList<RefEntity*>& entity_list);
     166                 :            :     //- need constructors accessable from derived classes
     167                 :            :   
     168                 :            : private:
     169                 :            : 
     170                 :            : };
     171                 :            : 
     172                 :            : #endif // REFGROUP_HPP
     173                 :            : 

Generated by: LCOV version 1.11