LCOV - code coverage report
Current view: top level - geom/virtual/cgm - PartitionEngine.hpp (source / functions) Hit Total Coverage
Test: coverage_sk.info Lines: 2 11 18.2 %
Date: 2020-06-30 00:58:45 Functions: 2 7 28.6 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : //-------------------------------------------------------------------------
       2                 :            : // Filename      : PartitionEngine.hpp
       3                 :            : //
       4                 :            : // Purpose       : 
       5                 :            : //
       6                 :            : // Special Notes : 
       7                 :            : //
       8                 :            : // Creator       : Jason Kraftcheck
       9                 :            : //
      10                 :            : // Creation Date : 04/23/02
      11                 :            : //-------------------------------------------------------------------------
      12                 :            : 
      13                 :            : #ifndef PARTITION_ENGINE_HPP
      14                 :            : #define PARTITION_ENGINE_HPP
      15                 :            : 
      16                 :            : #include "CubitDefines.h"
      17                 :            : #include "VGDefines.h"
      18                 :            : #include <map>
      19                 :            : #include "IntermediateGeomEngine.hpp"
      20                 :            : #include "DLIList.hpp"
      21                 :            : 
      22                 :            : class TopologyBridge;
      23                 :            : class TBPoint;
      24                 :            : class Curve;
      25                 :            : class Surface;
      26                 :            : class Lump;
      27                 :            : class LoopSM;
      28                 :            : class BodySM;
      29                 :            : 
      30                 :            : class SubSurface;
      31                 :            : class SubCurve;
      32                 :            : class SegmentedCurve;
      33                 :            : 
      34                 :            : class PartitionEntity;
      35                 :            : class PartitionBody;
      36                 :            : class PartitionLump;
      37                 :            : class PartitionShell;
      38                 :            : class PartitionCoSurf;
      39                 :            : class PartitionSurface;
      40                 :            : class PartitionCurve;
      41                 :            : class PartitionPoint;
      42                 :            : class PartitionLoop;
      43                 :            : class PartitionCoEdge;
      44                 :            : class PartPTCurve;
      45                 :            : 
      46                 :            : class PST_Point;
      47                 :            : class SubEntitySet;
      48                 :            : class FacetProjectTool;
      49                 :            : class CubitSimpleAttrib;
      50                 :            : 
      51                 :            : class CubitPoint;
      52                 :            : class CubitFacet;
      53                 :            : class CubitPointData;
      54                 :            : class CubitFacetData;
      55                 :            : class CubitFacetEdgeData;
      56                 :            : class Body;
      57                 :            : 
      58                 :            : class CubitVector;
      59                 :            : class CubitTransformMatrix;
      60                 :            : template <class X> class DLIList;
      61                 :            : 
      62                 :            : class PartitionEngine : public IntermediateGeomEngine
      63                 :            : {
      64                 :            : 
      65                 :            : public:
      66                 :            :   bool is_partition(TBOwner *bridge_owner);
      67                 :            :   bool is_composite(TBOwner *bridge_owner);
      68                 :            :   bool is_composite(TopologyBridge *bridge);
      69                 :          0 :   virtual void remove_imprint_attributes_after_modify
      70                 :            :                                 ( DLIList<BodySM*> &old_sms,
      71                 :          0 :                                 DLIList<BodySM*> &new_sms ){};
      72                 :          0 :   virtual void push_imprint_attributes_before_modify
      73                 :          0 :                      ( DLIList<BodySM*> &body_sms ){};
      74                 :          0 :   virtual void push_named_attributes_to_curves_and_points
      75                 :          0 :                      ( DLIList<TopologyBridge*> &tb_list, const char *name_in ){};
      76                 :          0 :   virtual void attribute_after_imprinting(DLIList<TopologyBridge*> &tb_list,
      77                 :          0 :                                           DLIList<Body*> &old_bodies){};
      78                 :          0 :   virtual void remove_attributes_from_unmodifed_virtual(DLIList<TopologyBridge*> &bridges){};
      79                 :            : 
      80                 :            : 
      81                 :            : 
      82                 :            :   virtual ~PartitionEngine();
      83                 :            : 
      84                 :            :   /** Get singleton instance */
      85                 :            :   static PartitionEngine& instance();
      86                 :            :   static void delete_instance();
      87                 :            : 
      88                 :       3364 :   int level() const { return SUBCOMP_PARTITION_LAYER; }
      89                 :            : 
      90                 :            :   void notify_deactivated (PartitionBody* body);
      91                 :            :   void notify_deactivated( PartitionLump* vol);
      92                 :            :   void notify_deactivated (PartitionSurface* surface);
      93                 :            :   void notify_deactivated (PartitionCurve* curve);
      94                 :            :   void notify_deactivated (PartitionPoint* point);
      95                 :            :   void add_to_deactivated_list(PartitionBody* body);
      96                 :            :   void add_to_deactivated_list(PartitionLump* vol);
      97                 :            :   void add_to_deactivated_list(PartitionSurface* sur);
      98                 :            :   void add_to_deactivated_list(PartitionCurve* cur);
      99                 :            :   void add_to_deactivated_list(PartitionPoint* pt);
     100                 :            :   /** Restore partitions on passed geometry
     101                 :            :    *
     102                 :            :    * Reads partition geometry saved as attributes on the passed
     103                 :            :    * geometry, restores the partitions and udpates the passed
     104                 :            :    * list
     105                 :            :    */
     106                 :            :   CubitStatus import_geometry( DLIList<TopologyBridge*>& imported_geometry );
     107                 :            : 
     108                 :            :   /** Save partition geometry.
     109                 :            :    *
     110                 :            :    * Saves any partition geometry in the passed list (or on children
     111                 :            :    * of entities int the passed list) as attributes on the underlying
     112                 :            :    * geometry, and update the passed list to contain the underlying
     113                 :            :    * geometry.
     114                 :            :    */
     115                 :            :   CubitStatus export_geometry( DLIList<TopologyBridge*>& geometry_to_save );
     116                 :            : 
     117                 :            :   /** Partition a curve
     118                 :            :    *
     119                 :            :    * @param curve The curve to partition
     120                 :            :    * @param u     The location at which to split the curve.
     121                 :            :    * @return      The new point created at the split location.
     122                 :            :    */
     123                 :            :   TBPoint* insert_point( Curve* curve, double u );
     124                 :            :   
     125                 :            :   /** Undo curve partitioning or point-curve creation.
     126                 :            :    * 
     127                 :            :    * @param point The point to remove.
     128                 :            :    * @param dead_curves If non-null, polulated with pointers to the
     129                 :            :    *                    destroyed PartitionCurves (pointers are by
     130                 :            :    *                    definition stale pointers.)
     131                 :            :    * @return The surviving curve, or null if a point-curve was removed..
     132                 :            :    */
     133                 :            :   Curve* remove_point( PartitionPoint* point, 
     134                 :            :                        PartitionCurve* dead_curves[2] = 0 );
     135                 :            :   
     136                 :            :   /** Single-surface interface to insert_curve(DLIList<Surface*>&,...)
     137                 :            :    *
     138                 :            :    * @see insert_curve( DLIList<Surface*>&, DLIList<CubitVector*>&, DLIList<Surface*>,& DLIList<Curve*>& ) 
     139                 :            :    */                   
     140                 :            :   Surface* insert_curve( Surface* surface, 
     141                 :            :                          DLIList<CubitVector*>& segment_points,
     142                 :            :                          DLIList<Curve*>& new_curves,
     143                 :            :                          const double *tolerance_length = NULL);
     144                 :            :   
     145                 :            :   /** Partition surfaces
     146                 :            :    * 
     147                 :            :    * Split surfaces by projecting the passed polyline onto the patch
     148                 :            :    * of surfaces.
     149                 :            :    * @param surfaces     The list of surfaces to split.
     150                 :            :    * @param polyline     The curve to imprint the surfaces with.
     151                 :            :    * @param new_surfaces Populated with new surfaces created during partitioning.
     152                 :            :    * @param polyline_curves Popolated with new curves.
     153                 :            :    */
     154                 :            :   CubitStatus insert_curve( DLIList<Surface*>& surfaces,
     155                 :            :                             DLIList<CubitVector*>& polyline,
     156                 :            :                             DLIList<Surface*>& new_surfaces,
     157                 :            :                             DLIList<Curve*>& polyline_curves,
     158                 :            :                             const double *tolerance_length = NULL,
     159                 :            :                             DLIList<Surface*>* surfs_to_reverse = NULL);
     160                 :            :   
     161                 :            :   /** Imprint a point on a surface, creating a zero-length (point) curve.
     162                 :            :    *
     163                 :            :    * Imprint a point on a surface, creating a zero-length (point) curve.
     164                 :            :    * @param surface  The surface on which to create the point-curve
     165                 :            :    * @param position The location on the surface at which to create the point.
     166                 :            :    * @return         The point created (and owned by the point-curve).  The
     167                 :            :    *                 point curve will be the only parent curve of this point.
     168                 :            :    */
     169                 :            :   TBPoint* insert_point_curve( Surface* surf,
     170                 :            :                              const CubitVector& position,
     171                 :            :                              Surface *&partitioned_surf );
     172                 :            : 
     173                 :            :   /** Partition a lump.
     174                 :            :    *
     175                 :            :    * Create a new surface in the lump as a copy of the passed surface.
     176                 :            :    * This function may partition the lump if the surface copy divides
     177                 :            :    * a shell of the lump into two distinct regions.
     178                 :            :    * @param surface_to_copy  The geometry from which to create the new surface
     179                 :            :    * @param lump             The lump into which the surface is to be inserted.
     180                 :            :    * @return If an error occured, the return value will be NULL.  If the lump
     181                 :            :    *         was split, the return value will be the new lump.  Otherwise it
     182                 :            :    *         will be the passed lump.
     183                 :            :    */
     184                 :            :   Lump* insert_surface( Surface* surf_to_copy, Lump* lump );
     185                 :            :   
     186                 :            :   /** Partition a lump.
     187                 :            :    *
     188                 :            :    * Create a new surface in the lump from the passed facet patch.
     189                 :            :    * This function may partition the lump if the surface divides
     190                 :            :    * a shell of the lump into two distinct regions.
     191                 :            :    * @param facets  The geometry from which to create the new surface
     192                 :            :    * @param lump    The lump into which the surface is to be inserted.
     193                 :            :    * @return If an error occured, the return value will be NULL.  If the lump
     194                 :            :    *         was split, the return value will be the new lump.  Otherwise it
     195                 :            :    *         will be the passed lump.
     196                 :            :    */
     197                 :            :   Surface* insert_surface( DLIList<CubitFacet*>& facets, Lump* lump );
     198                 :            :   
     199                 :            :   
     200                 :            :   /** Undo surface partitioning
     201                 :            :    *
     202                 :            :    * Remove a previously inserted split curve.
     203                 :            :    * @param curve The curve to remove.
     204                 :            :    * @param dead_surfs If non-null, will be populated with pointers to
     205                 :            :    *                   any surfaces destroyed by this operation.
     206                 :            :    * @return The surviving surface.
     207                 :            :    */
     208                 :            :   Surface* remove_curve( PartitionCurve* curve,
     209                 :            :                          PartitionSurface* dead_surfs[2] = 0 );                 
     210                 :            :   
     211                 :            :   /** Undo lump partitioning
     212                 :            :    *
     213                 :            :    * Remove a previously inserted split surface.
     214                 :            :    * @param surface The surface to remove.
     215                 :            :    * @return The surviving lump.
     216                 :            :    */
     217                 :            :   Lump* remove_surface( PartitionSurface* surface );
     218                 :            : 
     219                 :            :   /** Return layer in the TopologyBridge graph that this engine handles */
     220                 :      19134 :   int layer() { return SUBCOMP_PARTITION_LAYER; }
     221                 :            :   
     222                 :            :   //static void destroy_facet( CubitFacetData* facet );
     223                 :            :   
     224                 :            :   /** Add SubEntitySet to ID map (used for save/restore */
     225                 :            :   CubitStatus add_to_id_map( SubEntitySet* set, int unique_id );
     226                 :            : 
     227                 :            :   /** Remove SubEntitySet from ID map (used for save/restore */
     228                 :            :   CubitStatus remove_from_id_map( SubEntitySet* set, int unique_id );
     229                 :            : 
     230                 :            :   /** Retreive SubEntitySet from ID map given ID. */
     231                 :            :   SubEntitySet* get_from_id_map( int unique_id );
     232                 :            : 
     233                 :            :   /** Retreive a PartitionEntity given ID pair.
     234                 :            :    *
     235                 :            :    * PartitionEntities are identified by the ID of their
     236                 :            :    * SubEntitySet and the ID of the entity in that set. 
     237                 :            :    * Retreive the PartitionEntity given these IDs.
     238                 :            :    *
     239                 :            :    * @param set_id The UniqueID of the SubEntitySet.
     240                 :            :    * @param geom_id The ID of the PartitionEntity within the
     241                 :            :    *                SubEntitySet
     242                 :            :    * @param default_set The SubEntitySet to retreive the 
     243                 :            :    *                entity from if the set_id == 0.
     244                 :            :    * @return The requested PartitionEntit, or NULL if it does
     245                 :            :    *         not exist.
     246                 :            :    */
     247                 :            :   PartitionEntity* entity_from_id( int set_id, int geom_id, 
     248                 :            :                                    SubEntitySet& default_set );
     249                 :            :   
     250                 :            :   
     251                 :            :   /** Destroy a surface and child topology.  
     252                 :            :    *
     253                 :            :    * Destroy a surface with no parent topology, destroying any
     254                 :            :    * child topology that is used only by the passed surface.
     255                 :            :    */
     256                 :            :   CubitStatus destroy_surface( PartitionSurface* surface );
     257                 :            :   
     258                 :            :   /** Destroy a lump and child topology.  
     259                 :            :    *
     260                 :            :    * Destroy the passed lump and any child topology used
     261                 :            :    * only by the passed lump.
     262                 :            :    */
     263                 :            :   CubitStatus destroy_lump( PartitionLump* lump );
     264                 :            : 
     265                 :            :   static void delete_facet( CubitFacet* );
     266                 :            : 
     267                 :            :   CubitStatus delete_solid_model_entities( PartitionBody* body,
     268                 :            :                                            BodySM*& real_body );
     269                 :            :   CubitStatus delete_solid_model_entities( PartitionSurface* surface,
     270                 :            :                                            Surface*& real_surface );
     271                 :            :   CubitStatus delete_solid_model_entities( PartitionCurve* curve,
     272                 :            :                                            Curve*& real_curve );
     273                 :            : 
     274                 :            :   static void curves_from_surfaces( const DLIList<PartitionSurface*>& input_surfs,
     275                 :            :                                     DLIList<PartitionCurve*>& output_curves );
     276                 :            : 
     277                 :            :   void clean_out_deactivated_geometry();
     278                 :            :   
     279                 :            :   CubitStatus translate( PartitionBody* ent, const CubitVector& delta );
     280                 :            :   CubitStatus rotate( PartitionBody* ent, const CubitVector& axis, double degrees );
     281                 :            :   CubitStatus scale( PartitionBody* ent, const CubitVector& factors );
     282                 :            :   CubitStatus reflect( PartitionBody* ent, const CubitVector& axis );
     283                 :            :   CubitStatus restore_transform( PartitionBody* ent );
     284                 :            :   
     285                 :            :   CubitStatus translate( PartitionEntity* ent, const CubitVector& delta );
     286                 :            :   CubitStatus rotate( PartitionEntity* ent, const CubitVector& axis, double degrees );
     287                 :            :   CubitStatus scale( PartitionEntity* ent, const CubitVector& factors );
     288                 :            :   CubitStatus reflect( PartitionEntity* ent, const CubitVector& axis );
     289                 :            : 
     290                 :            :   CubitStatus notify_transform( TopologyBridge* bridge,
     291                 :            :                                 const CubitTransformMatrix& xform );
     292                 :            :    
     293                 :            :   void remove_attributes( DLIList<TopologyBridge*> &bridge_list );
     294                 :            :     //remove Composite attributes off of topology bridges
     295                 :            :   virtual void remove_modified(DLIList<Surface*> &all_surfs,
     296                 :            :     DLIList<Curve*> &all_curves, DLIList<TBPoint*> &all_pts);
     297                 :            :     
     298                 :            :   void get_tbs_with_bridge_manager_as_owner( TopologyBridge *source_bridge, 
     299                 :            :                                                DLIList<TopologyBridge*> &tbs );
     300                 :            : private:
     301                 :            : 
     302                 :            :   CubitStatus notify_transform_internal( TopologyBridge* bridge,
     303                 :            :                                 const CubitTransformMatrix& xform );
     304                 :            : 
     305                 :            :   PartitionEngine();
     306                 :            : 
     307                 :            :   friend class PartitionLumpImprint;
     308                 :            : 
     309                 :            :   /** Find location to insert a curve into a loop.
     310                 :            :    *
     311                 :            :    * Given a curve and an end point on the curve, find
     312                 :            :    * the two coedges in the loop between which the curve
     313                 :            :    * should be inserted.
     314                 :            :    *
     315                 :            :    *@param surface The surface the curve is to be inserted into.
     316                 :            :    *@param curve   The curve to be inserted.
     317                 :            :    *@param point   The end point of the curve to find the loop intersection for
     318                 :            :    *@param previous A CoEdge ending at the passed point (output).
     319                 :            :    *@param next     A CoEdge beginning at the passed point (output).
     320                 :            :    */
     321                 :            :   CubitStatus find_coedges( PartitionSurface* surface,
     322                 :            :                             PartitionCurve* curve,
     323                 :            :                             PartitionPoint* point,
     324                 :            :                             PartitionCoEdge*& previous,
     325                 :            :                             PartitionCoEdge*& next );
     326                 :            :   
     327                 :            :   /** Helper function for find_coedges(..).
     328                 :            :    *
     329                 :            :    * Use facet connectivity to find next/prev curve in loop.
     330                 :            :    *
     331                 :            :    *@param surface The owning surface
     332                 :            :    *@param edge    A facet edge owned by the surface
     333                 :            :    *@param point   The facet point to search around
     334                 :            :    *@param backwards The search direction (false for clockwise)
     335                 :            :    *@return The next curve in the specified order around the passed facet point.
     336                 :            :    */
     337                 :            :   PartitionCurve* next_curve_around_point( PartitionSurface *const surface,
     338                 :            :                                            CubitFacetEdgeData *const edge,
     339                 :            :                                            CubitPointData *const point,
     340                 :            :                                            const bool backwards );
     341                 :            :   
     342                 :            : 
     343                 :            :   /** Remove a point-curve */
     344                 :            :   CubitStatus remove_point_curve( PartitionPoint* point );
     345                 :            :   
     346                 :            :   /** Create a point curve 
     347                 :            :    * 
     348                 :            :    * Create point-curve topology.
     349                 :            :    * After the surface facetting has been updated with the 
     350                 :            :    * location of a point-curve, create the point curve given
     351                 :            :    * the facet point.
     352                 :            :    *
     353                 :            :    * Called by insert_point_curve(ParttionSurface*, const CubitVector& )
     354                 :            :    */
     355                 :            :   PartitionPoint* insert_point_curve( PartitionSurface* surface,
     356                 :            :                                       CubitPointData* point );
     357                 :            :   CubitStatus insert_point_curve( PartitionSurface* surface,
     358                 :            :                                   PartPTCurve* curve,
     359                 :            :                                   bool update_topology = true );
     360                 :            :                                   
     361                 :            :   
     362                 :            :   /** Partition a curve using the passed point.
     363                 :            :    *
     364                 :            :    * Split a curve.
     365                 :            :    *
     366                 :            :    * Used by restore_from_attrib(), insert_point(PartitionCurve*,double),
     367                 :            :    * and insert_point(CubitPointData*)
     368                 :            :    *
     369                 :            :    * @param curve  The curve to split.
     370                 :            :    * @param point  The new point splitting the curve.
     371                 :            :    * @return       The new curve.
     372                 :            :    */
     373                 :            :   PartitionCurve* insert_point( PartitionCurve* curve, PartitionPoint* point );
     374                 :            :   
     375                 :            :   /** Partition surfaces
     376                 :            :    * 
     377                 :            :    * Split surfaces by projecting the passed polyline onto the patch
     378                 :            :    * of surfaces.
     379                 :            :    * @param surfaces     The list of surfaces to split.
     380                 :            :    * @param polyline     The curve to imprint the surfaces with.
     381                 :            :    * @param new_surfaces Populated with new surfaces created during partitioning.
     382                 :            :    * @param polyline_curves Popolated with new curves.
     383                 :            :    */
     384                 :            :   CubitStatus insert_curve( DLIList<PartitionSurface*>& surfaces,
     385                 :            :                             DLIList<CubitVector*>& polyline,
     386                 :            :                             DLIList<PartitionSurface*>& new_surfaces,
     387                 :            :                             DLIList<PartitionCurve*>& polyline_curves,
     388                 :            :                             const double *tolerance_length = NULL);
     389                 :            : 
     390                 :            :   /** Insert a new curve into surface topology.
     391                 :            :    *
     392                 :            :    * Insert a new curve into the topology of the passed surface,
     393                 :            :    * splitting the surface if the curve splits a loop in the surface.
     394                 :            :    *
     395                 :            :    * The surface facet connectivity is used to determine which
     396                 :            :    * curves belong with which surface after the split.  This function
     397                 :            :    * assumes that the surface facetting has already been updated with
     398                 :            :    * the projection of the new curve, and that the resulting facet 
     399                 :            :    * edges are associated with the passed curve.
     400                 :            :    * 
     401                 :            :    * Used by insert_curve(DLIList<CubitFacetEdgeData*>&), 
     402                 :            :    * and restore_from_attrib(Surface*).
     403                 :            :    *
     404                 :            :    * @param surface  The surface to split
     405                 :            :    * @param curve    The split curve
     406                 :            :    * @return NULL if an error occured, the new surface if the surface
     407                 :            :    *         was split, otherwise the passed surface.
     408                 :            :    */
     409                 :            :   PartitionSurface* insert_curve( PartitionSurface* surface, 
     410                 :            :                                   SegmentedCurve* curve );
     411                 :            :   
     412                 :            :   /** Insert a curve into surface topology.
     413                 :            :    *
     414                 :            :    * Given the imprint if a curve on the surface facetting, create
     415                 :            :    * a new curve and insert it in the surface topology, splitting
     416                 :            :    * the surface if necessary.  The surface is determined from the
     417                 :            :    * owners of the facets adjacent to the passed edges.  The new
     418                 :            :    * curve is returned.
     419                 :            :    *
     420                 :            :    * If the list of curve segments is not specified, the facet edges
     421                 :            :    * will be used to define the curve geometry.  The list of curve
     422                 :            :    * segments may optionally be specified to provide a more precise
     423                 :            :    * definition of the curve geometry.
     424                 :            :    *
     425                 :            :    * Used by insert_Curve( DLIList<Surface*>&, DLIList<CubitVector*&, ... );
     426                 :            :    */
     427                 :            :   SegmentedCurve* insert_curve( DLIList<CubitFacetEdgeData*>& facet_edges,
     428                 :            :                                 DLIList<CubitVector*>* curve_segments = 0 );
     429                 :            :   
     430                 :            :   /** Project a point into the surface facetting
     431                 :            :    *
     432                 :            :    * Project a position onto the facetting of a surface, updating
     433                 :            :    * the surface facetting to contain the resulting point.
     434                 :            :    *
     435                 :            :    * Used by insert_point_curve(Surface*, const CubitVector&), and
     436                 :            :    * restore_from_attrib(Surface*)
     437                 :            :    *
     438                 :            :    * @param surface   The surface to project onto.
     439                 :            :    * @param position  The position to project.
     440                 :            :    * @return The new facet point added to the surface facetting.
     441                 :            :    */
     442                 :            :   CubitPointData* project_to_surface( PartitionSurface* surface,
     443                 :            :                                       const CubitVector& position );
     444                 :            :   
     445                 :            :   /** Project a polyline onto a facet patch.
     446                 :            :     * 
     447                 :            :     * Project a polyline onto a patch of facets.  Modifies facets
     448                 :            :     * and updates owners of facets.  The passed facet patch will
     449                 :            :     * no longer be valid after this operation.  If necessary, the
     450                 :            :     * facets should be re-aquired from the owning geometry, which
     451                 :            :     * will have been updated appropriately.
     452                 :            :     *
     453                 :            :     * Used by insert_curve(DLIList<Surface*>&, DLIList<CubitVector*>&, ...),
     454                 :            :     * and restore_from_attrib(Surface*)
     455                 :            :     *
     456                 :            :     * @param facets       The facet patch to project onto.
     457                 :            :     * @param polyline_in  The polyline to project.
     458                 :            :     * @param polyline_out The resulting polyline created in the
     459                 :            :     *                     facetting.
     460                 :            :     * @param polyline_pts The points in the facetting corresponding to
     461                 :            :     *                     each input position in polyline_in.  List
     462                 :            :     *                     may contain NULL values.
     463                 :            :     */
     464                 :            :   CubitStatus project_to_surface( DLIList<CubitFacetData*>& facets,
     465                 :            :                                   DLIList<CubitVector*>& polyline_in,
     466                 :            :                                   DLIList<CubitFacetEdgeData*>& polyline_out,
     467                 :            :                                   DLIList<CubitPointData*>& polyline_pts,
     468                 :            :                                   const double *tolerance_length = NULL);
     469                 :            :   
     470                 :            :   /** Insert a surface into a lump
     471                 :            :    *
     472                 :            :    * Update lump topology for the creation of a new surface.  Splits
     473                 :            :    * the lump if necessary.  
     474                 :            :    *
     475                 :            :    * Used by insert_surface(Surface*,Lump*) and restore_from_attrib(Lump*)
     476                 :            :    *
     477                 :            :    * @param lump  The lump to insert the surface in
     478                 :            :    * @param surf  The surface to insert
     479                 :            :    * @return      NULL if an error occured, the new lump if the passed
     480                 :            :    *              lump was split, or the passed lump otherwise.
     481                 :            :    */
     482                 :            :   PartitionLump* insert_surface( PartitionLump* lump, PartitionSurface* surf );
     483                 :            :   
     484                 :            :   
     485                 :            :   /** Find or create the owning body for a new PartitionPoint */
     486                 :            :   PartitionBody* make_body( PartitionPoint* pt );
     487                 :            :   /** Find or create the owning body for a new PartitionCurve */
     488                 :            :   PartitionBody* make_body( PartitionCurve* curve );
     489                 :            :   /** Find or create the owning body for a new PartitionSurface */
     490                 :            :   PartitionBody* make_body( PartitionSurface* surf );
     491                 :            :   /** Find or create the owning body for a new PartitionLump */
     492                 :            :   PartitionBody* make_body( PartitionLump* lump );
     493                 :            :   /** Common code used by make_body(..) methods. */
     494                 :            :   PartitionBody* make_body_internal( TopologyBridge* child_ptr );
     495                 :            : 
     496                 :            :   /** Replicate topology in partition layer */
     497                 :            :   PartitionLump* replace_lump( Lump* lump );
     498                 :            :   /** Remove partition layer topolgy and restore real topology */
     499                 :            :   Lump* restore_lump( PartitionLump* lump );
     500                 :            :   /** Helper for destroying PartitionLump topology*/
     501                 :            :   CubitStatus destroy_shell( PartitionShell* shell );
     502                 :            : 
     503                 :            : 
     504                 :            : public: /* temporarily public for debugging */
     505                 :            :   /** Replicate topology in partition layer */
     506                 :            :   SubSurface* replace_surface( Surface* surface );
     507                 :            : private:
     508                 :            :   /** Remove partition layer topolgy and restore real topology */
     509                 :            :   Surface* restore_surface( SubSurface* surface );
     510                 :            : 
     511                 :            :   /** Replicate topology in partition layer */
     512                 :            :   SubCurve* replace_curve( Curve* curve );
     513                 :            :   /** Remove partition layer topolgy and restore real topology */
     514                 :            :   Curve* restore_curve( SubCurve* curve );
     515                 :            :   
     516                 :            :   /** Replicate topology in partition layer */
     517                 :            :   PartitionPoint* replace_point( TBPoint* point );
     518                 :            :   /** Remove partition layer topolgy and restore real topology */
     519                 :            :   TBPoint* restore_point( PartitionPoint* point );
     520                 :            :   
     521                 :            :   /** Split a surface
     522                 :            :    * 
     523                 :            :    * Split surface and move loops to new surface.
     524                 :            :    * When inserting a curve results in a loop being split 
     525                 :            :    * (or a new hole-loop being created) this method is called.
     526                 :            :    * This method uses facet connectivity and facet-owenr 
     527                 :            :    * associativity to move the appropriate surface facets
     528                 :            :    * and PartitionLoops to the new surface.
     529                 :            :    *
     530                 :            :    * Used by insert_curve(PartitionSurface*, SegmentedCurve*).
     531                 :            :    *
     532                 :            :    *@param surface   The surface to split.
     533                 :            :    *@param new_curve A coedge owning the curve that caused the split.
     534                 :            :    *@return NULL if an error occured, the new surface if one was
     535                 :            :    *        created, or the passed surface if the surface isn't to
     536                 :            :    *        be split yet.
     537                 :            :    */
     538                 :            :   PartitionSurface* split_surface( PartitionSurface* surface, 
     539                 :            :                                    PartitionCoEdge* new_curve );
     540                 :            :   
     541                 :            :   /** Split a lump
     542                 :            :    *
     543                 :            :    * Split a lump and move shells to new lump.
     544                 :            :    * If inserting a surface could potentially result in the
     545                 :            :    * lump being partitioned, this method is called to attempt
     546                 :            :    * to split the shell and move the appropriate shells to the
     547                 :            :    * new lump.
     548                 :            :    *
     549                 :            :    * Called by insert_surface( PartitionLump*, PartitionSurface*)
     550                 :            :    *
     551                 :            :    *@param shell  The shell that is potentially to be split.
     552                 :            :    *@return NULL if an error occured, a pointer to the new lump
     553                 :            :    *        if the shell was split.  The orignal shells owner otherwise.
     554                 :            :    */
     555                 :            :   PartitionLump* split_lump( PartitionShell* shell );
     556                 :            :   
     557                 :            :   /** Split a shell
     558                 :            :    *
     559                 :            :    * Check if a shell can be split, and if so split it.
     560                 :            :    *
     561                 :            :    * Called by split_lump(PartitionShell*) and remove_surface(PartitionSurface*)
     562                 :            :    */
     563                 :            :   PartitionShell* split_shell( PartitionShell* shell );
     564                 :            :   
     565                 :            :   /** Put non-manifold surfaces in appropriate shell.
     566                 :            :    *
     567                 :            :    * After a shell is split, figure out which of the new shells
     568                 :            :    * each surface in the passed list of non-manifold surfaces belongs 
     569                 :            :    * in, and add it to that shell.
     570                 :            :    *
     571                 :            :    * Called by split_shell(PartitionShell*)
     572                 :            :    *
     573                 :            :    * @param surfaces  A list of non-manifold surfaces with co-surfaces
     574                 :            :    *                  already created, but not beloning to any shell.
     575                 :            :    * @param shell1    One of the two shells.
     576                 :            :    * @param shell2    The other of the two shells.
     577                 :            :    */
     578                 :            :   void insert_nonmanifold_surfaces( DLIList<PartitionSurface*>& surfaces,
     579                 :            :                              PartitionShell* shell1, PartitionShell* shell2);
     580                 :            :   
     581                 :            :   /** Test if a surface is on the inside of a shell.
     582                 :            :    *
     583                 :            :    * Given a surface which shares at least one curve with the
     584                 :            :    * boundary of the shell (i.e. two non-manifold surfaces in the
     585                 :            :    * shell), determine if the surface is inside or outside of the
     586                 :            :    * shell.
     587                 :            :    *
     588                 :            :    * This is a helper function for insert_nonmanifold_surfaces(..)
     589                 :            :    */
     590                 :            :   CubitStatus inside_shell( PartitionShell* const shell, 
     591                 :            :                             PartitionSurface* const surf, 
     592                 :            :                             bool& result );
     593                 :            :   
     594                 :            :   /** Save partition curve geometry as attributes.*/
     595                 :            :   CubitStatus save_curves( SubEntitySet* curve_set );
     596                 :            :   /** Save surface partitions as attributes. */
     597                 :            :   CubitStatus save_surfaces( SubEntitySet* surface_set );
     598                 :            :   /** Save lump partitions as attributes. */
     599                 :            :   CubitStatus save_lumps( SubEntitySet* lump_set );
     600                 :            :   
     601                 :            :   /** Restore curve partitions from attributes */
     602                 :            :   CubitStatus restore_from_attrib( Curve* partitioned_curve );
     603                 :            :   /** Restore surface partitions from attributes */
     604                 :            :   CubitStatus restore_from_attrib( Surface* partitioned_surface );
     605                 :            :   /** Restore lump partitions from attributes */
     606                 :            :   CubitStatus restore_from_attrib( Lump* partitioned_lump );
     607                 :            :   
     608                 :            :   static PartitionEngine* instance_;
     609                 :            : 
     610                 :            :   /** Map for getting a SubEntitySet given its unique ID */  
     611                 :            :   std::map<int,SubEntitySet*> uniqueIdMap;
     612                 :            : 
     613                 :            :   DLIList<TopologyBridge*> deactivatedList;
     614                 :            : };
     615                 :            : 
     616                 :            : #endif

Generated by: LCOV version 1.11