cgma
Surface.cpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Copyright Notice
00003 //
00004 // Copyright (c) 1996 
00005 // by Malcolm J. Panthaki, DBA, and the University of New Mexico.
00006 //-------------------------------------------------------------------------
00007 //
00008 //-------------------------------------------------------------------------
00009 // Filename      : Surface.cpp
00010 //
00011 // Purpose       : 
00012 //
00013 // Special Notes :
00014 //
00015 // Creator       : Many
00016 //
00017 // Creation Date : 08/02/96
00018 //
00019 // Owner         : Timothy J. Tautges
00020 //-------------------------------------------------------------------------
00021 
00022 
00023 #include "Surface.hpp"
00024 #include "RefFace.hpp"
00025 #include "GeometryQueryEngine.hpp"
00026 
00027 //-------------------------------------------------------------------------
00028 // Purpose       : The default constructor. 
00029 //
00030 // Special Notes :
00031 //
00032 // Creator       : Xuechen Liu
00033 //
00034 // Creation Date : 08/02/96
00035 //-------------------------------------------------------------------------
00036 
00037 Surface::Surface() 
00038 {
00039 }
00040 
00041 //-------------------------------------------------------------------------
00042 // Purpose       : The destructor. 
00043 //
00044 // Special Notes :
00045 //
00046 // Creator       : Raikanta Sahu
00047 //
00048 // Creation Date : 09/06/96
00049 //-------------------------------------------------------------------------
00050 
00051 Surface::~Surface() 
00052 {}
00053 
00054 CubitStatus Surface::closest_points(DLIList<CubitVector *> &location_list,
00055                                     DLIList<CubitVector *> *closest_location_list,
00056                                     DLIList<CubitVector *> *unit_normal_list,
00057                                     DLIList<CubitVector *> *curvature1_list,
00058                                     DLIList<CubitVector *> *curvature2_list)
00059 {
00060   CubitVector *curvature1, *curvature2;
00061   CubitVector *unit_normal;
00062   CubitVector *closest_location;
00063   CubitVector *location;
00064   CubitStatus stat;
00065   location_list.reset();
00066   if (closest_location_list) closest_location_list->reset();
00067   if (unit_normal_list) unit_normal_list->reset();
00068   if (curvature1_list) curvature1_list->reset();
00069   if (curvature2_list) curvature2_list->reset();
00070   for (int i=0; i<location_list.size(); i++)
00071   {
00072     location = location_list.get_and_step();
00073     if (closest_location_list == NULL)
00074       closest_location = NULL;
00075     else
00076       closest_location = closest_location_list->get_and_step();
00077     if (unit_normal_list == NULL)
00078       unit_normal = NULL;
00079     else
00080       unit_normal = unit_normal_list->get_and_step();
00081     if (curvature1_list == NULL)
00082       curvature1 = NULL;
00083     else
00084       curvature1 = curvature1_list->get_and_step();
00085     if (curvature2_list == NULL)
00086       curvature2 = NULL;
00087     else
00088       curvature2 = curvature2_list->get_and_step();
00089     stat = closest_point( *location, closest_location, unit_normal, curvature1, curvature2 );
00090     if (stat != CUBIT_SUCCESS)
00091       return stat;
00092   }
00093   return CUBIT_SUCCESS;
00094 }
00095 
00096 void Surface::closest_points_trimmed( std::vector<CubitVector> &from_points_list, 
00097                                       std::vector<CubitVector> &points_on_surface_list)
00098 {
00099   CubitVector from_point;
00100   CubitVector point_on_surface;  
00101   for (unsigned int i=0; i<from_points_list.size(); i++)
00102   {
00103     from_point = from_points_list[i];    
00104     closest_point_trimmed( from_point, point_on_surface );
00105     points_on_surface_list.push_back( point_on_surface );
00106   }
00107 }
00108 
00109 void Surface::are_positions_on( DLIList<CubitVector *> &test_position_list,
00110                               DLIList<CubitBoolean *> &is_on_list )
00111 {
00112   CubitVector *test_position;
00113   CubitBoolean *is_on;
00114   test_position_list.reset();
00115   is_on_list.reset();
00116   for (int i=0; i<test_position_list.size(); i++)
00117   {
00118     test_position = test_position_list.get_and_step();
00119     is_on = is_on_list.get_and_step();
00120     *is_on = is_position_on( *test_position );
00121   }
00122 }
00123 
00124 
00125 CubitStatus Surface::closest_point_along_vector(CubitVector& from_point, 
00126                                          CubitVector& along_vector,
00127                                          CubitVector& point_on_surface)
00128 {
00129   return CUBIT_FAILURE;
00130 }
00131 
00132 CubitStatus Surface::evaluate( double u, double v, CubitVector& pos, CubitVector deriv1[2], CubitVector deriv2[3])
00133 {
00134   PRINT_ERROR("evaluate is not implemented.");
00135   return CUBIT_FAILURE;
00136 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines