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

#ifndef _TOGLVIEW_H
#define _TOGLVIEW_H  1

#ifndef _SPACE_H
class Space;
#endif

#ifndef _GEOOBJECT_H
class GeoObject;
#endif

#include "Strings.h"
#include "Vec3D.h"

#include "togl.h"
#include "View.h"
#include "OGLView.h"

#ifdef _TOGLVIEW_CPP
#  undef _impexp
#  define _impexp __declspec(dllexport)
#elif defined BUILD_VIEWS_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 ToglView
//==================================================================

//##ModelId=4030D76E007D
class _impexp ToglView : public OGLView
  {
  public:
    // Init ToglView (needs an Interp)
    // HAVE TO CALL FIRST OF ALL
	//##ModelId=4030D76E007F
    static void setup (Tcl_Interp *interp);

	//##ModelId=4030D76E008D
    static bool isInitialized ();

    //constructor (all Koords are in ScreenPixels)
    // default for an TopLevel-Widget
    // otherwise you have to specify a WidgetPath
    // for the new ToglView-Widget to put into!!!!
	//##ModelId=4030D76E008F
    ToglView (int xPos, int yPos, int xSize, int ySize, const RGBAColor& bgcolor,
              char* widgetPath, char* menuPath = NULL);

    //destructor
	//##ModelId=4030D76E00A0
    virtual ~ToglView  ();

    // creates the Window with Space
	//##ModelId=4030D76E00A2
    virtual void pose  (Space *myspace);

    // redrawing the View
	//##ModelId=4030D76E00AD
    virtual void flush ();

	//##ModelId=4030D76E00AF
    virtual void setTitle   (char *title);
	//##ModelId=4030D76E00B2
    virtual void setBgColor (const RGBAColor& col);

    // get Widget-Name
	//##ModelId=4030D76E00BD
    const char *WidgetName   () const;
	//##ModelId=4030D76E00BF
    const char *ToplevelName () const;

    // manipulate the projection of camera
	//##ModelId=4030D76E00C1
    virtual void setToPerspectiveProj ();
	//##ModelId=4030D76E00CC
    virtual void setToOrthogonalProj  ();

    // manipulate and get informations about ViewPoints
	//##ModelId=4030D76E00CE
    virtual const ViewPoint& addViewPoint    (const Ustring& name, const ViewPoint& vp);
	//##ModelId=4030D76E00DA
    virtual bool             removeViewPoint (const Ustring& name);
	//##ModelId=4030D76E00DD
    virtual bool             setToViewPoint  (const Ustring& name);

    // Update View every 'timing' in millisecs
	//##ModelId=4030D76E00E0
    virtual void makeMovie (unsigned timing);
	//##ModelId=4030D76E00EB
    virtual void stopMovie ();

	//##ModelId=4030D76E00ED
    virtual void showLight ();
	//##ModelId=4030D76E00EF
    virtual void hideLight ();

	//##ModelId=4030D76E00F1
    virtual void lightOn   ();
	//##ModelId=4030D76E00FB
    virtual void lightOut  ();

	//##ModelId=4030D76E00FD
    virtual void smoothOn  ();
	//##ModelId=4030D76E00FF
    virtual void smoothOut ();

	//##ModelId=4030D76E0109
    virtual void wireOn    ();
	//##ModelId=4030D76E010B
    virtual void wireOut   ();

	//##ModelId=4030D76E010D
    virtual void shadowOn  ();
	//##ModelId=4030D76E010F
    virtual void shadowOut ();

	//##ModelId=4030D76E0119
    virtual void fogOn     ();
	//##ModelId=4030D76E011B
    virtual void fogOut    ();

    // show Axis
	//##ModelId=4030D76E011D
    virtual void showAxis  ();
	//##ModelId=4030D76E011F
    virtual void hideAxis  ();

    // show or hide Grid
	//##ModelId=4030D76E0128
    virtual void showGrid  ();
	//##ModelId=4030D76E012A
    virtual void hideGrid  ();

    // show or hide Base
	//##ModelId=4030D76E012C
    virtual void showBase  ();
	//##ModelId=4030D76E012E
    virtual void hideBase  ();

    // (Togl) MouseCallback managing
	//##ModelId=4030D76E0139
    static void MouseCB   (struct Togl *togl, GLint button, GLint state,
                                              GLint x, GLint y);
	//##ModelId=4030D76E0148
    static void MotionCB  (struct Togl *togl, GLint state,  GLint x, GLint y);
	//##ModelId=4030D76E014E
    static void PassiveCB (struct Togl *togl, GLint x, GLint y);

    // display managing
	//##ModelId=4030D76E015B
    static void doAtStart (struct Togl *togl);
	//##ModelId=4030D76E015E
    static void redraw    (const struct Togl *togl);
	//##ModelId=4030D76E0169
    static void reshape   (struct Togl *togl);

  private:
    // copy constructor declared, but not defined
	//##ModelId=4030D76E016C
    ToglView (const ToglView&);

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

    //data members
	//##ModelId=4030D76E017B
    struct Togl *ObjMyTogl;
	//##ModelId=4030D76E0188
    Tk_Window ObjMyWindow;
	//##ModelId=4030D76E0197
    Ustring ObjFullWidgetName;
	//##ModelId=4030D76E019C
    Ustring ObjMenuPath;
	//##ModelId=4030D76E01A6
    Ustring ObjToplevelName;

	//##ModelId=4030D76E01B6
    Tk_TimerToken ObjUpdateTimer;

	//##ModelId=4030D76E01C6
    static Ustring ClassShareLists;

    // this Timer should realize the Movie
	//##ModelId=4030D76E01CA
    static void updateTiming (ClientData cd);

    //static DataMembers
	//##ModelId=4030D76E01D6
    static Tcl_Interp *ClassMyInterp;

    // communticate with the Window
	//##ModelId=4030D76E01E4
    static int ToglViewCmd (struct Togl *togl, int argc, char *argv[]);

}; // class ToglView

#endif // !_TOGLVIEW_H

