/// This file is part of the X3DToolKit library
/// Copyright (C) 2002-2004  Yannick Le Goc (legoc@imag.fr)

/// http://artis.imag.fr/Members/Yannick.Legoc/X3D/

/// This library is free software; you can redistribute it and/or
/// modify it under the terms of the GNU Lesser General Public
/// License as published by the Free Software Foundation; either
/// version 2.1 of the License, or (at your option) any later version.

/// This library 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
/// Lesser General Public License for more details.

/// You should have received a copy of the GNU Lesser General Public
/// License along with this library; if not, write to the Free Software
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#ifndef X3DTK_X3D_NURBSSURFACE
#define X3DTK_X3D_NURBSSURFACE

#include "X3DTypes.h"
#include "X3D_X3DParametricGeometryNode.h"

namespace X3DTK {
namespace X3D {

class X3DTextureCoordinateNode;

/*! \brief Base class declared in <b><X3DTK/X3D/scenegraph.h></b>, part of the <a href="../../doc/X3DSpecs/Part01/components/nurbs.html">
 *  NURBS component</a> defining a NurbsSurface
 *  (<a href="../../doc/X3DSpecs/Part01/components/nurbs.html#NurbsSurface">
 *  documentation</a>).
 *
 *  \ingroup X3DSceneGraph
 */

class NurbsSurface : public X3DParametricGeometryNode
{
public:
  /// Constructor.
  NurbsSurface();
  /// Destructor.
  virtual ~NurbsSurface();
  
  /// Sets the controlPoint attribute.
  void setControlPoint(const MFVec3f &controlPoint);
  /// Sets the uTesselation attribute.
  void setUTesselation(const SFInt32 &uTesselation);
  /// Sets the vTesselation attribute.
  void setVTesselation(const SFInt32 &vTesselation);
  /// Sets the weight attribute.
  void setWeight(const MFDouble &weight);
  /// Sets the ccw attribute.
  void setCcw(const SFBool &ccw);
  /// Sets the solid attribute.
  void setSolid(const SFBool &solid);
  /// Sets the uDimension attribute.
  void setUDimension(const SFInt32 &uDimension);
  /// Sets the vDimension attribute.
  void setVDimension(const SFInt32 &vDimension);
  /// Sets the uKnot attribute.
  void setUKnot(const MFDouble &uKnot);
  /// Sets the vKnot attribute.
  void setVKnot(const MFDouble &vKnot);
  /// Sets the uOrder attribute.
  void setUOrder(const SFInt32 &uOrder);
  /// Sets the vOrder attribute.
  void setVOrder(const SFInt32 &vOrder);

  /// Gets the controlPoint attribute.
  inline const MFVec3f &getControlPoint() const {return _controlPoint;};
  /// Gets the texCoord attribute.
  inline X3DTextureCoordinateNode *getTexCoord() const {return _texCoord;};
  /// Gets the uTesselation attribute.
  inline const SFInt32 &getUTesselation() const {return _uTesselation;};
  /// Gets the vTesselation attribute.
  inline const SFInt32 &getVTesselation() const {return _vTesselation;};
  /// Gets the weight attribute.
  inline const MFDouble &getWeight() const {return _weight;};
  /// Gets the ccw attribute.
  inline const SFBool &getCcw() const {return _ccw;};
  /// Gets the solid attribute.
  inline const SFBool &getSolid() const {return _solid;};
  /// Gets the uDimension attribute.
  inline const SFInt32 &getUDimension() const {return _uDimension;};
  /// Gets the vDimension attribute.
  inline const SFInt32 &getVDimension() const {return _vDimension;};
  /// Gets the uKnot attribute.
  inline const MFDouble &getUKnot() const {return _uKnot;};
  /// Gets the vKnot attribute.
  inline const MFDouble &getVKnot() const {return _vKnot;};
  /// Gets the uOrder attribute.
  inline const SFInt32 &getUOrder() const {return _uOrder;};
  /// Gets the vOrder attribute.
  inline const SFInt32 &getVOrder() const {return _vOrder;};

private:
  /// Set of control points of dimension _uDimension * _vDimension.
  MFVec3f _controlPoint;
  /// Additional information on how to generate texture coordinates.
  X3DTextureCoordinateNode *_texCoord;
  /// Tesselation in the u direction.
  SFInt32 _uTesselation;
  /// Tesselation in the v direction.
  SFInt32 _vTesselation;
  /// Weight values assigned to each control point.
  MFDouble _weight;
  /// Ccw attribute.
  SFBool _ccw;
  /// Solid attribute.
  SFBool _solid;
  /// Number of control points in the u direction.
  SFInt32 _uDimension;
  /// Number of control points in the v direction.
  SFInt32 _vDimension;
  /// Knot vector in the u direction.
  MFDouble _uKnot;
  /// Knot vector in the v direction.
  MFDouble _vKnot;
  /// Order in the u direction.
  SFInt32 _uOrder;
  /// Order in the v direction.
  SFInt32 _vOrder;
};

}
}

#endif
