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

#ifndef _GEOPATTERN_H
#define _GEOPATTERN_H  1

#ifndef WIN32
#define __rtti
#endif

#include "IdObject.h"

#include <iostream.h>

#include "Vec3D.h"
#include "Location.h"
#include "Wrap.h"

#include "Attribut.h"
#include "Primitiv.h"

#include "RefCount.h"

#ifdef _GEOPATTERN_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 GeoPattern
//==================================================================

//##ModelId=4030D77F00CB
class _impexp __rtti GeoPattern : public Identity, public RefCounter
  {
  public:
    // functions to create a GeoPattern
	//##ModelId=4030D77F00DC
    static GeoPattern* create ();
	//##ModelId=4030D77F00DE
    static GeoPattern* create (const Primitive&, const Attribute&,
                               const Location& loc = Location ());
	//##ModelId=4030D77F00EC
    static GeoPattern* create (const GeoPattern&);

    // find GeoPattern with 'name'
	//##ModelId=4030D77F00EF
    static GeoPattern *find (const char *name);

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

    // extending the Contents
	//##ModelId=4030D77F00FC
    void insert (const Primitive&, const Attribute&,
                 const Location& loc = Location());

	//##ModelId=4030D77F0109
    void setAttrib (const Attribute&);
	//##ModelId=4030D77F010B
    const Attribute* Attrib () const;

	//##ModelId=4030D77F010D
    void setPrim (const Primitive&);
	//##ModelId=4030D77F0119
    const Primitive* Prim () const;

    //getting the Wrap
	//##ModelId=4030D77F011B
    const WrapBox& Wrap () const;

    // set and get Location
	//##ModelId=4030D77F011D
    void setLoc (const Location&);
	//##ModelId=4030D77F011F
    const Location& Loc ();

    // Building an OpenGL-DisplayList
	//##ModelId=4030D77F0128
    void buildOGL ();

  protected:

  private:
    // saved constructors
	//##ModelId=4030D77F0129
    GeoPattern ();
	//##ModelId=4030D77F012A
    GeoPattern (const Primitive&, const Attribute&, const Location&);
	//##ModelId=4030D77F013A
    GeoPattern (const GeoPattern&);

    // saved destructor
	//##ModelId=4030D77F013C
    virtual ~GeoPattern ();

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

    // kick all GeoPattern
	//##ModelId=4030D77F014A
    static void deleteAll ();

    // kick all unreferenzed GeoPatterns
	//##ModelId=4030D77F014C
    static void clean ();

    // writing create-command to ostr
	//##ModelId=4030D77F0158
    void stream (ostream& ostr) const;
	//##ModelId=4030D77F015B
    static void streamAll (ostream& ostr);

    // Wrap relativ to Location
	//##ModelId=4030D77F0168
    void setWrapToLoc ();

    // data members
	//##ModelId=4030D77F0178
    WrapBox  ObjWrapbox;  // Wrap relativ to it's Pattern
	//##ModelId=4030D77F017D
    Location ObjLoc;

	//##ModelId=4030D77F0187
    Primitive* ObjMyPrim;
	//##ModelId=4030D77F0197
    Attribute* ObjMyAttribute;

  // friends
    friend class Pattern;

}; // class GeoPattern


#endif // !_GEOPATTERN_H

