cgma
FacetboolInterface.hpp
Go to the documentation of this file.
00001 #ifndef FACETBOOLINTERFACE_HPP
00002 #define FACETBOOLINTERFACE_HPP
00003 
00004 class FacetBody;
00005 class BodySM;
00006 class FacetSurface;
00007 class FacetCurve;
00008 class Curve;
00009 class CubitBox;
00010 
00011 #include <vector>
00012 #include "CubitDefines.h"
00013 #include "DLIList.hpp"
00014 #include "../facetbool/cgm/FBStructs.hpp"
00015 
00016 class FacetboolInterface {
00017 
00018 public:
00019   
00020   FacetboolInterface();
00021   ~FacetboolInterface();
00022 
00023 CubitStatus webcut_FB(BodySM *bodysm_ptr,
00024                                          std::vector<double>& cutter_verts,
00025                                          std::vector<int>& cutter_connections,
00026                                          bool cutter_is_plane,
00027                                          CubitBoolean delete_bodies,
00028                                          CubitBoolean &intersects,
00029                                          DLIList<BodySM*>& results_list);
00030                                          
00031   CubitStatus dofacetboolean(DLIList<BodySM*>& body_list, 
00032                              BodySM*& newBody,
00033                              bool keep_old,
00034                              const CubitFacetboolOp op);
00035 
00036   CubitStatus dofacetboolean_subtract(BodySM*& tool_body, 
00037                                       DLIList<BodySM*>& from_bodies,
00038                                       DLIList<BodySM*>& new_bodies,
00039                                       bool keep_old,
00040                                       bool* to_be_deleted,
00041                                       const CubitFacetboolOp op);
00042 
00043   CubitStatus dofacetboolean_2bodies(BodySM*& body_in1, 
00044                              BodySM*& body_in2,
00045                              BodySM*& body_out,
00046                              bool keep_old,
00047                              bool& intersection_found,
00048                              const CubitFacetboolOp op);
00049 
00050 CubitStatus FB_imprint_with_curves(BodySM*& body_in,
00051                              BodySM*& body_out,                             
00052                              bool keep_old);
00053   
00054   CubitStatus dofacetboolean_2bodies_imprint(BodySM*& body_in1, 
00055                              BodySM*& body_in2,
00056                              BodySM*& body_out1,
00057                              BodySM*& body_out2,                             
00058                              bool keep_old);
00059 
00060   CubitStatus make_FB_edge_list(DLIList<Curve*> &ref_edge_list);
00061 
00062   void get_edge_list_bbox(CubitBox& edge_list_bbox);
00063 
00064 private:
00065 
00066   std::vector<FB_Edge*> FB_imprint_edges;
00067   std::vector<FB_Coord*> FB_imprint_edge_coords;
00068   std::vector<FSBoundingBox*> FB_imprint_edge_bboxes;
00069   
00070   CubitStatus facetbody_to_facetbool(
00071                                DLIList<FacetSurface*> &facet_surf_list,
00072                                std::vector<double> &body_verts,
00073                                std::vector<int> &body_connections,
00074                                std::vector<int> *f_c_indices,
00075                                std::vector<FacetSurface *>& fsurfarray,
00076                                std::vector<FacetCurve *>& fcurvearray
00077                                );                       
00078   int findcurve(FacetCurve *curve, std::vector<FacetCurve *>& fcurvearray);
00079  
00080   void make_persistents_webcut(BodySM *body_in, 
00081                                           BodySM *body_out1, 
00082                                           BodySM *body_out2,
00083                                           std::vector<FacetSurface *>& fsurfarray,
00084                                           std::vector<FacetCurve *>& fcurvearray,
00085                                           bool *surfs_in_intersection,
00086                                           bool *surfs_in_subtraction,
00087                                           bool *curves_in_intersection,
00088                                           bool  *curves_in_subtraction
00089                                          );
00090 
00091   void make_persistents_imprint(BodySM *body_in, 
00092                                           BodySM *body_out1, 
00093                                           std::vector<FacetSurface *>& fsurfarray,
00094                                           std::vector<FacetCurve *>& fcurvearray
00095                                          );
00096  
00097   void make_persistents_boolean(BodySM *body_in, 
00098                                           BodySM *body_out1, 
00099                                           std::vector<FacetSurface *>& fsurfarray,
00100                                           std::vector<FacetCurve *>& fcurvearray,
00101                                           bool *surfs_in_intersection,
00102                                           bool *surfs_in_subtraction,
00103                                           bool *curves_in_intersection,
00104                                           bool  *curves_in_subtraction,
00105                                           const CubitFacetboolOp op,
00106                                           bool body_1
00107                                          );
00108 
00109   void make_persistent_curves(DLIList<FacetCurve*> fcurvelist,
00110                               std::vector<FacetCurve *>& fcurvearray,
00111                               int n,
00112                               int which_parent = 0);
00113 
00114   void make_persistent_surfaces(DLIList<FacetSurface*> fsurfaceslist,
00115                                 std::vector<FacetSurface *>& fsurfarray,
00116                                 int n,
00117                                 int which_parent = 0);
00118 
00119   int find_coord(double xx, double yy, double zz);
00120 
00121   FSBoundingBox* make_edge_bounding_box(int v0, int v1);
00122   
00123     //Separate out the different "lumps" in a given body.  Generally,
00124     // lumps are disjoint volumes.  They will be converted to separate
00125     // volumes later in the code.
00126   CubitStatus separate_lumps( BodySM *body_ptr, bool is_sheet_body );
00127 
00128     //First call separate_lumps to find the disjoing lumps in the body,
00129     // and then separates the lumps into different bodies.  
00130   CubitStatus separate_shells_into_bodies( BodySM *body_ptr, 
00131                                            bool is_sheet_body,
00132                                            DLIList<BodySM*> &new_bodies );
00133 
00134 };
00135 
00136 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines