//=========================================================================== // GoTools Core - SINTEF Geometry Tools Core library, version 2.0.1 // // Copyright (C) 2000-2007, 2010 SINTEF ICT, Applied Mathematics, Norway. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., // 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // // Contact information: E-mail: tor.dokken@sintef.no // SINTEF ICT, Department of Applied Mathematics, // P.O. Box 124 Blindern, // 0314 Oslo, Norway. // // Other licenses are also available for this software, notably licenses // for: // - Building commercial software. // - Building software whose source code you wish to keep private. //=========================================================================== 00015 #ifndef _PLANE_H 00016 #define _PLANE_H 00017 00018 00019 #include "GoTools/geometry/ElementarySurface.h" 00020 #include "GoTools/utils/RotatedBox.h" 00021 00022 00023 namespace Go 00024 { 00025 00026 00027 class SplineSurface; 00028 00029 00037 00038 class Plane : public ElementarySurface 00039 { 00040 public: 00043 Plane() 00044 {}; 00045 00047 Plane(Point location, Point normal); 00048 00051 Plane(Point location, Point normal, Point x_axis); 00052 00055 Plane(double a, double b, double c, double d); 00056 00058 virtual ~Plane(); 00059 00062 virtual void read (std::istream& is); 00065 virtual void write (std::ostream& os) const; 00066 00067 // Inherited from GeomObject 00068 virtual int dimension() const; 00069 00070 // Inherited from GeomObject 00071 virtual ClassType instanceType() const; 00072 00073 // Inherited from GeomObject 00074 static ClassType classType() 00075 { return Class_Plane; } 00076 00078 virtual BoundingBox boundingBox() const; 00079 00080 // Inherited from GeomObject 00081 virtual Plane* clone() const 00082 { return new Plane(location_, normal_); } 00083 00084 00085 // --- Functions inherited from ParamSurface --- 00086 00087 const Domain& parameterDomain() const; 00088 00089 CurveLoop outerBoundaryLoop(double degenerate_epsilon 00090 = DEFAULT_SPACE_EPSILON) const; 00091 std::vector<CurveLoop> allBoundaryLoops(double degenerate_epsilon 00092 = DEFAULT_SPACE_EPSILON) const; 00093 00094 DirectionCone normalCone() const; 00095 DirectionCone tangentCone(bool pardir_is_u) const; 00096 00097 void point(Point& pt, double upar, double vpar) const; 00098 void point(std::vector<Point>& pts, 00099 double upar, double vpar, 00100 int derivs, 00101 bool u_from_right = true, 00102 bool v_from_right = true, 00103 double resolution = 1.0e-12) const; 00104 00105 void normal(Point& n, double upar, double vpar) const; 00106 00107 std::vector<boost::shared_ptr<ParamCurve> > 00108 constParamCurves(double parameter, bool pardir_is_u) const; 00109 00110 std::vector<boost::shared_ptr<ParamSurface> > 00111 subSurfaces(double from_upar, double from_vpar, 00112 double to_upar, double to_vpar, 00113 double fuzzy = DEFAULT_PARAMETER_EPSILON) const; 00114 00115 double nextSegmentVal(int dir, double par, bool forward, double tol) const; 00116 00117 void closestPoint(const Point& pt, 00118 double& clo_u, 00119 double& clo_v, 00120 Point& clo_pt, 00121 double& clo_dist, 00122 double epsilon, 00123 const RectDomain* domain_of_interest = NULL, 00124 double *seed = 0) const; 00125 00126 void closestBoundaryPoint(const Point& pt, 00127 double& clo_u, 00128 double& clo_v, 00129 Point& clo_pt, 00130 double& clo_dist, 00131 double epsilon, 00132 const RectDomain* rd = NULL, 00133 double *seed = 0) const; 00134 00135 void getBoundaryInfo(Point& pt1, Point& pt2, 00136 double epsilon, SplineCurve*& cv, 00137 SplineCurve*& crosscv, double knot_tol = 1e-05) const; 00138 00139 void turnOrientation(); 00140 00141 void reverseParameterDirection(bool direction_is_u); 00142 00143 void swapParameterDirection(); 00144 00145 bool isDegenerate(bool& b, bool& r, 00146 bool& t, bool& l, double tolerance) const; 00147 00148 00150 virtual void getDegenerateCorners(std::vector<Point>& deg_corners, double tol) const; 00151 00152 // --- Functions specific to Plane --- 00153 00154 Point getPoint() 00155 { return location_; } 00156 00157 Point getNormal() 00158 { return normal_; } 00159 00160 void getSpanningVectors(Point& axis1, Point& axis2) 00161 { 00162 axis1 = vec1_; 00163 axis2 = vec2_; 00164 } 00165 00166 Point projectPoint(const Point& pnt) const; 00167 00168 double distance(const Point& pnt) const; 00169 00170 void setParameterBounds(double from_upar, double from_vpar, 00171 double to_upar, double to_vpar); 00172 00173 Plane* subSurface(double from_upar, double from_vpar, 00174 double to_upar, double to_vpar, 00175 double fuzzy = DEFAULT_PARAMETER_EPSILON) const; 00176 00177 virtual SplineSurface* geometrySurface() const; 00178 00182 bool isBounded() const; 00183 00191 Plane* intersect(const RotatedBox& bd_box) const; 00192 00193 protected: 00194 00195 Point location_; 00196 Point normal_; 00197 Point vec1_; 00198 Point vec2_; 00199 00200 RectDomain domain_; 00201 00202 void setSpanningVectors(); 00203 00204 }; 00205 00206 } // namespace Go 00207 00208 00209 00210 #endif // _PLANE_H 00211
Generated on Tue Sep 21 15:44:17 2010 for GoTools Core by  doxygen 1.6.3