home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Zone
/
VRZONE.ISO
/
mac
/
PC
/
PCGLOVE
/
GLOVE
/
OBJGLV.ZIP
/
INCLUDE
/
WINACTOR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-11
|
4KB
|
144 lines
//
// WinActor.cpp:
// Interface Definition of classes WinPolygon, Win_PolySpace,
// TDataDialog, and winGraphicsActor. Example use of Object Glove.
//
// Purpose:
// Outputs graphics and text in Windows.
//
// Compatibility:
// Windows only!
//
// Copyright 1993 Mark Thomas Pflaging
//
// Date: 3/22/93 (Release 3.0)
//
#ifndef __WINACTOR_HPP
#define __WINACTOR_HPP
#include <owl.h>
#include <static.h>
#include "glgrph.hpp"
#include "winres.h"
#include "winglove.hpp"
class WinPolygon : public GenPolygon {
static HDC DC;
public:
WinPolygon(int numPoints) : GenPolygon(numPoints) {}
virtual void draw() {
Polygon(DC, (const POINT *)(&idx(0)), lastIdx / IntsPerPoint);
}
static void setDC(HDC where) { DC = where; }
};
class Win_PolySpace : public PolygonSpace {
public:
void WinDrawAll(HDC where) {
WinPolygon::setDC(where);
drawAll();
}
GenPolygon & makeNew(int numPoints) {
GenPolygon & retval = *(new WinPolygon(numPoints));
*this += &retval;
return retval;
}
};
_CLASSDEF(TDataDialog)
class TDataDialog : public TDialog
{
TStatic *X_Spot, *Y_Spot, *Z_Spot, *Rotation_Spot, *Keys_Spot,
*Thumb_Spot, *Index_Spot, *Middle_Spot, *Ring_Spot;
int old_X, old_Y, old_Z, old_Rotation, old_Keys,
old_Thumb, old_Index, old_Middle, old_Ring;
public:
TDataDialog(PTWindowsObject AParent, int ResourceID, PTModule AModule = NULL);
~TDataDialog() {
delete X_Spot;
delete Y_Spot;
delete Z_Spot;
delete Rotation_Spot;
delete Keys_Spot;
delete Thumb_Spot;
delete Index_Spot;
delete Middle_Spot;
delete Ring_Spot;
}
void infoDisplay(gloveDriver & gd);
};
class winGraphicsActor : public graphicsActor {
int xx; // plot position.
volatile int drawn; // set if cursor to be erased.
void displayGlove(GloveData& gd);
XYZ oldData; // MAYBE a little bigger than it needs to be.
XYZ newRect;
int oldFingers;
int currentColor;
int fillMode;
int upIncrement;
Boolean keyDown;
TDemoWindow & where;
PTDataDialog DataPlace1;
static PTDialog InfoScreen;
winGestureActor & gact;
public:
winGraphicsActor(InitFile & ini, TDemoWindow & arg, winGestureActor & garg);
winGraphicsActor(InitFile & ini, TDemoWindow & arg, ButtonGestSet &buttons, winGestureActor & garg);
~winGraphicsActor() {}
void Init(InitFile & ini);
static void displayHelp();
void Paint(HDC DC);
void drawGlove(gloveDriver &gd);
virtual void eraseGlove();
void infoDisplay(gloveDriver & gd);
void infoErase(int start);
void Process(gloveDriver& gd);
static void Process(gloveDriver& gd, void * aGraphicsActor) {
winGraphicsActor & here = *((winGraphicsActor *)aGraphicsActor);
here.Process(gd);
}
Boolean isInfoActive() { return infoActive; }
virtual void infoDisplay() {
if (!InfoScreen) {
InfoScreen = new TDialog(&where, ID_INFO_SCREEN, where.GetModule());
(where.GetModule())->MakeWindow(InfoScreen);
}
}
virtual void infoClear() {
if (InfoScreen) {
InfoScreen->CloseWindow();
InfoScreen = NULL;
}
}
virtual void eraseFingers() {}
virtual void displayDataBox() {
DataPlace1 = new TDataDialog(&where, getInstance(), where.GetModule());
(where.GetModule())->MakeWindow(DataPlace1);
}
virtual void closeDataBox() {
DataPlace1->CloseWindow();
}
virtual void clearScreen() {
InvalidateRect(where.HWindow, NULL, TRUE);
}
virtual void displayGestures();
virtual void clearGestures();
virtual void HandleUp() { }
virtual void HandleDown() { }
virtual void HandleLeft() { }
virtual void HandleRight() { }
virtual void Setup() {
if (infoActive) displayDataBox();
}
};
#endif