00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef _GOCURVEONSURFACE_H
00034 #define _GOCURVEONSURFACE_H
00035
00036 #include "ParamSurface.h"
00037 #include "ParamCurve.h"
00038 #include <boost/smart_ptr.hpp>
00039
00040
00041 namespace Go
00042 {
00045
00046
00047 class SplineCurve;
00048
00053 class CurveOnSurface : public ParamCurve
00054 {
00055 public:
00058 CurveOnSurface();
00059
00072 CurveOnSurface(boost::shared_ptr<ParamSurface> surf,
00073 boost::shared_ptr<ParamCurve> curve,
00074 bool preferparameter);
00075
00087 CurveOnSurface(boost::shared_ptr<ParamSurface> surf,
00088 boost::shared_ptr<ParamCurve> pcurve,
00089 boost::shared_ptr<ParamCurve> spacecurve,
00090 bool preferparameter);
00091
00095 CurveOnSurface(const CurveOnSurface& surface_curve);
00096
00100 CurveOnSurface& operator= (const CurveOnSurface& other);
00101
00104 virtual ~CurveOnSurface();
00105
00106
00107
00108 virtual void read (std::istream& is);
00109 virtual void write (std::ostream& os) const;
00110
00111
00112
00113 virtual BoundingBox boundingBox() const;
00114 virtual DirectionCone directionCone() const;
00115 virtual int dimension() const;
00116 virtual ClassType instanceType() const;
00117 static ClassType classType()
00118 { return Class_CurveOnSurface; }
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132 virtual CurveOnSurface* clone() const
00133 { return new CurveOnSurface(*this); }
00134
00135
00136
00137 virtual void point(Point& pt, double tpar) const;
00138
00141 virtual void point(std::vector<Point>& pts,
00142 double tpar,
00143 int derivs, bool from_right = true) const;
00144
00145
00146 virtual double startparam() const;
00147
00148
00149 virtual double endparam() const;
00150
00151
00152 virtual void reverseParameterDirection(bool switchparam = false);
00153
00154
00155 virtual SplineCurve* geometryCurve();
00156
00157
00158 virtual bool isDegenerate(double degenerate_epsilon);
00159
00160
00161
00162
00163
00164
00165
00166
00167 virtual CurveOnSurface* subCurve(double from_par, double to_par,
00168 double fuzzy =
00169 DEFAULT_PARAMETER_EPSILON) const;
00170
00171
00172
00173 virtual void closestPoint(const Point& pt,
00174 double tmin,
00175 double tmax,
00176 double& clo_t,
00177 Point& clo_pt,
00178 double& clo_dist,
00179 double const *seed = 0) const;
00180
00181
00182
00183 virtual void appendCurve(ParamCurve* cv, bool reparam=true);
00184
00185
00186
00187 virtual void appendCurve(ParamCurve* cv,
00188 int continuity, double& dist, bool reparam=true);
00189
00193 void setUnderlyingSurface(boost::shared_ptr<ParamSurface> surface)
00194 {surface_ = surface;}
00195
00201 virtual double nextSegmentVal(double par, bool forward, double tol) const;
00202
00203
00206 boost::shared_ptr<ParamSurface> underlyingSurface()
00207 { return surface_; }
00208
00211 boost::shared_ptr<ParamCurve> parameterCurve()
00212 { return pcurve_; }
00213
00216 boost::shared_ptr<ParamCurve> spaceCurve()
00217 { return spacecurve_; }
00218
00221 boost::shared_ptr<const ParamSurface> underlyingSurface() const
00222 { return surface_; }
00223
00226 boost::shared_ptr<const ParamCurve> parameterCurve() const
00227 { return pcurve_; }
00228
00231 boost::shared_ptr<const ParamCurve> spaceCurve() const
00232 { return spacecurve_; }
00233
00236 bool parPref() const
00237 { return prefer_parameter_; }
00238
00241 RectDomain containingDomain() const;
00242
00243 private:
00245 boost::shared_ptr<ParamSurface> surface_;
00247
00248 boost::shared_ptr<ParamCurve> pcurve_;
00249
00250 boost::shared_ptr<ParamCurve> spacecurve_;
00251
00252 bool prefer_parameter_;
00253 };
00254
00255
00257 }
00258
00259 #endif // _GOCURVEONSURFACE_H
00260
00261