00001 //=========================================================================== 00002 // GoTools - SINTEF Geometry Tools 00003 // 00004 // GoTools module: Intersections, version 1.0 00005 // 00006 // Copyright (C) 2000-2007 SINTEF ICT, Applied Mathematics, Norway. 00007 // 00008 // This program is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU General Public License 00010 // as published by the Free Software Foundation version 2 of the License. 00011 // 00012 // This program is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with this program; if not, write to the Free Software 00019 // Foundation, Inc., 00020 // 59 Temple Place - Suite 330, 00021 // Boston, MA 02111-1307, USA. 00022 // 00023 // Contact information: E-mail: tor.dokken@sintef.no 00024 // SINTEF ICT, Department of Applied Mathematics, 00025 // P.O. Box 124 Blindern, 00026 // 0314 Oslo, Norway. 00027 // 00028 // Other licenses are also available for this software, notably licenses 00029 // for: 00030 // - Building commercial software. 00031 // - Building software whose source code you wish to keep private. 00032 //=========================================================================== 00033 #ifndef _SECONDORDERPROPERTIES_H 00034 #define _SECONDORDERPROPERTIES_H 00035 00036 #include <vector> 00037 #include "Point.h" 00038 #include "SingularityType.h" 00039 00040 namespace Go { 00043 00044 00045 // this structure encapsulates all information about a IntersectionPoint that 00046 // is or might be influenced by second order properties of the objects it is 00047 // lying on. The need for this class arises because a geometrical object may 00048 // carry a discontinuity in its second derivative at an IntersectionPoint, and 00049 // its differential properties may therefore vary according to from where one 00050 // look at the point. 00051 // An IntersectionPoint lying on such a discontinuity (or more!), will therefore 00052 // contain multiple SecondOrderProperties, all of which are correct depending 00053 // on which point of view one takes. 00054 00055 struct SecondOrderProperties 00056 { 00057 SecondOrderProperties() : 00058 singularity_info_is_cached(false), tangent_is_oriented(false), tangent_2d_is_cached(false){} 00059 00060 void clear() 00061 { 00062 singularity_info_is_cached = false; 00063 tangent_is_oriented = false; 00064 tangent_2d_is_cached = false; 00065 } 00066 00067 // caching of singularity type. If the intersecting objects have 3D tangents (ie. they 00068 // are not parametrical functions), the 3D tangents will be cached simultaneously with 00069 // the SingularitytType. 00070 bool singularity_info_is_cached; 00071 Point tangent_3d[2]; // space for two tangents, in case of branch points 00072 SingularityType singularity_type; 00073 00074 bool tangent_is_oriented; 00075 00076 // caching of parametric tangent and related info 00077 bool tangent_2d_is_cached; 00078 Point tangent_2d_1[2]; // space for two tangents in case of branching point 00079 Point tangent_2d_2[2]; // space for two tangents in case of branching point 00080 00081 }; 00082 00084 }; // end namespace Go 00085 00086 #endif // _SECONDORDERPROPERTIES_H 00087 00088