LCOV - code coverage report
Current view: top level - geom/cgm - GeometryModifyTool.hpp (source / functions) Hit Total Coverage
Test: coverage_sk.info Lines: 19 28 67.9 %
Date: 2020-06-30 00:58:45 Functions: 8 15 53.3 %
Branches: 3 6 50.0 %

           Branch data     Line data    Source code
       1                 :            : /**
       2                 :            :  * \file GeometryModifyTool.hpp
       3                 :            :  *
       4                 :            :  * \brief This class provides the interface for all the geometry
       5                 :            :  *        related operations to the outside.
       6                 :            :  *
       7                 :            :  * This class is implemented using the Singleton pattern.
       8                 :            :  *
       9                 :            :  * \author Xuechen Liu
      10                 :            :  *
      11                 :            :  * \date 07/11/96
      12                 :            :  *
      13                 :            :  */
      14                 :            : 
      15                 :            : #ifndef GEOMETRYMODIFYTOOL_HPP 
      16                 :            : #define GEOMETRYMODIFYTOOL_HPP
      17                 :            : 
      18                 :            : #include <stdio.h>
      19                 :            : #include <map>
      20                 :            : 
      21                 :            : #include "CubitDefines.h"
      22                 :            : #include "GeometryDefines.h"
      23                 :            : #include "CubitBox.hpp"
      24                 :            : #include "CubitVector.hpp"
      25                 :            : #include "DLIList.hpp"
      26                 :            : #include "CGMGeomConfigure.h"
      27                 :            : #include "FacetShapeDefs.hpp"
      28                 :            : #include "CubitColor.hpp"
      29                 :            : 
      30                 :            : class CoEdgeSM;
      31                 :            : class LoopSM;
      32                 :            : class CubitPlane;
      33                 :            : class Surface;
      34                 :            : class Lump; 
      35                 :            : class Curve;
      36                 :            : class Body;
      37                 :            : class RefVertex;
      38                 :            : class RefEdge;
      39                 :            : class RefFace;
      40                 :            : class RefVolume;
      41                 :            : class RefVertex;
      42                 :            : class RefFace;
      43                 :            : class RefVolume;
      44                 :            : template <class X> class DLIList;
      45                 :            : class Loop;
      46                 :            : class LoopSM;
      47                 :            : class RefEntity;
      48                 :            : class CoEdgeSM;
      49                 :            : class Surface;
      50                 :            : class ShellSM;
      51                 :            : class Lump;
      52                 :            : class TopologyEntity;
      53                 :            : class TopologyBridge;
      54                 :            : class ShellSM;
      55                 :            : class GeometryModifyEngine;
      56                 :            : class TopologyBridge;
      57                 :            : class TopologyEntity;
      58                 :            : class BodySM;
      59                 :            : class Surface;
      60                 :            : class Curve;
      61                 :            : class TBPoint;
      62                 :            : class GeometryEntity;
      63                 :            : 
      64                 :            : 
      65                 :            : //! Interface class for modifying geometry. 
      66                 :            : class CUBIT_GEOM_EXPORT GeometryModifyTool
      67                 :            : {
      68                 :            : 
      69                 :            :   friend class MergeTool;
      70                 :            : public :
      71                 :            : 
      72                 :            :   /*!
      73                 :            :     *  \return GeometryModifyTool* - Pointer to the singleton GeometryModifyTool object
      74                 :            :     *  \arg SMEPtr
      75                 :            :     *   Pointer to a SolidModelingEngine object. The default value
      76                 :            :     *   is set to NULL.
      77                 :            :     *
      78                 :            :     *  Return a pointer to the only instance of the class with the default
      79                 :            :     *  solid modeling engine (SME) set to the argument, if it is not NULL.
      80                 :            :     *  If the argument is NULL, return the pointer to the existing
      81                 :            :     *  instance without modifying the default SME. A valid SMEPtr *must*
      82                 :            :     *  be supplied at the time of the first call to this function.
      83                 :            :     *  Hence, this instance function should specifically be called at
      84                 :            :     *  startup with a valid non-NULL input SMEPtr.
      85                 :            :     */
      86                 :            :   static GeometryModifyTool* instance( GeometryModifyEngine* GMEPtr = NULL);
      87                 :            : 
      88                 :            :   static void delete_instance();
      89                 :            : 
      90                 :            :   //! \brief Destructor.
      91                 :            :   ~GeometryModifyTool();
      92                 :            : 
      93                 :            :   /*! Creates an  sphere and assigns it to a Body $
      94                 :            :     *  {radius} input radius
      95                 :            :     *  Returns the new Body or NULL
      96                 :            :     */
      97                 :            :   //! \brief Creates a sphere.
      98                 :            :   Body* sphere( double radius,
      99                 :            :                 int x_shift = 0,
     100                 :            :                 int y_shift = 0,
     101                 :            :                 int z_shift = 0,
     102                 :            :                 double inner_radius = 0,
     103                 :            :                 bool delete_side = false );
     104                 :            :   
     105                 :            :   /*!  Creates an  cuboid and assigns it to a Body $
     106                 :            :     *  {wid, dep, hi} input width, depth, height
     107                 :            :     *  Returns the new Body or NULL
     108                 :            :     */
     109                 :            :   //! \brief Creates a brick (cube).
     110                 :            :   Body* brick( double wid, double dep, double hi );
     111                 :            : 
     112                 :            :   /*!  Creates an  cuboid and assigns it to a Body $
     113                 :            :     *  {center, axes, extension} input center, xyz axes, extension
     114                 :            :     *     (extension vector is 1/2 width, height, depth)
     115                 :            :     *  If one of dimensions is zero a planar sheet should be created.
     116                 :            :     *  Returns the new Body or NULL
     117                 :            :     */
     118                 :            :   //! \brief Creates a brick (cube).
     119                 :            :   Body* brick( const CubitVector &center,
     120                 :            :                const CubitVector axes[3],
     121                 :            :                const CubitVector &extension );
     122                 :            : 
     123                 :            :   /*!  Creates an  prism and assigns it to a Body $
     124                 :            :     *  {height, major, minor} input height, major and minor radii. $
     125                 :            :     *  {sides} input number of sides. Must be >= 3.
     126                 :            :     *  Returns the new Body or NULL
     127                 :            :     */
     128                 :            :   //! \brief Creates a brick (cube).
     129                 :            :   Body* prism( double height, int sides, double major, double minor );
     130                 :            : 
     131                 :            :   /*!  Creates an  pyramid and assigns it to a Body $
     132                 :            :     *  {height, major, minor} input height, major and minor radii. $
     133                 :            :     *  {sides} input number of sides. Must be >= 3.
     134                 :            :     *  {top} radius at top of pyramid.
     135                 :            :     *  Returns the new Body or NULL
     136                 :            :     */
     137                 :            :   //! \brief Creates a pyramid. 
     138                 :            :   Body* pyramid( double height, int sides, double major, double minor,
     139                 :            :                  double top=0.0 );
     140                 :            : 
     141                 :            :   /*!  Creates an  frustum and assigns it to a Body $
     142                 :            :     *  {hi} input height $
     143                 :            :     *  {r1} input radius in x-direction at base $
     144                 :            :     *  {r2} input radius in y-direction at base $
     145                 :            :     *  {r3} input radius in x-direction at top
     146                 :            :     *  Returns the new Body or NULL
     147                 :            :     */
     148                 :            :   //! \brief Creates a clyinder. 
     149                 :            :   Body* cylinder( double hi, double r1, double r2, double r3 );
     150                 :            : 
     151                 :            :   /*!  Creates an  torus and assigns it to a Body $
     152                 :            :     *  {r1} input major_radius $
     153                 :            :     *  {r2} input minor_radius
     154                 :            :     *  Returns the new Body or NULL
     155                 :            :     */
     156                 :            :   //! \brief Creates a torus. 
     157                 :            :   Body* torus( double r1, double r2 );
     158                 :            : 
     159                 :            :   /*! Creates a Body consisting of a planar sheet (no volume)
     160                 :            :     * p1 - 1st corner of the sheet
     161                 :            :     * p2 - 2nd corner of the sheet
     162                 :            :     * p3 - 3rd corner of the sheet
     163                 :            :     * p4 - 4th corner of the sheet
     164                 :            :     */
     165                 :            :   //! \brief Creates a planar surface from using four vertices.
     166                 :            :   Body* planar_sheet( const CubitVector& p1,
     167                 :            :                       const CubitVector& p2,
     168                 :            :                       const CubitVector& p3,
     169                 :            :                       const CubitVector& p4 );
     170                 :            : 
     171                 :            :   /*!  Creates an body consisting of a planar sheet (no volume)
     172                 :            :     *  {center, axes, width, height} - input location, orientation and
     173                 :            :     *                                  size of sheet
     174                 :            :     *  Returns the new Body or NULL
     175                 :            :     */
     176                 :            :   //! \brief Creates a surface from using four vertices.
     177                 :            :   Body* planar_sheet( const CubitVector &center,
     178                 :            :                       const CubitVector axes[2],
     179                 :            :                       double width, double height );
     180                 :            : 
     181                 :            :   /*!  Creates an  body consisting of a planar sheet (no volume)
     182                 :            :     *  {plane} - plane it will lie in
     183                 :            :     *  {bounding_box} - 3D bounding box it must expand.  Plane will
     184                 :            :     *                   have minimal area required to just cut the box.
     185                 :            :     *  {extension_type} - 0: no extension, 1: percentage, 2: absolute
     186                 :            :     *  {extension} - distance sheet is to extend outside of bounding box
     187                 :            :     *  Returns the new Body or NULL
     188                 :            :     */
     189                 :            :   //! \brief Creates a surface from a plane and bounding box. 
     190                 :            :   Body* planar_sheet( const CubitPlane& plane,
     191                 :            :                       const CubitBox& bounding_box,
     192                 :            :                       int extension_type = 0,
     193                 :            :                       double extension = 0.0 );
     194                 :            : 
     195                 :            :   /*!  Creates a facet body based on facet information
     196                 :            :     *  {volume} - topological and facet information of the volume and 
     197                 :            :     *             underlying entities
     198                 :            :     *  {points} - a vector of doubles representing points used by
     199                 :            :     *             the facets
     200                 :            :     *  Returns the new Body or NULL
     201                 :            :     */
     202                 :            :   //! \brief Creates a volume from facet data. 
     203                 :            :   Body* create_body( VolumeFacets& volume, std::map<FacetShapes*, RefEntity*>& entity_map,
     204                 :            :                      const FacetPointSet& points, int interp_order);
     205                 :            : 
     206                 :            :   //! \brief Scale a body non-uniformly. (x,y,z directions) 
     207                 :            :   CubitStatus scale ( Body *&entity, 
     208                 :            :                       const CubitVector& point,
     209                 :            :                       const CubitVector& factors, 
     210                 :            :                       bool check_to_transform = true,
     211                 :            :                       bool preview = false,
     212                 :            :                       bool reset_preview=true);
     213                 :            : 
     214                 :            :   /*!  \return  Body*
     215                 :            :     *  \return - A pointer to a newly created body.
     216                 :            :     *  \arg body_ptr
     217                 :            :     *  A pointer to a Body which is to used to make copy.
     218                 :            :     *
     219                 :            :     *  This function makes a copy of the input Body and returns a
     220                 :            :     *  pointer to the newly created copy. The input Body and the newly
     221                 :            :     *  created Body are geometrically identical. If the copying
     222                 :            :     *  operation fails for some reason, the function returns NULL.
     223                 :            :     *  The old_to_new_map is an optional parameter that maps all
     224                 :            :     *  the entities of the original to those of the copy.
     225                 :            :     */
     226                 :            :   //! \brief Copy a Body.
     227                 :            :   Body* copy_body( Body* body_ptr,
     228                 :            :       std::map< RefEntity*, RefEntity* > *old_to_new_map = NULL );
     229                 :            : 
     230                 :            :   /*!  Takes a RefEntity (RefVertex, RefEdge, or RefFace) and creates a
     231                 :            :     *  copy of it using the make_RefXxxxx commands.
     232                 :            :     */
     233                 :            :   //! \brief Copy a RefEntity. 
     234                 :            :   RefEntity* copy_refentity( RefEntity *old_entity );
     235                 :            : 
     236                 :            :   //! \brief Turn bodies inside-out 
     237                 :            :   CubitStatus reverse( DLIList<Body*> &body_list );
     238                 :            : 
     239                 :            :   //! \brief Reverse the given faces using the solid modeller (flip normals) 
     240                 :            :   CubitStatus reverse( DLIList<RefFace*> &ref_face_list );
     241                 :            : 
     242                 :            :   /*!  Aligns the body that contains my_face to match my_face
     243                 :            :     *  with the target face..
     244                 :            :     */
     245                 :            :   //! \brief Compute the transformation required to align my_face with target_face with respect to reference_body_ptr.  
     246                 :            :   //! Then perform the transformation on all entities in entities_to_move
     247                 :            :   CubitStatus align_entities( RefFace *my_face,                          
     248                 :            :                           RefFace *target_face,
     249                 :            :                           DLIList<RefEntity*> &entities_to_move,
     250                 :            :                           bool reverse,
     251                 :            :                           CubitVector &my_center,
     252                 :            :                           CubitVector &axis_of_rot,
     253                 :            :                           CubitVector &target_center,
     254                 :            :                           double &angle,
     255                 :            :                           bool preview);
     256                 :            :   /*!   \return  CubitStatus
     257                 :            :     *    \return - success or failure
     258                 :            :     *    \arg my_face - The surface to align    
     259                 :            :     *    \arg target_face - The surface to align to
     260                 :            :     *     entities to move - Entities that will be aligned.  Must
     261                 :            :           containe body_ptr.  (can include merged ones)
     262                 :            :     *    \arg reverse - If true, normals will be pointing opposite one another.
     263                 :            :     *    \arg my_center - Returned center of rotation
     264                 :            :     *    \arg axis_of_rot - Axis of rotation
     265                 :            :     *    \arg target_center - Returned center of target face
     266                 :            :     *    \arg angle - Returned angle of rotation    
     267                 :            :     *    \arg preview -- If true, just draws the rotated edges
     268                 :            :     *   This function will rotate 'entities_to_move' about the center point
     269                 :            :     *   of my_face, such that the normal of my_face's center is aligned with 
     270                 :            :     *   the nomal at target_face's center and then translates everything
     271                 :            :     *   by a vector from my_face's center point to target_face's center point.    
     272                 :            :     */
     273                 :            : 
     274                 :            : 
     275                 :            :   //! \brief Aligns entities by rotating about them about axis from one point to another
     276                 :            :   CubitStatus align_entities(DLIList<RefEntity*> &entities_to_move,
     277                 :            :                              CubitVector &position_to_align,
     278                 :            :                              CubitVector &position_to_align_to,
     279                 :            :                              CubitVector &axis_origin,
     280                 :            :                              CubitVector &axis_of_rot,
     281                 :            :                              double &angle_of_rotation,
     282                 :            :                              bool preview);
     283                 :            : 
     284                 :            :     /*!  \return  CubitStatus
     285                 :            :     *    \return - success or failure
     286                 :            :     *    \arg entities - Entities to align
     287                 :            :     *    \arg position_to_align - Where the angle of rotation starts
     288                 :            :     *    \arg position_to_align_to - Where the angle of rotation ends
     289                 :            :     *    \arg axis_origin - Origin of axis_or_rot
     290                 :            :     *    \arg axis_of_rot - Axis of rotation
     291                 :            :     *    \arg angle_of_rotation - Returned angle of rotation
     292                 :            :     *    \arg preview -- If true, just draws the rotated edges
     293                 :            :     *   This function will rotate 'entities_to_move' about an axis defined by 
     294                 :            :     *   axis_origin and axis_of_rot.  The angle of rotation about the axis 
     295                 :            :     *   (right-hand-rule) is the angle between two vectors, v1 and v2, where 
     296                 :            :     *   v1 and v2 are vectors perpendicular to the axis, to position_to_align 
     297                 :            :     *   and position_to_align_to respectively.
     298                 :            :     */
     299                 :            : 
     300                 :            : 
     301                 :            :   //! \brief Aligns a the normal of a surface or a line to a plane. 
     302                 :            :   CubitStatus align_entities( DLIList<RefEntity*>& reference_entities,
     303                 :            :                               DLIList<RefEntity*> &entities_to_move,
     304                 :            :                               CubitVector align_to_vec,                          
     305                 :            :                               CubitVector &my_center,                          
     306                 :            :                               CubitVector &axis_of_rot,
     307                 :            :                               double &angle,                          
     308                 :            :                               bool preview );
     309                 :            :     /*!  \return  CubitStatus
     310                 :            :     *    \return - success or failure    
     311                 :            :     *    \arg ref_ent_list - The plane you want to align to, defined by 
     312                 :            :           either 2 vertices or a surface    
     313                 :            :     *     entities to move - Entities that will be aligned (can include merged ones).
     314                 :            :     *    \arg align_to_vec - Vector defining the plane to align to
     315                 :            :     *    \arg my_center_1 - Returned center of rotation
     316                 :            :     *    \arg axis_of_rot - Returned axis of rotation
     317                 :            :     *    \arg angle - Returned angle of rotation
     318                 :            :     *    \arg preview -- If true, just draws the rotated edges
     319                 :            :     *   If ref_ent_list contains a surface, A, this function will rotate 
     320                 :            :     *  entities_to_move about A's center point so that A's normal at the center 
     321                 :            :     *  point is aligned with vec_to_align_to.
     322                 :            :     *   If ref_ent_list contains two vertices, this function will rotate 
     323                 :            :     *  entities_to_move about the first vertex so that a vector from vertex 1
     324                 :            :     *  to vertex 2 is aligned with vec_to_align_to. 
     325                 :            :     */
     326                 :            : 
     327                 :            : 
     328                 :            : 
     329                 :            : 
     330                 :            :   
     331                 :            :   /*!  This function accepts two bodies in the first list.  The second body
     332                 :            :        in the list is subtracted from and the first and the result is put
     333                 :            :        into the outsideBodies list.  intersectBodies list is the result of 
     334                 :            :        intersecting the original two bodies in the first list. 
     335                 :            :   */ 
     336                 :            :   //! \brief Intersects and subtracts the two bodies in the list. 
     337                 :            :   CubitStatus chop( DLIList<Body*> &bodies,
     338                 :            :                     DLIList<Body*> &intersectBodies,
     339                 :            :                     DLIList<Body*> &outsideBodies,
     340                 :            :                     Body*& leftoversBody,
     341                 :            :                     bool keep_old = false,
     342                 :            :                     bool nonreg = false );
     343                 :            : 
     344                 :            :   CubitStatus hollow( DLIList<Body*>& bodies,
     345                 :            :                       DLIList<RefFace*> faces_to_remove,
     346                 :            :                       DLIList<Body*>& new_bodies,
     347                 :            :                       double depth);
     348                 :            : 
     349                 :            :   //! \brief Thickens a sheet body (surface) into a solid body.  Can do both directions. 
     350                 :            :   CubitStatus thicken( DLIList<Body*>& bodies,
     351                 :            :                        DLIList<Body*>& new_bodies,
     352                 :            :                        double depth,
     353                 :            :                        bool both = false );
     354                 :            :   //! \brief Boolean unite.
     355                 :            :   CubitStatus unite( DLIList<Body*> &bodies,
     356                 :            :                      DLIList<Body*> &newBodies,
     357                 :            :                      bool keep_old = false );
     358                 :            : 
     359                 :            :   //! \brief Boolean unite.
     360                 :            :   CubitStatus unite( DLIList<BodySM*> &body_sm_list,
     361                 :            :                      DLIList<BodySM*> &new_body_sm_list,
     362                 :            :                      bool keep_old = false);
     363                 :            : 
     364                 :            :   //! \brief Boolean subtract.   
     365                 :            :   CubitStatus subtract( DLIList<Body*> &tool_body_list, 
     366                 :            :                         DLIList<Body*> &from_bodies,
     367                 :            :                         DLIList<Body*> &new_bodies,
     368                 :            :                         bool imprint = false,
     369                 :            :                         bool keep_old = false );
     370                 :            : 
     371                 :            :   //! \brief Boolean subtract.  Subtracts the tool from all the blanks.
     372                 :            :   CubitStatus subtract( Body* tool_body, 
     373                 :            :                         DLIList<Body*> &from_bodies,
     374                 :            :                         DLIList<Body*> &new_bodies,
     375                 :            :                         bool imprint = false,
     376                 :            :                         bool keep_old = false );
     377                 :            : 
     378                 :            :   /*! \brief Checks for consistent normals across body. Uses surf_ref
     379                 :            :     as a reference surface.  All other surfaces in volume should have 
     380                 :            :     normal point in likewise direction (in or out of volume).
     381                 :            :     */
     382                 :            :   //! \brief Checks for consistent normals across body.  
     383                 :            :   CubitStatus validate_normals( DLIList<Body*>& bodies,
     384                 :            :                                 RefFace *surf_ref,
     385                 :            :                                 bool reverse );
     386                 :            :   
     387                 :            :   //! \brief Boolean intersect.
     388                 :            :   CubitStatus intersect( Body *tool_body_ptr, 
     389                 :            :                          DLIList<Body*> &from_bodies,
     390                 :            :                          DLIList<Body*> &new_bodies,
     391                 :            :                          bool keep_old = false,
     392                 :            :                          bool preview = false );
     393                 :            : 
     394                 :            :   //! \brief Boolean intersect.
     395                 :            :   CubitStatus intersect( DLIList<Body*> &from_bodies,
     396                 :            :                          DLIList<Body*> &new_bodies,
     397                 :            :                          bool keep_old = false,
     398                 :            :                          bool preview = false);
     399                 :            : 
     400                 :            :   /*!  Cuts the given bodies with the points defining a plane.
     401                 :            :     *  This is mainly used for vis purposes to section a body with
     402                 :            :     *  a plane and only retain half of it.
     403                 :            :     */
     404                 :            :   //! \brief Cuts body with plane, throwing away one side.
     405                 :            :   CubitStatus section( DLIList<Body*> &section_body_list,
     406                 :            :                        const CubitVector &point_1,
     407                 :            :                        const CubitVector &point_2,
     408                 :            :                        const CubitVector &point_3,
     409                 :            :                        DLIList<Body*> &new_body_list,
     410                 :            :                        CubitBoolean keep_normal_side,
     411                 :            :                        CubitBoolean keep_old = CUBIT_FALSE );
     412                 :            : 
     413                 :            :   //! \brief Splits periodic curves and surfaces.
     414                 :            :   CubitStatus split_periodic( Body *body_ptr,
     415                 :            :                               Body *&new_body_ptr );
     416                 :            :   
     417                 :            :   //! \brief Stitches sheet bodies at common edges to form larger sheet body or solid. 
     418                 :            :   CubitStatus stitch( DLIList<Body*> &bodies_to_stitch,
     419                 :            :                       DLIList<Body*> &result_list,
     420                 :            :                       bool tighten_gaps,
     421                 :            :                       double tolerance = -1.0 );
     422                 :            : 
     423                 :            :   //! \brief Beta function.
     424                 :            :   CubitStatus discover_topology(RefFace *ref_face_ptr,
     425                 :            :                                 CubitVector &pos,
     426                 :            :                                 double &step_size,
     427                 :            :                                 int num_subdivisions);
     428                 :            : 
     429                 :            :   CubitStatus imprint_and_merge_curves(RefEdge *curve1, 
     430                 :            :                                        RefEdge *curve2, 
     431                 :            :                                        DLIList<RefVertex*> &vert_list, 
     432                 :            :                                        double divergence_angle,
     433                 :            :                                        DLIList<DLIList<RefEdge*>*> &curves_to_merge1,
     434                 :            :                                        DLIList<DLIList<RefEdge*>*> &curves_to_merge2,
     435                 :            :                                        DLIList<DLIList<RefEdge*>*> &prev_curve_merge_lists,
     436                 :            :                                        DLIList<DLIList<RefFace*>*> &prev_surf_merge_lists);
     437                 :            : 
     438                 :            : #ifdef KCM_MESH_TO_GEOM  
     439                 :            :   //! \brief Convert mesh entities to  geometry.
     440                 :            :   CubitStatus mesh2brep(std::vector<double> &xvals,
     441                 :            :                         std::vector<double> &yvals,
     442                 :            :                         std::vector<double> &zvals,
     443                 :            :                         std::vector<unsigned int> &tri_connectivity,
     444                 :            :                         DLIList<BodySM*> &new_body_sms);
     445                 :            : #endif
     446                 :            : 
     447                 :            :   //! \brief Beta function.
     448                 :            :   void march_path_to_discover_horizontal(CubitVector &start_pos,
     449                 :            :                   CubitVector &sweep_dir,
     450                 :            :                   RefFace *start_face,
     451                 :            :                   CubitVector &march_dir,
     452                 :            :                   double &step_size,
     453                 :            :                   DLIList<CubitVector> &final_points,
     454                 :            :                   DLIList<RefFace*> &ending_faces);
     455                 :            :   void march_path_to_discover_vertical(CubitVector &start_pos,
     456                 :            :                  CubitVector &sweep_dir,
     457                 :            :                  RefFace *start_face,
     458                 :            :                  CubitVector &march_dir,  // should be normalized
     459                 :            :                  double &step_size,
     460                 :            :                  DLIList<CubitVector> &final_points,
     461                 :            :                  DLIList<RefFace*> &ending_faces);
     462                 :            :   void march_using_planes(CubitVector &point_on_surf,
     463                 :            :                           RefFace *surf,
     464                 :            :                           CubitVector &march_dir,
     465                 :            :                           double step_size,
     466                 :            :                           DLIList<CubitVector> &horizontal_points,
     467                 :            :                           DLIList<CubitVector> &vertical_points);
     468                 :            :   void trace_out_curves(Body *plane_body,
     469                 :            :                         CubitVector &start_point,
     470                 :            :                         CubitVector &march_dir,
     471                 :            :                         double step_size,
     472                 :            :                         DLIList<CubitVector> &horizontal_points,
     473                 :            :                         DLIList<CubitVector> &vertical_points);
     474                 :            : 
     475                 :            :   //! \brief Beta function.
     476                 :            :   void subdivide_pie(CubitVector &dir1, CubitVector &dir2, int num_subdivisions,
     477                 :            :                                        DLIList<CubitVector> &all_directions);
     478                 :            :   
     479                 :            :   /*! Split function for simple surface splitting.  Temporary Curves are
     480                 :            :     * created on the RefFace and used to split the RefFace.  The curves are
     481                 :            :     * created from the input vec_lists (straight lines, arcs or splines).
     482                 :            :     * The input locations are the original input locations from the user,
     483                 :            :     * which are displayed for user reference.  If the preview_flg is CUBIT_TRUE,
     484                 :            :     * the curves are displayed but no splitting occurs.  If the preview_flg is
     485                 :            :     * CUBIT_TRUE and the create_ref_edges_flg is CUBIT_TRUE, then RefEdges are
     486                 :            :     * created (but no splitting occurs).  The clear_previous_previews flag
     487                 :            :     * controls whether previous previews are cleared from the graphics window
     488                 :            :     * (only applicable if preview_flg is CUBIT_TRUE).
     489                 :            :     */
     490                 :            :   //! \brief Splits a surface with a curve defined by positions.
     491                 :            :   CubitStatus split_surface( RefFace *ref_face_ptr,
     492                 :            :                              DLIList<CubitVector*> &locations,
     493                 :            :                              DLIList<DLIList<CubitVector*>*> &vec_lists,
     494                 :            :                              CubitBoolean preview_flg = CUBIT_FALSE,
     495                 :            :                              CubitBoolean create_ref_edges_flg = CUBIT_FALSE,
     496                 :            :                              CubitBoolean clear_previous_previews = CUBIT_TRUE );
     497                 :            : 
     498                 :            : 
     499                 :            :   /*! Same behavior as other split_surface function only it handles multiple surface
     500                 :            :       and multiple lists of curves.
     501                 :            :     */
     502                 :            :   //! \brief Splits MULTIPLE surfaces with a curves defined by positions.
     503                 :            :   CubitStatus split_surface( DLIList<RefFace*> &ref_face_list,
     504                 :            :                              DLIList<CubitVector*> &locations,
     505                 :            :                              DLIList<DLIList<DLIList<CubitVector*>*>*> &list_of_vec_lists,
     506                 :            :                              CubitBoolean preview_flg = CUBIT_FALSE,
     507                 :            :                              CubitBoolean create_ref_edges_flg = CUBIT_FALSE,
     508                 :            :                              CubitBoolean clear_previous_previews = CUBIT_TRUE );
     509                 :            : 
     510                 :            :   /*!  Splits surfaces by extending curves at the end of hardlines across the
     511                 :            :     *   surface.  Only works on planar surfaces and by extending linear curves.
     512                 :            :     *   If specified vertex list is provided, only try to extend curves
     513                 :            :     *   attached to those vertices, and error out if unable to perform the
     514                 :            :     *   operation using any vertex.  If no vertex list is provided, find
     515                 :            :     *   appropriate vertices automatically, and limit the split to gaps less
     516                 :            :     *   than or equal to the specified "split surface extend gap threshold".
     517                 :            :     *   {ref_face_list} - list of connected surfaces to split
     518                 :            :     *   {ref_vertex_list} - (OPTIONAL) - vertices to extend from. Function will
     519                 :            :     *                       error out if unable to extend from any vertex. If
     520                 :            :     *                       not supplied, function will automatically find
     521                 :            :     *                       valid vertices to extend from on the surfaces (AUTO
     522                 :            :     *                       mode), and will limit the split to gaps less than
     523                 :            :     *                       or equal to the specified extend gap threshold (see
     524                 :            :     *                       setting below).
     525                 :            :     *   {preview_flg} - routine only displays graphics preview of splits
     526                 :            :     *   {create_ref_edges_flg} - valid only if preview_flg=CUBIT_TRUE.  If
     527                 :            :     *                            CUBIT_TRUE, create RefEdges *instead* of
     528                 :            :     *                            splitting.
     529                 :            :     * Note: this function uses SplitSurfaceTool.  Three other settings can be
     530                 :            :     *       specified that control this function.  They are (static):
     531                 :            :     *         SplitSurfaceTool::set_extend_gap_threshold - for AUTO mode,
     532                 :            :     *          only split the surface if distance is less than or equal to
     533                 :            :     *          this value.
     534                 :            :     *         SplitSurfaceTool::set_extend_tolerance - snaps to vertices along
     535                 :            :     *           curves within this tolerance so as to avoid creating short
     536                 :            :     *           curves when splitting surfaces.
     537                 :            :     *         SplitSurfaceTool:set_extend_normal - if TRUE, if a projection
     538                 :            :     *          normal to the curve is less distance than a projection in the
     539                 :            :     *          direction of the curve, use the normal projection instead.
     540                 :            :     */
     541                 :            :   //! \brief  Splits surfaces by extending curves at the end of hardlines across the surface.
     542                 :            :   CubitStatus split_surfaces_extend( DLIList<RefFace*> &ref_face_list,
     543                 :            :                                      DLIList<RefVertex*> &ref_vertex_list,
     544                 :            :                                      CubitBoolean preview_flg = CUBIT_FALSE,
     545                 :            :                                      CubitBoolean create_ref_edges_flg = CUBIT_FALSE );
     546                 :            : 
     547                 :            :   /*!  Splits a surface or connected set of surfaces in one direction.
     548                 :            :     *   Particularly useful for splitting fillets to prepare the model
     549                 :            :     *   for sweeping.
     550                 :            :     *   {ref_face_list} - list of connected surfaces to split
     551                 :            :     *   {num_segs} - number of segments to create (i.e, 2 segments
     552                 :            :     *                means to split the surface in the middle).
     553                 :            :     *   {fraction} - the fraction along the surfaces to split, not valid if
     554                 :            :     *                num_segs > 2.  This value is not used if a distance is
     555                 :            :     *                specified instead.
     556                 :            :     *   {distance} - if 2 segments, allow the split to be at a
     557                 :            :     *                user specified distance across the surface.  Specify
     558                 :            :     *                -1.0 to use the fraction instead.
     559                 :            :     *   {from_curve_ptr} - (OPTIONAL) if user specified a fraction or distance,
     560                 :            :     *                      orient from this curve.  If not specified, a
     561                 :            :     *                      default is chosen automatically.
     562                 :            :     *   {corner_vertex_list} - (OPTIONAL) user can specify corners of surface
     563                 :            :     *                       patch.  Optional, if ommitted routine
     564                 :            :     *                       will attempt to use smallest angle criteria
     565                 :            :     *                       to pick corners.  User should specify corners
     566                 :            :     *                       in ccw order - split direction will be
     567                 :            :     *                       perpendicular to edge between first two
     568                 :            :     *                       corners, unless curve_dir_ptr is specified
     569                 :            :     *                       which overrides this direction.
     570                 :            :     *   {curve_dir_ptr} - (OPTIONAL) user specifies split direction - valid only
     571                 :            :     *                     for a single input surface (not a chain).
     572                 :            :     *                     Can be NULL, in which case the routine will
     573                 :            :     *                     split along longest aspect ratio (ie.,
     574                 :            :     *                     along a fillet)
     575                 :            :     *   {through_vertex_list} - (OPTIONAL) user specifies forced vertices for
     576                 :            :     *                           the split to run through (on curves).  Not valid
     577                 :            :     *                           with more than 2 segments.
     578                 :            :     *   {preview_flg} - routine only displays graphics preview of split
     579                 :            :     *   {create_ref_edges_flg} - valid only if preview_flg=CUBIT_TRUE.  If
     580                 :            :     *                            CUBIT_TRUE, create RefEdges *instead* of
     581                 :            :     *                            splitting.
     582                 :            :     * Note: this function uses SplitSurfaceTool.  Five other settings can be
     583                 :            :     *       specified that control this function.  They are (static):
     584                 :            :     *         SplitSurfaceTool::set_parametric_flg.  If TRUE, find spline
     585                 :            :     *           locations in parametric space of surface, otherwise do in 3D
     586                 :            :     *           and project  back to surface (handy if parametric space is
     587                 :            :     *           ill-formed).  DEFAULT = CUBIT_FALSE (do in 3D).  See
     588                 :            :     *           SplitSurfaceTool for more information.
     589                 :            :     *         SplitSurfaceTool::set_tolerance  Tolerance for finding split
     590                 :            :     *           location (determines how accurately curves are tessellated for
     591                 :            :     *           approximating the split location, etc.).  See SplitSurfaceTool
     592                 :            :     *           for more information.
     593                 :            :     *         SplitSurfaceTool::autoDetectTriangles.  If TRUE, detect triangles
     594                 :            :     *           on the end of surface chains automatically (see below).
     595                 :            :     *         SplitSurfaceTool::sideAngleThreshold.  The closest corner within
     596                 :            :     *           this threshold to 180 is removed (if pointAngleThreshold
     597                 :            :     *           criteria is also met).
     598                 :            :     *         SplitSurfaceTool::pointAngleThreshold.  The corner with angle
     599                 :            :     *           below this becomes the triangle point (if sideAngleThreshold
     600                 :            :     *           criteria is also met)
     601                 :            :     */
     602                 :            :   //! \brief Splits a surface or connected set of surfaces in one direction.
     603                 :            :   CubitStatus split_surfaces( DLIList<RefFace*> &ref_face_list,
     604                 :            :                               int num_segs,
     605                 :            :                               double fraction,
     606                 :            :                               double distance,
     607                 :            :                               RefEdge *from_curve_ptr,
     608                 :            :                               DLIList<RefVertex*> &corner_vertex_list,
     609                 :            :                               DLIList<RefVertex*> &through_vertex_list,
     610                 :            :                               RefEdge *curve_dir_ptr = NULL,
     611                 :            :                               CubitBoolean preview_flg = CUBIT_FALSE,
     612                 :            :                               CubitBoolean create_ref_edges_flg = CUBIT_FALSE );
     613                 :            : 
     614                 :            :   /*! Splits surfaces a specified distance from curves.
     615                 :            :   *   {ref_face_list} - list of surfaces to split
     616                 :            :   *   {edge_list} - list of curves to offset from
     617                 :            :   *   {num_segs} - number of segments to create (i.e, 2 segments
     618                 :            :   *                means to split using two offset curves).
     619                 :            :   *   {distance} - distance to offset
     620                 :            :   *   {partition_flg} - (OPTIONAL) creates partitions of the offset curves. This typically provides
     621                 :            :   *                         surfaces easily map meshed
     622                 :            :   *   {blunt_flg} - (OPTIONAL) if true the endings of the input curve graph are right angles
     623                 :            :   *                     instead of arcs
     624                 :            :   *   {preview_flg} - (OPTIONAL) user specifies forced vertices for
     625                 :            :   *                        the split to run through (on curves).  Not valid
     626                 :            :   *                        with more than 2 segments.
     627                 :            :   *   {create_ref_edges_flg} - (OPTIONAL) Create curves instead of splitting surfaces
     628                 :            :   *                                 Requires the preview flag
     629                 :            :   */
     630                 :            :   //! \brief Splits surfaces a specified distance from curves.
     631                 :            :   CubitStatus split_surfaces_offset(
     632                 :            :       DLIList<RefFace*> &ref_face_list,
     633                 :            :       DLIList<RefEdge*> &edge_list,
     634                 :            :       int num_segs,
     635                 :            :       double distance,
     636                 :            :       CubitBoolean partition_flg = CUBIT_FALSE,
     637                 :            :       CubitBoolean blunt_flg = CUBIT_FALSE,
     638                 :            :       CubitBoolean preview_flg = CUBIT_FALSE,
     639                 :            :       CubitBoolean create_ref_edges_flg = CUBIT_FALSE);
     640                 :            : 
     641                 :            :   /*! Automatically create a midsurface from a volume.
     642                 :            :   *   {body_list_in} - list of bodies to midsurface
     643                 :            :   *   {body_list_out} - resulting midsurfaces
     644                 :            :   *   {lower_tol} - lower tolerance for finding surface pairs
     645                 :            :   *   {upper_tol} - upper tolerance for finding surface pairs
     646                 :            :   *   {preview} - preview midsurfaces
     647                 :            :   */
     648                 :            :   //! \brief Create a midsurface from a volume.
     649                 :            :   CubitStatus auto_mid_surface(
     650                 :            :           DLIList<Body*> &body_list_in,
     651                 :            :           DLIList<Body*> &body_list_out,
     652                 :            :       DLIList<Body*> &old_bodies_midsurfaced,
     653                 :            :       DLIList<double> &thickness_list,
     654                 :            :       double lower_tol,
     655                 :            :       double upper_tol,
     656                 :            :       CubitBoolean delete_midsurfaced,
     657                 :            :       CubitBoolean preview);
     658                 :            :         /** Automatically create a midsurface from a volume.
     659                 :            :         *   {body_list_in} - list of bodies to midsurface
     660                 :            :         *   {body_list_out} - resulting midsurfaces
     661                 :            :     *   {thickness_list} - list of matching thickness values for the body out list
     662                 :            :         *   {lower_tol} - lower tolerance for finding surface pairs
     663                 :            :         *   {upper_tol} - upper tolerance for finding surface pairs
     664                 :            :         *   {preview} - preview midsurfaces
     665                 :            :         */
     666                 :            : 
     667                 :            :   /*!  Webcuts the bodies in the list with a cutting cylinder.
     668                 :            :     *  The cylinder is created by the given parameters.  This
     669                 :            :     *  is done in the solid modeling engine to reduce the impact
     670                 :            :     *  on body ids.
     671                 :            :     */
     672                 :            :   //! \brief Webcuts bodies with a cylinder.
     673                 :            :   CubitStatus webcut_with_cylinder( DLIList<Body*>& webcut_body_list,
     674                 :            :                                     double radius,
     675                 :            :                                     const CubitVector &axis,
     676                 :            :                                     const CubitVector& center,
     677                 :            :                                     DLIList<Body*> &results_list,
     678                 :            :                                     DLIList<Body*> &neighboring_bodies,
     679                 :            :                                     ImprintType imprint_type = NO_IMPRINT,
     680                 :            :                                     CubitBoolean merge = CUBIT_FALSE ,
     681                 :            :                                     CubitBoolean preview = CUBIT_FALSE);
     682                 :            : 
     683                 :            :     /*!  Webcuts the bodies in the list with a cutting cone.
     684                 :            :     *  The cone is created by the given parameters.  This
     685                 :            :     *  is done in the solid modeling engine to reduce the impact
     686                 :            :     *  on body ids.
     687                 :            :     */
     688                 :            :   //! \brief Webcuts bodies with a cone.
     689                 :            :   CubitStatus webcut_with_Cone( DLIList<Body*>& webcut_body_list,
     690                 :            :                                 DLIList<BodySM*> &webcut_bodySM_list,
     691                 :            :                                 double outer_radius,
     692                 :            :                                 double top_radius,
     693                 :            :                                 CubitVector &Axispt1,
     694                 :            :                                 CubitVector& Axispt2,
     695                 :            :                                 DLIList<Body*> &results_list,
     696                 :            :                                 DLIList<Body*> &neighboring_bodies,
     697                 :            :                                 ImprintType imprint_type = NO_IMPRINT,
     698                 :            :                                 CubitBoolean merge = CUBIT_FALSE ,
     699                 :            :                                 CubitBoolean preview = CUBIT_FALSE);
     700                 :            : 
     701                 :            : #ifdef CAT
     702                 :            :   CubitStatus webcut_across_translate( DLIList<Body*>& body_list,
     703                 :            :                                        RefFace* plane_surf1,
     704                 :            :                                        RefFace* plane_surf2,
     705                 :            :                                        DLIList<Body*>& results_list,
     706                 :            :                                        ImprintType imprint_type = NO_IMPRINT,
     707                 :            :                                        CubitBoolean merge = CUBIT_FALSE,
     708                 :            :                                        CubitBoolean preview = CUBIT_FALSE);
     709                 :            :   /**<  Webcuts with a flat plate to make a body suitable for single-single
     710                 :            :     *   sweeping.  Only experimental at this point.
     711                 :            :     */
     712                 :            : #endif
     713                 :            : 
     714                 :            :   /*!  Webcuts the bodies in the list with a cutting brick.
     715                 :            :     *  The brick is created by the given parameters - center of
     716                 :            :     *  brick, xyz axes, and extension.  Extension is 1/2 width,
     717                 :            :     *  height and depth. If one of the brick dimensions is zero
     718                 :            :     *  the resultant planar sheet is used to webcut (webcut_with_
     719                 :            :     *  planar_sheet is called).  Brick creation is done in the
     720                 :            :     *  solid modeling engine to reduce the impact on body ids.
     721                 :            :     */
     722                 :            :   //! \brief Webcuts bodies with a brick (cube).
     723                 :            :   CubitStatus webcut_with_brick( DLIList<Body*>& webcut_body_list,
     724                 :            :                                  const CubitVector &center,
     725                 :            :                                  const CubitVector axes[3],
     726                 :            :                                  const CubitVector &extension,
     727                 :            :                                  DLIList<Body*> &results_list,
     728                 :            :                                  DLIList<Body*> &neighbor_list,
     729                 :            :                                  ImprintType imprint_type = NO_IMPRINT,
     730                 :            :                                  CubitBoolean merge = CUBIT_FALSE,
     731                 :            :                                  CubitBoolean preview = CUBIT_FALSE);
     732                 :            : 
     733                 :            : 
     734                 :            :   /*!  Webcuts the bodies in the list with a cutting planar sheet.
     735                 :            :     *  The sheet is created by the given parameters - center of
     736                 :            :     *  sheet, xy axes, and width and height. Sheet creation is done
     737                 :            :     *  in the solid modeling engine to reduce the impact on body ids.
     738                 :            :     */
     739                 :            :   //! \brief Webcuts bodies with a planar sheet.
     740                 :            :   CubitStatus webcut_with_planar_sheet( DLIList<Body*>& webcut_body_list,
     741                 :            :                                         const CubitVector &center,
     742                 :            :                                         const CubitVector axes[2],
     743                 :            :                                         double width,
     744                 :            :                                         double height,
     745                 :            :                                         DLIList<Body*> &results_list,
     746                 :            :                                         DLIList<Body*> &neighbor_list,
     747                 :            :                                         ImprintType imprint_type = NO_IMPRINT,
     748                 :            :                                         CubitBoolean merge = CUBIT_FALSE,
     749                 :            :                                         CubitBoolean preview = CUBIT_FALSE);
     750                 :            : 
     751                 :            : 
     752                 :            :   /*!  \return  int
     753                 :            :     *  \return - Number of bodies that were webcut ( >= 0 )
     754                 :            :     *  \arg webcut_body_list
     755                 :            :     *  The list of bodies to be webcut
     756                 :            :     *  \arg plane
     757                 :            :     *  The plane to be used for webcutting.
     758                 :            :     *  \arg merge
     759                 :            :     *  A flag to decide whether the new bodies created by the
     760                 :            :     *  webcutting process should be merged or not.
     761                 :            :     *  \arg imprint
     762                 :            :     *  A flag to decide whether the new bodies created by the
     763                 :            :     *  webcutting process should be imprinted or not.
     764                 :            :     *
     765                 :            :     *  This function webcuts a list of bodies through a plane.
     766                 :            :     *  The newly created bodies are merged and imprinted depeding on
     767                 :            :     *  the respective flags.
     768                 :            :     */
     769                 :            :   //! \brief Webcuts bodies with a plane.
     770                 :            :   CubitStatus webcut_with_plane( DLIList<Body*>& webcut_body_list,
     771                 :            :                                  const CubitVector &vector1,
     772                 :            :                                  const CubitVector &vector2,
     773                 :            :                                  const CubitVector &vector3,
     774                 :            :                                  DLIList<Body*> &results_list,
     775                 :            :                                  DLIList<Body*> &neighbor_list,
     776                 :            :                                  ImprintType imprint_type = NO_IMPRINT,
     777                 :            :                                  CubitBoolean merge = CUBIT_FALSE,
     778                 :            :                                  CubitBoolean preview = CUBIT_FALSE) ;
     779                 :            : 
     780                 :            :   /*!  \return  int
     781                 :            :     *  \return - Number of bodies that were webcut ( >= 0 )
     782                 :            :     *  \arg webcut_body_list
     783                 :            :     *  The list of bodies to be webcut
     784                 :            :     *  \arg refFace
     785                 :            :     *  The refFace to be used to construct the plane for
     786                 :            :     *  webcutting.
     787                 :            :     *  \arg merge
     788                 :            :     *  A flag to decide whether the new bodies created by the
     789                 :            :     *  webcutting process should be merged or not.
     790                 :            :     *  \arg imprint
     791                 :            :     *  A flag to decide whether the new bodies created by the
     792                 :            :     *  webcutting process should be imprinted or not.
     793                 :            :     *
     794                 :            :     *  This function webcuts a list of bodies through a plane
     795                 :            :     *  defined by a refFace. The newly created bodies are
     796                 :            :     *  merged and imprinted depeding on the respective flags.
     797                 :            :     *  It returns the number of bodies that were webcut.
     798                 :            :     */
     799                 :            :   //! \brief Webcuts bodies with a surface -- must be planar.
     800                 :            :   CubitStatus webcut_with_surface( DLIList<Body*>& webcut_body_list,
     801                 :            :                                    RefFace* refFace,
     802                 :            :                                    DLIList<Body*>& results_list,
     803                 :            :                                    DLIList<Body*> &neighbor_list,
     804                 :            :                                    ImprintType imprint_type = NO_IMPRINT,
     805                 :            :                                    CubitBoolean merge = CUBIT_FALSE,
     806                 :            :                                    CubitBoolean preview = CUBIT_FALSE);
     807                 :            : 
     808                 :            :    /*!  \return  int
     809                 :            :     *  \return - Number of bodies that were webcut ( >= 0 )
     810                 :            :     *  \arg webcut_body_list
     811                 :            :     *  The list of bodies to be webcut
     812                 :            :     *  \arg refedge_list
     813                 :            :     *  The refEdge list to be used to construct the sheet body for
     814                 :            :     *  webcutting.
     815                 :            :     *  \arg merge
     816                 :            :     *  A flag to decide whether the new bodies created by the
     817                 :            :     *  webcutting process should be merged or not.
     818                 :            :     *  \arg imprint
     819                 :            :     *  A flag to decide whether the new bodies created by the
     820                 :            :     *  webcutting process should be imprinted or not.
     821                 :            :     *
     822                 :            :     *  This function webcuts a list of bodies through a sheet
     823                 :            :     *  body defined by a set of curves. The newly created bodies
     824                 :            :     *  are merged and imprinted depending on the respective flags.
     825                 :            :     *  It returns the number of bodies that were webcut.
     826                 :            :     */
     827                 :            :   //! \brief Webcuts bodies with a surface defined by a curve loop.
     828                 :            :   CubitStatus webcut_with_curve_loop( DLIList<Body*>& webcut_body_list,
     829                 :            :                               DLIList<RefEdge*>& refedge_list,
     830                 :            :                               DLIList<Body*>& results_list,
     831                 :            :                               DLIList<Body*> &neighbor_list,
     832                 :            :                               ImprintType imprint_type = NO_IMPRINT,
     833                 :            :                               CubitBoolean merge = CUBIT_FALSE,
     834                 :            :                               CubitBoolean preview = CUBIT_FALSE);
     835                 :            : 
     836                 :            :   /*!  Webcut the bodies using
     837                 :            :     *  the surface as the cutting tool.
     838                 :            :     *  This is the real webcut with surface.  The others are
     839                 :            :     *  just for planes...  The sheet body is a body with 0 volume.
     840                 :            :     */
     841                 :            :   //! \brief Webcut bodies using a surface, need to be planar. 
     842                 :            :   CubitStatus webcut_with_sheet( DLIList<Body*>& webcut_body_list,
     843                 :            :                                  Body *sheet_body,
     844                 :            :                                  DLIList<Body*> &new_bodies,
     845                 :            :                                  DLIList<Body*> &neighbor_list,
     846                 :            :                                  ImprintType imprint_type = NO_IMPRINT,
     847                 :            :                                  CubitBoolean merge = CUBIT_FALSE,
     848                 :            :                                  CubitBoolean preview = CUBIT_FALSE);
     849                 :            : 
     850                 :            :   /*!  \return  int
     851                 :            :     *  \return - Number of bodies that were webcut ( >= 0 )
     852                 :            :     *  \arg webcut_body_list
     853                 :            :     *  The list of bodies to be webcut
     854                 :            :     *  \arg plane
     855                 :            :     *  The plane to be used for webcutting.
     856                 :            :     *  \arg merge
     857                 :            :     *  A flag to decide whether the new bodies created by the
     858                 :            :     *  webcutting process should be merged or not.
     859                 :            :     *  \arg imprint
     860                 :            :     *  A flag to decide whether the new bodies created by the
     861                 :            :     *  webcutting process should be imprinted or not.
     862                 :            :     *
     863                 :            :     *  This function webcuts a list of bodies through a plane.
     864                 :            :     *  The newly created bodies are merged and imprinted depeding on
     865                 :            :     *  the respective flags.
     866                 :            :     */
     867                 :            :   //! \brief Webcuts bodies with a tool body.
     868                 :            :   CubitStatus webcut_with_body( DLIList<Body*>& webcut_body_list,
     869                 :            :                                 Body* body,
     870                 :            :                                 DLIList<Body*>& results_list,
     871                 :            :                                 DLIList<Body*> &neighbor_list,
     872                 :            :                                 ImprintType imprint_type = NO_IMPRINT,
     873                 :            :                                 CubitBoolean merge = CUBIT_FALSE,
     874                 :            :                                 CubitBoolean preview = CUBIT_FALSE);
     875                 :            : 
     876                 :            :   /*!  Create a sheet extended from the tool surfaces
     877                 :            :     *  and then uses it to webcut the bodies.
     878                 :            :     */
     879                 :            :   //! \brief Webcuts bodies by with an extended surface(s). 
     880                 :            :   CubitStatus webcut_with_extended_sheet( DLIList<Body*> &webcut_body_list,
     881                 :            :                                           DLIList<RefFace*> &ref_face_list,
     882                 :            :                                           DLIList<Body*> &new_bodies,
     883                 :            :                                           DLIList<Body*> &neighbor_list,
     884                 :            :                                           int &num_cut,
     885                 :            :                                           ImprintType imprint_type = NO_IMPRINT,
     886                 :            :                                           CubitBoolean merge = CUBIT_FALSE,
     887                 :            :                                           CubitBoolean preview = CUBIT_FALSE);
     888                 :            :   
     889                 :            :   //! \brief Webcuts bodies with a tool solid created by rotating surfaces about an axis.
     890                 :            :   CubitStatus webcut_with_sweep_surfaces_rotated(
     891                 :            :                             DLIList<Body*> &webcut_body_list,
     892                 :            :                             DLIList<RefFace*> &tool_faces,
     893                 :            :                             CubitVector &point,
     894                 :            :                             CubitVector &sweep_axis,
     895                 :            :                             double angle,
     896                 :            :                             RefFace* stop_surf,
     897                 :            :                             bool up_to_next,
     898                 :            :                             DLIList<Body*> &new_bodies,
     899                 :            :                             DLIList<Body*> &neighbor_list,
     900                 :            :                             ImprintType imprint_type = NO_IMPRINT,
     901                 :            :                             CubitBoolean merge = false,
     902                 :            :                             CubitBoolean preview = false);
     903                 :            : 
     904                 :            :   //! \brief Webcuts bodies with a tool surface created by rotating curves about an axis.
     905                 :            :   CubitStatus webcut_with_sweep_curves_rotated(
     906                 :            :                             DLIList<Body*> &webcut_body_list,
     907                 :            :                             DLIList<RefEdge*> &tool_curves,
     908                 :            :                             CubitVector &point,
     909                 :            :                             CubitVector &sweep_axis,
     910                 :            :                             double angle,
     911                 :            :                             RefFace* stop_surf,
     912                 :            :                             DLIList<Body*> &new_bodies,
     913                 :            :                             DLIList<Body*> &neighbor_list,
     914                 :            :                             ImprintType imprint_type = NO_IMPRINT,
     915                 :            :                             CubitBoolean merge = false,
     916                 :            :                             CubitBoolean preview = false);
     917                 :            : 
     918                 :            :   //! \brief Webcuts bodies with a tool solid created by sweeping surfaces along a vector.
     919                 :            :   CubitStatus webcut_with_sweep_surfaces(
     920                 :            :                             DLIList<Body*> &webcut_body_list,
     921                 :            :                             DLIList<RefFace*> &tool_faces,
     922                 :            :                             const CubitVector sweep_vector,
     923                 :            :                             bool sweep_perp,
     924                 :            :                             bool through_all,
     925                 :            :                             bool outward,
     926                 :            :                             bool up_to_next,
     927                 :            :                             RefFace *stop_surf,
     928                 :            :                             RefEdge* edge_to_sweep_along,
     929                 :            :                             DLIList<Body*> &new_bodies,
     930                 :            :                             DLIList<Body*> &neighbor_list,
     931                 :            :                             ImprintType imprint_type = NO_IMPRINT,
     932                 :            :                             CubitBoolean merge = false,
     933                 :            :                             CubitBoolean preview = false);
     934                 :            : 
     935                 :            :   //! \brief Webcuts bodies with a tool surface created by sweeping curves along a vector.
     936                 :            :   CubitStatus webcut_with_sweep_curves(
     937                 :            :                             DLIList<Body*> &webcut_body_list,
     938                 :            :                             DLIList<RefEdge*> &tool_curves,
     939                 :            :                             const CubitVector sweep_vector,
     940                 :            :                             bool through_all,
     941                 :            :                             RefFace *stop_surf,
     942                 :            :                             RefEdge* edge_to_sweep_along,
     943                 :            :                             DLIList<Body*> &new_bodies,
     944                 :            :                             DLIList<Body*> &neighbor_list,
     945                 :            :                             ImprintType imprint_type = NO_IMPRINT,
     946                 :            :                             CubitBoolean merge = false,
     947                 :            :                             CubitBoolean preview = false);
     948                 :            :   
     949                 :            :   //! \brief Removes small topology; i.e, curves and surfaces.
     950                 :            :   CubitStatus remove_topology( DLIList<RefEdge*> &ref_edge_list,
     951                 :            :         DLIList<RefFace*> &ref_face_list, double backoff_distance,
     952                 :            :         double small_curve_size, DLIList<Body*> &new_body_list,
     953                 :            :         CubitBoolean propagate,
     954                 :            :         CubitBoolean preview);
     955                 :            : 
     956                 :            :   /*!  Creates curves offset from a chain of curves.  The offset direction is
     957                 :            :     *  only used if there is one linear curve.  Otherwise, the offset direction
     958                 :            :     *  is calculated by  (the cross product of the wires tangent and the
     959                 :            :     *  planar normal).  The gap type is 0 - rounded, 1 - extended, 2 - natural.
     960                 :            :     */
     961                 :            :   //! \brief Creates curves offset from a chain of curves.  The offset direction is
     962                 :            :   CubitStatus offset_curves( DLIList<RefEdge*>& ref_edge_list,
     963                 :            :                              DLIList<RefEdge*>& output_edge_list,
     964                 :            :                              double offset_distance,
     965                 :            :                              const CubitVector& offset_direction,
     966                 :            :                              int gap_type = 1 );
     967                 :            : 
     968                 :            :   /*!  Trims or extends a curve, up to the trim_vector.  If trimming, the
     969                 :            :     *  keep_vector determines which side of the curve to keep.  If the curve
     970                 :            :     *  is not free, the curve is automatically copied before trimming (so
     971                 :            :     *  a new curve results).
     972                 :            :     */
     973                 :            :   //! \brief Trims or extends a curve, up to the trim_vector.  If trimming, the
     974                 :            :   CubitStatus trim_curve( RefEdge* trim_curve,
     975                 :            :                           const CubitVector& trim_vector,
     976                 :            :                           const CubitVector& keep_vector );
     977                 :            : 
     978                 :            :   //! \brief Imprints a group of bodies with one another.
     979                 :            :   CubitStatus imprint( DLIList<Body*> &from_body_list,
     980                 :            :                        DLIList<Body*> &new_body_list,
     981                 :            :                        CubitBoolean keep_old = CUBIT_FALSE );
     982                 :            : 
     983                 :            :   /*!  Imprints a list of Bodies with a list of RefEdges.  Useful for
     984                 :            :     *  splitting surfaces.  If edge pierces a surface a hardpoint will
     985                 :            :     *  result at the pierce location.  Interface is free of  but
     986                 :            :     *  currently only works if all entities are  entities.
     987                 :            :     */
     988                 :            :   //! \brief Imprints a list of Bodies with a list of RefEdges.  Useful for
     989                 :            :   CubitStatus imprint( DLIList<Body*> &body_list,
     990                 :            :                        DLIList<RefEdge*> &ref_edge_list,
     991                 :            :                        DLIList<Body*>& new_body_list,
     992                 :            :                        CubitBoolean keep_old_body = CUBIT_FALSE,
     993                 :            :                        CubitBoolean show_messages = CUBIT_TRUE );
     994                 :            : 
     995                 :            :   /*!  Imprints a list of RefFaces with a list of RefEdges.  This is
     996                 :            :     *  useful if the user has a curve which spans several surfaces on
     997                 :            :     *  a body and only wants to imprint to selected surfaces.  Algorithm
     998                 :            :     *  does not support imprinting to free surfaces.  This method
     999                 :            :     *  is not as reliable as the function to imprint a curve to a
    1000                 :            :     *  body. Interface is free of  but currently only works if all
    1001                 :            :     *  entities are  entities.
    1002                 :            :     */
    1003                 :            :   //! Imprints a list of RefFaces with a list of RefEdges.  This is
    1004                 :            :   CubitStatus imprint( DLIList<RefFace*> &ref_face_list,
    1005                 :            :                        DLIList<RefEdge*> &ref_edge_list,
    1006                 :            :                        DLIList<Body*>& new_body_list,
    1007                 :            :                        CubitBoolean keep_old_body = CUBIT_FALSE );
    1008                 :            : 
    1009                 :            :   /**<  Imprints a list of Surfaces with list of Curves, sorted per
    1010                 :            :     *  Surface (ie., curve_lists_list is same length as surface_list).
    1011                 :            :     *  This version is more efficient than the general-purpose one
    1012                 :            :     *  above, as we know which curves to imprint with which surfaces.
    1013                 :            :     *  Also, the Curves need not be RefEntities.
    1014                 :            :     *  All input surfaces must be from the same body however.
    1015                 :            :     */
    1016                 :            :   //! \brief Imprints a list of Surfaces with list of Curves, sorted per
    1017                 :            :   CubitStatus imprint( DLIList<Surface*> &surface_list,
    1018                 :            :                        DLIList<DLIList<Curve*>*> &curve_lists_list,
    1019                 :            :                        Body*& new_body,
    1020                 :            :                        CubitBoolean keep_old_body = CUBIT_FALSE,
    1021                 :            :                        CubitBoolean expand = CUBIT_TRUE);
    1022                 :            : 
    1023                 :            :   /*!  Imprints a list of bodies to a list of locations.  Useful for
    1024                 :            :     *  splitting curves and creating hardpoints on surfaces.  Interface
    1025                 :            :     *  is free of  but currently only works if bodies are  bodies.
    1026                 :            :     */
    1027                 :            :   //! \brief Imprints a list of bodies to a list of locations.  
    1028                 :            :   CubitStatus imprint(DLIList<Body*> &body_list,
    1029                 :            :                        DLIList<CubitVector> &vector_list,
    1030                 :            :                        DLIList<Body*>& new_body_list,
    1031                 :            :                        CubitBoolean keep_old_body = CUBIT_FALSE,
    1032                 :            :                        CubitBoolean merge = CUBIT_FALSE );
    1033                 :            : 
    1034                 :            :   //HEADER- Sweep-related functions. All of these are implemented
    1035                 :            :   //HEADER- only for RefEntities whose underlying geometry is
    1036                 :            :   //HEADER- represented by a solid model such as . The interface
    1037                 :            :   //HEADER- itself is free of .
    1038                 :            : 
    1039                 :            : 
    1040                 :            :    //! \brief Imprints a list of RefFaces with a list of projected RefEdges.
    1041                 :            :    CubitStatus imprint_projected_edges( DLIList<RefFace*> &ref_face_list,
    1042                 :            :                                         DLIList<RefEdge*> &ref_edge_list,
    1043                 :            :                                         DLIList<Body*>& new_body_list,
    1044                 :            :                                         CubitBoolean keep_old_body,
    1045                 :            :                                         CubitBoolean keep_free_edges );
    1046                 :            : 
    1047                 :            :    //! \brief Imprints a list of Bodies with a list of RefEdges which are projected
    1048                 :            :    //! to a list of RefFaces
    1049                 :            :    CubitStatus imprint_projected_edges( DLIList<RefFace*> &ref_face_list,
    1050                 :            :                                         DLIList<Body*> &body_list,
    1051                 :            :                                         DLIList<RefEdge*> &ref_edge_list,
    1052                 :            :                                         DLIList<Body*>& new_body_list,
    1053                 :            :                                         CubitBoolean keep_old_body,
    1054                 :            :                                         CubitBoolean keep_free_edges );
    1055                 :            : 
    1056                 :            :   //! \brief Tolerantly imprintings a list of curves on a list of surfaces.
    1057                 :            :   //! Should be used when you have sloppy/out-of-tolerance geometry.
    1058                 :            :   CubitStatus tolerant_imprint( DLIList<RefFace*> &ref_faces,
    1059                 :            :                                 DLIList<RefEdge*> &ref_edge_list,
    1060                 :            :                                 DLIList<Body*> &new_bodies,
    1061                 :            :                                 bool merge = false );
    1062                 :            : 
    1063                 :            :   //! \brief Tolerantly imprintings a list of curves onto a single surface.
    1064                 :            :   //!  Should be used when you have sloppy/out-of-tolerance geometry.
    1065                 :            :   CubitStatus tolerant_imprint( RefFace *ref_face,
    1066                 :            :                                 DLIList<RefEdge*> &ref_edge_list,
    1067                 :            :                                 Body *&new_body, bool merge = false );
    1068                 :            : 
    1069                 :            :   //! \brief Imprints bodies onto one another.  Should be used when you have sloppy/out-
    1070                 :            :   //! of-tolerance geometry.
    1071                 :            :   CubitStatus tolerant_imprint( DLIList<Body*> &bodies, DLIList<Body*> &new_bodies,
    1072                 :            :                                 double overlap_tol,
    1073                 :            :                                 double imprint_tol, 
    1074                 :            :                                 bool merge = false );
    1075                 :            : 
    1076                 :            :   //! \brief Projects list RefEdges onto a list of RefFaces.
    1077                 :            :   CubitStatus project_edges( DLIList<RefFace*> &ref_face_list,
    1078                 :            :                               DLIList<RefEdge*> &ref_edge_list_in,
    1079                 :            :                              DLIList<RefEdge*> &ref_edge_list_new,
    1080                 :            :                              CubitBoolean trim_projected = CUBIT_FALSE);
    1081                 :            : 
    1082                 :            :   //! \brief Removes all unnessesary faces, curves, vertices from a body. 
    1083                 :            :   CubitStatus regularize_body( Body *body_ptr, Body *&new_body );
    1084                 :            : 
    1085                 :            :   //! \brief Removes all unnessesary faces, curves, vertices and associated
    1086                 :            :   //! data from a refentity.
    1087                 :            :   CubitStatus regularize_refentity( RefEntity *old_entity_ptr,
    1088                 :            :                                     Body *&new_body_ptr);
    1089                 :            :   
    1090                 :            :   //! \brief Tests if a RefEntity can have any unncessary child entities removed,
    1091                 :            :   //! or simplified away. 
    1092                 :            :   CubitStatus test_regularize_refentity( RefEntity *old_entity_ptr);
    1093                 :            : 
    1094                 :            :   CubitStatus split_free_curve( RefEdge *ref_edge,
    1095                 :            :                                 DLIList<CubitVector> &split_locations,
    1096                 :            :                                 DLIList<RefEdge*> &new_ref_edges );
    1097                 :            : 
    1098                 :            :   //! \brief Separates multi-volume bodies into single-volume bodies.
    1099                 :            :   CubitStatus split_body( Body *body_ptr,
    1100                 :            :                           DLIList<Body*> &new_bodies ) const;
    1101                 :            :     
    1102                 :            :   /*!  Separates surfaces from sheet bodies into separate bodies.  Connected
    1103                 :            :     *   surfaces will remain connected but be placed in a new body.
    1104                 :            :     */
    1105                 :            :   //! \brief Separates surfaces from sheet bodies into separate bodies.  Connected
    1106                 :            :   CubitStatus separate_surfaces( DLIList<RefFace*> &ref_face_list,
    1107                 :            :                                  DLIList<Body*> &new_bodies );
    1108                 :            : 
    1109                 :            : 
    1110                 :            :   ///< <HR><H3>GeometryModifyTool options and settings</H3>
    1111                 :            :   
    1112                 :            :   //! \brief Sets group imprint flag.
    1113                 :          0 :   static void set_group_imprint(CubitBoolean flag) {groupImprint = flag;}
    1114                 :            :   //! \brief Gets group imprint flag.
    1115                 :         62 :   static CubitBoolean get_group_imprint() {return groupImprint;}
    1116                 :            : 
    1117                 :            :   //! \brief Sets all edges imprint flag.
    1118                 :            :   static void set_all_edges_imprint( CubitBoolean flag );
    1119                 :            :   //! \brief Gets all edges imprint flag.
    1120                 :            :   static CubitBoolean get_all_edges_imprint();
    1121                 :            : 
    1122                 :            :   //! \brief Gets boolean regularize flag.
    1123                 :            :   static void boolean_regularize( CubitBoolean flag );
    1124                 :            :   //! \brief Sets boolean regularize flag.
    1125                 :            :   static CubitBoolean boolean_regularize();
    1126                 :            : 
    1127                 :            :   //! \brief Gets unite mixed models flag.
    1128                 :            :   static CubitBoolean unite_mixed_models();
    1129                 :            :   //! \brief Sets unite mixed models flag.
    1130                 :            :   static void unite_mixed_models( CubitBoolean flag );
    1131                 :            : 
    1132                 :            :   //! \brief Gets new ids flag.
    1133                 :        262 :   static CubitBoolean get_new_ids() {return newIds;}
    1134                 :            :   //! \brief Sets new ids flag.
    1135                 :          0 :   static void set_new_ids(CubitBoolean flag) {newIds = flag;}
    1136                 :            : 
    1137                 :            :   //! \brief Gets old names flag.
    1138                 :         62 :   static CubitBoolean get_old_names() { return oldNames; }
    1139                 :            :   //! \brief Sets old names flag.
    1140                 :          0 :   static void set_old_names(CubitBoolean flag) { oldNames = flag; }
    1141                 :            : 
    1142                 :            :   //! \brief Initializes all the settings in GeometryModifyTool to defaults
    1143                 :            :   static void initialize_settings();
    1144                 :            : 
    1145                 :            : 
    1146                 :            :   #ifdef PROE
    1147                 :            :   CubitStatus prepare_for_topology_update( BodySM* old_bodysm );
    1148                 :            : 
    1149                 :            :   CubitStatus finish_topology_update( BodySM* new_bodysm,
    1150                 :            :                                       Body* old_body );
    1151                 :            :   #endif
    1152                 :            : 
    1153                 :            :   //! \brief Gets the entity being copied, if any. 
    1154                 :      11108 :   static RefEntity* get_copy_entity() { return copyingEntity; }
    1155                 :            : 
    1156                 :            :   //! \brief Sets the entity being copied.
    1157                 :            :   static void set_copy_entity( RefEntity *ent) { copyingEntity = ent; }
    1158                 :            :   
    1159                 :            :   double get_resultant_angle_score(RefFace *narrow_face,
    1160                 :            :                                    RefFace *other_face,
    1161                 :            :                                    RefEdge *common_edge);
    1162                 :            : 
    1163                 :            :   double get_neighbor_type_score(RefEdge *common_edge,
    1164                 :            :                                  RefFace *other_face,
    1165                 :            :                                  double small_curve_size,
    1166                 :            :                                  int &neighbor_is_narrow_or_small);
    1167                 :            : 
    1168                 :            :   double get_dihedral_angle_score(RefFace *f1, RefFace *f2,
    1169                 :            :                                   RefEdge *common_edge);
    1170                 :            : 
    1171                 :            :   double get_edge_type_score(RefEdge *common_edge, double small_curve_size);
    1172                 :            :   double get_diff_from_multiple_of_90(double angle);
    1173                 :            :   void split_surface_with_narrow_region(RefFace *face,
    1174                 :            :                                         DLIList<CubitVector> &split_pos1_list,
    1175                 :            :                                         DLIList<CubitVector> &split_pos2_list);
    1176                 :            : 
    1177                 :            :   ///< <HR><H3>Topology/geometry creation functions</H3>
    1178                 :            : 
    1179                 :            :   /*!  \return  RefVertex*
    1180                 :            :     *  \return - A pointer to a newly created RefVertex
    1181                 :            :     *  \arg ref_vertex_type
    1182                 :            :     *  The type of the RefVertex
    1183                 :            :     *  \arg point
    1184                 :            :     *  The spatial location to use to create the RefVertex
    1185                 :            :     *  This function takes a type information and a location to create
    1186                 :            :     *  a RefVertex. The underlying representation of the RefVertex is
    1187                 :            :     *  determined by the default GeometryQueryEngine.
    1188                 :            :     *  \arg color
    1189                 :            :     *  Allows the color to define during creation
    1190                 :            :     *  defaults to CUBIT_DEFAULT_COLOR_INDEX
    1191                 :            :     */
    1192                 :            :   //! \brief Creates a point from an x,y,z location
    1193                 :            :   RefVertex* make_RefVertex(CubitVector const& point, int color = CUBIT_DEFAULT_COLOR_INDEX) const;
    1194                 :            :   RefVertex* make_RefVertex( RefVertex *vertex ) const;
    1195                 :            : 
    1196                 :            :   //! \brief Creates a sheet body from a surface.
    1197                 :            :   Body *make_Body(Surface *surface) const;
    1198                 :            : 
    1199                 :            :   /*!  \return  RefEdge*
    1200                 :            :     *  \return - A pointer to a newly created RefEdge
    1201                 :            :     *  \arg ref_edge_type
    1202                 :            :     *  The type of the RefEdge
    1203                 :            :     *  \arg ref_vertex_1
    1204                 :            :     *  The starting point of the to be created RefEdge.
    1205                 :            :     *  \arg ref_vertex_2
    1206                 :            :     *  The end point of the to be created RefEdge.
    1207                 :            :     *  \arg vector_list
    1208                 :            :     *  List of CubitVectors.
    1209                 :            :     *  \arg refface_ptr
    1210                 :            :     *  Input pointer to a RefFace -- defaults to NULL.
    1211                 :            :     *
    1212                 :            :     *  This function creates a RefEdge connected to the input RefVertices
    1213                 :            :     *  as end points. This RefEdge interpolates between the locations
    1214                 :            :     *  represented by the input set of CubitVectors. A spline curve
    1215                 :            :     *  is created. If the input refface_ptr is not NULL, the points are
    1216                 :            :     *  first moved to the surface before interpolation.
    1217                 :            :     */
    1218                 :            :   //! \brief Creates a curve from two or more points.
    1219                 :            :   RefEdge* make_RefEdge( GeometryType ref_edge_type,
    1220                 :            :                          RefVertex *ref_vertex_1,
    1221                 :            :                          RefVertex *ref_vertex_2,
    1222                 :            :                          DLIList<CubitVector*>& vector_list,
    1223                 :            :                          RefFace* reffaca_ptr = NULL ) const ;
    1224                 :            : 
    1225                 :            :   /*!  \return  RefEdge*
    1226                 :            :     *  \return - A pointer to a newly created RefEdge
    1227                 :            :     *  \arg ref_edge_type
    1228                 :            :     *  The type of the RefEdge
    1229                 :            :     *  \arg ref_vertex_1
    1230                 :            :     *  The starting point of the to be created RefEdge.
    1231                 :            :     *  \arg ref_vertex_2
    1232                 :            :     *  \arg refface_ptr
    1233                 :            :     *
    1234                 :            :     *  This function creates a RefEdge connected to the input RefVertices
    1235                 :            :     *  as end points. This is along the ref_face. It is basically a straight
    1236                 :            :     *  line along the surface.  In periodic surfaces, a third point may
    1237                 :            :     *  be used to create the give the correct direction.
    1238                 :            :     */
    1239                 :            :   //! \brief Creates a curve from two or more points, on a surface.
    1240                 :            :   RefEdge* make_RefEdge(  RefVertex *ref_vertex_1,
    1241                 :            :                           RefVertex *ref_vertex_2,
    1242                 :            :                           RefFace* ref_face_ptr,
    1243                 :            :                           RefVertex const* ref_vertex_3 = NULL ) const ;
    1244                 :            :   
    1245                 :            :   /*!  Give a certain ref edge, create a new one.
    1246                 :            :     *  This is useful when you are creating surfaces from curves already
    1247                 :            :     *  in the model.  If you use curves existing in the model (attached
    1248                 :            :     *  to other surfaces) then  will mess up.  So we basically
    1249                 :            :     *  need a copy.  This will also create new vertices...
    1250                 :            :     *  The old_to_new_map is an optional parameter that maps all
    1251                 :            :     *  the entities of the original to those of the copy.
    1252                 :            :     */
    1253                 :            :   //! \brief Create a curve from an existing curve.
    1254                 :            :   RefEdge* make_RefEdge(RefEdge *ref_edge, 
    1255                 :            :                         bool copy_attribs = true,
    1256                 :            :                         std::map< RefEntity*, RefEntity* > *old_to_new_map = NULL ) const;
    1257                 :            :   
    1258                 :            :   /*!  \return  RefEdge*
    1259                 :            :     *  \return - A pointer to a newly created RefEdge
    1260                 :            :     *  \arg ref_edge_type
    1261                 :            :     *  The type of the RefEdge
    1262                 :            :     *  \arg ref_vertex_1
    1263                 :            :     *  The starting point of the to be created RefEdge.
    1264                 :            :     *  \arg ref_vertex_2
    1265                 :            :     *  The end point of the to be created RefEdge.
    1266                 :            :     *  indermediate_point
    1267                 :            :     *  The intermediate point to be used to form the RefEdge.
    1268                 :            :     *  For a parabola, the intermediate point is the tip of the
    1269                 :            :     *  parabola. For an ellipse, the intermediate point is the
    1270                 :            :     *  center of the ellipse. If the intermediate point is does
    1271                 :            :     *  not lie at the center of a circle, an logarithmic spiral
    1272                 :            :     *  curve is generated. For straight curves this argument is
    1273                 :            :     *  ignored.
    1274                 :            :     *  \arg sense
    1275                 :            :     *
    1276                 :            :     *  The "sense" makes sense (no pun intended) only for ellipses in
    1277                 :            :     *  the XY plane. For ellipses in the XY plane, the curve can
    1278                 :            :     *  defined from point-1 to point-2 in two ways. The direction of
    1279                 :            :     *  the curve can be such that the vector going from the center to
    1280                 :            :     *  the first point can be rotated in a counter clockwise manner to
    1281                 :            :     *  reach the vector going from the center to the second point. Such
    1282                 :            :     *  an ellipse is considered to have positive or FORWARD sense. When
    1283                 :            :     *  the curve is defined in the other direction it is considered to
    1284                 :            :     *  have a negative or REVERSED sense.
    1285                 :            :     *  This argument is ignored for straight and parabolic curves.
    1286                 :            :     *  This function takes a type information, two RefVertices, an
    1287                 :            :     *  intermediate position, and a sense information to create a
    1288                 :            :     *  RefEdge. The RefVertices must be associated with the same
    1289                 :            :     *  GeometryQueryEngine. The return value can be a NULL
    1290                 :            :     *  pointer, if the RefEdge cannot be succesfully made for some reason.
    1291                 :            :     *
    1292                 :            :     *  Elliptical:
    1293                 :            :     *  The portion of the ellipse (circle) that is generated goes from
    1294                 :            :     *  the first point to the second point.
    1295                 :            :     *
    1296                 :            :     *  Parabolic:
    1297                 :            :     *  Construct a parabolic arc from 3 points. The intermediate point
    1298                 :            :     *  is the peak of the parabola - in this case, the point which is
    1299                 :            :     *  equidistant from the start and end points of the parabola. The
    1300                 :            :     *  3 points must form an isosceles triangle. This definition
    1301                 :            :     *  limits the user to generation of the tip of parabolic shapes only.
    1302                 :            :     */
    1303                 :            :   //! \brief Create a curve, i.e. ellipse, parabola, straight, or arc curves.  
    1304                 :            :   RefEdge* make_RefEdge(GeometryType ref_edge_type,
    1305                 :            :                         RefVertex *ref_vertex_1,
    1306                 :            :                         RefVertex *ref_vertex_2,
    1307                 :            :                         CubitVector const* intermediate_point = NULL ) const;
    1308                 :            : 
    1309                 :            :   RefEdge* make_elliptical_RefEdge( RefVertex *vert1,
    1310                 :            :                                     RefVertex *vert2,
    1311                 :            :                                     CubitVector center_point,
    1312                 :            :                                     double start_angle,
    1313                 :            :                                     double end_angle,
    1314                 :            :                                     CubitSense sense) const;
    1315                 :            : 
    1316                 :            : 
    1317                 :            :   //! \brief Create a surface from an existing one. 
    1318                 :            :   RefFace* make_RefFace(RefFace *from_ref_face,                        
    1319                 :            :                         std::map< RefEntity*, RefEntity* > *old_to_new_map = NULL) const;
    1320                 :            : 
    1321                 :            :   /*!  \return Body*
    1322                 :            :     *  \return - Pointer to a newly created Body object.
    1323                 :            :     *  \arg ref_face_list
    1324                 :            :     *  The RefFace list from which we want to create an extended sheet.
    1325                 :            :     *  \arg clip_box
    1326                 :            :     *  An optional bounding box to clip the resultant sheet body by.
    1327                 :            :     *  \arg preview
    1328                 :            :     *  If true just draw the extended sheet instead of creating it
    1329                 :            :     *
    1330                 :            :     * This function creates a sheet body by extending the input surfaces.
    1331                 :            :     * The result can be optionally clipped to fit inside of the given
    1332                 :            :     * bounding box.
    1333                 :            :     */
    1334                 :            :   //! \brief This function creates a sheet body by extending the input surfaces.
    1335                 :            :   Body* make_extended_sheet( DLIList<RefFace*> &ref_face_list,
    1336                 :            :                              CubitBox *clip_box_ptr = NULL,
    1337                 :            :                              bool preview = false) const;
    1338                 :            : 
    1339                 :            :   /*!  \return  RefFace*
    1340                 :            :     *  \return - A pointer to a newly created RefFace
    1341                 :            :     *  \arg ref_face_type
    1342                 :            :     *  The type of the RefFace
    1343                 :            :     *  \arg ref_edge_list
    1344                 :            :     *  The RefEdges to use to create the RefFace. The RefFace will
    1345                 :            :     *  have just one loop. The first RefEdge in the list will be
    1346                 :            :     *  first RefEdge of the loop and so on.
    1347                 :            :     *  \arg ref_face_ptr
    1348                 :            :     *  The surface that the curves will "cut" a piece out of.  The
    1349                 :            :     *  curves must lie on this surface.
    1350                 :            :     *  \check_edges  (specific to OCC)
    1351                 :            :     *  Creates duplicate edges if these edges are already in use or
    1352                 :            :     *  if their vertices are merged. For more info see: AME::make_Surface
    1353                 :            :     *
    1354                 :            :     *  This function takes a type information and a list of
    1355                 :            :     *  RefEdges to create a RefFace. The underlying representation
    1356                 :            :     *  of the RefFace is determined by the GeometryQueryEngine of
    1357                 :            :     *  the RefEdges. All the RefEdges in the list must be
    1358                 :            :     *  associated with the same GeometryQueryEngine. The return
    1359                 :            :     *  value can be a NULL pointer, if the RefFace cannot be succesfully
    1360                 :            :     *  made for some reason.
    1361                 :            :     */
    1362                 :            :   //! \brief Creates a surface from bounding curves.
    1363                 :            :   RefFace* make_RefFace(GeometryType ref_face_type,
    1364                 :            :                         DLIList<RefEdge*>& ref_edge_list,
    1365                 :            :                         bool is_free_face,
    1366                 :            :                         RefFace *ref_face_ptr = NULL,
    1367                 :            :                         bool check_edges = true ) const ;
    1368                 :            : 
    1369                 :            :   /*!  \return  Body*
    1370                 :            :     *  \return - A pointer to a newly created Body
    1371                 :            :     *  \arg ref_volume_list
    1372                 :            :     *  The RefVolumes to use to create the Body
    1373                 :            :     *
    1374                 :            :     *  This function takes a list of RefVolumes to create a Body. The
    1375                 :            :     *  underlying representation of the Body is determined by the
    1376                 :            :     *  GeometryQueryEngine of the RefVolumes. All the RefVolumes
    1377                 :            :     *  in the list must be associated with the same
    1378                 :            :     *  GeometryQueryEngine. The return value can be a NULL
    1379                 :            :     *  pointer, if the RefFace cannot be succesfully made for some
    1380                 :            :     *  reason.
    1381                 :            :     */
    1382                 :            :   //! \brief Creates a body from a list of volumes. 
    1383                 :            :   Body* make_Body(DLIList<RefVolume*>& ref_volume_list) const ;
    1384                 :            : 
    1385                 :            :   /*!  Creates a body from a ref_face.  This will always be a
    1386                 :            :     *  sheet body, with no volume, consisting of a single face.
    1387                 :            :     *  The old_to_new_map is an optional parameter that maps all
    1388                 :            :     *  the entities of the original to those of the copy.
    1389                 :            :     */
    1390                 :            :   //! \brief Creates a body from a surface.
    1391                 :            :   Body* make_Body(RefFace *from_ref_face,                  
    1392                 :            :                   std::map< RefEntity*, RefEntity* > *old_to_new_map = NULL ) const;
    1393                 :            : 
    1394                 :            :   /*!  \return  Body*
    1395                 :            :     *  \return - A pointer to a newly created Body that has just one RefFace
    1396                 :            :     *  \arg ref_face_type
    1397                 :            :     *  The type of the RefFace
    1398                 :            :     *  \arg ref_edge_list
    1399                 :            :     *  The RefEdges to use to create the RefFace. The RefFace will
    1400                 :            :     *  have just one loop. The first RefEdge in the list will be
    1401                 :            :     *  first RefEdge of the loop and so on.
    1402                 :            :     *
    1403                 :            :     *  This function takes a type information and a list of RefEdges
    1404                 :            :     *  to create a Body that has just one RefFace. The underlying
    1405                 :            :     *  representation of the Body is determined by the
    1406                 :            :     *  GeometryQueryEngine of the RefEdges. All the RefEdges in
    1407                 :            :     *  the list must be associated with the same
    1408                 :            :     *  GeometryQueryEngine. The return value can be a NULL
    1409                 :            :     *  pointer, if the Body cannot be succesfully made for some
    1410                 :            :     *  reason.
    1411                 :            :     *
    1412                 :            :     *  Each RefEdge in ref_edge_list MUST be a free edge, i.e., not
    1413                 :            :     *  attached to a RefFace, for this function to succeed!
    1414                 :            :     */
    1415                 :            :   //! \brief Creates a body from a surface created from a list of curves.
    1416                 :            :   Body* make_Body(GeometryType ref_face_type,
    1417                 :            :                   DLIList<RefEdge*>& ref_edge_list,
    1418                 :            :                   RefFace *ref_face_ptr = NULL) const ;
    1419                 :            : 
    1420                 :            :   //! \brief Create bodies by sweeping curves or surfaces along a vector.
    1421                 :            :   CubitStatus sweep_translational(DLIList<RefEntity*>& ref_ent_list,
    1422                 :            :                                   const CubitVector& sweep_vector,
    1423                 :            :                                   double draft_angle,
    1424                 :            :                                   int draft_type,
    1425                 :            :                                   CubitBoolean switchside,
    1426                 :            :                                   CubitBoolean rigid,
    1427                 :            :                                   CubitBoolean anchor_entity,
    1428                 :            :                                   CubitBoolean keep_old,
    1429                 :            :                                   DLIList<Body*>& output_body_list);
    1430                 :            : 
    1431                 :            :   CubitStatus sweep_helical( DLIList<RefEntity*>& ref_ent_list,
    1432                 :            :                              CubitVector &location,
    1433                 :            :                              CubitVector &direction,
    1434                 :            :                              double &thread_distance,
    1435                 :            :                              double &angle,
    1436                 :            :                              bool right_handed,
    1437                 :            :                              CubitBoolean anchor_entity,
    1438                 :            :                              CubitBoolean keep_old,
    1439                 :            :                              DLIList<Body*>& output_body_list); 
    1440                 :            : 
    1441                 :            :    CubitStatus sweep_curve_target(CubitPlane ref_plane,
    1442                 :            :                                                  DLIList<RefEntity*>& ref_ent_list);
    1443                 :            : 
    1444                 :            :    CubitStatus sweep_curve_target(DLIList<RefEdge*>& curve_list,
    1445                 :            :                             Body *target_body,
    1446                 :            :                             DLIList<Body*> &out_bodies,
    1447                 :            :                             CubitVector direction,
    1448                 :            :                             CubitPlane stop_plane,
    1449                 :            :                             bool unite);
    1450                 :            : 
    1451                 :            :    CubitStatus sweep_surface_target(RefFace *face,
    1452                 :            :                                     Body *target_body,
    1453                 :            :                                     CubitVector distance,
    1454                 :            :                                     CubitPlane stop_plane,                                    
    1455                 :            :                                     double magnitude = 0.0 );                                    
    1456                 :            : 
    1457                 :            :    CubitStatus sweep_surface_target(CubitPlane ref_plane,
    1458                 :            :                                                 DLIList<RefEntity*>& ref_ent_list);
    1459                 :            : 
    1460                 :            :   CubitStatus sweep_perpendicular(DLIList<RefEntity*>& ref_ent_list,
    1461                 :            :                                   double distance,
    1462                 :            :                                   double draft_angle,
    1463                 :            :                                   int draft_type,
    1464                 :            :                                   CubitBoolean switchside,
    1465                 :            :                                   CubitBoolean rigid,
    1466                 :            :                                   CubitBoolean anchor_entity,
    1467                 :            :                                   CubitBoolean keep_old,
    1468                 :            :                                   DLIList<Body*>& output_body_list);
    1469                 :            : 
    1470                 :            :   //! \brief Creates bodies by sweeping surfaces or curves about an axis. 
    1471                 :            :   CubitStatus sweep_rotational(DLIList<RefEntity*>& ref_ent_list,
    1472                 :            :                                const CubitVector& point,
    1473                 :            :                                const CubitVector& direction,
    1474                 :            :                                double angle,
    1475                 :            :                                DLIList<Body*>& output_body_list,
    1476                 :            :                                CubitBoolean anchor_entity,
    1477                 :            :                                CubitBoolean keep_old,
    1478                 :            :                                int steps = 0,
    1479                 :            :                                double draft_angle = 0.0,
    1480                 :            :                                int draft_type = 0,                               
    1481                 :            :                                CubitBoolean switchside = CUBIT_FALSE,
    1482                 :            :                                CubitBoolean make_solid = CUBIT_FALSE,
    1483                 :            :                                CubitBoolean rigid = CUBIT_FALSE );
    1484                 :            : 
    1485                 :            :   //! \brief Creates bodies by sweeping surfaces or curves along a curve. 
    1486                 :            :   CubitStatus sweep_along_curve(DLIList<RefEntity*>& ref_ent_list,
    1487                 :            :                                 DLIList<RefEdge*>& ref_edge_list,
    1488                 :            :                                 DLIList<Body*>& output_body_list,
    1489                 :            :                                 CubitBoolean anchor_entity,
    1490                 :            :                                 CubitBoolean keep_old,
    1491                 :            :                                 double draft_angle = 0.0,
    1492                 :            :                                 int draft_type = 0,
    1493                 :            :                                 CubitBoolean rigid = CUBIT_FALSE);
    1494                 :            : 
    1495                 :            :   //! \brief Currently unsupported.
    1496                 :            :   CubitStatus tweak_bend(DLIList<Body*> &bend_bodies,
    1497                 :            :                     DLIList<Body*> &new_body_list,
    1498                 :            :                     CubitVector& neutral_root,
    1499                 :            :                     CubitVector& bend_axis,
    1500                 :            :                     CubitVector& bend_direction,
    1501                 :            :                     double radius,
    1502                 :            :                     double angle,
    1503                 :            :                       DLIList<CubitVector> &bend_regions,
    1504                 :            :                       double width = -1,
    1505                 :            :                       CubitBoolean center_bend = CUBIT_FALSE,
    1506                 :            :                       int num_points = 0,
    1507                 :            :                       CubitBoolean keep_old_body = CUBIT_FALSE,
    1508                 :            :                       CubitBoolean preview = CUBIT_FALSE );
    1509                 :            : 
    1510                 :            :   /*! Chamfer curves on solid and sheet bodies.  The left and right offsets
    1511                 :            :     * are with respect to the curve direction.  If the given right offset is
    1512                 :            :     * negative, the left offset is used.  Users can preview to clarify the
    1513                 :            :     * meaning of left and right.
    1514                 :            :     */
    1515                 :            :   //! \brief Chamfer curves on solid and sheet bodies. 
    1516                 :            :   CubitStatus tweak_chamfer( DLIList<RefEdge*> &ref_edge_list,
    1517                 :            :                              double left_offset,
    1518                 :            :                              DLIList<Body*> &new_body_list,
    1519                 :            :                              double right_offset = -1.0,
    1520                 :            :                              CubitBoolean keep_old_body = CUBIT_FALSE,
    1521                 :            :                              CubitBoolean preview = CUBIT_FALSE );
    1522                 :            : 
    1523                 :            :   /*! Chamfer vertices on solid or sheet bodies.  On a solid body there can
    1524                 :            :     * be up to 3 offsets; on a sheet body up to 2 offsets.  The offsets are
    1525                 :            :     * in the direction of the supplied edges.  If multiple vertices are
    1526                 :            :     * supplied, only one offset value is allowed and the edges are not used.
    1527                 :            :     */
    1528                 :            :   //! \brief Chamfer vertices on solid or sheet bodies.
    1529                 :            :   CubitStatus tweak_chamfer( DLIList<RefVertex*> &ref_vertex_list,
    1530                 :            :                              double offset1,
    1531                 :            :                              DLIList<Body*> &new_body_list,
    1532                 :            :                              RefEdge *edge1 = NULL,
    1533                 :            :                              double offset2 = -1.0,
    1534                 :            :                              RefEdge *edge2 = NULL,
    1535                 :            :                              double offset3 = -1.0,
    1536                 :            :                              RefEdge *edge3 = NULL,
    1537                 :            :                              CubitBoolean keep_old_body = CUBIT_FALSE,
    1538                 :            :                              CubitBoolean preview = CUBIT_FALSE );
    1539                 :            : 
    1540                 :            :   //! \brief Creates a round fillet (or blend) at the given curves on solid or
    1541                 :            :   //!  sheet bodies.
    1542                 :            :   CubitStatus tweak_fillet( DLIList<RefEdge*> &ref_edge_list,
    1543                 :            :                             double radius,
    1544                 :            :                             DLIList<Body*> &new_body_list,
    1545                 :            :                             CubitBoolean keep_old_body = CUBIT_FALSE,
    1546                 :            :                             CubitBoolean preview = CUBIT_FALSE );
    1547                 :            : 
    1548                 :            :   /*! Creates a round fillet (or blend) at the given curve on a solid or sheet
    1549                 :            :     * body.  The fillet has a variable radius from the start to the end of
    1550                 :            :     * the curve.
    1551                 :            :     */
    1552                 :            :   //! \brief Creates a round fillet (or blend) at the given curve. 
    1553                 :            :   CubitStatus tweak_fillet( RefEdge *ref_edge_ptr,
    1554                 :            :                             double start_radius,
    1555                 :            :                             double end_radius,
    1556                 :            :                             Body *&new_body_ptr,
    1557                 :            :                             CubitBoolean keep_old_body = CUBIT_FALSE,
    1558                 :            :                             CubitBoolean preview = CUBIT_FALSE );
    1559                 :            : 
    1560                 :            :   //! \brief Create a round fillet (or blend) at the given vertices on sheet bodies.
    1561                 :            :   CubitStatus tweak_fillet( DLIList<RefVertex*> &ref_vertex_list,
    1562                 :            :                             double radius,
    1563                 :            :                             DLIList<Body*> &new_body_list,
    1564                 :            :                             CubitBoolean keep_old_body = CUBIT_FALSE,
    1565                 :            :                             CubitBoolean preview = CUBIT_FALSE );
    1566                 :            : 
    1567                 :            :   //! \brief Tweak specified faces of a volume or volumes along a vector.
    1568                 :            :   CubitStatus tweak_move( DLIList<RefFace*> &ref_face_list,
    1569                 :            :                           const CubitVector &delta,
    1570                 :            :                           DLIList<Body*> &new_body_list,
    1571                 :            :                           CubitBoolean keep_old_body = CUBIT_FALSE,
    1572                 :            :                           CubitBoolean preview = CUBIT_FALSE );
    1573                 :            : 
    1574                 :            :   //! \brief Tweak specified curves of a sheet body along a vector.
    1575                 :            :   CubitStatus tweak_move( DLIList<RefEdge*> &ref_edge_list,
    1576                 :            :                           const CubitVector &delta,
    1577                 :            :                           DLIList<Body*> &new_body_list,
    1578                 :            :                           CubitBoolean keep_old_body = CUBIT_FALSE,
    1579                 :            :                           CubitBoolean preview = CUBIT_FALSE );
    1580                 :            : 
    1581                 :            :   /*! Tweak specified faces of a volume or volumes by offsetting those faces
    1582                 :            :     * by the offset distance. Optionally supply additional faces with
    1583                 :            :     * different offset distances.
    1584                 :            :     */
    1585                 :            :   //! \brief Offsets a surface(s) on a volume(s).
    1586                 :            :   CubitStatus tweak_offset( DLIList<RefFace*> &ref_face_list,
    1587                 :            :                             double offset_distance,
    1588                 :            :                             DLIList<RefFace*> *add_ref_face_list_ptr,
    1589                 :            :                             DLIList<double> *add_offset_list_ptr,
    1590                 :            :                             DLIList<Body*> &new_body_list,
    1591                 :            :                             CubitBoolean keep_old_body = CUBIT_FALSE,
    1592                 :            :                             CubitBoolean preview = CUBIT_FALSE );
    1593                 :            : 
    1594                 :            :   /*! Tweak specified curves of a sheet body or bodies by offsetting those
    1595                 :            :     * curves by the offset distance.  Optionally supply additional curves with
    1596                 :            :     * different offset distances.
    1597                 :            :     */
    1598                 :            :   //! \brief Offset curves on sheet bodies.
    1599                 :            :   CubitStatus tweak_offset( DLIList<RefEdge*> &ref_edge_list,
    1600                 :            :                             double offset_distance,
    1601                 :            :                             DLIList<RefEdge*> *add_ref_face_list_ptr,
    1602                 :            :                             DLIList<double> *add_offset_list_ptr,
    1603                 :            :                             DLIList<Body*> &new_body_list,
    1604                 :            :                             CubitBoolean keep_old_body = CUBIT_FALSE,
    1605                 :            :                             CubitBoolean preview = CUBIT_FALSE );
    1606                 :            : 
    1607                 :            :   //! \brief Performs tweak_remove operation on surfaces individually. 
    1608                 :            :   CubitStatus tweak_remove_individually( DLIList<RefFace*> &ref_face_list,
    1609                 :            :                                          DLIList<Body*> &new_body_list,
    1610                 :            :                                          CubitBoolean keep_surface = CUBIT_FALSE,
    1611                 :            :                                          CubitBoolean keep_old_body = CUBIT_FALSE,
    1612                 :            :                                          CubitBoolean preview = CUBIT_FALSE );
    1613                 :            : 
    1614                 :            :   //! \brief Performs tweak_remove operation on surfaces collectively. 
    1615                 :            :   CubitStatus tweak_remove_together( DLIList<RefFace*> &ref_face_list,
    1616                 :            :                                      DLIList<Body*> &new_body_list,
    1617                 :            :                                      CubitBoolean extend_adjoining = CUBIT_TRUE,
    1618                 :            :                                      CubitBoolean keep_surface = CUBIT_FALSE,
    1619                 :            :                                      CubitBoolean keep_old_body = CUBIT_FALSE,
    1620                 :            :                                      CubitBoolean preview = CUBIT_FALSE);
    1621                 :            : 
    1622                 :            :   /*! Remove curves from a sheet body or bodies and then extend the remaining
    1623                 :            :     * curves to fill the gap.  If an internal loop of curves is removed the
    1624                 :            :     * hole is removed.
    1625                 :            :   */
    1626                 :            :   //! \brief Removes a surface from a volume, extending neighboring surfaces.
    1627                 :            :   CubitStatus tweak_remove( DLIList<RefEdge*> &ref_edge_list,
    1628                 :            :                             DLIList<Body*> &new_body_list,
    1629                 :            :                             CubitBoolean keep_old_body = CUBIT_FALSE,
    1630                 :            :                             CubitBoolean preview = CUBIT_FALSE );
    1631                 :            : 
    1632                 :            :   /*!  Tweak specified faces of a volume or volumes up to target surface.
    1633                 :            :     *  If extend flag is true, extend out the targets before
    1634                 :            :     *   tweaking to them (only used for multiple targets; single targets are
    1635                 :            :     *   always extended).  The optional limit plane is only valid if extend_flg
    1636                 :            :     *   is TRUE; it will limit the tweak to not go past this plane in the case
    1637                 :            :     *   where the tweaked body would only partially intersect the extended
    1638                 :            :     *   targets.The reverse flag should never be needed - if it is there may be
    1639                 :            :     *   a bug or a bad normal on a body (i.e., negative volume body), and is
    1640                 :            :     *   only retained for debugging.
    1641                 :            :     */
    1642                 :            :   //! \brief Extends (tweaks) surfaces up to a target surface.
    1643                 :            :   CubitStatus tweak_target( DLIList<RefFace*> &ref_face_list,
    1644                 :            :                             DLIList<RefFace*> &target_face_list,
    1645                 :            :                             DLIList<Body*> &new_body_list,
    1646                 :            :                             CubitBoolean extend_flg = CUBIT_TRUE,
    1647                 :            :                             CubitPlane *limit_plane = NULL,
    1648                 :            :                             CubitBoolean reverse_flg = CUBIT_FALSE,
    1649                 :            :                             CubitBoolean keep_old_body = CUBIT_FALSE,
    1650                 :            :                             CubitBoolean preview = CUBIT_FALSE );
    1651                 :            : 
    1652                 :            :   /*!  Tweak specified faces of a volume or volumes up to target plane. 
    1653                 :            :     *   If extend flag is true, extend out the targets before
    1654                 :            :     *   tweaking to them (only used for multiple targets; single targets are
    1655                 :            :     *   always extended).  The optional limit plane is only valid if extend_flg
    1656                 :            :     *   is TRUE; it will limit the tweak to not go past this plane in the case
    1657                 :            :     *   where the tweaked body would only partially intersect the extended
    1658                 :            :     *   targets.The reverse flag should never be needed - if it is there may be
    1659                 :            :     *   a bug or a bad normal on a body (i.e., negative volume body), and is
    1660                 :            :     *   only retained for debugging.
    1661                 :            :     */
    1662                 :            : 
    1663                 :            :   //! \brief Extends (tweaks) surfaces up to a target plane.
    1664                 :            :   CubitStatus tweak_target( DLIList<RefFace*> &ref_face_list,
    1665                 :            :                             CubitPlane &plane,
    1666                 :            :                             DLIList<Body*> &new_body_list,
    1667                 :            :                             CubitBoolean reverse_flg = CUBIT_FALSE,
    1668                 :            :                             CubitBoolean keep_old_body = CUBIT_FALSE,
    1669                 :            :                             CubitBoolean preview = CUBIT_FALSE );
    1670                 :            : 
    1671                 :            :   /*!   Tweak specified edges of a surface or set of surfaces (in sheet
    1672                 :            :     *   bodies) up to target surfaces or plane.  This essentially extends
    1673                 :            :     *   or trims the attached surfaces of the sheet body.  If extend flag is
    1674                 :            :     *   true, extend out the targets before tweaking to them (only used for
    1675                 :            :     *   multiple targets; single targets are always extended).  The optional
    1676                 :            :     *   limit plane is only valid if extend_flg is TRUE; it will limit the
    1677                 :            :     *   tweak to not go past this plane in the case where the tweaked body
    1678                 :            :     *   would only partially intersect the extended targets.The reverse flag
    1679                 :            :     *   should never be needed - if it is there may be a bug or a bad normal
    1680                 :            :     *   on a body (i.e., negative volume body), and is only retained for
    1681                 :            :     *   debugging.
    1682                 :            :     */
    1683                 :            :   //! \brief Extends (tweaks) curves up to a target surface.
    1684                 :            :   CubitStatus tweak_target( DLIList<RefEdge*> &ref_edge_list,
    1685                 :            :                             DLIList<RefFace*> &target_face_list,
    1686                 :            :                             DLIList<Body*> &new_body_list,
    1687                 :            :                             CubitBoolean extend_flg = CUBIT_TRUE,
    1688                 :            :                             CubitPlane *limit_plane = NULL,
    1689                 :            :                             CubitBoolean reverse_flg = CUBIT_FALSE,
    1690                 :            :                             CubitBoolean keep_old_body = CUBIT_FALSE,
    1691                 :            :                             CubitBoolean preview = CUBIT_FALSE,
    1692                 :            :                             double max_area_increase = 0 );
    1693                 :            :   CubitStatus tweak_target( DLIList<RefEdge*> &ref_edge_list,
    1694                 :            :                             CubitPlane &plane,
    1695                 :            :                             DLIList<Body*> &new_body_list,
    1696                 :            :                             CubitBoolean reverse_flg = CUBIT_FALSE,
    1697                 :            :                             CubitBoolean keep_old_body = CUBIT_FALSE,
    1698                 :            :                             CubitBoolean preview = CUBIT_FALSE );
    1699                 :            : 
    1700                 :            :   /*!   Tweak specified edges of a surface or set of surfaces (in sheet
    1701                 :            :     *   bodies) up to target plane.  This essentially extends
    1702                 :            :     *   or trims the attached surfaces of the sheet body.  If extend flag is
    1703                 :            :     *   true, extend out the targets before tweaking to them (only used for
    1704                 :            :     *   multiple targets; single targets are always extended).  The optional
    1705                 :            :     *   limit plane is only valid if extend_flg is TRUE; it will limit the
    1706                 :            :     *   tweak to not go past this plane in the case where the tweaked body
    1707                 :            :     *   would only partially intersect the extended targets.The reverse flag
    1708                 :            :     *   should never be needed - if it is there may be a bug or a bad normal
    1709                 :            :     *   on a body (i.e., negative volume body), and is only retained for
    1710                 :            :     *   debugging.
    1711                 :            :     */
    1712                 :            :   //! \brief Extends (tweaks) curves up to a target plane.
    1713                 :            :   CubitStatus tweak_target( DLIList<RefEdge*> &ref_edge_list,
    1714                 :            :                             DLIList<RefEdge*> &target_edge_list,
    1715                 :            :                             DLIList<Body*> &new_body_list,
    1716                 :            :                             CubitBoolean extend_flg = CUBIT_TRUE,
    1717                 :            :                             CubitPlane *limit_plane = NULL,
    1718                 :            :                             CubitBoolean reverse_flg = CUBIT_FALSE,
    1719                 :            :                             CubitBoolean keep_old_body = CUBIT_FALSE,
    1720                 :            :                             CubitBoolean preview = CUBIT_FALSE,
    1721                 :            :                             double max_area_increase = 0 );
    1722                 :            :   /**<  Tweak specified edges of a sheet body or bodies up to target curves
    1723                 :            :     *   that are part of a sheet body.  The target is a surface or surfaces
    1724                 :            :     *   created by thickening the owning surface of the target curve(s).
    1725                 :            :     *   If extend flag is true, extend out the targets before tweaking to them
    1726                 :            :     *   (only used for multiple targets; single targets are always extended).
    1727                 :            :     *   The optional limit plane is only valid if extend_flg is TRUE; it will
    1728                 :            :     *   limit the tweak to not go past this plane in the case where the tweaked
    1729                 :            :     *   body would only partially intersect the extended targets. The reverse
    1730                 :            :     *   flag should never be needed - if it is there may be a bug or a bad normal
    1731                 :            :     *   on a body (i.e., negative volume body), and is only retained for
    1732                 :            :     *   debugging.
    1733                 :            :     */
    1734                 :            :   //! \brief Tweak specified vertex of a sheet body to a given location.
    1735                 :            :   CubitStatus tweak_target( RefVertex *ref_vertex_ptr,
    1736                 :            :                             DLIList<RefFace*> &modify_ref_face_list,
    1737                 :            :                             CubitVector &target_loc,
    1738                 :            :                             Body *&new_Body_ptr,
    1739                 :            :                             CubitBoolean keep_old_body = CUBIT_FALSE,
    1740                 :            :                             CubitBoolean preview = CUBIT_FALSE );
    1741                 :            : 
    1742                 :            :   //! \brief Converts edges smaller than 'lengthlimit' into tolerant (or fat) vertices.
    1743                 :            :   //!  only.
    1744                 :            :   CubitStatus remove_curve_slivers( DLIList<Body*> &bodies, double lengthlimit );
    1745                 :            : 
    1746                 :            :   //! \brief Create a surface using arrays of points in u and v directions. 
    1747                 :            :   CubitStatus create_net_surface( DLIList<Surface*>& ref_face_list, BodySM *& new_body,
    1748                 :            :                                   DLIList<DLIList<CubitVector*>*> &vec_lists_u,
    1749                 :            :                                   DLIList<DLIList<CubitVector*>*> &vec_lists_v,
    1750                 :            :                                   double net_tol = 1e-3,
    1751                 :            :                                   CubitBoolean heal = CUBIT_TRUE );
    1752                 :            : 
    1753                 :            :   //! \brief Create a surface using curves in u and v directions. 
    1754                 :            :   CubitStatus create_net_surface( DLIList<RefEdge*>& u_curves, 
    1755                 :            :                                   DLIList<RefEdge*>& v_curves,
    1756                 :            :                                   double net_tol = 1e-3,
    1757                 :            :                                   CubitBoolean heal = CUBIT_TRUE );
    1758                 :            : 
    1759                 :            :   //! \brief Creates an offset surface some distance from a surface.
    1760                 :            :   CubitStatus create_offset_surface( RefFace* ref_face_ptr,
    1761                 :            :                                      double offset_distance );
    1762                 :            : 
    1763                 :            :   /*! Create a sheet body (or bodies) by offsetting the given faces. The
    1764                 :            :     *  optional additional face list and double list (must be same length)
    1765                 :            :     *  allow different offset distances for different faces. Adjoining faces
    1766                 :            :     *  are extended or trimmed to remain joined in the new sheet body.  Radial
    1767                 :            :     *  faces that cannot be so offset are removed and the resulting wound
    1768                 :            :     *  healed by the surrounding faces.
    1769                 :            :     */
    1770                 :            :   //! \brief Create a body(s) by offsetting the given surfaces. 
    1771                 :            :   CubitStatus create_offset_sheet( DLIList<RefFace*> &ref_face_list,
    1772                 :            :                                    double offset_distance,
    1773                 :            :                                    DLIList<RefFace*> *add_ref_face_list_ptr,
    1774                 :            :                                    DLIList<double> *add_offset_list_ptr,
    1775                 :            :                                    DLIList<Body*> &new_body_list,
    1776                 :            :                                    CubitBoolean preview = CUBIT_FALSE );
    1777                 :            : 
    1778                 :            :   //! \brief Create a body by offsetting all the surface of the body. 
    1779                 :            :   CubitStatus create_offset_body( Body *body_ptr, Body *&new_body,
    1780                 :            :                                   double offset_distance );
    1781                 :            : 
    1782                 :            :   //! \brief Create a sheet body skinning (lofting) a series of curves.
    1783                 :            :   CubitStatus create_skin_surface( DLIList<RefEdge*>& ref_edges, 
    1784                 :            :                                    Body*& new_body,
    1785                 :            :                                    DLIList<RefEdge*>& guides);
    1786                 :            :   
    1787                 :            :   ////! \brief Create a solid body by lofting between two surfaces.
    1788                 :            :   CubitStatus loft_surfaces_to_body(DLIList<RefFace*> &surfaces,
    1789                 :            :                                     DLIList<double> &takeoff_factor_list,
    1790                 :            :                                     DLIList<RefFace*> &takeoff_vector_surface_list,
    1791                 :            :                                     DLIList<CubitVector> &surface_takeoff_vector_list,
    1792                 :            :                                     DLIList<RefEdge*> &takeoff_vector_curve_list,
    1793                 :            :                                     DLIList<CubitVector> &curve_takeoff_vector_list,
    1794                 :            :                                     DLIList<RefEdge*> &guides,
    1795                 :            :                                     DLIList<RefVertex*> &match_vertices_list,
    1796                 :            :                                     Body*& new_body,
    1797                 :            :                                     CubitBoolean global_guides,
    1798                 :            :                                     CubitBoolean closed,
    1799                 :            :                                     CubitBoolean show_matching_curves,
    1800                 :            :                                     CubitBoolean preview
    1801                 :            :                                     );
    1802                 :            : 
    1803                 :            : 
    1804                 :            : 
    1805                 :            : 
    1806                 :            : 
    1807                 :            :   CubitStatus create_surface_curve(DLIList<RefEntity*> curve_entity,
    1808                 :            :                                    DLIList<RefEntity*> target_entity,
    1809                 :            :                                    CubitVector sweep_direction = CubitVector (0,0,0),
    1810                 :            :                                    CubitBoolean distance_flag = CUBIT_FALSE);
    1811                 :            : 
    1812                 :            :   Body* create_rectangle_surface( double width, double height, CubitVector plane );
    1813                 :            : 
    1814                 :            :   Body* create_parallelogram_surface( RefVertex *v1, 
    1815                 :            :                                             RefVertex *v2,
    1816                 :            :                                             RefVertex *v3 );
    1817                 :            : 
    1818                 :            :   Body* create_circle_surface( double radius, CubitVector plane ); 
    1819                 :            : 
    1820                 :            :   Body* create_circle_surface( RefVertex *v1, 
    1821                 :            :                                      RefVertex *v2,
    1822                 :            :                                      RefVertex *v3 );
    1823                 :            : 
    1824                 :            :   Body* create_circle_surface( RefVertex *v1, 
    1825                 :            :                                      RefVertex *v2,
    1826                 :            :                                      CubitVector center_point ); 
    1827                 :            : 
    1828                 :            :   Body* create_ellipse_surface( RefVertex *v1, 
    1829                 :            :                                       RefVertex *v2,
    1830                 :            :                                       CubitVector center_point ); 
    1831                 :            : 
    1832                 :            :   Body* create_ellipse_surface( double major_radius, 
    1833                 :            :                                       double minor_radius,
    1834                 :            :                                       CubitVector plane );
    1835                 :            : 
    1836                 :            :   CubitStatus idealize_hole_slot_geometry(DLIList<RefEntity*> idealize_entity,
    1837                 :            :                                      DLIList<RefEntity*> exclude_entity,
    1838                 :            :                                      double arc_radius,
    1839                 :            :                                      double slot_arc_radius,
    1840                 :            :                                      double slot_length,
    1841                 :            :                                      CubitBoolean preview = CUBIT_FALSE);
    1842                 :            : 
    1843                 :            :   CubitStatus idealize_fillet_geometry(DLIList<RefEntity*> idealize_entity,
    1844                 :            :                                        DLIList<RefEntity*> exclude_entity,
    1845                 :            :                                        double fillet_rad,
    1846                 :            :                                        CubitBoolean internal_flg,
    1847                 :            :                                        CubitBoolean external_flg,
    1848                 :            :                                                                CubitBoolean preview = CUBIT_FALSE);
    1849                 :            : 
    1850                 :            :   CubitStatus create_surface_doubler(DLIList<RefEntity*> doubler_entity,
    1851                 :            :                                     DLIList<RefEntity*> target_entity,
    1852                 :            :                                     DLIList<Body*> &body_list_out,
    1853                 :            :                                     CubitBoolean internal_flg = CUBIT_FALSE,
    1854                 :            :                                     CubitBoolean extend_flg = CUBIT_TRUE,
    1855                 :            :                                     CubitPlane *limit_plane = NULL,
    1856                 :            :                                     CubitVector sweep_direction = CubitVector(0,0,0),
    1857                 :            :                                     CubitBoolean preview = CUBIT_FALSE);
    1858                 :            :   
    1859                 :            :   /*! Fits an analytic spline surface through positions.  If a surface is specified, 
    1860                 :            :       positions are forced to lie on the surface and restrains the resultant surface
    1861                 :            :       geometry to match the surface's geometry.  The project parameter will project 
    1862                 :            :       the nodes or vertices to the specified surface. 
    1863                 :            :   */
    1864                 :            :   //! \brief  Fits an analytic spline surface through positions. 
    1865                 :            :   CubitStatus create_surface( DLIList<CubitVector*>& vec_list,
    1866                 :            :                               Body *&new_body,
    1867                 :            :                               RefFace *ref_face_ptr,
    1868                 :            :                               CubitBoolean project_points );
    1869                 :            : 
    1870                 :            :   CubitStatus create_surface( DLIList<RefVertex*> &vert_list, 
    1871                 :            :                               Body *&new_body,
    1872                 :            :                               RefFace *on_surface = NULL);
    1873                 :            : 
    1874                 :            : 
    1875                 :            :   //! \brief Creates a simple triangular weld surface.
    1876                 :            :   CubitStatus create_weld_surface( CubitVector &root,
    1877                 :            :                                    RefFace *ref_face1,
    1878                 :            :                                    double leg1,
    1879                 :            :                                    RefFace *ref_face2,
    1880                 :            :                                    double leg2,
    1881                 :            :                                    Body *&new_body );
    1882                 :            : 
    1883                 :            :   /*!  Creates a body out of the surfaces in the ref_face_list.  The surfaces
    1884                 :            :     *  can be either free surfaces or sheet bodies or both.
    1885                 :            :     *  The body should be healed.  The bounding curves and vertices between
    1886                 :            :     *  the surfaces must be within tolerance.
    1887                 :            :     */
    1888                 :            :   //! \brief Creates a body out of the specified surfaces. 
    1889                 :            :   CubitStatus create_solid_bodies_from_surfs( DLIList<RefFace*> &ref_face_list,
    1890                 :            :                                       DLIList<Body*> &new_bodies,
    1891                 :            :                                       CubitBoolean keep_old = CUBIT_FALSE,
    1892                 :            :                                       CubitBoolean heal = CUBIT_TRUE,
    1893                 :            :                                       CubitBoolean sheet = CUBIT_FALSE ) const;
    1894                 :            : 
    1895                 :            :   //! \brief Create curves from the intersection of two surfaces.
    1896                 :            :   CubitStatus surface_intersection( RefFace *ref_face1,
    1897                 :            :                                     RefFace *ref_face2,
    1898                 :            :                                     DLIList<RefEdge*> &ref_edge_list );
    1899                 :            : 
    1900                 :            :   RefEdge* create_arc(const CubitVector& position,
    1901                 :            :                                double radius,
    1902                 :            :                                double start_angle,
    1903                 :            :                                double end_angle,
    1904                 :            :                                CubitVector plane,
    1905                 :            :                                CubitBoolean preview = CUBIT_FALSE);
    1906                 :            : 
    1907                 :            :   RefEdge* create_arc_radius( RefVertex* ref_vertex1,
    1908                 :            :                                    RefVertex* ref_vertex2,
    1909                 :            :                                    const CubitVector &normal,
    1910                 :            :                                    double radius,
    1911                 :            :                                    CubitBoolean other_arc = CUBIT_FALSE ,
    1912                 :            :                                    CubitBoolean full = CUBIT_FALSE,
    1913                 :            :                                    CubitBoolean preview = CUBIT_FALSE);
    1914                 :            :   //! \brief Create an arc curve from three points.
    1915                 :            :   RefEdge* create_arc_three( RefVertex* ref_vertex1,
    1916                 :            :                              RefVertex* ref_vertex2,
    1917                 :            :                              RefVertex* ref_vertex3,
    1918                 :            :                              CubitBoolean full = CUBIT_FALSE,
    1919                 :            :                              CubitBoolean preview = CUBIT_FALSE );
    1920                 :            : 
    1921                 :            :   //! \brief Create an arc curve tangent to three curves.
    1922                 :            :   RefEdge* create_arc_three( RefEdge* ref_edge1,
    1923                 :            :                              RefEdge* ref_edge2,
    1924                 :            :                              RefEdge* ref_edge3,
    1925                 :            :                              CubitBoolean full = CUBIT_FALSE,
    1926                 :            :                              CubitBoolean preview = CUBIT_FALSE );
    1927                 :            :   
    1928                 :            :   /*! \brief Create an arc curve from two points and a center point. 
    1929                 :            :       If full option is specified, a full circle is created.*/
    1930                 :            :   //! \brief Create an arc curve from two points and a center point. 
    1931                 :            :   RefEdge* create_arc_center_edge( RefVertex* ref_vertex1,
    1932                 :            :                                    RefVertex* ref_vertex2,
    1933                 :            :                                    RefVertex* ref_vertex3,
    1934                 :            :                                    const CubitVector &normal,
    1935                 :            :                                    double radius = CUBIT_DBL_MAX,
    1936                 :            :                                    CubitBoolean full = CUBIT_FALSE,
    1937                 :            :                                    CubitBoolean preview = CUBIT_FALSE );
    1938                 :            : 
    1939                 :            :   //! \brief  Create a curve that is a combination of the specified curves.
    1940                 :            :   CubitStatus create_curve_combine( DLIList<RefEdge*>& ref_edge_list,
    1941                 :            :                                     RefEdge *&new_ref_edge_ptr );
    1942                 :            : 
    1943                 :            : 
    1944                 :            :   CubitStatus create_curve_helix( CubitVector &location,
    1945                 :            :                                   CubitVector &direction,
    1946                 :            :                                   CubitVector &start_point,
    1947                 :            :                                   double &thread_distance,
    1948                 :            :                                   double &angle,
    1949                 :            :                                   bool right_handed,
    1950                 :            :                                   RefEdge *&new_ref_edge_ptr);
    1951                 :            : 
    1952                 :            : 
    1953                 :            :   //! \brief Sets sepAfterWebcut variable.
    1954                 :          0 :   static void set_sep_after_webcut_setting(CubitBoolean val) {sepAfterWebcut = val;}
    1955                 :            : 
    1956                 :            :   //! \brief Gets sepAfterWebcut variable.
    1957                 :          0 :   static CubitBoolean get_sep_after_webcut_setting() {return sepAfterWebcut;}
    1958                 :            : 
    1959                 :            :   /*!  Returns CUBIT_TRUE if all the entities have the same geometric query engine and
    1960                 :            :     *  if that is the same one as the default. */
    1961                 :            :   //! \brief Check to determine if all entities are of the same geometry engine.
    1962                 :            :   CubitBoolean same_modify_engine(DLIList<TopologyEntity*> &topo_list) const;
    1963                 :            : 
    1964                 :            :   /*!  Returns CUBIT_TRUE if all the entities have the same geometric query engine and
    1965                 :            :     *  if that is the same one as the default.  If the check_children parameter is
    1966                 :            :     *  CUBIT_TRUE, all the child entities will also be checked.
    1967                 :            :     */
    1968                 :            :   //! \brief Check to determine if all entities are of the same geometry engine as 
    1969                 :            :   //! active geometry engine.
    1970                 :            :   CubitBoolean same_modify_engine(DLIList<RefEntity*> &ref_entity_list,
    1971                 :            :                                   CubitBoolean check_children = CUBIT_FALSE) const;
    1972                 :            : 
    1973                 :            :   
    1974                 :            :   //! \brief Determines if specified RefFaces and RefEdges are of the same geometry engine.
    1975                 :            :   //! Returns common engine, if any, and underlying surfaces and curves. 
    1976                 :            :   GeometryModifyEngine* common_modify_engine( DLIList<RefFace*>& faces,
    1977                 :            :                                               DLIList<RefEdge*>& edges,
    1978                 :            :                                               DLIList<Surface*>& surfaces,
    1979                 :            :                                               DLIList<Curve*>& curves,
    1980                 :            :                                               CubitBoolean allow_composites = CUBIT_FALSE) const;
    1981                 :            : 
    1982                 :            : 
    1983                 :            : 
    1984                 :            :   CubitStatus unmerge_and_return_merge_partners(RefVertex *input_vertex, 
    1985                 :            :                                                 DLIList<DLIList<RefVertex*>*> &vert_merge_lists,
    1986                 :            :                                                 DLIList<DLIList<RefEdge*>*> &curve_merge_lists,
    1987                 :            :                                                 DLIList<DLIList<RefFace*>*> &surf_merge_lists);
    1988                 :            : 
    1989                 :            :   //! \brief Add a geometry modify engine to the list.
    1990                 :            :   void add_gme(GeometryModifyEngine *gme_ptr);
    1991                 :            : 
    1992                 :            :   //! \brief < remove a geometry modify engine from the list; returns CUBIT_FAILURE
    1993                 :            :   //!  if it wasn't in the list.
    1994                 :            :   CubitStatus remove_gme(GeometryModifyEngine *gme_ptr);
    1995                 :            : 
    1996                 :            :   //! \brief Returns a list of GeometryModifyEngines.
    1997                 :            :   void get_gme_list(DLIList<GeometryModifyEngine*> &gme_list);
    1998                 :            : 
    1999                 :            :   //! \brief Gets the current active GeometryModifyEngine.
    2000                 :            :   GeometryModifyEngine *get_gme() const;
    2001                 :            : 
    2002                 :            : 
    2003                 :            :   //! \brief Gets the GeometryModifyEngine of this entity.
    2004                 :            :   GeometryModifyEngine *get_engine(TopologyBridge *tb_ptr) const;
    2005                 :            : 
    2006                 :            :   //! \brief Gets the GeometryModifyEngine of this entity.
    2007                 :            :   GeometryModifyEngine *get_engine(TopologyEntity *te_ptr,
    2008                 :            :                                    TopologyBridge** bridge = 0) const;
    2009                 :            : 
    2010                 :            :   /*! Finds the intersections of a certain distance (offset) between two
    2011                 :            :     * curves.  The two curves must lie in a plane.  The first curve is offset
    2012                 :            :     * the offset distance in both directions, and the bounded intersections with
    2013                 :            :     * the second curve are found.  The first curve can optionally be extended
    2014                 :            :     * to infinity for the intersection calculation.  The intent of the function
    2015                 :            :     * is so that the user can create a point on a curve a certain distance
    2016                 :            :     * from another curve, as in specifying a reference location for a gage
    2017                 :            :     * diameter on an arc in an engineering drawing.  The function allocates the
    2018                 :            :     * CubitVectors in the returned list, so be sure to free them.
    2019                 :            :     */
    2020                 :            :   //! \brief Finds the intersections of a certain distance (offset) between two curves.
    2021                 :            :   CubitStatus get_offset_intersections(RefEdge* ref_edge1, RefEdge* ref_edge2,
    2022                 :            :                                         DLIList<CubitVector> &intersection_list,
    2023                 :            :                                         double offset, CubitBoolean ext_first = CUBIT_TRUE );
    2024                 :            : 
    2025                 :            :   /*! Finds intersections (points) of the curve and surface.  The surface can
    2026                 :            :     * be offset - it is offset to each side and intersections are found.  By
    2027                 :            :     * default the surface is extended to infinity (if possible) and the
    2028                 :            :     * intersections are found.  The function allocates the CubitVectors in
    2029                 :            :     * the returned list, so be sure to free them.
    2030                 :            :     */
    2031                 :            :   //! \brief Finds intersections (points) of the curve and surface.  
    2032                 :            :   CubitStatus get_offset_intersections( RefEdge* ref_edge_ptr, RefFace* ref_face_ptr,
    2033                 :            :                                         DLIList<CubitVector> &intersection_list,
    2034                 :            :                                         double offset = 0.0,
    2035                 :            :                                         CubitBoolean ext_surf = CUBIT_TRUE );
    2036                 :            : 
    2037                 :            :   //! \brief From two surface, create a midplane, then trim it with a body.
    2038                 :            :   CubitStatus get_mid_plane( RefFace *ref_face_1,
    2039                 :            :                              RefFace *ref_face_2,
    2040                 :            :                              Body *body_to_trim_to,
    2041                 :            :                              DLIList<RefFace*> &mid_plane_surfs ) const;
    2042                 :            : 
    2043                 :            :   //! \brief Given 2 surfaces, this returns trimmed surfaces of
    2044                 :            :   //!  the midsurface (this is an ALPHA feature).
    2045                 :            :   CubitStatus get_mid_surface( RefFace *ref_face_1,
    2046                 :            :                              RefFace *ref_face_2,
    2047                 :            :                              Body *body_to_trim_to,
    2048                 :            :                              DLIList<RefFace*> &mid_plane_surfs ) const;
    2049                 :            : 
    2050                 :            :   //! \brief Sets the active geometry engine.
    2051                 :            :   CubitStatus set_default_gme(GeometryModifyEngine* GMEPtr);
    2052                 :            : 
    2053                 :            :   //! Get a subset of bodies from 'remaining_bodies' that share
    2054                 :            :   //! a common GeometryModifyEngine.  Remove them from
    2055                 :            :   //! 'remaining_bodies', put the Bodies and corresponding BodySMs in
    2056                 :            :   //! 'engine_bodies' and 'engine_body_sms', and return the engine.
    2057                 :            :   //! Returns NULL if all bodies remaining in the list have no
    2058                 :            :   //! modify engine.
    2059                 :            :   //! \brief Groups Bodies with the same underlying geometry engine into a list.
    2060                 :            :   GeometryModifyEngine* group_bodies_by_engine( DLIList<Body*>& remaining_bodies,
    2061                 :            :                                                 DLIList<Body*>& engine_bodies,
    2062                 :            :                                                 DLIList<BodySM*>& engine_body_sms ) const;
    2063                 :            : 
    2064                 :            :   static CubitStatus prepare_for_copy( RefEntity *ref_ents,
    2065                 :            :                                        TopologyBridge *&top_bridge );
    2066                 :            : 
    2067                 :            :   static CubitStatus finish_copy( TopologyBridge *&new_bridge,
    2068                 :            :                                   TopologyBridge *old_bridge );
    2069                 :            :   
    2070                 :            :   static CubitStatus clean_up_from_copy_failure( TopologyBridge *old_bridge );
    2071                 :            :   
    2072                 :            :   bool contains_composites(DLIList<TopologyBridge*>& bridge_list ) const;
    2073                 :            :   bool contains_partitions(DLIList<TopologyBridge*>& bridge_list ) const;
    2074                 :            :   bool contains_partitions( DLIList<Body*>& list ) const;
    2075                 :            :   bool contains_composites( DLIList<Body*>& list ) const;
    2076                 :            : 
    2077                 :            : protected :
    2078                 :            : 
    2079                 :            :   GeometryModifyTool(GeometryModifyEngine* GMEPtr);
    2080                 :            :   /**<  Constructor for the (singleton) GeometryModifyTool object
    2081                 :            :     */
    2082                 :            : 
    2083                 :            :   GeometryModifyEngine* make_RefEdge_common ( RefVertex* start_vertex,
    2084                 :            :                                               RefVertex* end_vertex,
    2085                 :            :                                               TBPoint*& start_point,
    2086                 :            :                                               TBPoint*& end_point,
    2087                 :            :                                               RefFace* ref_face = 0,
    2088                 :            :                                               Surface** surface = 0) const;
    2089                 :            :     //- Common code for misc. make_RefEdge functions.
    2090                 :            :     //- Input  : start and end vertices and an optional RefFace pointer.
    2091                 :            :     //- Returns: The modify engine to use to create the curve.
    2092                 :            :     //- Output : points in the returned modify engine and if a refface
    2093                 :            :     //-          was given, a surface in the modify engine.
    2094                 :            :     //- Determines which engine to use to create the curve and returns
    2095                 :            :     //- TopologyBridges owned by that surface.  New Points are created
    2096                 :            :     //- if either the RefVertex already has a parent RefEdge or because
    2097                 :            :     //- a common modify engine could not be found for all the input
    2098                 :            :     //- entities.
    2099                 :            : 
    2100                 :            :   CubitStatus okay_to_modify( DLIList<Body*>& bodies, const char* op ) const;
    2101                 :            : 
    2102                 :            :   GeometryModifyEngine* common_modify_engine( DLIList<Body*>& bodies,
    2103                 :            :                                               DLIList<BodySM*>& bodysms ) const;
    2104                 :            : 
    2105                 :            :   GeometryModifyEngine* common_modify_engine( DLIList<RefFace*>& faces,
    2106                 :            :                                               DLIList<Surface*>& surfaces,
    2107                 :            :                                               CubitBoolean allow_composites = CUBIT_FALSE ) const;
    2108                 :            :   GeometryModifyEngine* common_modify_engine( DLIList<RefEdge*>& edges,
    2109                 :            :                                               DLIList<Curve*>& curves,
    2110                 :            :                                               CubitBoolean allow_composites = CUBIT_FALSE ) const;
    2111                 :            :   GeometryModifyEngine* common_modify_engine( DLIList<RefVertex*>& vertices,
    2112                 :            :                                               DLIList<TBPoint*>& points,
    2113                 :            :                                               CubitBoolean allow_composites = CUBIT_FALSE ) const;
    2114                 :            : 
    2115                 :            :   GeometryModifyEngine* common_modify_engine( DLIList<TopologyEntity*>& topology_list,
    2116                 :            :                                               DLIList<TopologyBridge*>& engine_bridges,
    2117                 :            :                                               CubitBoolean allow_composites
    2118                 :            :                                               = CUBIT_FALSE ) const;
    2119                 :            :   /**<  \return GeometryModifyEngine*
    2120                 :            :     *   A GeometryModifyEngine common at least one
    2121                 :            :     *   TopologyBridge of each of the passed TopologyEntities, or
    2122                 :            :     *   NULL if no common geometry engine is found.
    2123                 :            :     *   \arg topology_list
    2124                 :            :     *   The input list of TopologyEntities
    2125                 :            :     *   \arg engine_bridges
    2126                 :            :     *   Pass back the list of TopolgyBridges associated with each
    2127                 :            :     *   of the passed TopologyEntities (topology_list) and owned
    2128                 :            :     *   by the returned geometry engine.
    2129                 :            :     *   \arg allow_virtual_engine
    2130                 :            :     *   Return VirtualGeometryEngine::instance() if no common
    2131                 :            :     *   geometry enginge can be found.
    2132                 :            :     *
    2133                 :            :     *   Look for a common geometry engine other than the
    2134                 :            :     *   VirtualGeometryEngine.  If no common geometry engine other
    2135                 :            :     *   than VGE can be found and allow_virtual_engine is FALSE,
    2136                 :            :     *   NULL is returned.  If allow_virtual_engine is TRUE, and no
    2137                 :            :     *   common geometry engine is found, VGE will be returned, and
    2138                 :            :     *   engine_bridges will be populated with any virtual geometry
    2139                 :            :     *   if possible, otherwise with the first topology bridge attached
    2140                 :            :     *   to each of the passed TopologyEntities.
    2141                 :            :     */
    2142                 :            : 
    2143                 :            : public:  
    2144                 :            : 
    2145                 :            :   //! \brief Internal use only. 
    2146                 :            :   CubitStatus finish_sm_op( DLIList<Body*>& input_bodies,
    2147                 :            :                             DLIList<BodySM*>& new_bodies,
    2148                 :            :                             DLIList<Body*>& result_bodies,
    2149                 :            :                             bool print_info = true ) const;
    2150                 :            :     //- Common code for completion of solid model engine operations
    2151                 :            :     //- on a set of bodies.
    2152                 :            :     //I input_bodies
    2153                 :            :     //I- A list of potentially modified or deleted bodies that were
    2154                 :            :     //I- were passed as input to the solid modeling operation.
    2155                 :            :     //I new_bodies
    2156                 :            :     //I- New bodies created during the solid modeling operation.
    2157                 :            :     //I result_bodies
    2158                 :            :     //I- New Bodys created for the BodySMs in new_bodies.
    2159                 :            :     //I update_input_bodies
    2160                 :            :     //I- Update DAG for non-deleted input_bodies
    2161                 :            :     //I delete_old_first
    2162                 :            :     //I- Clean out all deactivated geometry from input_bodies
    2163                 :            :     //I- before generating any new entities.  This has effect
    2164                 :            :     //I- on the resulting topology or IDs, but does affect the
    2165                 :            :     //I- names on new entities.
    2166                 :            : 
    2167                 :            : protected:
    2168                 :            : 
    2169                 :            :   GeometryModifyEngine* tweak_setup( DLIList<RefFace*>& input_faces,
    2170                 :            :                                      const char* tweak_function_name,
    2171                 :            :                                      DLIList<Body*>& old_bodies_out,
    2172                 :            :                                      DLIList<Surface*>& surfaces_out,
    2173                 :            :                                      CubitBoolean allow_composites = CUBIT_FALSE);
    2174                 :            : 
    2175                 :            :   GeometryModifyEngine* tweak_setup( DLIList<RefEdge*>& input_edges,
    2176                 :            :                                      const char* tweak_function_name,
    2177                 :            :                                      DLIList<Body*>& old_bodies_out,
    2178                 :            :                                      DLIList<Curve*>& curves_out,
    2179                 :            :                                      CubitBoolean allow_composites = CUBIT_FALSE );
    2180                 :            : 
    2181                 :            :   GeometryModifyEngine* tweak_setup( DLIList<RefVertex*> &input_vertices,
    2182                 :            :                                      const char* name,
    2183                 :            :                                      DLIList<Body*> &output_bodies,
    2184                 :            :                                      DLIList<TBPoint*> &output_points,
    2185                 :            :                                      CubitBoolean allow_composites = CUBIT_FALSE );
    2186                 :            : 
    2187                 :            :   CubitStatus sweep_setup ( const char* sweep_function_name,
    2188                 :            :                             DLIList<RefEntity*>& entity_list,
    2189                 :            :                             DLIList<Body*>& body_list,
    2190                 :            :                             GeometryModifyEngine*& engine,
    2191                 :            :                             CubitBoolean& changed_new_ids,
    2192                 :            :                             DLIList<GeometryEntity*>& geom_list,
    2193                 :            :                             bool keep_old,
    2194                 :            :                             DLIList<RefEdge*>* edge_list = 0,
    2195                 :            :                             DLIList<Curve*>* curve_list = 0 );
    2196                 :            :     //- Common setup code for sweep functions
    2197                 :            :     //I sweep_function_name
    2198                 :            :     //I- Name to use in error messages.
    2199                 :            :     //I entity_list
    2200                 :            :     //I- Input entity list to be swept
    2201                 :            :     //O body_list
    2202                 :            :     //O- Existing bodies that could potentially be modified.
    2203                 :            :     //O engine
    2204                 :            :     //O- Engine to call sweep_* on.
    2205                 :            :     //O change_new_ids
    2206                 :            :     //O- Save this value and pass into sweep_finish to make sure
    2207                 :            :     //O- state of 'new ids' is restored.
    2208                 :            :     //O geom_list
    2209                 :            :     //O- TopologyBridges to pass to the sweep fuction of the ModifyEngine.
    2210                 :            :     //I edge_list
    2211                 :            :     //I- RefEdges describing sweep path
    2212                 :            :     //O curve_list
    2213                 :            :     //O- Curves corresponding to edges in edge_list.
    2214                 :            : 
    2215                 :            :   CubitStatus imprint_singly( DLIList<Body*>& body_list,
    2216                 :            :                               DLIList<Body*>& new_bodies,
    2217                 :            :                               CubitBoolean keep_old );
    2218                 :            :     //- Implementation of imprint(..) when group_imprint is false.
    2219                 :            : 
    2220                 :            :   void remove_dead_entity_names( RefEntity* entity ) const;
    2221                 :            :     //- If the passed entity or any child entities are dead
    2222                 :            :     //- (have no TopologyBridges), remove entity names.
    2223                 :            : 
    2224                 :            :   Body* update_body( Body* body ) const;
    2225                 :            :     //- Destroy or update modified body, as appropriate.
    2226                 :            : 
    2227                 :            : private :
    2228                 :            : 
    2229                 :            :   //! \brief Static pointer to the unique instance of this class.
    2230                 :            :   static GeometryModifyTool* instance_;
    2231                 :            : 
    2232                 :            :   //! \brief Use group imprinting, which is much faster. Default: true.
    2233                 :            :   static CubitBoolean groupImprint;
    2234                 :            : 
    2235                 :            :   //! \brief An object will be unmeshed if modified or deleted. Default: true.
    2236                 :            :   static CubitBoolean meshAutodelete;
    2237                 :            : 
    2238                 :            :   //! \brief  An object will be cached if the mesh is autodeleted
    2239                 :            :   //!  and can be remeshed later.  Default: false.
    2240                 :            :   static CubitBoolean meshAutodeleteRemesh;
    2241                 :            : 
    2242                 :            :   //! \brief Causes code to reuse old ids, which are more persistent.  Default: false.
    2243                 :            :   static CubitBoolean newIds;
    2244                 :            : 
    2245                 :            :   //! \brief Attempt entity naming backwards compatible with v8/pre-bool-on-merged.  Default:
    2246                 :            :   //! false.
    2247                 :            :   static CubitBoolean oldNames;
    2248                 :            : 
    2249                 :            :   //! \brief Separate the result bodies of webcutting into single-body volumes. 
    2250                 :            :   //!  Default: true.
    2251                 :            :   static CubitBoolean sepAfterWebcut;
    2252                 :            : 
    2253                 :            :   /*!  Option for  to know if we should imprint all of the edges
    2254                 :            :     *  or only relevant ones.  For now, default is false, but check
    2255                 :            :     *  the .cc file.  The user can control this by a "set" nonregimprint
    2256                 :            :     *  command.  Default: true.
    2257                 :            :     */
    2258                 :            :   static CubitBoolean allEdgesImprint;
    2259                 :            : 
    2260                 :            :   //! \brief Regularized booleans are performed.  Default: true.
    2261                 :            :   static CubitBoolean booleanRegularize;
    2262                 :            : 
    2263                 :            :   //! \brief Unite operations can mix sheet bodies with solid bodies.  Default: true.
    2264                 :            :   static CubitBoolean uniteMixedModels;
    2265                 :            : 
    2266                 :            :   /*! Pointer to the entity being copied.  When copying an entity, used to 
    2267                 :            :       prevent to copying of unique id and saved-merged-ids attributes. 
    2268                 :            :   */
    2269                 :            :   //! \brief This pointer points to the entity that is being copied.  
    2270                 :            :   static RefEntity *copyingEntity;
    2271                 :            : 
    2272                 :            :   //! \brief The list of geometry modify engines.
    2273                 :            :   DLIList<GeometryModifyEngine*> gmeList;
    2274                 :            : 
    2275                 :            :   void get_merged_curve_and_surface_ids( DLIList<Body*> &bodies,
    2276                 :            :                                          DLIList<int> &merged_surface_ids,
    2277                 :            :                                          DLIList<int> &merged_curve_ids ) const;
    2278                 :            : 
    2279                 :            :   CubitStatus match_v1_to_c1(RefVertex *&v1,
    2280                 :            :                                              RefVertex *&v2,
    2281                 :            :                                              RefVertex *c1_v1,
    2282                 :            :                                              RefVertex *c1_v2,
    2283                 :            :                                              RefVertex *c2_v1,
    2284                 :            :                                              RefVertex *c2_v2);
    2285                 :            : 
    2286                 :            :   CubitStatus find_best_curves_to_merge(DLIList<RefEdge*> *&curves_from_curve1,
    2287                 :            :                                         DLIList<RefEdge*> *&curves_from_curve2,
    2288                 :            :                                         RefEdge *&curve1,
    2289                 :            :                                         RefEdge *&curve2);
    2290                 :            : 
    2291                 :            :   CubitStatus unmerge_and_return_merge_partners(RefEdge *input_curve, 
    2292                 :            :                                                 DLIList<DLIList<RefEdge*>*> &curve_merge_lists,
    2293                 :            :                                                 DLIList<DLIList<RefFace*>*> &surf_merge_lists);
    2294                 :            : 
    2295                 :            :   CubitStatus unmerge_input(RefEdge *curve1,
    2296                 :            :                           RefEdge *curve2,
    2297                 :            :                           DLIList<DLIList<RefEdge*>*> &curve_merge_lists,
    2298                 :            :                           DLIList<DLIList<RefFace*>*> &surf_merge_lists);
    2299                 :            : 
    2300                 :            :   CubitStatus calculate_split_points_for_merge(RefEdge* c1, 
    2301                 :            :                                                RefEdge* c2,
    2302                 :            :                                                DLIList<RefVertex*> &verts_to_merge,
    2303                 :            :                                                double *merge_tolerance,
    2304                 :            :                                                DLIList<CubitVector> &merge_end_points_on_curve1,
    2305                 :            :                                                DLIList<CubitVector> &merge_end_points_on_curve2,
    2306                 :            :                                                DLIList<CubitBoolean> &split_flags_for_curve1,
    2307                 :            :                                                DLIList<CubitBoolean> &split_flags_for_curve2,
    2308                 :            :                                                double divergence_angle);
    2309                 :            :   CubitStatus find_overlap_region(RefEdge *c1, 
    2310                 :            :                                             RefEdge *c2,
    2311                 :            :                                             RefVertex *v1,
    2312                 :            :                                             RefVertex *v2,
    2313                 :            :                                             bool forward_c1,
    2314                 :            :                                             bool forward_c2,
    2315                 :            :                                             bool &full_c1,
    2316                 :            :                                             bool &full_c2,
    2317                 :            :                                             double &c1_stop_param,
    2318                 :            :                                             double &c2_stop_param,
    2319                 :            :                                             double divergence_angle);
    2320                 :            :   CubitStatus separate_body_after_webcut (DLIList<Body*> &input_list,
    2321                 :            :                                           DLIList<Body*> &output_list) const;
    2322                 :            :   /**<  Separates each body in the input list to have one volume per body,
    2323                 :            :     *   and places the new list of bodies in the output_list. Should
    2324                 :            :     *   only be called after webcutting. (Checks sepAfterWebcut flag.)
    2325                 :            :     */
    2326                 :            : 
    2327                 :            :   void fixup_merged_entities( DLIList<int> &merged_surface_ids,
    2328                 :            :                               DLIList<int> &merged_curve_ids ) const;
    2329                 :            : 
    2330                 :            :   bool contains_intermediate_geom(DLIList<Body*>& list) const;
    2331                 :            :   bool contains_intermediate_geom(DLIList<TopologyBridge*>& list) const;
    2332                 :            : 
    2333                 :            :   void do_attribute_setup(void);
    2334                 :            :   void do_attribute_cleanup(void);
    2335                 :            :   void push_attributes_before_modify(DLIList<BodySM*> &old_sms);
    2336                 :            :   CubitStatus restore_vg_after_modify(DLIList<BodySM*> &new_sms,
    2337                 :            :                                       DLIList<Body*> &old_bodies,
    2338                 :            :                                       GeometryModifyEngine *gme);
    2339                 :            :   void remove_pushed_attributes(DLIList<BodySM*> &new_sms,
    2340                 :            :                                       DLIList<Body*> &old_bodies);
    2341                 :            :   void push_imprint_attributes_before_modify(DLIList<BodySM*> &old_sms);
    2342                 :            :   void push_named_attributes_to_curves_and_points(DLIList<TopologyBridge*> &tb_list, const char *name_in);
    2343                 :            :   void remove_imprint_attributes_after_modify(DLIList<BodySM*> &body_sms,
    2344                 :            :                                               DLIList<BodySM*> &new_sms);
    2345                 :            : 
    2346                 :            :   //! draw a preview of a plane for webcut previews
    2347                 :            :   static void plane_preview(DLIList<Body*> &body_list,
    2348                 :            :                             const CubitVector &pt1,
    2349                 :            :                             const CubitVector &pt2,
    2350                 :            :                             const CubitVector &pt3);
    2351                 :            : 
    2352                 :            :   void propagate_from_small_edge( RefEdge *edge,
    2353                 :            :                                   DLIList<RefEdge*> &small_edges,
    2354                 :            :                                   DLIList<RefFace*> &narrow_faces,
    2355                 :            :                                   DLIList<RefFace*> &processed_faces,
    2356                 :            :                                   double small_edge_length);
    2357                 :            :   void propagate_over_narrow_face( RefFace *narrow_face,
    2358                 :            :                                    RefEdge *edge,
    2359                 :            :                                    DLIList<RefFace*> &processed_faces,
    2360                 :            :                                    DLIList<RefEdge*> &small_edges,
    2361                 :            :                                    DLIList<RefFace*> &narrow_faces,
    2362                 :            :                                    double small_edge_length);
    2363                 :            : 
    2364                 :            :   void propagate_merge_tolerance(DLIList<Body*> &body_list);
    2365                 :            :   void push_tolerance_attribute(DLIList<Body*> &body_list);
    2366                 :            : 
    2367                 :            :   CubitStatus prepare_bc_for_webcut();
    2368                 :            :   CubitStatus finish_bc_webcut();
    2369                 :            : 
    2370                 :            :   CubitStatus sweep_finish( const char* const sweep_function_name,
    2371                 :            :                             DLIList<Body*>& input_body_list,
    2372                 :            :                             DLIList<BodySM*>& new_body_list,
    2373                 :            :                             DLIList<Body*>& output_body_list,
    2374                 :            :                             CubitBoolean restore_newids );
    2375                 :            :     //- Common cleanup code for sweep functions
    2376                 :            :     //I sweep_function_name
    2377                 :            :     //I- Name to use in error messages.
    2378                 :            :     //I input_body_list
    2379                 :            :     //I- Bodies that may need to be updated.
    2380                 :            :     //I new_body_list
    2381                 :            :     //I- SMbodies returned by GeometryModifyEngine
    2382                 :            :     //I output_body_list
    2383                 :            :     //I- ref_bodies returned by GeometryModifyEngine
    2384                 :            :     //I restore_newids
    2385                 :            :     //I- Passed back from sweep_setup -- restore setting state.
    2386                 :            : 
    2387                 :            :   CubitStatus finish_webcut( DLIList<Body*>& input_bodies,
    2388                 :            :                              DLIList<BodySM*>& webcut_results,
    2389                 :            :                              CubitBoolean merge,
    2390                 :            :                              CubitStatus webcut_status,
    2391                 :            :                              DLIList<Body*>& new_bodies,
    2392                 :            :                              DLIList<int> *merged_surface_ids = NULL,
    2393                 :            :                              DLIList<int> *merged_curve_ids = NULL,
    2394                 :            :                              CubitBoolean print_info = CUBIT_TRUE ) const;
    2395                 :            :     //- Helper function for all webcut functions.
    2396                 :            :     //- Finish up DAG update, merging, etc. after GME does webcut.
    2397                 :            :     //I input_bodies
    2398                 :            :     //I- The list of bodies that were webcut
    2399                 :            :     //I webcut_results
    2400                 :            :     //I- The new bodies returned by the GME webcut.
    2401                 :            :     //I merge
    2402                 :            :     //I- Merge after webcut
    2403                 :            :     //I webcut_status
    2404                 :            :     //I- The return value from the GME webcut function
    2405                 :            :     //O new_bodies
    2406                 :            :     //O- The new Bodies constructed from the passed BodySMs.
    2407                 :            :     //R CubitStatus
    2408                 :            :     //R- CUBIT_FAILURE on error, webcut_status on success.
    2409                 :            :     //- Does separate_body_after_webcut for all bodies if
    2410                 :            :     //- webcut_status == CUBIT_SUCCESS
    2411                 :            :     //- Merges bodies if webcut_status == CUBIT_SUCCESS AND merge == CUBIT_TRUE
    2412                 :            : 
    2413                 :            :   CubitStatus tweak_remove( DLIList<RefFace*> &ref_face_list,
    2414                 :            :                             DLIList<Body*> &new_body_list,
    2415                 :            :                             CubitBoolean extend_adjoining = CUBIT_TRUE,
    2416                 :            :                             CubitBoolean keep_surface = CUBIT_FALSE,
    2417                 :            :                             CubitBoolean keep_old_body = CUBIT_FALSE,
    2418                 :            :                             CubitBoolean preview = CUBIT_FALSE);
    2419                 :            :   /**<  Remove surfaces from a body or bodies and then extend the adjoining
    2420                 :            :     *   surfaces to fill the gap or remove the hole.  Only called by
    2421                 :            :     *   tweak_remove_individually, tweak_remove_together.
    2422                 :            :     */
    2423                 :            : 
    2424                 :            :   void get_neighboring_bodies( DLIList<Body*> &input_bodies,
    2425                 :            :                                DLIList<Body*> &neighboring_bodies );
    2426                 :            : 
    2427                 :            : 
    2428                 :            :   CubitStatus unite_separately( GeometryModifyEngine *gme_ptr,
    2429                 :            :                                 DLIList<Body*> &body_list,
    2430                 :            :                                 DLIList<Body*> &new_body_list,
    2431                 :            :                                 bool keep_old );
    2432                 :            :   CubitStatus unite_all( GeometryModifyEngine *gme_ptr,
    2433                 :            :                          DLIList<Body*> &body_list,
    2434                 :            :                          DLIList<Body*> &new_body_list,
    2435                 :            :                          bool keep_old );
    2436                 :            :   /**<  Private functions called to unite bodies.  First form separates the
    2437                 :            :     *   body list into sheets & solids and unites each group together 
    2438                 :            :     *   separately.  Second one unites all bodies together (including sheets
    2439                 :            :     *   & solids.
    2440                 :            :     */
    2441                 :            : 
    2442                 :            :   CubitStatus unite_private( GeometryModifyEngine *gme_ptr,
    2443                 :            :                              DLIList<Body*> &body_list,
    2444                 :            :                              DLIList<Body*> &new_body_list,
    2445                 :            :                              bool keep_old );
    2446                 :            :   /**<  Private lower level function called to unite bodies
    2447                 :            :     */
    2448                 :            : 
    2449                 :            :   GeometryModifyEngine * pull_common_surfs( DLIList<RefFace*> &ref_face_list,
    2450                 :            :                                             DLIList<RefFace*> &common_face_list,
    2451                 :            :                                             DLIList<Surface*> &common_surf_list );
    2452                 :            :     /**< Pull RefFaces with a common GeometryModifyEngine out of the input
    2453                 :            :       *  ref_face_list.  Place their surfaces in the output RefFace and Surface
    2454                 :            :       *  lists, and return the common modify engine.  Note the function returns
    2455                 :            :       *  a NULL pointer if a RefFace without a modify engine is found in the
    2456                 :            :       *  input list.
    2457                 :            :       */
    2458                 :            : 
    2459                 :            :   void remove_bodies_outside_bounding_box( DLIList<Body*> &body_list, CubitVector v1, CubitVector v2, CubitVector v3 );  
    2460                 :            :   void remove_bodies_outside_bounding_box( DLIList<Body*> &body_list, CubitBox &tool_bounding_box );
    2461                 :            :   CubitVector FindExtendedEndPt(  double outer_rad , double inner_rad , CubitVector inner_AxisPt , 
    2462                 :            :                                 CubitVector Axis , double Height );
    2463                 :            : 
    2464                 :            :   CubitVector FindExtendedStartPt(  CubitBox box ,  double outer_rad , double inner_rad , CubitVector inner_AxisPt , 
    2465                 :            :                                 CubitVector Axis , double &Height , double dTanAngle , double &dExtendedadius );
    2466                 :            : 
    2467                 :            :   void  FindExtendedPoints( CubitVector AxisPt1 , CubitVector AxisPt2 , double outer_radius , double inner_radius , 
    2468                 :            :                             CubitVector axis,double Height , CubitBox bounding_box , double dTanAngle , CubitVector& start , 
    2469                 :            :                             CubitVector& end , double& dExtended_OuterRadius, double& dExtended_InnerRadius  );
    2470                 :            : 
    2471                 :            :   void preview_align( CubitVector translation_to_origin,
    2472                 :            :                       CubitVector origin_to_target,
    2473                 :            :                       double angle_of_rotation,
    2474                 :            :                       CubitVector axis_of_rotation,
    2475                 :            :                       DLIList<RefEntity*> &entities );
    2476                 :            : 
    2477                 :            :   static CubitStatus create_old_to_new_ref_ent_map( 
    2478                 :            :     TopologyBridge *old_top_level_bridge,
    2479                 :            :     TopologyBridge *new_top_level_bridge,
    2480                 :            :     std::map< RefEntity*, RefEntity* > &old_to_new_map,
    2481                 :            :     std::map< TopologyBridge*, TopologyBridge*> &old_tb_to_new_tb );
    2482                 :            : 
    2483                 :            : };
    2484                 :            : 
    2485                 :          0 : inline void GeometryModifyTool::set_all_edges_imprint( CubitBoolean flag )
    2486                 :          0 : {allEdgesImprint = flag;}
    2487                 :          0 : inline CubitBoolean GeometryModifyTool::get_all_edges_imprint()
    2488                 :          0 : {return allEdgesImprint;}
    2489                 :            : 
    2490                 :            : inline CubitBoolean GeometryModifyTool::boolean_regularize()
    2491                 :            : {return booleanRegularize;}
    2492                 :            : inline void GeometryModifyTool::boolean_regularize(CubitBoolean flag)
    2493                 :            : {booleanRegularize = flag;}
    2494                 :            : 
    2495                 :         87 : inline CubitBoolean GeometryModifyTool::unite_mixed_models()
    2496                 :         87 : {return uniteMixedModels;}
    2497                 :            : inline void GeometryModifyTool::unite_mixed_models(CubitBoolean flag)
    2498                 :            : {uniteMixedModels = flag;}
    2499                 :            : 
    2500                 :       1715 : inline void GeometryModifyTool::add_gme(GeometryModifyEngine *gme_ptr)
    2501                 :            : {
    2502         [ -  + ]:       1715 :   assert(gme_ptr != 0);
    2503         [ +  - ]:       1715 :   if (!gmeList.move_to(gme_ptr)) gmeList.append(gme_ptr);
    2504                 :       1715 : }
    2505                 :            :   /**< add a geometry query engine to the list
    2506                 :            :    */
    2507                 :            : 
    2508                 :         11 : inline void GeometryModifyTool::get_gme_list(DLIList<GeometryModifyEngine*> &gme_list)
    2509                 :            : {
    2510                 :         11 :   gme_list += gmeList;
    2511                 :         11 : }
    2512                 :            :   /**< return the list of gme's
    2513                 :            :    */
    2514                 :            : 
    2515                 :         55 : inline GeometryModifyEngine *GeometryModifyTool::get_gme() const
    2516                 :            : {
    2517                 :         55 :   GeometryModifyEngine *gme = NULL;
    2518         [ +  - ]:         55 :   if (gmeList.size()) {
    2519                 :         55 :     const_cast<GeometryModifyTool*>(this)->gmeList.reset();
    2520                 :         55 :     gme = gmeList.get();
    2521                 :            :   }
    2522                 :         55 :   return gme;
    2523                 :            : }
    2524                 :            : 
    2525                 :            : #endif
    2526                 :            : 

Generated by: LCOV version 1.11