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

#ifndef _PATTERN_H
#define _PATTERN_H  1

#ifndef WIN32
#define __rtti
#endif

#ifndef _GEOPATTERN_H
class GeoPattern;
#endif

#include "IdObject.h"
#include "RefCount.h"

#include "DynArray.h"
#include "Wrap.h"

#ifdef _PATTERN_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 Pattern
//==================================================================

//##ModelId=4030D77D03D8
class _impexp __rtti Pattern : public Identity, public RefCounter {
  public:
    // functions to create a Pattern
	//##ModelId=4030D77E0001
    static Pattern* create ();
	//##ModelId=4030D77E0003
    static Pattern* create (const GeoPattern&);
	//##ModelId=4030D77E0006
    static Pattern* create (const Pattern&);

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

    // dispose, no destruct
	//##ModelId=4030D77E0014
    void dispose ();

    // kick all Pattern
	//##ModelId=4030D77E001F
    static void deleteAll ();

    // kick all unreferenzed Patterns
	//##ModelId=4030D77E0021
    static void clean ();

    // extending the Contents
	//##ModelId=4030D77E0023
    void insert (const GeoPattern&);

    // remove one or all AttribPatterns
	//##ModelId=4030D77E002F
    void remove (const GeoPattern&);
	//##ModelId=4030D77E0031
    void removeAll ();

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

    // return copy of Wrap transformed to parent coordinates
	//##ModelId=4030D77E003F
    WrapBox WrapForParent ();

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

    // kick all DisplayLists
	//##ModelId=4030D77E0041
    static void removeDisplayLists ();

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

  private:
    // constructors
	//##ModelId=4030D77E0050
    Pattern ();
	//##ModelId=4030D77E0051
    Pattern (const GeoPattern&);
	//##ModelId=4030D77E005D
    Pattern (const Pattern&);

    // destructor
	//##ModelId=4030D77E005F
    virtual ~Pattern ();

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

    // data members
	//##ModelId=4030D77E007E
    DynArray<GeoPattern> ObjMyGeoPatterns;
	//##ModelId=4030D77E0083
    WrapBox  ObjWrapbox;
	//##ModelId=4030D77E008D
    unsigned ObjMyIndex;
	//##ModelId=4030D77E009D
    unsigned ObjViewMask;

  // friends
    friend class Identity;

};	// class Pattern

#endif // !_PATTERN_H

