/*****************************************************************************
* Conversion routines from curvesand surfaces to polygons and polylines.     *
*									     *
* Written by:  Gershon Elber				Ver 1.0, Apr 1992    *
*****************************************************************************/

#ifndef IP_CONVRT_H
#define IP_CONVRT_H

#include "iritprsr.h"
#include "attribut.h"

#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif

IPPolygonStruct *IritCurve2Polylines(CagdCrvStruct *Crv, int SamplesPerCurve,
				     int Optimal);
IPPolygonStruct *IritCurve2CtlPoly(CagdCrvStruct *Crv);
IPPolygonStruct *IritSurface2Polylines(CagdSrfStruct *Srf,
				       int NumOfIsolines[2],
				       int SamplesPerCurve,
				       int Optimal);
IPPolygonStruct *IritSurface2CtlMesh(CagdSrfStruct *Srf);
IPPolygonStruct *IritSurface2Polygons(CagdSrfStruct *Srf, int FourPerFlat,
				      RealType FineNess, int ComputeUV,
				      int Optimal);
IPPolygonStruct *IritTrimSrf2Polylines(TrimSrfStruct *TrimSrf,
				       int NumOfIsolines[2],
				       int SamplesPerCurve,
				       int Optimal,
				       int TrimmingCurves,
				       int IsoParamCurves);
IPPolygonStruct *IritTrimSrf2CtlMesh(TrimSrfStruct *TrimSrf);
IPPolygonStruct *IritTrivar2Polygons(TrivTVStruct *Trivar,
				     int FourPerFlat,
				     RealType FineNess,
				     int ComputeUV,
				     int Optimal);
IPPolygonStruct *IritTrivar2Polylines(TrivTVStruct *Trivar,
				      int NumOfIsolines[3],
				      int SamplesPerCurve,
				      int Optimal);
IPPolygonStruct *IritTrivar2CtlMesh(TrivTVStruct *Trivar);
void IritSetCurvesToCubicBzrTol(RealType Tolerance);
CagdCrvStruct *IritCurvesToCubicBzrCrvs(CagdCrvStruct *Crvs,
					IPPolygonStruct **CtlPolys,
					CagdBType DrawCurve,
					CagdBType DrawCtlPoly,
					CagdRType MaxArcLen);
CagdCrvStruct *IritSurfacesToCubicBzrCrvs(CagdSrfStruct *Srfs,
					  IPPolygonStruct **CtlMeshes,
					  CagdBType DrawSurface,
					  CagdBType DrawMesh,
					  int NumOfIsolines[2],
					  CagdRType MaxArcLen);
CagdCrvStruct *IritTrimSrfsToCubicBzrCrvs(TrimSrfStruct *TrimSrfs,
					  IPPolygonStruct **CtlMeshes,
					  CagdBType DrawTrimSrf,
					  CagdBType DrawMesh,
					  int NumOfIsolines[2],
					  CagdRType MaxArcLen);
CagdCrvStruct *IritTrivarToCubicBzrCrvs(TrivTVStruct *Trivar,
					  IPPolygonStruct **CtlMeshes,
					  CagdBType DrawSurface,
					  CagdBType DrawMesh,
					  int NumOfIsolines[2],
					  CagdRType MaxArcLen);

#if defined(__cplusplus) || defined(c_plusplus)
}
#endif

#endif /* IP_CONVRT_H */
