Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/parametrics/nurbsCurveResult.h

Go to the documentation of this file.
00001 // Filename: nurbsCurveResult.h
00002 // Created by:  drose (03Dec02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef NURBSCURVERESULT_H
00020 #define NURBSCURVERESULT_H
00021 
00022 #include "pandabase.h"
00023 #include "referenceCount.h"
00024 #include "nurbsMatrixVector.h"
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //       Class : NurbsCurveResult
00028 // Description : The result of a NurbsCurveEvaluator.  This object
00029 //               represents a curve in a particular coordinate space.
00030 //               It can return the point and/or tangent to the curve
00031 //               at any point.
00032 //
00033 //               This is not related to NurbsCurve, ClassicNurbsCurve,
00034 //               CubicCurveseg or any of the ParametricCurve-derived
00035 //               objects in this module.  It is a completely parallel
00036 //               implementation of NURBS curves, and will probably
00037 //               eventually replace the whole ParametricCurve class
00038 //               hierarchy.
00039 ////////////////////////////////////////////////////////////////////
00040 class EXPCL_PANDA NurbsCurveResult : public ReferenceCount {
00041 public:
00042   NurbsCurveResult(const NurbsMatrixVector &basis, int order,
00043                    const LVecBase4f verts[], int num_vertices);
00044 
00045 PUBLISHED:
00046   INLINE ~NurbsCurveResult();
00047 
00048   INLINE float get_start_t() const;
00049   INLINE float get_end_t() const;
00050 
00051   INLINE bool eval_point(float t, LVecBase3f &point);
00052   INLINE bool eval_tangent(float t, LVecBase3f &tangent);
00053   
00054   INLINE int get_num_segments() const;
00055   void eval_segment_point(int segment, float t, LVecBase3f &point) const;
00056   void eval_segment_tangent(int segment, float t, LVecBase3f &tangent) const;
00057   INLINE float get_segment_t(int segment, float t) const;
00058   
00059 private:
00060   int find_segment(float t);
00061   int r_find_segment(float t, int top, int bot) const;
00062 
00063   NurbsMatrixVector _prod;
00064 
00065   int _last_segment;
00066   float _last_from;
00067   float _last_to;
00068 };
00069 
00070 #include "nurbsCurveResult.I"
00071 
00072 #endif
00073 

Generated on Fri May 2 00:40:46 2003 for Panda by doxygen1.3