// $Source: /usr/local/SimSoft/SoftShop/XGraph/Primitiv/Polygon.h,v $
// $Revision: 1.20 $
// $Author: baum $
// $Date: 2001/11/29 15:52:24 $
//
// Login name of the user who locked the revision
// $Locker:  $
// Tag name used to checkout the file
// $Name: Release-20 $
// State assigned to revision
// $State: Exp $
//
//
// $Log: Polygon.h,v $
// Revision 1.20  2001/11/29 15:52:24  baum
// -In Kalender.cpp und Kalender.h Handsteuerung eingebaut
//

#ifndef _POLYGON_H
#define _POLYGON_H 1

#ifndef WIN32
#define __rtti
#endif

#include "Primitiv.h"
#include "Vec3D.h"
#include "Array.h"
#include "Wrap.h"

#ifdef _POLYGON_CPP
#  undef _impexp
#  define _impexp __declspec(dllexport)
#elif defined BUILD_XGRAPH_DLL
#  undef _impexp
#  define _impexp
#else
#  undef _impexp
#  define _impexp __declspec(dllimport)
#endif

#if defined __GNUG__ || defined __hpux
#  undef _impexp
#  define _impexp
#endif

//==================================================================
//		Class-Header
//		for class PlanePolygon 
//==================================================================

//##ModelId=4030D77D02FD
class _impexp __rtti PlanePolygon : public Primitive
  {
  public:
    // constructs a PlanePolygon
	//##ModelId=4030D77D030E
    static Primitive *create (const Array<Vec3D>& vecs, const Array<int>& index);

    // constructs a PlanePolygon
	//##ModelId=4030D77D031C
    static Primitive *create (const Vec3D& p1, const Vec3D& p2, const Vec3D& p3);

    // constructs a PlanePolygon
    // with 'pointNo' of Vec3D* 
	//##ModelId=4030D77D0321
    static Primitive *create (unsigned pointsNo, ...);

    // inserting Vec3D
	//##ModelId=4030D77D032D
    void insert (const Vec3D&);

    // virtual functions for Building Display-Lists
	//##ModelId=4030D77D032F
    virtual void buildOGL (Vec2D* texSize = NULL);

  protected:
    // writing create-command to ostr
	//##ModelId=4030D77D0332
    void stream (ostream& ostr) const;

  private:
    // data-members
	//##ModelId=4030D77D033F
    unsigned     ObjLast;
	//##ModelId=4030D77D034C
    WrapBox      ObjWrap;
	//##ModelId=4030D77D035D
    Array<Vec3D> ObjVecs;
	//##ModelId=4030D77D037A
    Array<int>   ObjVecsIndex;

    // constructors
	//##ModelId=4030D77D037E
    PlanePolygon (const Array<Vec3D>& vecs, const Array<int>& index);
	//##ModelId=4030D77D038B
    PlanePolygon (const Vec3D& p1, const Vec3D& p2, const Vec3D& p3);

    // destructor
	//##ModelId=4030D77D039A
    virtual ~PlanePolygon ( );

    // default constructor declared, but not defined
	//##ModelId=4030D77D039C
    PlanePolygon ();

    // copy constructor declared, but not defined
	//##ModelId=4030D77D039D
    PlanePolygon (const PlanePolygon&);

    // assignment operator declared, but not defined
	//##ModelId=4030D77D03AA
    PlanePolygon& operator = (const PlanePolygon&);

  //friends
    friend class Primitive;

};	// class PlanePolygon 

#endif	// !defined _POLYGON_H

