cgma
FBClassify.hpp
Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Copyright (C) 2004 Sandia Corporation.  Under the terms of Contract DE-AC04-94AL85000
00005  * with Sandia Corporation, the U.S. Government retains certain rights in this software.
00006  *
00007  * This file is part of facetbool--contact via cubit@sandia.gov
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  *
00014  * This library is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with this library; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022  *
00023  *
00024  *
00025  */
00026 
00027 #ifndef _FACETEDBOOLEANCLASSIFY
00028 #define _FACETEDBOOLEANCLASSIFY
00029 #include "FBDefines.hpp"
00030 #include "FBStructs.hpp"
00031 #include "FBPolyhedron.hpp"
00032 #include "CubitDefines.h"
00033 #include <vector>
00034 #include <map>
00035 
00036 const int NO_EDGE_NBR = -99999;
00037 
00038 class FBClassify {
00039 
00040 public:
00041   FBClassify();
00042   ~FBClassify();
00043   
00044   void SetPoly(FBPolyhedron *poly1, FBPolyhedron *poly2);
00045   CubitStatus Group(int which);
00046   CubitStatus CharacterizeGroups(int which, bool other_is_planar);
00047   void get_group(std::vector<int> **this_group,
00048                  std::vector<int> **this_group_characterization);
00049 
00050 private:
00051   FBPolyhedron *polya, *polyb;
00052   std::vector<int> group, group_characterization;
00053   void fill_group(int itri, int ngroup);
00054   void perturb_the_ray(double &xbary, double &ybary, double &zbary);
00055   int pt_in_tri_2d(double xpt, double ypt,
00056                            double x0, double y0,
00057                    double x1, double y1,
00058                    double x2, double y2);
00059   int *e0, *e1, *e2;
00060   int number_of_groups;
00061   int classify(int itri, int which);
00062   int classify_against_plane(int itri, int which);
00063 };
00064 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines