| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2003 Computer Graphics Systems Group at the 00004 * Hasso-Plattner-Institute (HPI), Potsdam, Germany. 00005 * 00006 * This library is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2.1 of the License, or (at 00009 * your option) any later version. This library is distributed in the hope 00010 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 00011 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Lesser General Public License for more details. You should have received 00013 * a copy of the GNU Lesser+ General Public License along with this library; if 00014 * not, write to the FreeSoftware Foundation, Inc., 59 Temple Place, Suite 330, 00015 * Boston, MA, 02111-1307, USA. 00016 ******************************************************************************/ 00017 00018 // $Id: compositecurve.h 6378 2008-06-02 13:30:09Z Konstantin_Baumann $ 00019 // $Date: 2008-06-02 15:30:09 +0200 (Mon, 02 Jun 2008) $ 00020 // $Revision: 6378 $ 00021 // $State$ 00022 // $Author: Konstantin_Baumann $ 00023 // 00024 // $Log$ 00025 // Revision 1.11 2005/09/20 09:36:10 baumann 00026 // visitor mechanism refined 00027 // 00028 // Revision 1.10 2005/01/03 01:43:07 klimetschek 00029 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00030 // - removed vrs.vcproj 00031 // minor things: 00032 // - added all glutexamples to vrs4glut.sln 00033 // - fixed some problems in glutexamples 00034 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00035 // 00036 // Revision 1.9 2004/11/05 13:58:09 basch 00037 // Class comment changed (Doxygen style) 00038 // 00039 // Revision 1.8 2004/03/31 14:04:47 kirsch 00040 // cleanup 00041 // 00042 // Revision 1.7 2004/03/12 16:28:38 baumann 00043 // macros VRS_NAMESPACE_BEGIN/_END expanded and removed 00044 // 00045 // Revision 1.6 2004/01/19 11:43:56 baumann 00046 // serialization mechanism improved 00047 // 00048 // Revision 1.5 2003/07/23 17:04:01 baumann 00049 // new generic visitor added (see ChangeLog.txt for more information) 00050 // 00051 // Revision 1.4 2003/06/27 12:22:25 baumann 00052 // unneeded include removed 00053 // 00054 // Revision 1.3 2003/05/12 06:48:01 baumann 00055 // - comments added 00056 // - persistency added 00057 // 00058 // Revision 1.2 2003/04/17 10:25:45 kirsch 00059 // removed gcc signed/unsigned warnings by interface changes 00060 // 00061 // Revision 1.1 2003/04/15 10:50:15 baumann 00062 // new class CompositeCurve added 00063 // 00064 00065 #ifndef VRS_COMPOSITECURVE_H 00066 #define VRS_COMPOSITECURVE_H 00067 00068 #include <vrs/curve.h> 00069 00070 namespace VRS { 00071 00076 class VRS_CORE_API CompositeCurve : public Curve { 00077 00078 public: 00079 CompositeCurve(Curve* curve = NULL); 00080 00081 void appendCurve(Curve* curve); 00083 Curve* getCurve(unsigned int index) const; 00085 const Iterator<SO<Curve> >* getCurveIterator() const; 00087 void insertCurveAt(unsigned int index, Curve* curve); 00089 void removeCurve(unsigned int index); 00091 00092 static bool areCurvesCompatible(Curve* curve1, Curve* curve2); 00094 00095 virtual Vector curvePoint(double t) const; 00097 00098 virtual double t2length(double t) const; 00102 virtual double length2t(double length) const; 00108 virtual Vector derivative(int degree, double t) const; 00110 00111 virtual double getLength() const; 00113 00114 virtual int getSize() const; 00116 00117 virtual Bounds boundingBox() const; 00119 00120 VRS_TYPEINFO(CompositeCurve, Curve); 00121 VRS_SERIALIZABLE(CompositeCurve); 00122 00123 protected: 00124 virtual void acceptChildren(std::vector<Visitable*>& appendChildrenHere) const; 00125 00126 private: 00127 int getAffectedCurve(double& t) const; 00132 SO<Array<SO<Curve> > > curves_; 00133 double length_; 00134 Bounds bounds_; 00135 }; 00136 00137 } // namespace VRS 00138 00139 #endif // VRS_COMPOSITECURVE_H 00140 00141