cgma
|
00001 //------------------------------------------------------------------------- 00002 // Filename : CubitEvaluator.hpp 00003 // 00004 // Purpose : 00005 // 00006 // Special Notes : 00007 // 00008 // Creator : Matthew Staten 00009 // 00010 // Creation Date : 09/14/04 00011 // 00012 // Owner : Matthew Staten 00013 //------------------------------------------------------------------------- 00014 00015 #ifndef CUBIT_EVALUATOR_HPP 00016 #define CUBIT_EVALUATOR_HPP 00017 00018 #include "CubitDefines.h" 00019 #include "GeometryDefines.h" 00020 #include "CubitTransformMatrix.hpp" 00021 #include "CGMGeomConfigure.h" 00022 00023 class CubitVector; 00024 class CubitBox; 00025 class CubitTransformMatrix; 00026 00027 class CUBIT_GEOM_EXPORT CubitEvaluatorData 00028 { 00029 public: 00030 virtual ~CubitEvaluatorData() {} 00031 virtual GeometryType ask_type() const { return UNDEFINED_SURFACE_TYPE; } 00032 }; 00033 00034 class CUBIT_GEOM_EXPORT CubitEvaluator 00035 { 00036 00037 private: 00038 00039 protected: 00040 00041 CubitTransformMatrix mTmatrix; 00042 00043 public : 00044 virtual ~CubitEvaluator() 00045 {} 00046 00047 virtual GeometryType ask_type() { return UNDEFINED_SURFACE_TYPE; } 00048 00049 virtual const CubitEvaluatorData* evaluator_data() const = 0; 00050 virtual CubitBox bounding_box() const = 0; 00051 virtual CubitBoolean is_parametric() const = 0; 00052 virtual CubitBoolean is_periodic() const = 0; 00053 virtual CubitBoolean is_periodic_in_U( double &period ) const = 0; 00054 virtual CubitBoolean is_periodic_in_V( double &period ) const = 0; 00055 virtual CubitBoolean is_singular_in_U() const = 0; 00056 virtual CubitBoolean is_singular_in_V() const = 0; 00057 virtual CubitBoolean is_closed_in_U() const = 0; 00058 virtual CubitBoolean is_closed_in_V() const = 0; 00059 virtual CubitBoolean get_param_range_U( double& lower_bound, 00060 double& upper_bound ) const = 0; 00061 virtual CubitBoolean get_param_range_V( double& lower_bound, 00062 double& upper_bound ) const = 0; 00063 00064 virtual CubitVector position_from_u_v( double u, double v ) const = 0; 00065 virtual CubitStatus u_v_from_position( CubitVector const& location, 00066 double& u, 00067 double& v, 00068 CubitVector* closest_location ) const = 0; 00069 00070 virtual CubitStatus principal_curvatures( CubitVector const& location, 00071 double& curvature_1, 00072 double& curvature_2, 00073 CubitVector* closest_location = NULL ) = 0; 00074 //R CubitStatus 00075 //R- CUBIT_SUCCESS/FAILURE 00076 //I location 00077 //I- The point at which the curvatures are being requested -- it is also 00078 //I- the point to which the closest point on the surface is returned. 00079 //I- curvatures. 00080 //O closest_location 00081 //O- The point on the surface, closest to the input location (this 00082 //O- might not be on the surface). This is input as a reference 00083 //O- so that the function can modify its contents. 00084 //O curvature_1/2 00085 //O- Returned principal curvature magnitudes. 00086 //- This functions computes the point on the surface that is closest 00087 //- to the input location and then calculates the magnitudes of the 00088 //- principal curvatures at this (possibly, new) point on the surface. 00089 00090 virtual CubitStatus closest_point( CubitVector const& location, 00091 CubitVector* closest_location = NULL, 00092 CubitVector* unit_normal_ptr = NULL, 00093 CubitVector* curvature1_ptr = NULL, 00094 CubitVector* curvature2_ptr = NULL ) const = 0; 00095 //R CubitStatus 00096 //R- CUBIT_SUCCESS/FAILURE 00097 //I location 00098 //I- The point to which the closest point on the surface is desired. 00099 //O closest_location 00100 //O- The point on the Surface, closest to the 00101 //O- input location (which might not be on the Surface). This is 00102 //O- input as a reference so that the function can modify its 00103 //O- contents. 00104 //O unit_normal_ptr 00105 //O- The normal (represented as a unit vector) at the closest_location. 00106 //O- If this pointer is NULL, the normal is not returned. 00107 //O curvature1_ptr 00108 //O- The first principal curvature of the surface at closest_location. 00109 //O- If this pointer is NULL, this curvature is not returned. 00110 //O curvature2_ptr 00111 //O- The second principal curvature of the surface at closest_location. 00112 //O- If this pointer is NULL, this curvature is not returned. 00113 //- This function computes the point on the surface closest to the input 00114 //- location -- i.e., closest_location. 00115 //- The first Facet FACE in the list 00116 //- is queried. 00117 //- 00118 //- If the input pointer values of unit_normal, curvature1 and 00119 //- curvature2 00120 //- are non-NULL, the normal and principal curvatures, too, are 00121 //- returned. These are computed at closest_location, not at the 00122 //- input location. 00123 //- 00124 //- NOTE: 00125 //- It is assumed that if the calling code needs the normal or the 00126 //- principal curvatures, it will *allocate* space for the CubitVectors 00127 //- before sending in the pointers. 00128 00129 void add_transformation( CubitTransformMatrix &tfmat ) 00130 { 00131 mTmatrix = tfmat * mTmatrix; 00132 } 00133 00134 }; 00135 00136 00137 // ********** BEGIN INLINE FUNCTIONS ********** 00138 // ********** END INLINE FUNCTIONS ********** 00139 00140 // ********** BEGIN FRIEND FUNCTIONS ********** 00141 // ********** END FRIEND FUNCTIONS ********** 00142 00143 // ********** BEGIN EXTERN FUNCTIONS ********** 00144 // ********** END EXTERN FUNCTIONS ********** 00145 00146 #endif 00147