/***************************************************************************
 *                          Zanoza Modeler v2.x                            *
 *      This is unpublished propietary source code of Zanoza Software.     *
 *      The copyright notice does not evidence any actual or intended      *
 *                    publication of such source code.                     *
 *                                                                         *
 *                Copyright (c) 2002-2008 Zanoza Software.                 *
 *                                                                         *
 *                        All rights reserved.                             *
 ***************************************************************************
 *--------------------------------------------------------------------------
 * @author:   Oleg Melashenko
 *--------------------------------------------------------------------------
 * @purpose:  Declaration of the class ISpline
 *--------------------------------------------------------------------------
 * @created: Monday, September 15, 2003 14:36:20
 */

#if !defined(ISpline_h_included)
#define ISpline_h_included
//forward declaration of this class might require
namespace scene
{ class ISpline; };
#include <zmodeler.h>
#include <scene/zmSceneTypes.h>
#include <scene/IControlPoint.h>


namespace scene
{
  
  class ISpline : public CControlPointCol
  {
  public:
    virtual ZRESULT isClosed(void)=0;
    virtual ZRESULT setClosed(bool bClosed=true)=0;
    /* Provides section end-control point in respect to closed splines. ZRESULT_FALSE is
     * returned once last section acieved.
     * Spline iterator is set to the start vertex. so, getSectionPoint is a valid call afterward */
    virtual ZRESULT getSectionControls(scene::IControlPoint* pStart, scene::IControlPoint** ppEnd)=0;
    /* Provides an adaptive detalization for supplied section (amount of mid-points) */
    virtual long getSectionAutoDetail(scene::IControlPoint* pStart, scene::IControlPoint* pEnd)=0;
    /* Provides point for current section using supplied u [0..1] */
    virtual ZRESULT getSectionPoint(scene::IControlPoint* pStart, scene::IControlPoint* pEnd, float u, ZPoint3D& pt)=0;
    /* Provides point for the spline using supplied u [0..1] */
    virtual ZRESULT getSplinePoint(float u, float fLength, ZPoint3D& pt)=0;
    /* Provides a control point which controls the curve pointed by u-parameter [0..1]. */
    virtual ZRESULT getSplineControlPoint(float u, scene::IControlPoint** ppPoint)=0;
    /* when bControl true: provides amount of control points in spline; otherwise: provides
     * complete amount of points in the spline (using section detalization values). */
    virtual long numCurvePoints(bool bControl=false)=0;
    /* Provides current spline length, accumulating sections length using current detalization set. */
    virtual ZRESULT getSplineLength(float& fLength)=0;
    virtual ZRESULT getSectionLength(scene::IControlPoint* pS, scene::IControlPoint* pE, float& fLength)=0;
  
  };//class ISpline
};//scene

#endif
