//=========================================================================== // 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. //=========================================================================== 00013 #ifndef _COMPOSITESURFACE_H 00014 #define _COMPOSITESURFACE_H 00015 00020 #include "GoTools/geometry/SplineSurface.h" 00021 00022 namespace Go 00023 { 00024 00025 class CompositeSurface : public ParamSurface 00026 { 00027 public: 00028 CompositeSurface() 00029 {} 00030 CompositeSurface(const std::vector<SplineSurface>& domain_maps, 00031 const SplineSurface& surf) 00032 : surf_(surf), domain_maps_(domain_maps) 00033 { 00034 int num_maps = domain_maps.size(); 00035 for (int i = 0; i < num_maps; ++i) { 00036 ASSERT(domain_maps_[i].dimension() == 2); 00037 } 00038 } 00039 00042 virtual void read (std::istream& is) 00043 { 00044 surf_.read(is); 00045 int num_maps; 00046 is >> num_maps; 00047 domain_maps_.resize(num_maps); 00048 for (int i = 0; i < num_maps; ++i) { 00049 domain_maps_[i].read(is); 00050 } 00051 } 00054 virtual void write (std::ostream& os) const 00055 { 00056 surf_.write(os); 00057 int num_maps = domain_maps_.size(); 00058 os << num_maps << '\n'; 00059 for (int i = 0; i < num_maps; ++i) { 00060 domain_maps_[i].write(os); 00061 } 00062 } 00063 00065 virtual BoundingBox boundingBox() const 00066 { return surf_.boundingBox(); } 00067 00069 virtual int dimension() const 00070 { return surf_.dimension(); } 00071 00073 virtual ClassType instanceType() const 00074 { return CompositeSurface::classType(); } 00075 00077 static ClassType classType() 00078 { return Class_CompositeSurface; } 00079 00080 00082 virtual ~CompositeSurface() 00083 {} 00084 00088 virtual CompositeSurface* clone() const 00089 { return new CompositeSurface(*this); } 00095 virtual const RectDomain& parameterDomain() const 00096 { return domain_maps_.front().parameterDomain(); } 00097 00103 virtual RectDomain containingDomain() const 00104 { return domain_maps_.front().parameterDomain(); } 00105 00111 void setParameterDomain(double u1, double u2, double v1, double v2) 00112 { domain_maps_.front().setParameterDomain(u1, u2, v1, v2); } 00113 00114 00120 virtual CurveLoop outerBoundaryLoop(double degenerate_epsilon 00121 = DEFAULT_SPACE_EPSILON) const 00122 { THROW("Not implemented");return surf_.outerBoundaryLoop(degenerate_epsilon); } 00123 00132 virtual std::vector<CurveLoop> allBoundaryLoops(double degenerate_epsilon 00133 = DEFAULT_SPACE_EPSILON) const 00134 { THROW("Not implemented");return surf_.allBoundaryLoops(degenerate_epsilon); } 00135 00139 virtual DirectionCone normalCone() const 00140 { THROW("Not implemented");return surf_.normalCone(); } 00141 00149 virtual DirectionCone tangentCone(bool pardir_is_u) const 00150 { THROW("Not implemented");return surf_.tangentCone(pardir_is_u); } 00151 00159 virtual CompositeBox compositeBox() const 00160 { THROW("Not implemented");return surf_.compositeBox(); } 00161 00166 virtual void point(Point& pt, double upar, double vpar) const 00167 { 00168 Point param(2); 00169 param[0] = upar; 00170 param[1] = vpar; 00171 Point param_next(2); 00172 int num_maps = domain_maps_.size(); 00173 for (int i = 0; i < num_maps; ++i) { 00174 domain_maps_[i].point(param_next, param[0], param[1]); 00175 param = param_next; 00176 } 00177 surf_.point(pt, param[0], param[1]); 00178 } 00179 00203 virtual void point(std::vector<Point>& pts, 00204 double upar, double vpar, 00205 int derivs, 00206 bool u_from_right = true, 00207 bool v_from_right = true, 00208 double resolution = 1.0e-12) const 00209 { THROW("Not implemented"); } 00210 00226 virtual void normal(Point& n, double upar, double vpar) const 00227 { 00228 Point param(2); 00229 param[0] = upar; 00230 param[1] = vpar; 00231 Point param_next(2); 00232 int num_maps = domain_maps_.size(); 00233 for (int i = 0; i < num_maps; ++i) { 00234 domain_maps_[i].point(param_next, param[0], param[1]); 00235 param = param_next; 00236 } 00237 surf_.normal(n, param[0], param[1]); 00238 } 00239 00250 virtual std::vector<boost::shared_ptr<ParamCurve> > 00251 constParamCurves(double parameter, bool pardir_is_u) const 00252 { THROW("Not implemented"); } 00253 00267 virtual std::vector<boost::shared_ptr<ParamSurface> > 00268 subSurfaces(double from_upar, double from_vpar, 00269 double to_upar, double to_vpar, 00270 double fuzzy = DEFAULT_PARAMETER_EPSILON) const 00271 { THROW("Not implemented"); } 00272 00291 virtual double nextSegmentVal(int dir, double par, bool forward, double tol) const 00292 { THROW("Not implemented"); } 00293 00306 virtual void closestPoint(const Point& pt, 00307 double& clo_u, 00308 double& clo_v, 00309 Point& clo_pt, 00310 double& clo_dist, 00311 double epsilon, 00312 const RectDomain* domain_of_interest = NULL, 00313 double *seed = 0) const 00314 { THROW("Not implemented"); } 00315 00316 00319 virtual void closestBoundaryPoint(const Point& pt, 00320 double& clo_u, 00321 double& clo_v, 00322 Point& clo_pt, 00323 double& clo_dist, 00324 double epsilon, 00325 const RectDomain* rd = NULL, 00326 double *seed = 0) const 00327 { THROW("Not implemented"); } 00328 00350 virtual void getBoundaryInfo(Point& pt1, Point& pt2, 00351 double epsilon, SplineCurve*& cv, 00352 SplineCurve*& crosscv, double knot_tol = 1e-05) const 00353 { THROW("Not implemented"); } 00354 00356 virtual void turnOrientation() 00357 { THROW("Not implemented"); } 00358 00362 virtual void reverseParameterDirection(bool direction_is_u) 00363 { THROW("Not implemented"); } 00364 00366 virtual void swapParameterDirection() 00367 { THROW("Not implemented"); } 00368 00371 00383 virtual bool isDegenerate(bool& b, bool& r, 00384 bool& t, bool& l, double tolerance) const 00385 { THROW("Not implemented"); } 00386 00387 virtual double area(double tol) const 00388 { 00389 THROW("Not implemented"); 00390 } 00391 00392 virtual bool inDomain(double u, double v) const 00393 { 00394 THROW("Not implemented"); 00395 } 00396 00397 virtual void getDegenerateCorners(std::vector<Point>& deg_corners, double tol) const 00398 { 00399 THROW("Not implemented"); 00400 } 00401 00402 private: 00403 SplineSurface surf_; 00404 std::vector<SplineSurface> domain_maps_; 00405 }; 00406 00407 00408 } // namespace Go 00409 00410 00411 00412 #endif // _COMPOSITESURFACE_H 00413
Generated on Tue Sep 21 15:44:17 2010 for GoTools Core by  doxygen 1.6.3