#ifndef AC_GECYLNDR_H
#define AC_GECYLNDR_H
//
// (C) Copyright 1993-1999 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted, 
// provided that the above copyright notice appears in all copies and 
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting 
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC. 
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to 
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
// Description:
//
// This file implements the class AcGeCylinder, a representation for
// a right circular cylinder.  It is defined by its radius,
// axis of symmetry, and the origin (a point on the axis). It
// is generated by revolving a line parallel to the axis of symmetry,
// at a	distance of radius. The cylinder is paramterized as follows.
// u is the angle of revolution, measured from the refAxis (an axis
// perpendicular to the axis of symmetry). Right hand rule applied
// along the direction of the axis of symmetry defines the positive
// direction.  For a closed cylinder, u defaults to [-PI, PI).
// v parameter varies along the axis of symmetry.  It is positive in
// the direction of the axis of symmetry.  v = 0 correspond to the
// cross section containing the origin of the cylinder.  v is
// dimensionless.  Its speed is determined by the initial radius
// of the cylinder.
// The surface is perodic in u with a period of 2PI.
// [umin, umax] x [vmin, vmax] defines a four sided cylindrical
// patch bounded by two straight lines (at umin and umax), and
// two circular arcs (at vmin and vmax).  Following constraints
// apply to the definition of a cylindrical patch.
// umin < umax and |umin - umax| <= 2PI.
//



#include "gegbl.h"
#include "gesurf.h"
#include "gevec3d.h"
#include "geintrvl.h"
#include "gearc3d.h"
#pragma pack (push, 8)

class AcGeCircArc3d;

class
GX_DLLEXPIMPORT
AcGeCylinder : public AcGeSurface
{
public:
    AcGeCylinder ();
    AcGeCylinder (double radius, const AcGePoint3d& origin,
                  const AcGeVector3d& axisOfSymmetry);
    AcGeCylinder (double radius, const AcGePoint3d& origin,
                  const AcGeVector3d& axisOfSymmetry,
                  const AcGeVector3d& refAxis,
                  const AcGeInterval& height,
                  double startAngle, double endAngle);
    AcGeCylinder (const AcGeCylinder&);

    // Geometric properties.
    //
    double         radius        () const;
    AcGePoint3d    origin        () const;
    void           getAngles     (double& start, double& end) const;
    void           getHeight     (AcGeInterval& height) const;
    double         heightAt      (double u) const;
    AcGeVector3d   axisOfSymmetry() const;
    AcGeVector3d   refAxis       () const;
    Adesk::Boolean isOuterNormal () const;
    Adesk::Boolean isClosed      (const AcGeTol& tol = AcGeContext::gTol) const;

    AcGeCylinder&  setRadius     (double radius);
    AcGeCylinder&  setAngles     (double start, double end);
    AcGeCylinder&  setHeight     (const AcGeInterval& height);
    AcGeCylinder&  set           (double radius, const AcGePoint3d& origin,
                                  const AcGeVector3d& axisOfSym);
    AcGeCylinder&  set           (double radius, const AcGePoint3d& origin,
                                  const AcGeVector3d& axisOfSym,
                                  const AcGeVector3d& refAxis,
                                  const AcGeInterval& height,
                                  double startAngle, double endAngle);
    // Assignment operator.
    //
    AcGeCylinder&  operator =    (const AcGeCylinder& cylinder);

    // Intersection with a linear entity
    //
    Adesk::Boolean intersectWith (const AcGeLinearEnt3d& linEnt, int& intn,
                                  AcGePoint3d& p1, AcGePoint3d& p2,
                                  const AcGeTol& tol = AcGeContext::gTol) const;
};

#pragma pack (pop)
#endif
