// $Source: /usr/local/SimSoft/SoftShop/XGraph/Primitiv/Primitiv.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: Primitiv.h,v $
// Revision 1.20  2001/11/29 15:52:24  baum
// -In Kalender.cpp und Kalender.h Handsteuerung eingebaut
//

#ifndef _PRIMITIVE_H
#define _PRIMITIVE_H 1

#ifndef WIN32
#define __rtti
#endif

#ifndef _GEOPATTERN_H
class GeoPattern;
#endif

#include "IdObject.h"

#include <iostream.h>

#include "RefCount.h"

#include "DynArray.h"
#include "Vec2D.h"
#include "Vec3D.h"

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

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

//==================================================================
//		Class-Header
//		for class Primitive
//==================================================================

//##ModelId=4030D77D0280
class _impexp __rtti Primitive
 : public Identity, public RefCounter
  {
  public:
    // find Primitive with 'name'
	//##ModelId=4030D77D0290
    static Primitive *find (const char *name);

    // dispose, perhaps destruct
	//##ModelId=4030D77D0293
    void dispose ();

    // getting all Vecs in an Array
	//##ModelId=4030D77D0294
    const DynArray<Vec3D>& VecArray () const;

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

  protected:
    // defaultconstructor
	//##ModelId=4030D77D02A1
    Primitive (const char *name = NULL);

    // destructor
	//##ModelId=4030D77D02A3
    virtual ~Primitive ();

    // writing create-command to ostr
	//##ModelId=4030D77D02AF
    virtual void stream (ostream&) const = 0;

    // data members
	//##ModelId=4030D77D02C1
    DynArray<Vec3D> ObjPoints;

  private:
    //copyconstructor
	//##ModelId=4030D77D02C5
    Primitive (const Primitive&);

    // Zuweisungsoperator
	//##ModelId=4030D77D02CF
    Primitive& operator = (const Primitive&);

    // kick all Primitivs
	//##ModelId=4030D77D02D1
    static void deleteAll ();

    // writing create-command to ostr
	//##ModelId=4030D77D02DF
    static void streamAll (ostream& ostr);

    // kick all unreferenzed Primitives
	//##ModelId=4030D77D02E2
    static void clean ();

  //friends
    friend class GeoPattern;

};	// class Primitive

#endif	// !defined _PRIMITIVE_H

