00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "lux.h"
00025 #include "shape.h"
00026 #include "dynload.h"
00027 #include "texture.h"
00028
00029 namespace lux
00030 {
00031
00032
00033 class NURBS : public Shape {
00034 public:
00035
00036 NURBS(const Transform &o2w, bool reverseOrientation, int nu, int uorder,
00037 const float *uknot, float umin, float umax,
00038 int nv, int vorder, const float *vknot, float vmin, float vmax,
00039 const float *P, bool isHomogeneous);
00040 virtual ~NURBS();
00041 virtual BBox ObjectBound() const;
00042 virtual BBox WorldBound() const;
00043 virtual bool CanIntersect() const { return false; }
00044 virtual void Refine(vector<boost::shared_ptr<Shape> > &refined) const;
00045
00046 static Shape* CreateShape(const Transform &o2w, bool reverseOrientation, const ParamSet ¶ms);
00047 private:
00048
00049 int nu, uorder, nv, vorder;
00050 float umin, umax, vmin, vmax;
00051 float *uknot, *vknot;
00052 bool isHomogeneous;
00053 float *P;
00054 };
00055
00056 }