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


#ifndef _SELECTION_H
#define _SELECTION_H 1

#include <iostream.h>

#include "DynArray.h"

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

#include "Pattern.h"
#include "Parent.h"
#include "GeoObj.h"

#ifndef _SPACE_H
  class Space;
#endif

#ifdef _SELECTION_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

//==================================================================
//		Klassen-Header
//		fuer class Selection
//==================================================================

//##ModelId=4030D77D00BB
class _impexp Selection {
  public:
    // constructor
	//##ModelId=4030D77D00BC
    Selection (const Space& mySpace);

    // destructor
	//##ModelId=4030D77D00CB
    ~Selection ();

    // TotalMarkBox actions
	//##ModelId=4030D77D00CC
    void showTotalMarkBox ();
	//##ModelId=4030D77D00CD
    void hideTotalMarkBox ();
	//##ModelId=4030D77D00CE
    bool hasTotalMarkBox () const;

    // set the style of MarkBox
	//##ModelId=4030D77D00DA
    void markWithRedBox   ();
	//##ModelId=4030D77D00DB
    void markWithGreenBox ();
	//##ModelId=4030D77D00DC
    void markWithBlueBox  ();

	//##ModelId=4030D77D01D5
    enum XGSelColor {SelDefault = 0,
		//##ModelId=4030D77D01E5
                     SelRed     = 1,
		//##ModelId=4030D77D01E6
                     SelGreen   = 2,
		//##ModelId=4030D77D01F4
                     SelBlue    = 3};

    // specify and maipulate
    // selection of objects
	//##ModelId=4030D77D00DD
    GeoObject *insert (GeoObject& obj, XGSelColor col = SelDefault);
	//##ModelId=4030D77D00EB
    GeoObject *remove (GeoObject& obj);
	//##ModelId=4030D77D00ED
    void removeAll ();

    // manipulate the selected Objects
    // with global koordinates!!!
	//##ModelId=4030D77D00EE
    void move   (const Vec3D& mVec);
	//##ModelId=4030D77D00FA
    void rotate (const Vec3D& axis, const Angle& rot);
	//##ModelId=4030D77D00FD
    void scale  (const Vec3D& sVec);

    // query functions
	//##ModelId=4030D77D00FF
    bool       hasSelection () const;
	//##ModelId=4030D77D010A
    bool       hasSelection (const GeoObject& obj) const;
	//##ModelId=4030D77D010D
    GeoObject* couldSelect  (const GeoObject& obj) const;

    // DynArray of all selected Objects
	//##ModelId=4030D77D0119
    const DynArray<GeoObject>& SelectedObjects () const;

  private:
    // data-members
	//##ModelId=4030D77D012A
    DynArray<GeoObject> ObjSelectedObjects;
	//##ModelId=4030D77D0139
    DynArray<GeoObject> ObjBoxes;

	//##ModelId=4030D77D013E
    WrapBox   ObjTotalWrap;
	//##ModelId=4030D77D0149
    GeoObject ObjTotalMarkBox;

	//##ModelId=4030D77D0158
    Pattern *ObjMarkPatt;
	//##ModelId=4030D77D0168
    Space   *ObjMySpace;

	//##ModelId=4030D77D016C
    GeoObject *findObject (const GeoObject& box) const;
	//##ModelId=4030D77D0178
    GeoObject *findBox (const GeoObject& object) const;

	//##ModelId=4030D77D0186
    void calcWrap ();

	//##ModelId=4030D77D0187
    void showBoxes ();
	//##ModelId=4030D77D0188
    void hideBoxes ();

	//##ModelId=4030D77D0197
    static Pattern *ClassRedBox;
	//##ModelId=4030D77D019C
    static Pattern *ClassGreenBox;
	//##ModelId=4030D77D01A6
    static Pattern *ClassBlueBox;
	//##ModelId=4030D77D01B6
    static unsigned ClassRefCounter;

	//##ModelId=4030D77D01BA
    static void setup ();
	//##ModelId=4030D77D01C6
    static void cleanup ();

    // declared, but not defined
	//##ModelId=4030D77D01C8
    Selection ();
	//##ModelId=4030D77D01C9
    const Selection& operator = (const Selection& sel);

}; // class Selection

#endif	// !defined _SELECTION_H

