//=========================================================================== // 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 _HYPERBOLA_H 00016 #define _HYPERBOLA_H 00017 00018 00019 00020 00021 #include "GoTools/geometry/ElementaryCurve.h" 00022 00023 00024 namespace Go { 00025 00026 00033 00034 class Hyperbola : public ElementaryCurve 00035 { 00036 public: 00039 Hyperbola() 00040 {}; 00041 00045 Hyperbola(Point location, Point direction, Point normal, 00046 double r1, double r2); 00047 00049 virtual ~Hyperbola(); 00050 00053 virtual void read (std::istream& is); 00056 virtual void write (std::ostream& os) const; 00057 00058 00059 // --- Functions inherited from GeomObject --- 00060 00061 virtual BoundingBox boundingBox() const; 00062 00063 virtual int dimension() const; 00064 00065 virtual ClassType instanceType() const; 00066 00067 static ClassType classType(); 00068 00069 virtual Hyperbola* clone() const; 00070 00071 // --- Functions inherited from ParamCurve --- 00072 00073 virtual void point(Point& pt, double tpar) const; 00074 00075 virtual void point(std::vector<Point>& pts, 00076 double tpar, 00077 int derivs, 00078 bool from_right = true) const; 00079 00080 virtual double startparam() const; 00081 virtual double endparam() const; 00082 00083 virtual void reverseParameterDirection(bool switchparam = false); 00084 00085 virtual void setParameterInterval(double t1, double t2); 00086 00087 virtual SplineCurve* geometryCurve(); 00088 00089 virtual bool isDegenerate(double degenerate_epsilon); 00090 00091 virtual 00092 Hyperbola* subCurve(double from_par, double to_par, 00093 double fuzzy = DEFAULT_PARAMETER_EPSILON) const; 00094 00095 virtual DirectionCone directionCone() const; 00096 00097 virtual void appendCurve(ParamCurve* cv, bool reparam=true); 00098 00099 virtual void appendCurve(ParamCurve* cv, 00100 int continuity, double& dist, bool reparam=true); 00101 00102 virtual void closestPoint(const Point& pt, 00103 double tmin, 00104 double tmax, 00105 double& clo_t, 00106 Point& clo_pt, 00107 double& clo_dist, 00108 double const *seed = 0) const; 00109 00110 virtual double length(double tol); 00111 00112 // --- Functions specific to Hyperbola --- 00113 00117 void setParamBounds(double startpar, double endpar); 00118 00122 bool isBounded(); 00123 00124 void setSpanningVectors(); 00125 00126 protected: 00127 00128 Point location_; 00129 Point vec1_; // The axis wrt r1_ (input direction). 00130 Point vec2_; // The axis wrt r2_. 00131 Point normal_; 00132 00133 double r1_; // semi_imag_axis; 00134 double r2_; // semi_axis; 00135 00136 double startparam_; 00137 double endparam_; 00138 00139 }; 00140 00141 00142 } // namespace Go 00143 00144 00145 00146 #endif // _HYPERBOLA_H 00147