cgma
FacetModifyEngine.hpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Filename      : FacetModifyEngine.hpp
00003 //
00004 // Purpose       : ModifyEngine for faceted geometry
00005 //
00006 // Special Notes : Modeled after GeometryModifyEngine and OCCModifyEngine.
00007 //
00008 // Creator       : John Fowler
00009 //
00010 // Creation Date : 6/02
00011 //
00012 // Owner         : John Fowler
00013 //-------------------------------------------------------------------------
00014 
00015 #ifndef FACET_MODIFY_ENGINE_HPP
00016 #define FACET_MODIFY_ENGINE_HPP 
00017 
00018 #include "GeometryModifyEngine.hpp"
00019 #include <vector>
00020 #include <map> 
00021 
00022 class TBPoint;
00023 class TopologyBridge;
00024 class TopologyEntity;
00025 class ChollaSurface;
00026 class ChollaCurve;
00027 class ChollaPoint;
00028 class ChollaEngine;
00029 class CurveFacetEvalTool;
00030 class FacetEvalTool;
00031 class CubitPoint;
00032 class CubitFacet;
00033 class CubitFacetEdge;
00034 class CubitQuadFacet;
00035 class TBPoint;
00036 class CoEdgeSM;
00037 class ShellSM;
00038 class FacetBody;
00039 class Body;
00040 class RefFace;
00041 class FacetSurface;
00042 class FacetCurve;
00043 class FacetPoint;
00044 class CubitEvaluatorData;
00045 class SphereEvaluatorData;
00046 class CylinderEvaluatorData;
00047 
00048 class FacetModifyEngine : public GeometryModifyEngine
00049 {
00050   
00051 public:
00052   
00053   //HEADER- Constructor and Destructor
00054 private:
00055   
00056   FacetModifyEngine();
00057   
00058   static FacetModifyEngine* instance_;
00059   
00060 public:
00061   
00062   static inline FacetModifyEngine* instance()
00063   {
00064     if( !instance_ )
00065       instance_ = new FacetModifyEngine;
00066     return instance_;
00067   }
00068   
00069   static void initialize_settings();
00070   
00071   virtual ~FacetModifyEngine();
00072   //- virtual destructor
00073   
00074   virtual bool supports_interoperability() { return false; }
00075     //- Returns whether intermixing of real and virtual geometry operations
00076     //- is supported for the current geometry kernel.
00077 
00078   virtual bool supports_facets() { return true; }
00079 
00080   virtual TBPoint* make_Point( CubitVector const& point) const ;
00081   
00082   virtual Curve* make_Curve(Curve *curve_ptr,
00083     std::map<TopologyBridge*, TopologyBridge*> *old_tb_to_new_tb = NULL) const;
00084   //- creates a curve from an existing curve.  This creates totally
00085   //- new topology.  This function is useful for constructing geometry
00086   //- from existing geometry.
00087   
00088   virtual Curve* make_Curve( TBPoint const* point1_ptr,
00089     TBPoint const* point2_ptr,
00090     Surface* ref_face_ptr,
00091     const CubitVector *third_point = NULL) const;
00092   //- Create a curve exactly on the give ref_face.
00093   //- Make sure the points are on the underlying surface.
00094   
00095   virtual Curve* make_Curve( GeometryType curve_type,
00096     TBPoint const* point1_ptr,
00097     TBPoint const* point2_ptr,
00098     DLIList<CubitVector*>& vector_list,
00099     Surface* ref_face_ptr = NULL) const;
00100   
00101   virtual Curve* make_Curve( GeometryType curve_type,
00102     TBPoint const* point1_ptr,
00103     TBPoint const* point2_ptr,
00104     CubitVector const* intermediate_point_ptr) const;
00105 
00106   virtual Curve* make_Curve( DLIList<CubitVector*>& point_list,
00107                              DLIList<CubitVector*>& point_tangents) const;
00108   
00109   
00110   virtual Surface* make_Surface( Surface *old_surface_ptr,
00111     std::map< TopologyBridge*, TopologyBridge* > *old_tb_to_new_tb = NULL) const;
00112 
00113   virtual BodySM* make_extended_sheet( DLIList<Surface*> &surface_list,
00114                                        CubitBox *clip_box = NULL,
00115                                        bool preview = false ) const;
00116   
00117 #ifdef KCM_MESH_TO_GEOM
00118   virtual CubitStatus mesh2brep(std::vector<double> &xvals,
00119                         std::vector<double> &yvals,
00120                         std::vector<double> &zvals,
00121                         std::vector<unsigned int> &tri_connectivity,
00122                         DLIList<BodySM*> &new_body_sms) const;
00123 #endif
00124 
00125   virtual Surface* make_Surface( GeometryType surface_type,
00126     DLIList<Curve*>& curve_list,
00127     Surface *old_surface_ptr = NULL,
00128     bool check_edges = true ) const;
00129   
00130   virtual Lump* make_Lump( DLIList<Surface*>& surface_list ) const;
00131   
00132   //virtual Body *make_Body(Surface *) const;
00133   
00134   virtual BodySM* make_BodySM( Surface * ) const;
00135   
00136   virtual BodySM* make_BodySM( DLIList<Lump*>& /*lump_list*/ ) const;
00137   
00138   //virtual Chain *make_Chain(Curve *) const;
00139   
00140   virtual BodySM* sphere(double radius) const ;
00141   
00142   virtual BodySM* brick( double wid, double dep, double hi ) const ;
00143   
00144   virtual BodySM* brick( const CubitVector &center, 
00145                          const CubitVector axes[3],
00146                          const CubitVector &extension) const ;
00147   
00148   virtual BodySM* prism( double height, int sides, double major,
00149     double minor) const ;
00150   
00151   virtual BodySM* pyramid( double height, int sides, double major,
00152     double minor, double top=0.0) const ;
00153   
00154   virtual BodySM* cylinder( double hi, double r1, double r2,
00155     double r3 ) const ;
00156   
00157   virtual BodySM* torus( double r1, double r2 ) const ;
00158   
00159   virtual BodySM* planar_sheet ( const CubitVector& p1,
00160     const CubitVector& p2,
00161     const CubitVector& p3,
00162     const CubitVector& p4 ) const;
00163   
00164   virtual BodySM* copy_body( BodySM* body_sm,
00165         std::map<TopologyBridge*, TopologyBridge*> *old_tb_to_new_tb = NULL ) const;
00166 /*      
00167   virtual CubitStatus stitch_surfs(
00168                       DLIList<BodySM*>& surf_bodies,
00169                       BodySM*& stitched_body)const;
00170 */
00171   virtual BodySM* create_body( VolumeFacets& volume, std::map<FacetShapes*, GeometryEntity*>& entity_map, 
00172                                const FacetPointSet& points, int interp_order) const;
00173       
00174   virtual CubitStatus subtract(DLIList<BodySM*> &tool_body_list,
00175     DLIList<BodySM*> &from_bodies,
00176     DLIList<BodySM*> &new_bodies,
00177     bool imprint = false,
00178     bool keep_old = false) const;
00179   
00180   virtual CubitStatus imprint(BodySM* BodyPtr1, BodySM* BodyPtr2,
00181     BodySM*& newBody1, BodySM*& newBody2,
00182     bool keep_old) const;
00183   
00184   virtual CubitStatus imprint(DLIList<BodySM*> &from_body_list,
00185     DLIList<BodySM*> &new_from_body_list,
00186     bool keep_old, DLIList<TopologyBridge*> *new_tbs = NULL,
00187     DLIList<TopologyBridge*> *att_tbs = NULL) const;
00188   
00189   virtual CubitStatus imprint( DLIList<BodySM*> &body_list,
00190     DLIList<Curve*> &ref_edge_list,
00191     DLIList<BodySM*>& new_body_list,
00192     DLIList<TopologyBridge*> &temporary_bridges,
00193     bool keep_old_body,
00194     bool show_messages=CUBIT_TRUE) const;
00195   
00196   virtual CubitStatus imprint( DLIList<Surface*> &ref_face_list,
00197     DLIList<Curve*> &ref_edge_list,
00198     DLIList<TopologyBridge*> &temporary_bridges,
00199     DLIList<BodySM*>& new_body_list,
00200     bool keep_old_body ) const;
00201 
00202   virtual CubitStatus imprint( DLIList<Surface*> &surface_list,
00203     DLIList<DLIList<Curve*>*> &curve_lists_list,
00204     BodySM*& new_body,
00205     bool keep_old_body,
00206     bool expand = true,
00207     DLIList<TopologyBridge*> *new_tbs = NULL,
00208     DLIList<TopologyBridge*> *att_tbs = NULL ) const;
00209   
00210   virtual CubitStatus imprint( DLIList<BodySM*> &body_list,
00211     DLIList<CubitVector> &vector_list,
00212     DLIList<BodySM*>& new_body_list,
00213     bool keep_old_body,
00214     DLIList<TopologyBridge*> *new_tbs = NULL,
00215     DLIList<TopologyBridge*> *att_tbs = NULL,
00216     double *tol_in = NULL,
00217     bool clean_up_slivers = true) const;
00218   
00219   virtual CubitStatus imprint_projected_edges( DLIList<Surface*> &ref_face_list,
00220     DLIList<Curve*> &ref_edge_list,
00221     DLIList<BodySM*>& new_body_list,
00222     DLIList<Curve*> &kept_edge_list,
00223     bool keep_old_body,
00224     bool keep_free_edges) const;
00225   
00226   virtual CubitStatus imprint_projected_edges(DLIList<Surface*> &ref_face_list,
00227     DLIList<BodySM*> &body_list,
00228     DLIList<Curve*> &ref_edge_list,
00229     DLIList<BodySM*>& new_body_list,
00230     bool keep_old_body,
00231     bool keep_free_edges) const;
00232   
00233   virtual CubitStatus project_edges( DLIList<Surface*> &ref_face_list,
00234     DLIList<Curve*> &ref_edge_list_in,
00235     DLIList<Curve*> &ref_edge_list_new,
00236     bool print_error = true ) const;
00237  
00238   virtual CubitStatus remove_topology(DLIList<Curve*> &curves_to_remove,
00239                                        DLIList<Surface*> &surfs_to_remove,
00240                                        double backoff_distance,
00241                                        double small_edge_size,
00242                                        DLIList<BodySM*> &new_bodysm_list,
00243                                        CubitBoolean preview) const;
00244 
00245   virtual CubitStatus curve_surface_intersection( Surface *surface, 
00246                                                   Curve* curve,
00247                                                   DLIList<Curve*> &new_curves ) const;
00248 
00249   virtual CubitStatus intersect(BodySM* tool_body_ptr,
00250     DLIList<BodySM*> &from_bodies,
00251     DLIList<BodySM*> &new_bodies,
00252     bool keep_old = CUBIT_FALSE,
00253     bool preview = CUBIT_FALSE ) const;
00254   
00255   virtual CubitStatus chop(DLIList<BodySM*> &bodies, 
00256                            DLIList<BodySM*> &intersectBodies,
00257                            DLIList<BodySM*> &outsideBody, 
00258                            BodySM*& leftoversBody,
00259                            bool keep_old = CUBIT_FALSE,
00260                            bool nonreg = CUBIT_FALSE) const;
00261   
00262   virtual CubitStatus unite(DLIList<BodySM*> &bodies, 
00263                             DLIList<BodySM*> &newBodies,
00264                             bool keep_old = CUBIT_FALSE) const;
00265 
00266   virtual void get_possible_invalid_tbs(DLIList<TopologyBridge*> &bridges_in,
00267                              DLIList<TopologyBridge*> &bridges_out);
00268   
00269   virtual CubitStatus thicken(DLIList<BodySM*>& bodies, 
00270     DLIList<BodySM*>& new_bodies,
00271     double depth,
00272     bool both = CUBIT_FALSE) const ;
00273 
00274   virtual CubitStatus hollow(DLIList<BodySM*>& bodies,
00275                              DLIList<Surface*>& surfs_to_remove,
00276                              DLIList<BodySM*>& new_bodies,
00277                              double depth) const ;
00278 
00279   virtual CubitStatus flip_normals( DLIList<Surface*>& face_list ) const;
00280   
00281   virtual CubitStatus  sweep_translational(
00282     DLIList<GeometryEntity*>& ref_ent_list,
00283     DLIList<BodySM*>& result_body_list,
00284     const CubitVector& sweep_vector,
00285     double draft_angle,
00286     int draft_type,
00287     bool switchside,
00288     bool rigid,
00289     bool anchor_entity=CUBIT_FALSE,
00290     bool keep_old=CUBIT_FALSE ) const;
00291   
00292   virtual CubitStatus  sweep_perpendicular(
00293     DLIList<GeometryEntity*>& ref_ent_list,
00294     DLIList<BodySM*>& result_body_list,
00295     double distance,
00296     double draft_angle,
00297     int draft_type,
00298     bool switchside,
00299     bool rigid,
00300     bool anchor_entity=CUBIT_FALSE,
00301     bool keep_old=CUBIT_FALSE ) const;
00302   
00303   virtual CubitStatus  sweep_rotational(
00304     DLIList<GeometryEntity*>& ref_ent_list,
00305     DLIList<BodySM*>& result_body_list,
00306     const CubitVector& point,
00307     const CubitVector& direction,
00308     double angle,
00309     int steps = 0,
00310     double draft_angle = 0.0,
00311     int draft_type = 0,
00312     bool switchside = CUBIT_FALSE,
00313     bool make_solid = CUBIT_FALSE,
00314     bool rigid = CUBIT_FALSE,
00315     bool anchor_entity=CUBIT_FALSE,
00316     bool keep_old=CUBIT_FALSE ) const;
00317   
00318   virtual CubitStatus sweep_along_curve(
00319     DLIList<GeometryEntity*>& ref_ent_list,
00320     DLIList<BodySM*>& result_body_list,
00321     DLIList<Curve*>& ref_edge_list,
00322     double draft_angle = 0.0,
00323     int draft_type = 0,
00324     bool rigid = CUBIT_FALSE,
00325     bool anchor_entity=CUBIT_FALSE,
00326     bool keep_old=CUBIT_FALSE ) const;
00327 
00328   virtual CubitStatus sweep_to_body(
00329     DLIList<Curve*> curve_list,
00330     BodySM *target_body,
00331     CubitVector distance,
00332     DLIList<BodySM*> &new_bodies,
00333     bool unite) const;
00334 
00335   virtual CubitStatus sweep_to_body(
00336     Surface *source_surface,
00337     BodySM *target_body,
00338     CubitVector distance,
00339     DLIList<BodySM*> &new_bodies) const;
00340  
00341 
00342     virtual CubitStatus webcut_with_sweep_surfaces(
00343                           DLIList<BodySM*> &blank_bodies,
00344                           DLIList<Surface*> &surfaces,
00345                           const CubitVector& sweep_vector,
00346                           bool sweep_perp, 
00347                           bool through_all,
00348                           bool outward,
00349                           bool up_to_next, 
00350                           Surface *stop_surf, 
00351                           Curve *curve_to_sweep_along, 
00352                           DLIList<BodySM*> &neighbor_imprint_list,
00353                           DLIList<BodySM*> &results_list,
00354                           ImprintType imprint_type = NO_IMPRINT,
00355                           CubitBoolean preview = false);
00356 
00357     virtual CubitStatus webcut_with_sweep_curves(
00358                           DLIList<BodySM*> &blank_bodies,
00359                           DLIList<Curve*> &curves,
00360                           const CubitVector& sweep_vector,
00361                           bool through_all, 
00362                           Surface *stop_surf, 
00363                           Curve *curve_to_sweep_along, 
00364                           DLIList<BodySM*> &neighbor_imprint_list,
00365                           DLIList<BodySM*> &results_list,
00366                           ImprintType imprint_type = NO_IMPRINT,
00367                           CubitBoolean preview = false);
00368 
00369     virtual CubitStatus webcut_with_sweep_curves_rotated(
00370                           DLIList<BodySM*> &blank_bodies,
00371                           DLIList<Curve*> &curves,
00372                           const CubitVector &point,
00373                           const CubitVector &sweep_axis,
00374                           double angle,
00375                           Surface *stop_surf, 
00376                           DLIList<BodySM*> &neighbor_imprint_list,
00377                           DLIList<BodySM*> &results_list,
00378                           ImprintType imprint_type = NO_IMPRINT,
00379                           CubitBoolean preview = false);
00380 
00381     virtual CubitStatus webcut_with_sweep_surfaces_rotated(
00382                             DLIList<BodySM*> &blank_bodies,
00383                             DLIList<Surface*> &surfaces,
00384                             const CubitVector &point, 
00385                             const CubitVector &sweep_axis, 
00386                             double angle, 
00387                             Surface *stop_surf, 
00388                             bool up_to_next, 
00389                             DLIList<BodySM*> &neighbor_imprint_list,
00390                             DLIList<BodySM*> &results_list,
00391                             ImprintType imprint_type = NO_IMPRINT,
00392                             CubitBoolean preview = false); 
00393 
00394   //HEADER- Webcut-related functions
00395   virtual CubitStatus webcut(DLIList<BodySM*>& webcut_body_list,
00396     const CubitVector &v1,
00397     const CubitVector &v2,
00398     const CubitVector &v3,
00399     DLIList<BodySM*>& neighbor_imprint_list,
00400     DLIList<BodySM*>& results_list,
00401     ImprintType imprint_type = NO_IMPRINT,
00402     bool preview = false) const;
00403   
00404   virtual CubitStatus webcut(DLIList<BodySM*>& webcut_body_list,
00405     BodySM const* tool_body,
00406     DLIList<BodySM*>& neighbor_imprint_list,
00407     DLIList<BodySM*>& results_list,
00408     ImprintType imprint_type = NO_IMPRINT,
00409     bool preview = false) const;
00410   
00411   virtual CubitStatus webcut_across_translate( DLIList<BodySM*>& body_list,
00412     Surface* plane_surf1,
00413     Surface* plane_surf2,
00414     DLIList<BodySM*>& neighbor_imprint_list,
00415     DLIList<BodySM*>& results_list,
00416     ImprintType imprint_type = NO_IMPRINT,
00417     bool preview = false) const;
00418   
00419   virtual CubitStatus webcut_with_sheet(DLIList<BodySM*> &webcut_body_list,
00420     BodySM *sheet_body,
00421     DLIList<BodySM*>& neighbor_imprint_list,
00422     DLIList<BodySM*> &new_bodies,
00423     ImprintType imprint_type = NO_IMPRINT,
00424     bool preview = false);
00425   
00426   virtual CubitStatus webcut_with_extended_sheet(DLIList<BodySM*> &webcut_body_list,
00427     DLIList<Surface*> &surface_list,
00428     DLIList<BodySM*>& neighbor_imprint_list,
00429     DLIList<BodySM*> &new_bodies,
00430     int &num_cut,
00431     ImprintType imprint_type = NO_IMPRINT,
00432     bool preview = false);
00433   
00434   virtual CubitStatus webcut_with_cylinder(DLIList<BodySM*> &webcut_body_list,
00435     double radius,
00436     const CubitVector &axis,
00437     const CubitVector &center,
00438     DLIList<BodySM*>& neighbor_imprint_list,
00439     DLIList<BodySM*>& results_list,
00440     ImprintType imprint_type = NO_IMPRINT,
00441     bool preview = false);
00442   
00443   virtual CubitStatus webcut_with_brick( DLIList<BodySM*>& webcut_body_list, 
00444     const CubitVector &center,
00445     const CubitVector axes[3], 
00446     const CubitVector &extension,
00447     DLIList<BodySM*>& neighbor_imprint_list,
00448     DLIList<BodySM*> &results_list,
00449     ImprintType imprint_type = NO_IMPRINT,
00450     bool preview = false);
00451   
00452   virtual CubitStatus webcut_with_planar_sheet( DLIList<BodySM*>& webcut_body_list,
00453     const CubitVector &center,
00454     const CubitVector axes[2],
00455     double width, double height,
00456     DLIList<BodySM*>& neighbor_imprint_list,
00457     DLIList<BodySM*> &results_list,
00458     ImprintType imprint_type = NO_IMPRINT,
00459     bool preview = false);
00460   
00461   virtual CubitStatus webcut_with_curve_loop(DLIList<BodySM*> &webcut_body_list,
00462     DLIList<Curve*> &ref_edge_list,
00463     DLIList<BodySM*>& results_list,
00464     DLIList<BodySM*>& neighbor_imprint_list,
00465     ImprintType imprint_type = NO_IMPRINT,
00466     bool preview = false);
00467   
00468   virtual CubitStatus section( DLIList<BodySM*> &section_body_list,
00469     const CubitVector &point_1,
00470     const CubitVector &point_2,
00471     const CubitVector &point_3,
00472     DLIList<BodySM*>& new_body_list,
00473     bool keep_normal_side,
00474     bool keep_old = false,
00475     bool keep_both_sides = false);
00476   
00477   virtual CubitStatus split_body( BodySM *body_ptr,
00478     DLIList<BodySM*> &new_bodies );
00479 
00480   virtual CubitStatus separate_surfaces( DLIList<Surface*> &surf_list,
00481                                          DLIList<BodySM*> &new_bodies );
00482   
00483   virtual CubitStatus reverse_body( BodySM *body_to_reverse );
00484   
00485   virtual CubitStatus split_periodic( BodySM *body_ptr,
00486     BodySM *&new_body );
00487   
00488   virtual CubitStatus regularize_body( BodySM *body_ptr,
00489     BodySM *&new_body_ptr );
00490   
00491   virtual CubitStatus regularize_entity(GeometryEntity *old_entity_ptr,  
00492                                            BodySM *&new_body_ptr);
00493   virtual CubitStatus test_regularize_entity( GeometryEntity *old_refentity_ptr);
00494   
00495   virtual CubitStatus offset_curves( DLIList<Curve*>& ref_edge_list, 
00496                                      DLIList<Curve*>& result_curve_list,
00497                                      double offset_distance,
00498                                      const CubitVector& offset_direction, 
00499                                      int gap_type = 1 );
00500   
00501   virtual CubitStatus scale ( BodySM *&body, const CubitVector& factors );
00502 
00503   virtual CubitStatus  split_curve( Curve* curve_to_split,
00504                                         const CubitVector& split_location,
00505                                         DLIList<Curve*>& created_curves );
00506   
00507   virtual Curve* trim_curve( Curve* trim_curve, 
00508                              const CubitVector& trim_vector,
00509                              const CubitVector& keep_vector,
00510                              bool keep_old = false );
00511   
00512   virtual CubitStatus create_solid_bodies_from_surfs(DLIList<Surface*> &ref_face_list,
00513                                                      DLIList<BodySM*> &new_bodies,
00514                                                      bool keep_old = false,
00515                                                      bool heal = true,
00516                                                      bool sheet = false ) const;
00517     
00518   virtual Curve* create_arc(const CubitVector& position,
00519                                double radius,
00520                                double start_angle,
00521                                double end_angle,
00522                                CubitVector plane,
00523                                bool preview = false  );
00524 
00525 virtual Curve* create_arc_radius(const CubitVector &center,
00526                                  TBPoint* ref_vertex_start,
00527                                  TBPoint* ref_vertex_end, 
00528                                  const CubitVector &normal,
00529                                  double radius,
00530                                  bool full = false,
00531                                  bool preview = false);
00532 
00533 
00534   virtual Curve* create_arc_three( TBPoint* ref_vertex1, 
00535                                    TBPoint* ref_vertex2,
00536                                    TBPoint* ref_vertex3, 
00537                                    bool full = false,
00538                                    bool preview = false  );
00539   
00540   virtual Curve* create_arc_three( Curve* ref_edge1, 
00541                                    Curve* ref_edge2,
00542                                    Curve* ref_edge3, 
00543                                    bool full = false ,
00544                                    bool preview = false  );
00545   
00546   virtual Curve* create_arc_center_edge( 
00547                                    TBPoint* ref_vertex1, 
00548                                    TBPoint* ref_vertex2,
00549                                    TBPoint* ref_vertex3, 
00550                                    const CubitVector &normal,
00551                                    double radius = CUBIT_DBL_MAX,
00552                                    bool full = false,
00553                                    bool preview = false   );
00554   
00555   virtual CubitStatus create_curve_combine( DLIList<Curve*>& curve_list, 
00556                                     Curve *&new_curve_ptr );
00557     //-  Uses the solid modeller to create a new RefEdge that is a combination 
00558     //- of the input chain of edges.  
00559     //-
00560 
00561   virtual GeometryQueryEngine *get_gqe();
00562   
00563   virtual CubitBoolean is_modify_engine(const TopologyBridge *tb_ptr) const;
00564   
00565   virtual CubitStatus get_offset_intersections( 
00566                                Curve* ref_edge1, 
00567                                Curve* ref_edge2,
00568                                DLIList<CubitVector>& intersection_list,
00569                                double offset,
00570                                bool ext_first = true );
00571   
00572   virtual CubitStatus get_offset_intersections( 
00573                                Curve* ref_edge_ptr, 
00574                                Surface* ref_face_ptr,
00575                                DLIList<CubitVector> &intersection_list,
00576                                double offset = 0.0,
00577                                bool ext_surf = true );
00578   
00579   virtual CubitStatus surface_intersection( Surface *surface1_ptr,
00580     Surface *surface2_ptr,
00581     DLIList<Curve*> &inter_graph,
00582     const double tol) const;
00583   
00584   virtual CubitStatus get_mid_plane( const CubitVector &point_1,
00585     const CubitVector &point_2,
00586     const CubitVector &point_3,
00587     BodySM *body_to_trim_to,
00588     BodySM *&midplane_body ) const;
00589 
00590   virtual CubitStatus get_spheric_mid_surface( Surface *surface_ptr1,
00591                            Surface *surface_ptr2,
00592                            BodySM *body_to_trim_to,
00593                            BodySM *&midsurface_body ) const;
00594   
00595   virtual CubitStatus get_conic_mid_surface( Surface *surface_ptr1,
00596                            Surface *surface_ptr2,
00597                            BodySM *body_to_trim_to,
00598                            BodySM *&midsurface_body ) const;
00599   
00600   virtual CubitStatus get_toric_mid_surface( Surface *surface_ptr1,
00601                            Surface *surface_ptr2,
00602                            BodySM *body_to_trim_to,
00603                            BodySM *&midsurface_body ) const;
00604   
00605   virtual CubitStatus tweak_bend( DLIList<BodySM*> &bend_bodies,
00606                                   DLIList<BodySM*> &new_bodysm_list,
00607                                   CubitVector& neutral_root,
00608                                   CubitVector& bend_axis,
00609                                   CubitVector& bend_direction,
00610                                   double radius,
00611                                   double angle,
00612                                   DLIList<CubitVector>& bend_regions,
00613                                   double width = -1,
00614                                   CubitBoolean center_bend = CUBIT_FALSE,
00615                                   int num_points = 0,
00616                                   CubitBoolean keep_old_body = CUBIT_FALSE,
00617                                   CubitBoolean preview = CUBIT_FALSE ) const;
00621   virtual CubitStatus tweak_chamfer( DLIList<Curve*> &curve_list, 
00622                                      double left_offset,
00623                                      DLIList<BodySM*> &new_bodysm_list,
00624                                      double right_offset = -1.0,
00625                                      CubitBoolean keep_old_body = CUBIT_FALSE,
00626                                      CubitBoolean preview = CUBIT_FALSE ) const;
00633   virtual CubitStatus tweak_chamfer( DLIList<TBPoint*> &point_list, 
00634                                      double offset1, 
00635                                      DLIList<BodySM*> &new_bodysm_list,
00636                                      Curve *edge1 = NULL,
00637                                      double offset2 = -1.0,
00638                                      Curve *edge2 = NULL,
00639                                      double offset3 = -1.0,
00640                                      Curve *edge3 = NULL,
00641                                      CubitBoolean keep_old_body = CUBIT_FALSE,
00642                                      CubitBoolean preview = CUBIT_FALSE ) const;
00649   virtual CubitStatus tweak_fillet( DLIList<Curve*> &curve_list, 
00650                                     double radius,
00651                                     DLIList<BodySM*> &new_bodysm_list,
00652                                     CubitBoolean keep_old_body = CUBIT_FALSE,
00653                                     CubitBoolean preview = CUBIT_FALSE ) const;
00657   virtual CubitStatus tweak_fillet( Curve *curve_ptr, 
00658                                     double start_radius,
00659                                     double end_radius,
00660                                     BodySM *&new_body_ptr,
00661                                     CubitBoolean keep_old_body = CUBIT_FALSE,
00662                                     CubitBoolean preview = CUBIT_FALSE ) const;
00667   virtual CubitStatus tweak_fillet( DLIList<TBPoint*> &point_list, 
00668                                     double radius,
00669                                     DLIList<BodySM*> &new_bodysm_list,
00670                                     CubitBoolean keep_old_body = CUBIT_FALSE,
00671                                     CubitBoolean preview = CUBIT_FALSE ) const;
00675   virtual CubitStatus tweak_move( DLIList<Surface*> &surface_list,
00676                                   const CubitVector &delta,
00677                                   DLIList<BodySM*> &new_bodysm_list,
00678                                   CubitBoolean keep_old_body = CUBIT_FALSE,
00679                                   CubitBoolean preview = CUBIT_FALSE ) const;
00683   virtual CubitStatus tweak_move( DLIList<Curve*> &curve_list,
00684                                   const CubitVector &delta,
00685                                   DLIList<BodySM*> &new_bodysm_list,
00686                                   CubitBoolean keep_old_body = CUBIT_FALSE,
00687                                   CubitBoolean preview = CUBIT_FALSE ) const;
00691   virtual CubitStatus tweak_offset( DLIList<Surface*> &surface_list,
00692                                     double offset_distance,
00693                                     DLIList<Surface*> *add_surface_list_ptr, 
00694                                     DLIList<double> *add_offset_list_ptr,
00695                                     DLIList<BodySM*> &new_bodysm_list,
00696                                     CubitBoolean keep_old_body = CUBIT_FALSE,
00697                                     CubitBoolean preview = CUBIT_FALSE ) const;
00702   virtual CubitStatus tweak_offset( DLIList<Curve*> &curve_list,
00703                                     double offset_distance,
00704                                     DLIList<Curve*> *add_curve_list_ptr, 
00705                                     DLIList<double> *add_offset_list_ptr,
00706                                     DLIList<BodySM*> &new_bodysm_list,
00707                                     CubitBoolean keep_old_body = CUBIT_FALSE,
00708                                     CubitBoolean preview = CUBIT_FALSE ) const;
00713   virtual CubitStatus tweak_remove( DLIList<Surface*> &surface_list,
00714                                     DLIList<BodySM*> &new_bodysm_list,
00715                                     CubitBoolean extend_adjoining = CUBIT_TRUE,
00716                                     CubitBoolean keep_old_body = CUBIT_FALSE,
00717                                     CubitBoolean preview = CUBIT_FALSE ) const;
00722   virtual CubitStatus tweak_remove( DLIList<Curve*> &curve_list,
00723                                     DLIList<BodySM*> &new_bodysm_list, 
00724                                     CubitBoolean keep_old_body = CUBIT_FALSE,
00725                                     CubitBoolean preview = CUBIT_FALSE ) const;
00731   virtual CubitStatus tweak_target( DLIList<Surface*> &surface_list,
00732                                     DLIList<Surface*> &target_surf_list,
00733                                     DLIList<BodySM*> &new_bodysm_list,
00734                                     CubitBoolean extend_flg = CUBIT_TRUE,
00735                                     CubitPlane *limit_plane = NULL,
00736                                     CubitBoolean reverse_flg = CUBIT_FALSE,
00737                                     CubitBoolean keep_old_body = CUBIT_FALSE,
00738                                     CubitBoolean preview = CUBIT_FALSE ) const;
00742   virtual CubitStatus tweak_target( DLIList<Curve*> &curve_list,
00743                                     DLIList<Surface*> &target_surf_list, 
00744                                     DLIList<BodySM*> &new_bodysm_list,
00745                                     CubitBoolean extend_flg = CUBIT_TRUE,
00746                                     CubitPlane *limit_plane = NULL,
00747                                     CubitBoolean reverse_flg = CUBIT_FALSE,
00748                                     CubitBoolean keep_old_body = CUBIT_FALSE,
00749                                     CubitBoolean preview = CUBIT_FALSE,
00750                                     double surface_area_increase_allowed = 0 ) const;
00756   virtual CubitStatus tweak_target( DLIList<Curve*> &curve_list,
00757                                     DLIList<Curve*> &target_curve_list, 
00758                                     DLIList<BodySM*> &new_bodysm_list,
00759                                     CubitBoolean extend_flg = CUBIT_TRUE,
00760                                     CubitPlane *limit_plane = NULL,
00761                                     CubitBoolean reverse_flg = CUBIT_FALSE,
00762                                     CubitBoolean keep_old_body = CUBIT_FALSE,
00763                                     CubitBoolean preview = CUBIT_FALSE,
00764                                     double surface_area_increase_allowed = 0 ) const;
00770   virtual CubitStatus tweak_target( TBPoint *point_ptr,
00771                                     DLIList<Surface*> &modify_surface_list,
00772                                     CubitVector &target_loc,
00773                                     BodySM *&new_bodysm_ptr,
00774                                     CubitBoolean keep_old_body = CUBIT_FALSE,
00775                                     CubitBoolean preview = CUBIT_FALSE ) const;
00784   virtual CubitStatus remove_curve_slivers( BodySM *body, double lengthlimit ) const;
00785 
00786   virtual CubitStatus create_net_surface( DLIList<Surface*>& ref_face_list, BodySM *& new_body,
00787                                           DLIList<DLIList<CubitVector*>*> &vec_lists_u, 
00788                                           DLIList<DLIList<CubitVector*>*> &vec_lists_v, 
00789                                           double net_tol = 1e-3,
00790                                           CubitBoolean heal = CUBIT_TRUE ) const;
00791 
00792   virtual CubitStatus create_net_surface( DLIList<Curve*>& u_curves, DLIList<Curve*>& v_curves,
00793                                           BodySM *& new_body,
00794                                           double net_tol = 1e-3, 
00795                                           CubitBoolean heal = CUBIT_TRUE ) const;
00796 
00797   virtual CubitStatus create_offset_surface( Surface* ref_face_ptr, BodySM*& new_body, double offset_distance ) const;
00798 
00799   virtual CubitStatus create_offset_sheet( DLIList<Surface*> &surface_list,
00800                                            double offset_distance,
00801                                            DLIList<Surface*> *add_surface_list_ptr,
00802                                            DLIList<double> *add_offset_list_ptr,
00803                                            DLIList<BodySM*> &new_body_list,
00804                                            CubitBoolean preview = CUBIT_FALSE ) const;
00813   virtual CubitStatus create_offset_body( BodySM* body_ptr, BodySM*& new_body, double offset_distance ) const;
00814 
00815   virtual CubitStatus create_skin_surface( DLIList<Curve*>& curves, BodySM*& new_body,
00816                                            DLIList<Curve*>& guides) const;
00817 
00818 
00819 
00820   
00821   virtual CubitStatus loft_surfaces_to_body( DLIList<Surface*> &surfaces,
00822                                              DLIList<double> &takeoff_factor_list,
00823                                              DLIList<Surface*> &takeoff_vector_surface_list,
00824                                              DLIList<CubitVector> &surface_takeoff_vector_list,
00825                                              DLIList<Curve*> &takeoff_vector_curve_list,
00826                                              DLIList<CubitVector> &curve_takeoff_vector_list,
00827                                              DLIList<Curve*> &guides,
00828                                              DLIList<TBPoint*> &match_vertices_list,
00829                                              BodySM*& new_body,
00830                                              CubitBoolean global_guides,
00831                                              CubitBoolean closed,
00832                                              CubitBoolean show_matching_curves,
00833                                              CubitBoolean preview
00834                                              ) const ;
00835   
00836   virtual CubitStatus create_surface( DLIList<CubitVector*>& vec_list,
00837                                       BodySM *&new_body,
00838                                       Surface *ref_face_ptr, 
00839                                   CubitBoolean project_points ) const;
00840 
00841   virtual CubitStatus create_surface( DLIList<TBPoint*> &points,
00842                                       BodySM *&new_body,
00843                                       Surface *on_surface ) const;
00844 
00845   virtual CubitStatus create_weld_surface( CubitVector &root,
00846                                            Surface *ref_face1, double leg1, Surface *ref_face2, double leg2,
00847                                            BodySM *&new_body ) const;
00848 
00849   virtual CubitStatus stitch( DLIList<BodySM*> &bodies_to_stitch,
00850                               DLIList<BodySM*> &new_bodies,
00851                               bool tighten_gaps,
00852                               double tolerance )const; 
00853 
00854 
00855   //--------------------------------------------------------------
00856    //- Methods for building specific facet-based geometry entities
00857    //--------------------------------------------------------------
00858   CubitStatus make_facet_point( CubitPoint *thePoint,
00859                                 TBPoint *&new_point_ptr );
00860   CubitStatus make_facet_point( const CubitVector &location,
00861                                 TBPoint *&new_point_ptr );
00862     //- create a new facet point
00863 
00864   CubitStatus make_facet_curve( TBPoint *start_ptr,
00865                                 TBPoint *end_ptr,
00866                                 Curve *&new_curve_ptr,
00867                                 CurveFacetEvalTool *eval_tool_ptr = NULL);
00868   CubitStatus make_facet_curve( TBPoint *start_ptr,
00869                                 TBPoint *end_ptr,
00870                                 DLIList<CubitFacetEdge*> &edge_list,
00871                                 DLIList<CubitPoint*> &point_list,
00872                                 Curve *&new_curve_ptr,
00873                                 CurveFacetEvalTool *eval_tool_ptr = NULL);
00874    //- create a new facet curve 
00875 
00876   CubitStatus make_facet_coedge( Curve *curv_ptr,
00877                                  CubitSense sense,
00878                                  CoEdgeSM *&new_coedge_ptr );
00879    //- create a new facet coedge
00880 
00881   CubitStatus make_facet_loop( DLIList<CoEdgeSM*> &coedge_list,
00882                                LoopSM *&new_loop_ptr );
00883    //- create a new facet loop
00884 
00885   CubitStatus make_facet_surface(const CubitEvaluatorData *eval_data,
00886                                  DLIList<CubitFacet*> &facet_list,
00887                                  DLIList<CubitPoint*> &point_list,
00888                                  DLIList<LoopSM*> &my_loops,
00889                                  int interp_order,
00890                                  double min_dot,
00891                                  Surface *&new_surface_ptr,
00892                                  CubitBoolean use_point_addresses = CUBIT_TRUE,
00893                                  FacetEvalTool *eval_tool_ptr = NULL,
00894                                  std::map<FacetCurve*, FacetCurve*> *hard_line_curve_map = NULL );
00895     //-creates a new FacetSurface given the points and facet list.
00896 
00897   CubitStatus make_facet_surface(DLIList<CubitQuadFacet*> &facet_list,
00898                                  DLIList<CubitPoint*> &point_list,
00899                                  DLIList<LoopSM*> &my_loops,
00900                                  int interp_order,
00901                                  double min_dot,
00902                                  Surface *&new_surface_ptr);
00903     //-creates a new FacetSurface given the points and quad facet list.
00904 
00905   CubitStatus make_facet_shell(DLIList<Surface*> &surface_list,
00906                                ShellSM *&new_shell_ptr);
00907     //-creates a new shell, given the list of surfaces.
00908 
00909   CubitStatus make_facet_lump(DLIList<ShellSM*> &shell_list,
00910                               Lump*& new_lump_ptr);
00911     //-creates a new lump, given the list of shells.
00912 
00913   CubitStatus make_facet_body(DLIList<Lump*> &lump_list,
00914                               BodySM *&new_body_ptr);
00915     //-creates a new body, given the list of lump.
00916 
00917   CubitStatus build_facet_surface( const CubitEvaluatorData **eval_data,
00918                                    DLIList<CubitFacet *> &facet_list,
00919                                    DLIList<CubitPoint *> &point_list,
00920                                    double feature_angle,
00921                                    int interp_order,
00922                                    CubitBoolean smooth_non_manifold,
00923                                    CubitBoolean split_surfaces,
00924                                    DLIList<Surface *> &surface_list);
00925   CubitStatus build_facet_surface( DLIList<CubitQuadFacet *> &qfacet_list,
00926                                    DLIList<CubitFacet *> &tfacet_list,
00927                                    DLIList<CubitPoint *> &point_list,
00928                                    double feature_angle,
00929                                    int interp_order,
00930                                    CubitBoolean smooth_non_manifold,
00931                                    CubitBoolean split_surfaces,
00932                                    DLIList<Surface *> &surface_list);
00933   CubitStatus build_facet_surface( DLIList<CubitQuadFacet *> &facet_list,
00934                                    DLIList<CubitPoint *> &point_list,
00935                                    double feature_angle,
00936                                    int interp_order,
00937                                    CubitBoolean smooth_non_manifold,
00938                                    CubitBoolean split_surfaces,
00939                                    DLIList<Surface *> &surface_list);
00940     //- creates one or more new FacetSurfaces with all of its lower
00941     //- order entities.  Use an optional feature_angle to break
00942     //- surface
00943 
00944     //- Define separate CubitPoint* for the CubitFacet list and CubitQuadFacet 
00945     //- list if they are going to create different surfaces.
00946     //- Facets sharing the same CubitPoint* will be created into one surfaces.
00947     //- Separate call of build_facet_surface will try to build different
00948     //- surfaces, and won't be able to use shared CubitPoint* from other 
00949     //- build_facet_surface call.
00950     //- As long as facets are defined, the CubitPoint list should be left empty
00951     
00952   CubitStatus smooth_facets( RefFace *ref_face_ptr, int niter, CubitBoolean free_laplacian );
00953     //- attempt to clean up facets by smoothing the points on the surface
00954   CubitStatus create_shell_offset( BodySM *bodysm_ptr, BodySM *&new_bodysm, double offset );
00955     // create a shell offset from body
00956   CubitStatus improve_facets( RefFace *ref_face_ptr );
00957     // improve the facets by local swaps
00958 
00959   CubitStatus build_cholla_surfaces( DLIList<CubitFacet *> facet_list,
00960                                      DLIList<CubitPoint *> point_list,
00961                                      double feature_angle,
00962                                      int interp_order,
00963                                      CubitBoolean smooth_non_manifold,
00964                                      CubitBoolean split_surfaces,
00965                                      ChollaEngine *&cholla_ptr );
00966 
00967 /*  virtual CubitStatus finish_facet_Body(
00968     GeometryType surface_type,
00969     const CubitEvaluatorData *eval_data,
00970     DLIList <CubitFacet *>facet_list,
00971     DLIList <CubitPoint *>point_list,
00972     double feature_angle,
00973     int interp_order,
00974     CubitBoolean smooth_non_manifold, 
00975     CubitBoolean split_surfaces,
00976     BodySM *&body_ptr) const;
00977 */
00978   virtual CubitStatus finish_facet_Body( ChollaEngine *cholla_ptr,
00979                                          const CubitEvaluatorData **eval_data,
00980                                          double feature_angle,
00981                                          int interp_order,
00982                                          BodySM *&bodysm_ptr) const;
00983   
00984   virtual CubitStatus finish_facet_Body( DLIList<Surface*>& surfaces, DLIList<CubitSense>& surface_sense,
00985                                          BodySM *&bodysm_ptr) const;
00986 
00987   void set_sphere_eval_data( ChollaEngine *cholla_ptr,
00988                              double radius,
00989                              CubitEvaluatorData **&eval_data ) const;
00990 
00991   void set_cylinder_eval_data( ChollaEngine *cholla_ptr,
00992                                double height,
00993                                double base_radius_xdir,
00994                                double base_radius_ydir,
00995                                double top_radius,
00996                                CubitEvaluatorData **&eval_data ) const;
00997 
00998   // non-virtual specific functions for building facet-based geometry
00999   // from Cholla geometry
01000 
01001   CubitStatus build_cholla_geometry(
01002     const CubitEvaluatorData **eval_data,
01003     DLIList<ChollaSurface*> &cholla_surface_list,
01004     DLIList<ChollaCurve*> &cholla_curve_list,
01005     DLIList<ChollaPoint*> &cholla_point_list,
01006     CubitBoolean use_feature_angle, 
01007     double feature_angle, 
01008     int interp_order,
01009     DLIList<Surface *> &surface_list);
01010     // build the CUBIT geometry based on the Cholla entity class lists
01011 
01012   CubitStatus build_cholla_point_geometry(
01013     DLIList<ChollaPoint*> &cholla_point_list );
01014     // From the cholla point list, create geometric points for each
01015 
01016   CubitStatus build_cholla_curve_geometry(
01017     DLIList<ChollaCurve*> &cholla_curve_list );
01018     // From the cholla curve list, create geometric curves for each
01019 
01020   CubitStatus build_cholla_surface_geometry(
01021     const CubitEvaluatorData **eval_data,
01022     DLIList<ChollaSurface*> &cholla_surface_list,
01023     int interp_order,
01024     double min_dot,
01025     DLIList<Surface *> &surface_list);
01026     // From the facet surface list, create geometric surface,
01027     // loops and coedges for each surface in the list  
01028 
01029     virtual CubitStatus tolerant_imprint(DLIList<Surface*> &surfs_in,
01030       DLIList<BodySM*> &new_bodysm_list) const;
01031     CubitStatus tolerant_imprint_surface_with_curves( Surface *surface_to_imprint,
01032                                                       DLIList<Curve*> &curves,
01033                                          DLIList<TopologyBridge*> &temporary_bridges,
01034                                                       BodySM *&new_body, 
01035                                                       DLIList<TopologyBridge*> *new_tbs = NULL,
01036                                                       DLIList<TopologyBridge*> *att_tbs = NULL ) const; 
01037 
01038     CubitStatus tolerant_imprint( DLIList<BodySM*> &bodies_in,
01039                                   DLIList<BodySM*> &new_bodies,
01040                                   double overlap_tol,
01041                                   double imprint_tol,
01042                                    DLIList<TopologyBridge*> *new_tbs = NULL,
01043                                    DLIList<TopologyBridge*> *att_tbs = NULL ) const;
01044 
01045   static CubitBoolean is_modify_enabled()
01046     {return modifyEnabled;}
01047 
01048   static void set_modify_enabled(CubitBoolean my_bool)
01049     {modifyEnabled = my_bool;}
01050   
01051       
01052   
01053   
01054 protected:
01055      
01056 private:
01057   
01058   static CubitBoolean modifyEnabled;
01059   
01060   CubitStatus build_cholla_loop_geometry(
01061     DLIList<ChollaCurve*> &cholla_curve_list,
01062     ChollaSurface *chsurf_ptr,
01063     DLIList<LoopSM*> &loop_list,
01064     int debug_draw = 0 );
01065     // From the cholla curve list of a surface, create geometric loops 
01066  
01067   void fillinedge( 
01068     int *edge, 
01069     int numpointsonanedge, 
01070     double radius, 
01071     std::vector<CubitPoint *>& points) const;
01073     
01074   void refinetriangle(
01075     int level, 
01076     int numpointsonanedge, 
01077     int *iedge1, 
01078     int *iedge2, 
01079     int *iedge3,
01080     int isign1, 
01081     int isign2, 
01082     int isign3, 
01083     double radius, 
01084     std::vector<CubitPoint *>& points,
01085     DLIList<CubitFacet *>& facet_list) const;    
01087 
01088   void create_facets(
01089       const std::vector<std::pair<SurfaceFacets*, CubitSense> >& surfaceTopology,
01090       const FacetPointSet& points,
01091       int interp_order,
01092       DLIList<CubitPoint*>& c_points,
01093       std::map<SurfaceFacets*, DLIList<CubitFacet*> >& facet_map,
01094       std::map<CurveFacets*, DLIList<CubitFacetEdge*> >& facet_edge_map
01095       );
01096   
01097   CubitStatus process_topology(SurfaceFacets* surface, CubitSense& coface_sense,
01098       int interp_order, const DLIList<CubitPoint*>& c_points,
01099       std::map<SurfaceFacets*, DLIList<CubitFacet*> >& facet_map,
01100       std::map<CurveFacets*, DLIList<CubitFacetEdge*> >& facet_edge_map,
01101       std::map<FacetShapes*, GeometryEntity*>& entity_map
01102       );
01103 
01104   void process_topology(CurveFacets* curve, const DLIList<CubitPoint*>& c_points,
01105       FacetEvalTool* eval, CubitSense sense, 
01106       std::map<CurveFacets*, DLIList<CubitFacetEdge*> >& facet_edge_map,
01107       std::map<FacetShapes*, GeometryEntity*>& entity_map);
01108 
01109 } ;
01110 
01111 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines