00001 #ifndef OPENTISSUE_CORE_FUNCTION_SIGNED_DISTANCE_FUNCTION_H 00002 #define OPENTISSUE_CORE_FUNCTION_SIGNED_DISTANCE_FUNCTION_H 00003 // 00004 // OpenTissue Template Library 00005 // - A generic toolbox for physics-based modeling and simulation. 00006 // Copyright (C) 2008 Department of Computer Science, University of Copenhagen. 00007 // 00008 // OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php 00009 // 00010 #include <OpenTissue/configuration.h> 00011 00012 #include <OpenTissue/core/function/function_implicit_function.h> 00013 00014 00015 namespace OpenTissue 00016 { 00017 00018 namespace function 00019 { 00020 00021 // 2007-06-24 kenny: doxygen class documentation maybe with example of usage? 00026 template<typename math_types > 00027 class SignedDistanceFunction : public ImplicitFunction< math_types > 00028 { 00029 public: 00030 00031 virtual ~SignedDistanceFunction() {} 00032 00033 public: 00034 00035 typedef typename math_types::real_type real_type; 00036 typedef typename math_types::vector3_type vector3_type; 00037 00038 public: 00039 00040 // 2007-06-24 kenny: I have mixed feelings about our naming... should the names reflect whether computations are done inside a function call or not? For instance compute_signed_distance will tell caller that this call might be expensive???? 00041 00045 virtual vector3_type normal(vector3_type const & x) const = 0; 00046 00051 virtual real_type signed_distance(vector3_type const & x) const = 0; 00052 00053 }; 00054 00055 } // namespace function 00056 00057 } // namespace OpenTissue 00058 00059 //OPENTISSUE_CORE_FUNCTION_SIGNED_DISTANCE_FUNCTION_H 00060 #endif