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

#ifndef _ATTRIBUTE_H
#define _ATTRIBUTE_H  1

#ifndef WIN32
#define __rtti
#endif

#include "IdObject.h"

#include <iostream.h>

#include "RefCount.h"
#include "Color.h"
#include "Vec2D.h"

#ifdef _ATTRIBUTE_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 Attribute
//==================================================================

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

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

    // Building an OpenGL-DisplayList
	//##ModelId=4030D7810189
    virtual void buildOGL (class Primitive* prim) = 0;

  protected:
    // saved constructors
	//##ModelId=4030D7810197
    Attribute (const char* name, const RGBAColor&);

    // saved destructor
	//##ModelId=4030D781019A
    virtual ~Attribute ();

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

    // data members
	//##ModelId=4030D78101A9
    RGBAColor ObjColor;

  private:
    // default and copy constructor declared, but not defined
	//##ModelId=4030D78101B5
    Attribute ();
	//##ModelId=4030D78101B6
    Attribute (const Attribute&);

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

    // kick all Attribute
	//##ModelId=4030D78101C6
    static void deleteAll ();

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

    // kick all unreferenzed Attributes
	//##ModelId=4030D78101D5
    static void clean ();

  // friends
    friend class GeoPattern;
}; // class Attribute


//==================================================================
//		Class-Header
//		for class ColorAttribute
//==================================================================

//##ModelId=4030D7810203
class _impexp __rtti ColorAttribute : public Attribute {
  public:
    // functions to create an Attribute
	//##ModelId=4030D7810214
    static Attribute* create (const RGBAColor&);
	//##ModelId=4030D7810217
    static Attribute* create (const char* colorName);
	//##ModelId=4030D7810222
    static Attribute* create (const ColorAttribute&);

    // Get MainColor
	//##ModelId=4030D7810225
    const RGBAColor& Color () const;

    // Building an OpenGL-DisplayList
	//##ModelId=4030D7810227
    virtual void buildOGL (Primitive* prim);

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

  private:
    // saved constructors
	//##ModelId=4030D7810235
    ColorAttribute (const RGBAColor&);
	//##ModelId=4030D7810242
    ColorAttribute (const char* attribName, const RGBAColor&);
	//##ModelId=4030D7810245
    ColorAttribute (const ColorAttribute&);

    // saved destructor
	//##ModelId=4030D7810247
    virtual ~ColorAttribute ();

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

  // friends
    friend class Attribute;
}; // class ColorAttribute

//==================================================================
//		Class-Header
//		for class MaterialAttribute
//==================================================================

//##ModelId=4030D781029F
class _impexp __rtti MaterialAttribute : public Attribute {
  public:
    // functions to create an Attribute
    // definition of Material with OpenGL defaults!!
	//##ModelId=4030D78102A1
    static Attribute* create (const RGBAColor& ambient,
                              const RGBAColor& diffuse,
                              const RGBAColor& specular  = RGBAColor (0.0,0.0,0.0,1.0),
                              const double&    shininess = 0.0);
	//##ModelId=4030D78102B4
    static Attribute* create (const char* materialName);
	//##ModelId=4030D78102C1
    static Attribute* create (const MaterialAttribute&);

    // info
	//##ModelId=4030D78102C4
    const RGBAColor& Ambient   () const;
	//##ModelId=4030D78102C6
    const RGBAColor& Diffuse   () const;
	//##ModelId=4030D78102CF
    const RGBAColor& Specular  () const;
	//##ModelId=4030D78102D1
    const double&    Shininess () const;

    // Building an OpenGL-DisplayList
	//##ModelId=4030D78102D3
    virtual void buildOGL (Primitive* prim);

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

  private:
    // saved constructors
	//##ModelId=4030D78102E2
    MaterialAttribute (const char* materialName,
                       const RGBAColor& ambient,
                       const RGBAColor& diffuse,
                       const RGBAColor& specular,
                       const double& shininess);
	//##ModelId=4030D78102F2
    MaterialAttribute (const MaterialAttribute&);

    // saved destructor
	//##ModelId=4030D78102F4
    virtual ~MaterialAttribute ();

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

    // data members
	//##ModelId=4030D7810301
    RGBAColor ObjDiffuse;
	//##ModelId=4030D781030E
    RGBAColor ObjSpecular;
	//##ModelId=4030D781031C
    double ObjShininess;

	//##ModelId=4030D781031E
    static RGBAColor ClassDefaultSpecular;

  // friends
    friend class Attribute;
	//##ModelId=4030D781032C
    friend Attribute* getMaterialByName (const char* materialName);
}; // class MaterialAttribute

//==================================================================
//		Class-Header
//		for class TexAttribute
//==================================================================

//##ModelId=4030D781036B
class _impexp __rtti TexAttribute : public Attribute {
  public:
    // functions to create an Attribute
	//##ModelId=4030D781036D
    static Attribute* create (const char* texFileName, const Vec2D& texVec,
                              const RGBAColor& = RGBAColor (0.8, 0.8, 0.8));
	//##ModelId=4030D781037D
    static Attribute* create (const TexAttribute&);

    // info
	//##ModelId=4030D781038A
    const Vec2D&     TextureSize () const;
	//##ModelId=4030D781038C
    const RGBAColor& Color       () const;

    // Building an OpenGL-DisplayList
	//##ModelId=4030D781038E
    virtual void buildOGL (Primitive* prim);

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

  private:
    // saved constructors
	//##ModelId=4030D781039B
    TexAttribute (const char* texFileName, const Vec2D& texVec, const RGBAColor&);
	//##ModelId=4030D78103A9
    TexAttribute (const TexAttribute&);

    // saved destructor
	//##ModelId=4030D78103AB
    virtual ~TexAttribute ();

    // data members
	//##ModelId=4030D78103AE
    class Texture* ObjTexture;
	//##ModelId=4030D78103BC
    Vec2D          ObjTextureSize;

    // default constructor and assignment operator declared, but not defined
	//##ModelId=4030D78103C8
    TexAttribute ();
	//##ModelId=4030D78103C9
    TexAttribute& operator = (const TexAttribute&);

  // friends
    friend class Attribute;
}; // class TexAttribute

#endif // !_ATTRIBUTE_H

