00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if defined(_MSC_VER)
00025 #pragma once
00026 #endif
00027
00028 #ifndef PBRT_SHAPES_NURBS_H
00029 #define PBRT_SHAPES_NURBS_H
00030
00031
00032 #include "pbrt.h"
00033 #include "shape.h"
00034 #include "geometry.h"
00035
00036
00037
00038 class NURBS : public Shape {
00039 public:
00040
00041 NURBS(const Transform *o2w, const Transform *w2o,
00042 bool ReverseOrientation, int nu, int uorder,
00043 const float *uknot, float umin, float umax,
00044 int nv, int vorder, const float *vknot, float vmin, float vmax,
00045 const float *P, bool isHomogeneous);
00046 ~NURBS();
00047 BBox ObjectBound() const;
00048 BBox WorldBound() const;
00049 bool CanIntersect() const { return false; }
00050 void Refine(vector<Reference<Shape> > &refined) const;
00051 private:
00052
00053 int nu, uorder, nv, vorder;
00054 float umin, umax, vmin, vmax;
00055 float *uknot, *vknot;
00056 bool isHomogeneous;
00057 float *P;
00058 };
00059
00060
00061
00062
00063 extern NURBS *CreateNURBSShape(const Transform *o2w, const Transform *w2o,
00064 bool ReverseOrientation, const ParamSet ¶ms);
00065
00066
00067 #endif // PBRT_SHAPES_NURBS_H