cgma
SurfaceOverlapFacet.hpp
Go to the documentation of this file.
00001 //- Class: SurfaceOverlapFacet
00002 //- Description: Facet definition class for efficient processing
00003 //-              for SurfaceOverlapTool.  
00004 //- Owner: Steve Storm
00005 //- Created: January 26, 2003
00006 
00007 #ifndef SurfaceOverlapFacet_HPP
00008 #define SurfaceOverlapFacet_HPP
00009 
00010 #include "CubitDefines.h"
00011 #include "AnalyticGeometryTool.hpp"
00012 #include "GMem.hpp"
00013 #include "CubitBox.hpp"
00014 #include "CGMGeomConfigure.h"
00015 
00016 #ifndef CUBIT_MIN_3
00017 #define CUBIT_MIN_3(a,b,c)             (( (a) < (b) ? (a) : (b) ) < \
00018                                         ( (c) ) ? \
00019                                         ( (a) < (b) ? (a) : (b) ) : \
00020                                         ( (c) ))
00021 #endif
00022 #ifndef CUBIT_MAX_3
00023 #define CUBIT_MAX_3(a,b,c)             (( (a) > (b) ? (a) : (b) ) > \
00024                                         ( (c) ) ? \
00025                                         ( (a) > (b) ? (a) : (b) ) : \
00026                                         ( (c) ))
00027 #endif
00028 
00029 class CUBIT_GEOM_EXPORT SurfaceOverlapFacet
00030 {
00031 
00032 public:
00033   
00034   SurfaceOverlapFacet( GPoint pnt[3] );
00035   ~SurfaceOverlapFacet();
00036   
00037   double distance( SurfaceOverlapFacet &other_facet );
00038   CubitBoolean facing( SurfaceOverlapFacet &other_facet );
00039   double angle( SurfaceOverlapFacet &other_facet );
00040   double projected_overlap( SurfaceOverlapFacet &other_facet, 
00041                             CubitBoolean draw_overlap = CUBIT_FALSE );
00042 
00043   double distance_from_position( CubitVector &position );
00044 
00045   bool facet_points_within_tol( SurfaceOverlapFacet *other_face, double tolerance );
00046 
00047   double perimeter();
00048 
00049   bool bbox_overlap( double tol, SurfaceOverlapFacet &other_facet ) 
00050   { return boundingBox.overlap( tol, other_facet.boundingBox ); }
00051 
00052   CubitBox bounding_box() { return boundingBox; }
00053   void draw( int color ); 
00054   
00055   CubitVector centroid();
00056 
00057   CubitVector smallest_edge_midpoint();
00058 
00059 protected:
00060    
00061 private:
00062 
00063   Triangle3 t;
00064   CubitBox boundingBox;
00065   static AnalyticGeometryTool *agt;
00066 
00067 };
00068 
00069 #endif
00070 
00071 
00072 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines