2013-07-29 06:08:34 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Declarations relating to our user interface, in both the graphics and
|
|
|
|
// text browser window.
|
|
|
|
//
|
|
|
|
// Copyright 2008-2013 Jonathan Westhues.
|
|
|
|
//-----------------------------------------------------------------------------
|
2008-03-25 18:02:13 +08:00
|
|
|
|
|
|
|
#ifndef __UI_H
|
|
|
|
#define __UI_H
|
|
|
|
|
2008-03-28 18:00:37 +08:00
|
|
|
class TextWindow {
|
|
|
|
public:
|
2013-09-10 03:50:32 +08:00
|
|
|
enum {
|
|
|
|
MAX_COLS = 100,
|
|
|
|
MIN_COLS = 45,
|
|
|
|
MAX_ROWS = 2000
|
|
|
|
};
|
2008-03-25 18:02:13 +08:00
|
|
|
|
2008-03-26 17:18:12 +08:00
|
|
|
#ifndef RGB
|
|
|
|
#define RGB(r, g, b) ((r) | ((g) << 8) | ((b) << 16))
|
|
|
|
#endif
|
2009-03-18 00:33:46 +08:00
|
|
|
#define RGBf(r, g, b) RGB((int)(255*(r)), (int)(255*(g)), (int)(255*(b)))
|
|
|
|
#define RED(v) (((v) >> 0) & 0xff)
|
|
|
|
#define GREEN(v) (((v) >> 8) & 0xff)
|
|
|
|
#define BLUE(v) (((v) >> 16) & 0xff)
|
|
|
|
#define REDf(v) (RED (v) / 255.0f)
|
|
|
|
#define GREENf(v) (GREEN(v) / 255.0f)
|
|
|
|
#define BLUEf(v) (BLUE (v) / 255.0f)
|
2008-03-28 18:00:37 +08:00
|
|
|
typedef struct {
|
2008-04-25 16:26:15 +08:00
|
|
|
char c;
|
2008-04-28 15:18:39 +08:00
|
|
|
int color;
|
2008-03-28 18:00:37 +08:00
|
|
|
} Color;
|
2008-04-28 15:18:39 +08:00
|
|
|
static const Color fgColors[];
|
|
|
|
static const Color bgColors[];
|
2008-03-25 18:02:13 +08:00
|
|
|
|
2010-04-26 15:52:49 +08:00
|
|
|
float bgColorTable[256*3];
|
|
|
|
float fgColorTable[256*3];
|
|
|
|
|
2013-09-10 03:50:32 +08:00
|
|
|
enum {
|
|
|
|
CHAR_WIDTH = 9,
|
|
|
|
CHAR_HEIGHT = 16,
|
|
|
|
LINE_HEIGHT = 20,
|
|
|
|
LEFT_MARGIN = 6,
|
2010-04-26 15:52:49 +08:00
|
|
|
|
2013-09-10 03:50:32 +08:00
|
|
|
CHECK_FALSE = 0x80,
|
|
|
|
CHECK_TRUE = 0x81,
|
|
|
|
RADIO_FALSE = 0x82,
|
|
|
|
RADIO_TRUE = 0x83
|
|
|
|
};
|
2010-05-09 09:20:02 +08:00
|
|
|
|
2010-04-26 15:52:49 +08:00
|
|
|
int scrollPos; // The scrollbar position, in half-row units
|
|
|
|
int halfRows; // The height of our window, in half-row units
|
|
|
|
|
2008-03-25 18:02:13 +08:00
|
|
|
BYTE text[MAX_ROWS][MAX_COLS];
|
2008-03-28 18:00:37 +08:00
|
|
|
typedef void LinkFunction(int link, DWORD v);
|
2013-09-10 03:50:32 +08:00
|
|
|
enum { NOT_A_LINK = 0 };
|
2008-03-25 18:02:13 +08:00
|
|
|
struct {
|
2008-04-28 15:18:39 +08:00
|
|
|
char fg;
|
2008-05-30 14:09:41 +08:00
|
|
|
int bg;
|
2008-03-28 18:00:37 +08:00
|
|
|
int link;
|
|
|
|
DWORD data;
|
|
|
|
LinkFunction *f;
|
2008-05-26 17:56:50 +08:00
|
|
|
LinkFunction *h;
|
2008-03-25 18:02:13 +08:00
|
|
|
} meta[MAX_ROWS][MAX_COLS];
|
2010-05-03 13:04:42 +08:00
|
|
|
int hoveredRow, hoveredCol;
|
|
|
|
|
2008-03-25 18:02:13 +08:00
|
|
|
|
2010-05-03 13:04:42 +08:00
|
|
|
int top[MAX_ROWS]; // in half-line units, or -1 for unused
|
2008-04-09 17:35:09 +08:00
|
|
|
int rows;
|
2010-04-26 15:52:49 +08:00
|
|
|
|
2010-05-03 13:04:42 +08:00
|
|
|
// The row of icons at the top of the text window, to hide/show things
|
|
|
|
typedef struct {
|
2013-08-27 02:58:35 +08:00
|
|
|
bool *var;
|
|
|
|
BYTE *icon;
|
|
|
|
const char *tip;
|
2010-05-03 13:04:42 +08:00
|
|
|
} HideShowIcon;
|
|
|
|
static HideShowIcon hideShowIcons[];
|
|
|
|
static bool SPACER;
|
|
|
|
|
2010-04-26 15:52:49 +08:00
|
|
|
// These are called by the platform-specific code.
|
2010-05-03 13:04:42 +08:00
|
|
|
void Paint(void);
|
2010-07-21 13:04:03 +08:00
|
|
|
void MouseEvent(bool isClick, bool leftDown, double x, double y);
|
2010-04-26 15:52:49 +08:00
|
|
|
void MouseScroll(double x, double y, int delta);
|
2010-05-03 13:04:42 +08:00
|
|
|
void MouseLeave(void);
|
2010-04-26 15:52:49 +08:00
|
|
|
void ScrollbarEvent(int newPos);
|
2010-05-03 13:04:42 +08:00
|
|
|
|
2013-09-10 03:50:32 +08:00
|
|
|
enum {
|
|
|
|
PAINT = 0,
|
|
|
|
HOVER = 1,
|
|
|
|
CLICK = 2
|
|
|
|
};
|
2010-05-03 13:04:42 +08:00
|
|
|
void DrawOrHitTestIcons(int how, double mx, double my);
|
|
|
|
void TimerCallback(void);
|
|
|
|
Point2d oldMousePos;
|
|
|
|
HideShowIcon *hoveredIcon, *tooltippedIcon;
|
2010-07-21 13:04:03 +08:00
|
|
|
|
|
|
|
Vector HsvToRgb(Vector hsv);
|
|
|
|
BYTE *HsvPattern2d(void);
|
|
|
|
BYTE *HsvPattern1d(double h, double s);
|
|
|
|
void ColorPickerDone(void);
|
|
|
|
bool DrawOrHitTestColorPicker(int how, bool leftDown, double x, double y);
|
2008-03-25 18:02:13 +08:00
|
|
|
|
|
|
|
void Init(void);
|
2010-04-26 15:52:49 +08:00
|
|
|
void MakeColorTable(const Color *in, float *out);
|
2013-08-27 02:58:35 +08:00
|
|
|
void Printf(bool half, const char *fmt, ...);
|
2008-03-25 18:02:13 +08:00
|
|
|
void ClearScreen(void);
|
2008-04-13 18:57:41 +08:00
|
|
|
|
2008-04-11 20:47:14 +08:00
|
|
|
void Show(void);
|
|
|
|
|
2008-04-12 22:12:26 +08:00
|
|
|
// State for the screen that we are showing in the text window.
|
2013-09-10 03:50:32 +08:00
|
|
|
enum {
|
|
|
|
SCREEN_LIST_OF_GROUPS = 0,
|
|
|
|
SCREEN_GROUP_INFO = 1,
|
|
|
|
SCREEN_GROUP_SOLVE_INFO = 2,
|
|
|
|
SCREEN_CONFIGURATION = 3,
|
|
|
|
SCREEN_STEP_DIMENSION = 4,
|
|
|
|
SCREEN_LIST_OF_STYLES = 5,
|
|
|
|
SCREEN_STYLE_INFO = 6,
|
|
|
|
SCREEN_PASTE_TRANSFORMED = 7,
|
|
|
|
SCREEN_EDIT_VIEW = 8,
|
|
|
|
SCREEN_TANGENT_ARC = 9
|
|
|
|
};
|
2008-04-12 22:12:26 +08:00
|
|
|
typedef struct {
|
2008-04-25 16:26:15 +08:00
|
|
|
int screen;
|
2008-07-20 19:27:22 +08:00
|
|
|
|
2008-04-25 16:26:15 +08:00
|
|
|
hGroup group;
|
2009-09-18 16:14:15 +08:00
|
|
|
hStyle style;
|
2008-07-20 19:27:22 +08:00
|
|
|
|
|
|
|
hConstraint constraint;
|
|
|
|
bool dimIsDistance;
|
|
|
|
double dimFinish;
|
|
|
|
int dimSteps;
|
2009-12-15 20:26:22 +08:00
|
|
|
|
|
|
|
struct {
|
|
|
|
int times;
|
|
|
|
Vector trans;
|
|
|
|
double theta;
|
|
|
|
Vector origin;
|
|
|
|
double scale;
|
|
|
|
} paste;
|
2008-04-12 22:12:26 +08:00
|
|
|
} ShownState;
|
2008-07-10 14:11:56 +08:00
|
|
|
ShownState shown;
|
2008-04-12 22:12:26 +08:00
|
|
|
|
2013-09-10 03:50:32 +08:00
|
|
|
enum {
|
|
|
|
EDIT_NOTHING = 0,
|
|
|
|
// For multiple groups
|
|
|
|
EDIT_TIMES_REPEATED = 1,
|
|
|
|
EDIT_GROUP_NAME = 2,
|
|
|
|
EDIT_GROUP_SCALE = 3,
|
|
|
|
EDIT_GROUP_COLOR = 4,
|
|
|
|
// For the configuraiton screen
|
|
|
|
EDIT_LIGHT_DIRECTION = 100,
|
|
|
|
EDIT_LIGHT_INTENSITY = 101,
|
|
|
|
EDIT_COLOR = 102,
|
|
|
|
EDIT_CHORD_TOLERANCE = 103,
|
|
|
|
EDIT_MAX_SEGMENTS = 104,
|
|
|
|
EDIT_CAMERA_TANGENT = 105,
|
|
|
|
EDIT_GRID_SPACING = 106,
|
|
|
|
EDIT_DIGITS_AFTER_DECIMAL = 107,
|
|
|
|
EDIT_EXPORT_SCALE = 108,
|
|
|
|
EDIT_EXPORT_OFFSET = 109,
|
|
|
|
EDIT_CANVAS_SIZE = 110,
|
|
|
|
EDIT_G_CODE_DEPTH = 120,
|
|
|
|
EDIT_G_CODE_PASSES = 121,
|
|
|
|
EDIT_G_CODE_FEED = 122,
|
|
|
|
EDIT_G_CODE_PLUNGE_FEED = 123,
|
|
|
|
// For TTF text
|
|
|
|
EDIT_TTF_TEXT = 300,
|
|
|
|
// For the step dimension screen
|
|
|
|
EDIT_STEP_DIM_FINISH = 400,
|
|
|
|
EDIT_STEP_DIM_STEPS = 401,
|
|
|
|
// For the styles stuff
|
|
|
|
EDIT_STYLE_WIDTH = 500,
|
|
|
|
EDIT_STYLE_TEXT_HEIGHT = 501,
|
|
|
|
EDIT_STYLE_TEXT_ANGLE = 502,
|
|
|
|
EDIT_STYLE_COLOR = 503,
|
|
|
|
EDIT_STYLE_FILL_COLOR = 504,
|
|
|
|
EDIT_STYLE_NAME = 505,
|
|
|
|
EDIT_BACKGROUND_COLOR = 506,
|
|
|
|
EDIT_BACKGROUND_IMG_SCALE = 507,
|
|
|
|
// For paste transforming
|
|
|
|
EDIT_PASTE_TIMES_REPEATED = 600,
|
|
|
|
EDIT_PASTE_ANGLE = 601,
|
|
|
|
EDIT_PASTE_SCALE = 602,
|
|
|
|
// For view
|
|
|
|
EDIT_VIEW_SCALE = 700,
|
|
|
|
EDIT_VIEW_ORIGIN = 701,
|
|
|
|
EDIT_VIEW_PROJ_RIGHT = 702,
|
|
|
|
EDIT_VIEW_PROJ_UP = 703,
|
|
|
|
// For tangent arc
|
|
|
|
EDIT_TANGENT_ARC_RADIUS = 800
|
|
|
|
};
|
2008-05-27 14:36:59 +08:00
|
|
|
struct {
|
2010-01-04 08:35:28 +08:00
|
|
|
bool showAgain;
|
2008-06-30 17:09:17 +08:00
|
|
|
int meaning;
|
|
|
|
int i;
|
|
|
|
hGroup group;
|
|
|
|
hRequest request;
|
2009-09-18 16:14:15 +08:00
|
|
|
hStyle style;
|
2008-05-27 14:36:59 +08:00
|
|
|
} edit;
|
|
|
|
|
2008-05-26 17:56:50 +08:00
|
|
|
static void ReportHowGroupSolved(hGroup hg);
|
|
|
|
|
2010-07-12 15:51:12 +08:00
|
|
|
struct {
|
|
|
|
int halfRow;
|
|
|
|
int col;
|
|
|
|
|
2010-07-21 13:04:03 +08:00
|
|
|
struct {
|
|
|
|
DWORD rgb;
|
|
|
|
double h, s, v;
|
|
|
|
bool show;
|
|
|
|
bool picker1dActive;
|
|
|
|
bool picker2dActive;
|
|
|
|
} colorPicker;
|
2010-07-12 15:51:12 +08:00
|
|
|
} editControl;
|
|
|
|
|
|
|
|
void HideEditControl(void);
|
|
|
|
void ShowEditControl(int halfRow, int col, char *s);
|
2010-07-21 13:04:03 +08:00
|
|
|
void ShowEditControlWithColorPicker(int halfRow, int col, DWORD rgb);
|
2010-07-12 15:51:12 +08:00
|
|
|
|
2008-06-01 08:26:41 +08:00
|
|
|
void ClearSuper(void);
|
|
|
|
|
|
|
|
void ShowHeader(bool withNav);
|
2008-04-08 20:54:53 +08:00
|
|
|
// These are self-contained screens, that show some information about
|
|
|
|
// the sketch.
|
2008-04-25 16:26:15 +08:00
|
|
|
void ShowListOfGroups(void);
|
|
|
|
void ShowGroupInfo(void);
|
2008-05-26 17:56:50 +08:00
|
|
|
void ShowGroupSolveInfo(void);
|
2008-06-11 12:22:52 +08:00
|
|
|
void ShowConfiguration(void);
|
2009-09-18 16:14:15 +08:00
|
|
|
void ShowListOfStyles(void);
|
|
|
|
void ShowStyleInfo(void);
|
2008-07-20 19:27:22 +08:00
|
|
|
void ShowStepDimension(void);
|
2009-12-15 20:26:22 +08:00
|
|
|
void ShowPasteTransformed(void);
|
2010-01-04 08:35:28 +08:00
|
|
|
void ShowEditView(void);
|
2010-05-17 00:36:23 +08:00
|
|
|
void ShowTangentArc(void);
|
2008-06-01 08:26:41 +08:00
|
|
|
// Special screen, based on selection
|
|
|
|
void DescribeSelection(void);
|
2008-04-18 15:06:37 +08:00
|
|
|
|
2008-07-10 14:11:56 +08:00
|
|
|
void GoToScreen(int screen);
|
2008-05-27 14:36:59 +08:00
|
|
|
|
2008-06-30 17:09:17 +08:00
|
|
|
// All of these are callbacks from the GUI code; first from when
|
|
|
|
// we're describing an entity
|
|
|
|
static void ScreenEditTtfText(int link, DWORD v);
|
|
|
|
static void ScreenSetTtfFont(int link, DWORD v);
|
|
|
|
static void ScreenUnselectAll(int link, DWORD v);
|
|
|
|
|
|
|
|
// and the rest from the stuff in textscreens.cpp
|
2008-04-12 22:12:26 +08:00
|
|
|
static void ScreenSelectGroup(int link, DWORD v);
|
2008-04-27 17:03:01 +08:00
|
|
|
static void ScreenActivateGroup(int link, DWORD v);
|
2008-04-28 15:18:39 +08:00
|
|
|
static void ScreenToggleGroupShown(int link, DWORD v);
|
2008-05-26 17:56:50 +08:00
|
|
|
static void ScreenHowGroupSolved(int link, DWORD v);
|
2008-05-17 16:02:39 +08:00
|
|
|
static void ScreenShowGroupsSpecial(int link, DWORD v);
|
2008-06-02 19:43:27 +08:00
|
|
|
static void ScreenDeleteGroup(int link, DWORD v);
|
2008-04-28 15:18:39 +08:00
|
|
|
|
2008-05-26 17:56:50 +08:00
|
|
|
static void ScreenHoverConstraint(int link, DWORD v);
|
|
|
|
static void ScreenHoverRequest(int link, DWORD v);
|
2008-04-25 16:26:15 +08:00
|
|
|
static void ScreenSelectRequest(int link, DWORD v);
|
2008-04-27 17:03:01 +08:00
|
|
|
static void ScreenSelectConstraint(int link, DWORD v);
|
2008-05-26 17:56:50 +08:00
|
|
|
|
2009-10-09 20:57:10 +08:00
|
|
|
static void ScreenChangeGroupOption(int link, DWORD v);
|
2008-05-30 14:09:41 +08:00
|
|
|
static void ScreenColor(int link, DWORD v);
|
2008-05-27 17:52:36 +08:00
|
|
|
|
2009-09-18 16:14:15 +08:00
|
|
|
static void ScreenShowListOfStyles(int link, DWORD v);
|
|
|
|
static void ScreenShowStyleInfo(int link, DWORD v);
|
|
|
|
static void ScreenDeleteStyle(int link, DWORD v);
|
|
|
|
static void ScreenChangeStyleYesNo(int link, DWORD v);
|
|
|
|
static void ScreenCreateCustomStyle(int link, DWORD v);
|
|
|
|
static void ScreenLoadFactoryDefaultStyles(int link, DWORD v);
|
2009-09-22 13:46:30 +08:00
|
|
|
static void ScreenAssignSelectionToStyle(int link, DWORD v);
|
2009-11-08 09:11:38 +08:00
|
|
|
static void ScreenBackgroundImage(int link, DWORD v);
|
2009-09-18 16:14:15 +08:00
|
|
|
|
2008-06-11 12:22:52 +08:00
|
|
|
static void ScreenShowConfiguration(int link, DWORD v);
|
2010-01-04 08:35:28 +08:00
|
|
|
static void ScreenShowEditView(int link, DWORD v);
|
2008-02-09 21:52:01 +08:00
|
|
|
static void ScreenGoToWebsite(int link, DWORD v);
|
2008-06-02 13:38:12 +08:00
|
|
|
|
2009-09-22 13:46:30 +08:00
|
|
|
static void ScreenChangeFixExportColors(int link, DWORD v);
|
2008-08-11 18:56:08 +08:00
|
|
|
static void ScreenChangeBackFaces(int link, DWORD v);
|
2009-10-01 18:35:11 +08:00
|
|
|
static void ScreenChangeCheckClosedContour(int link, DWORD v);
|
2009-04-14 12:19:23 +08:00
|
|
|
static void ScreenChangePwlCurves(int link, DWORD v);
|
2009-09-03 16:13:09 +08:00
|
|
|
static void ScreenChangeCanvasSizeAuto(int link, DWORD v);
|
|
|
|
static void ScreenChangeCanvasSize(int link, DWORD v);
|
2009-03-18 12:26:04 +08:00
|
|
|
static void ScreenChangeShadedTriangles(int link, DWORD v);
|
2008-08-11 18:56:08 +08:00
|
|
|
|
2008-07-20 19:27:22 +08:00
|
|
|
static void ScreenStepDimSteps(int link, DWORD v);
|
|
|
|
static void ScreenStepDimFinish(int link, DWORD v);
|
|
|
|
static void ScreenStepDimGo(int link, DWORD v);
|
|
|
|
|
2010-05-17 00:36:23 +08:00
|
|
|
static void ScreenChangeTangentArc(int link, DWORD v);
|
|
|
|
|
2009-12-15 20:26:22 +08:00
|
|
|
static void ScreenPasteTransformed(int link, DWORD v);
|
|
|
|
|
2008-07-10 14:11:56 +08:00
|
|
|
static void ScreenHome(int link, DWORD v);
|
2008-06-02 13:38:12 +08:00
|
|
|
|
2008-05-27 17:52:36 +08:00
|
|
|
// These ones do stuff with the edit control
|
2008-05-27 14:36:59 +08:00
|
|
|
static void ScreenChangeExprA(int link, DWORD v);
|
2008-05-27 17:52:36 +08:00
|
|
|
static void ScreenChangeGroupName(int link, DWORD v);
|
2009-12-15 20:26:22 +08:00
|
|
|
static void ScreenChangeGroupScale(int link, DWORD v);
|
2008-06-11 12:30:18 +08:00
|
|
|
static void ScreenChangeLightDirection(int link, DWORD v);
|
2008-06-11 12:22:52 +08:00
|
|
|
static void ScreenChangeLightIntensity(int link, DWORD v);
|
|
|
|
static void ScreenChangeColor(int link, DWORD v);
|
2008-07-10 13:26:08 +08:00
|
|
|
static void ScreenChangeChordTolerance(int link, DWORD v);
|
2008-02-12 21:00:26 +08:00
|
|
|
static void ScreenChangeMaxSegments(int link, DWORD v);
|
2008-06-18 03:12:25 +08:00
|
|
|
static void ScreenChangeCameraTangent(int link, DWORD v);
|
2009-09-29 19:35:19 +08:00
|
|
|
static void ScreenChangeGridSpacing(int link, DWORD v);
|
2010-09-24 10:58:34 +08:00
|
|
|
static void ScreenChangeDigitsAfterDecimal(int link, DWORD v);
|
2008-07-08 15:41:29 +08:00
|
|
|
static void ScreenChangeExportScale(int link, DWORD v);
|
2008-08-14 16:28:25 +08:00
|
|
|
static void ScreenChangeExportOffset(int link, DWORD v);
|
2010-01-14 12:47:17 +08:00
|
|
|
static void ScreenChangeGCodeParameter(int link, DWORD v);
|
2009-09-18 16:14:15 +08:00
|
|
|
static void ScreenChangeStyleName(int link, DWORD v);
|
2009-09-24 23:52:48 +08:00
|
|
|
static void ScreenChangeStyleWidthOrTextHeight(int link, DWORD v);
|
2009-09-29 19:35:19 +08:00
|
|
|
static void ScreenChangeStyleTextAngle(int link, DWORD v);
|
2009-09-18 16:14:15 +08:00
|
|
|
static void ScreenChangeStyleColor(int link, DWORD v);
|
|
|
|
static void ScreenChangeBackgroundColor(int link, DWORD v);
|
2009-11-08 09:11:38 +08:00
|
|
|
static void ScreenChangeBackgroundImageScale(int link, DWORD v);
|
2009-12-15 20:26:22 +08:00
|
|
|
static void ScreenChangePasteTransformed(int link, DWORD v);
|
2010-01-04 08:35:28 +08:00
|
|
|
static void ScreenChangeViewScale(int link, DWORD v);
|
|
|
|
static void ScreenChangeViewOrigin(int link, DWORD v);
|
|
|
|
static void ScreenChangeViewProjection(int link, DWORD v);
|
2008-05-17 16:02:39 +08:00
|
|
|
|
2009-09-18 16:14:15 +08:00
|
|
|
bool EditControlDoneForStyles(char *s);
|
2009-09-29 21:14:47 +08:00
|
|
|
bool EditControlDoneForConfiguration(char *s);
|
2009-12-15 20:26:22 +08:00
|
|
|
bool EditControlDoneForPaste(char *s);
|
2010-01-04 08:35:28 +08:00
|
|
|
bool EditControlDoneForView(char *s);
|
2008-05-27 14:36:59 +08:00
|
|
|
void EditControlDone(char *s);
|
2008-03-28 18:00:37 +08:00
|
|
|
};
|
2008-03-25 18:02:13 +08:00
|
|
|
|
2008-03-28 18:00:37 +08:00
|
|
|
class GraphicsWindow {
|
|
|
|
public:
|
2008-04-12 23:17:58 +08:00
|
|
|
void Init(void);
|
|
|
|
|
2008-03-26 17:18:12 +08:00
|
|
|
// This table describes the top-level menus in the graphics winodw.
|
2008-04-12 23:17:58 +08:00
|
|
|
typedef enum {
|
2008-04-18 19:11:48 +08:00
|
|
|
// File
|
|
|
|
MNU_NEW = 100,
|
|
|
|
MNU_OPEN,
|
2008-05-28 18:10:31 +08:00
|
|
|
MNU_OPEN_RECENT,
|
2008-04-18 19:11:48 +08:00
|
|
|
MNU_SAVE,
|
|
|
|
MNU_SAVE_AS,
|
2008-06-18 16:35:14 +08:00
|
|
|
MNU_EXPORT_PNG,
|
2008-07-06 17:24:31 +08:00
|
|
|
MNU_EXPORT_MESH,
|
2009-06-08 14:50:16 +08:00
|
|
|
MNU_EXPORT_SURFACES,
|
2009-01-14 13:10:42 +08:00
|
|
|
MNU_EXPORT_VIEW,
|
|
|
|
MNU_EXPORT_SECTION,
|
2009-10-12 17:28:34 +08:00
|
|
|
MNU_EXPORT_WIREFRAME,
|
2008-04-18 19:11:48 +08:00
|
|
|
MNU_EXIT,
|
2008-04-13 18:57:41 +08:00
|
|
|
// View
|
2008-04-18 19:11:48 +08:00
|
|
|
MNU_ZOOM_IN,
|
2008-04-12 23:17:58 +08:00
|
|
|
MNU_ZOOM_OUT,
|
|
|
|
MNU_ZOOM_TO_FIT,
|
2009-09-29 19:35:19 +08:00
|
|
|
MNU_SHOW_GRID,
|
2010-05-03 13:15:28 +08:00
|
|
|
MNU_PERSPECTIVE_PROJ,
|
2010-05-03 13:04:42 +08:00
|
|
|
MNU_ONTO_WORKPLANE,
|
2009-01-02 12:06:47 +08:00
|
|
|
MNU_NEAREST_ORTHO,
|
|
|
|
MNU_NEAREST_ISO,
|
2009-01-13 14:56:05 +08:00
|
|
|
MNU_CENTER_VIEW,
|
2008-04-27 13:00:12 +08:00
|
|
|
MNU_SHOW_TEXT_WND,
|
2009-01-02 18:38:36 +08:00
|
|
|
MNU_SHOW_TOOLBAR,
|
2008-04-22 21:14:15 +08:00
|
|
|
MNU_UNITS_INCHES,
|
|
|
|
MNU_UNITS_MM,
|
2008-04-14 18:28:32 +08:00
|
|
|
// Edit
|
2008-06-04 18:22:30 +08:00
|
|
|
MNU_UNDO,
|
|
|
|
MNU_REDO,
|
2009-11-04 02:54:49 +08:00
|
|
|
MNU_CUT,
|
|
|
|
MNU_COPY,
|
|
|
|
MNU_PASTE,
|
2009-11-10 11:57:24 +08:00
|
|
|
MNU_PASTE_TRANSFORM,
|
2008-04-14 18:28:32 +08:00
|
|
|
MNU_DELETE,
|
2009-11-04 02:54:49 +08:00
|
|
|
MNU_SELECT_CHAIN,
|
2009-12-22 00:44:00 +08:00
|
|
|
MNU_SELECT_ALL,
|
2009-09-29 19:35:19 +08:00
|
|
|
MNU_SNAP_TO_GRID,
|
2009-06-22 04:39:42 +08:00
|
|
|
MNU_ROTATE_90,
|
2008-04-27 13:00:12 +08:00
|
|
|
MNU_UNSELECT_ALL,
|
2008-06-30 17:34:03 +08:00
|
|
|
MNU_REGEN_ALL,
|
2008-04-13 18:57:41 +08:00
|
|
|
// Request
|
2008-04-27 11:26:27 +08:00
|
|
|
MNU_SEL_WORKPLANE,
|
|
|
|
MNU_FREE_IN_3D,
|
2008-04-13 18:57:41 +08:00
|
|
|
MNU_DATUM_POINT,
|
2008-05-05 19:17:00 +08:00
|
|
|
MNU_WORKPLANE,
|
2008-04-13 18:57:41 +08:00
|
|
|
MNU_LINE_SEGMENT,
|
2008-05-05 14:18:01 +08:00
|
|
|
MNU_CIRCLE,
|
2008-05-12 18:01:44 +08:00
|
|
|
MNU_ARC,
|
2008-04-22 18:53:42 +08:00
|
|
|
MNU_RECTANGLE,
|
2008-04-25 20:07:17 +08:00
|
|
|
MNU_CUBIC,
|
2008-06-30 17:09:17 +08:00
|
|
|
MNU_TTF_TEXT,
|
2009-01-03 20:27:33 +08:00
|
|
|
MNU_SPLIT_CURVES,
|
2010-05-17 00:36:23 +08:00
|
|
|
MNU_TANGENT_ARC,
|
2008-05-07 12:17:29 +08:00
|
|
|
MNU_CONSTRUCTION,
|
2008-04-27 17:03:01 +08:00
|
|
|
// Group
|
2008-05-11 10:57:47 +08:00
|
|
|
MNU_GROUP_3D,
|
|
|
|
MNU_GROUP_WRKPL,
|
2008-04-27 17:03:01 +08:00
|
|
|
MNU_GROUP_EXTRUDE,
|
2008-06-06 19:35:28 +08:00
|
|
|
MNU_GROUP_LATHE,
|
2008-05-11 14:09:46 +08:00
|
|
|
MNU_GROUP_ROT,
|
|
|
|
MNU_GROUP_TRANS,
|
2008-05-28 18:10:31 +08:00
|
|
|
MNU_GROUP_IMPORT,
|
|
|
|
MNU_GROUP_RECENT,
|
2008-04-14 18:28:32 +08:00
|
|
|
// Constrain
|
|
|
|
MNU_DISTANCE_DIA,
|
2008-05-17 19:15:14 +08:00
|
|
|
MNU_ANGLE,
|
|
|
|
MNU_OTHER_ANGLE,
|
2008-06-11 12:22:52 +08:00
|
|
|
MNU_REFERENCE,
|
2008-04-22 13:00:49 +08:00
|
|
|
MNU_EQUAL,
|
2008-05-11 18:40:37 +08:00
|
|
|
MNU_RATIO,
|
2008-04-21 16:16:38 +08:00
|
|
|
MNU_ON_ENTITY,
|
2008-04-30 16:14:32 +08:00
|
|
|
MNU_SYMMETRIC,
|
|
|
|
MNU_AT_MIDPOINT,
|
2008-04-23 15:29:19 +08:00
|
|
|
MNU_HORIZONTAL,
|
|
|
|
MNU_VERTICAL,
|
2008-05-09 13:33:23 +08:00
|
|
|
MNU_PARALLEL,
|
2008-07-02 17:21:29 +08:00
|
|
|
MNU_PERPENDICULAR,
|
2008-05-09 13:33:23 +08:00
|
|
|
MNU_ORIENTED_SAME,
|
2010-05-04 13:11:52 +08:00
|
|
|
MNU_WHERE_DRAGGED,
|
2008-06-12 16:58:58 +08:00
|
|
|
MNU_COMMENT,
|
2008-07-20 19:27:22 +08:00
|
|
|
// Analyze
|
|
|
|
MNU_VOLUME,
|
2010-03-02 01:23:57 +08:00
|
|
|
MNU_AREA,
|
2009-03-29 14:05:28 +08:00
|
|
|
MNU_INTERFERENCE,
|
2009-01-19 18:37:10 +08:00
|
|
|
MNU_NAKED_EDGES,
|
2009-01-04 20:01:46 +08:00
|
|
|
MNU_SHOW_DOF,
|
2008-07-20 19:27:22 +08:00
|
|
|
MNU_TRACE_PT,
|
|
|
|
MNU_STOP_TRACING,
|
|
|
|
MNU_STEP_DIM,
|
2008-02-09 21:52:01 +08:00
|
|
|
// Help,
|
|
|
|
MNU_WEBSITE,
|
2013-08-27 04:54:04 +08:00
|
|
|
MNU_ABOUT
|
2008-04-12 23:17:58 +08:00
|
|
|
} MenuId;
|
2008-04-14 18:28:32 +08:00
|
|
|
typedef void MenuHandler(int id);
|
2008-03-26 17:18:12 +08:00
|
|
|
typedef struct {
|
2008-04-01 18:48:44 +08:00
|
|
|
int level; // 0 == on menu bar, 1 == one level down
|
2013-08-27 02:58:35 +08:00
|
|
|
const char *label; // or NULL for a separator
|
2008-03-26 17:18:12 +08:00
|
|
|
int id; // unique ID
|
2008-04-12 23:17:58 +08:00
|
|
|
int accel; // keyboard accelerator
|
2008-03-26 17:18:12 +08:00
|
|
|
MenuHandler *fn;
|
|
|
|
} MenuEntry;
|
|
|
|
static const MenuEntry menu[];
|
2008-04-14 18:28:32 +08:00
|
|
|
static void MenuView(int id);
|
|
|
|
static void MenuEdit(int id);
|
|
|
|
static void MenuRequest(int id);
|
2009-12-04 16:08:41 +08:00
|
|
|
void DeleteSelection(void);
|
|
|
|
void CopySelection(void);
|
2009-12-15 20:26:22 +08:00
|
|
|
void PasteClipboard(Vector trans, double theta, double scale);
|
2009-12-04 16:08:41 +08:00
|
|
|
static void MenuClipboard(int id);
|
2008-04-12 22:12:26 +08:00
|
|
|
|
2008-04-01 18:48:44 +08:00
|
|
|
// The width and height (in pixels) of the window.
|
|
|
|
double width, height;
|
2008-03-25 18:02:13 +08:00
|
|
|
// These parameters define the map from 2d screen coordinates to the
|
|
|
|
// coordinates of the 3d sketch points. We will use an axonometric
|
|
|
|
// projection.
|
|
|
|
Vector offset;
|
|
|
|
Vector projRight;
|
2008-04-12 23:17:58 +08:00
|
|
|
Vector projUp;
|
2008-03-27 17:53:51 +08:00
|
|
|
double scale;
|
|
|
|
struct {
|
2009-11-08 09:11:38 +08:00
|
|
|
bool mouseDown;
|
2008-03-27 17:53:51 +08:00
|
|
|
Vector offset;
|
|
|
|
Vector projRight;
|
2008-04-12 23:17:58 +08:00
|
|
|
Vector projUp;
|
2008-03-27 17:53:51 +08:00
|
|
|
Point2d mouse;
|
2009-11-04 02:54:49 +08:00
|
|
|
Point2d mouseOnButtonDown;
|
2009-11-04 15:52:58 +08:00
|
|
|
Vector marqueePoint;
|
2009-09-23 18:59:59 +08:00
|
|
|
bool startedMoving;
|
2008-03-27 17:53:51 +08:00
|
|
|
} orig;
|
|
|
|
|
2010-07-12 14:47:14 +08:00
|
|
|
// Most recent mouse position, updated every time the mouse moves.
|
|
|
|
Point2d currentMousePosition;
|
|
|
|
|
2008-04-28 17:40:02 +08:00
|
|
|
// When the user is dragging a point, don't solve multiple times without
|
|
|
|
// allowing a paint in between. The extra solves are wasted if they're
|
|
|
|
// not displayed.
|
|
|
|
bool havePainted;
|
|
|
|
|
2009-09-23 18:59:59 +08:00
|
|
|
// Some state for the context menu.
|
|
|
|
struct {
|
|
|
|
bool active;
|
|
|
|
} context;
|
|
|
|
|
2008-03-27 17:53:51 +08:00
|
|
|
void NormalizeProjectionVectors(void);
|
2008-04-12 22:12:26 +08:00
|
|
|
Point2d ProjectPoint(Vector p);
|
2008-06-18 03:12:25 +08:00
|
|
|
Vector ProjectPoint3(Vector p);
|
|
|
|
Vector ProjectPoint4(Vector p, double *w);
|
2009-11-04 15:52:58 +08:00
|
|
|
Vector UnProjectPoint(Point2d p);
|
2009-01-02 12:06:47 +08:00
|
|
|
void AnimateOnto(Quaternion quatf, Vector offsetf);
|
2008-05-27 10:22:20 +08:00
|
|
|
void AnimateOntoWorkplane(void);
|
2008-06-11 12:22:52 +08:00
|
|
|
Vector VectorFromProjs(Vector rightUpForward);
|
2008-06-18 03:12:25 +08:00
|
|
|
void HandlePointForZoomToFit(Vector p, Point2d *pmax, Point2d *pmin,
|
|
|
|
double *wmin, bool div);
|
2009-05-29 13:40:17 +08:00
|
|
|
void LoopOverPoints(Point2d *pmax, Point2d *pmin, double *wmin, bool div,
|
|
|
|
bool includingInvisibles);
|
|
|
|
void ZoomToFit(bool includingInvisibles);
|
2008-04-13 18:57:41 +08:00
|
|
|
|
|
|
|
hGroup activeGroup;
|
2008-05-27 10:22:20 +08:00
|
|
|
void EnsureValidActives(void);
|
|
|
|
bool LockedInWorkplane(void);
|
|
|
|
void SetWorkplaneFreeIn3d(void);
|
|
|
|
hEntity ActiveWorkplane(void);
|
2008-09-17 18:13:37 +08:00
|
|
|
void ForceTextWindowShown(void);
|
2008-04-13 18:57:41 +08:00
|
|
|
|
|
|
|
// Operations that must be completed by doing something with the mouse
|
2008-05-05 14:18:01 +08:00
|
|
|
// are noted here. These occupy the same space as the menu ids.
|
2013-09-10 03:50:32 +08:00
|
|
|
enum {
|
|
|
|
FIRST_PENDING = 0x0f000000,
|
|
|
|
DRAGGING_POINTS = 0x0f000000,
|
|
|
|
DRAGGING_NEW_POINT = 0x0f000001,
|
|
|
|
DRAGGING_NEW_LINE_POINT = 0x0f000002,
|
|
|
|
DRAGGING_NEW_CUBIC_POINT = 0x0f000003,
|
|
|
|
DRAGGING_NEW_ARC_POINT = 0x0f000004,
|
|
|
|
DRAGGING_CONSTRAINT = 0x0f000005,
|
|
|
|
DRAGGING_RADIUS = 0x0f000006,
|
|
|
|
DRAGGING_NORMAL = 0x0f000007,
|
|
|
|
DRAGGING_NEW_RADIUS = 0x0f000008,
|
|
|
|
DRAGGING_MARQUEE = 0x0f000009
|
|
|
|
};
|
2008-05-05 14:18:01 +08:00
|
|
|
struct {
|
2009-11-04 02:54:49 +08:00
|
|
|
int operation;
|
2008-05-05 14:18:01 +08:00
|
|
|
|
2009-11-04 02:54:49 +08:00
|
|
|
hEntity point;
|
|
|
|
List<hEntity> points;
|
|
|
|
hEntity circle;
|
|
|
|
hEntity normal;
|
|
|
|
hConstraint constraint;
|
2009-11-10 11:57:24 +08:00
|
|
|
|
2013-08-27 02:58:35 +08:00
|
|
|
const char *description;
|
2008-05-05 14:18:01 +08:00
|
|
|
} pending;
|
|
|
|
void ClearPending(void);
|
2008-04-21 18:12:04 +08:00
|
|
|
// The constraint that is being edited with the on-screen textbox.
|
|
|
|
hConstraint constraintBeingEdited;
|
2008-05-05 14:18:01 +08:00
|
|
|
|
2009-09-29 19:35:19 +08:00
|
|
|
Vector SnapToGrid(Vector p);
|
2008-05-08 15:30:30 +08:00
|
|
|
bool ConstrainPointByHovered(hEntity pt);
|
2009-01-03 20:27:33 +08:00
|
|
|
void DeleteTaggedRequests(void);
|
2008-06-04 18:22:30 +08:00
|
|
|
hRequest AddRequest(int type, bool rememberForUndo);
|
2008-05-05 14:18:01 +08:00
|
|
|
hRequest AddRequest(int type);
|
2009-01-03 20:27:33 +08:00
|
|
|
|
2010-05-17 00:36:23 +08:00
|
|
|
class ParametricCurve {
|
|
|
|
public:
|
|
|
|
bool isLine; // else circle
|
|
|
|
Vector p0, p1;
|
|
|
|
Vector u, v;
|
|
|
|
double r, theta0, theta1, dtheta;
|
|
|
|
|
|
|
|
void MakeFromEntity(hEntity he, bool reverse);
|
|
|
|
Vector PointAt(double t);
|
|
|
|
Vector TangentAt(double t);
|
|
|
|
double LengthForAuto(void);
|
|
|
|
|
|
|
|
hRequest CreateRequestTrimmedTo(double t, bool extraConstraints,
|
|
|
|
hEntity orig, hEntity arc, bool arcFinish);
|
|
|
|
void ConstrainPointIfCoincident(hEntity hpt);
|
|
|
|
};
|
2009-01-03 20:27:33 +08:00
|
|
|
void MakeTangentArc(void);
|
|
|
|
void SplitLinesOrCurves(void);
|
2009-07-07 16:21:59 +08:00
|
|
|
hEntity SplitEntity(hEntity he, Vector pinter);
|
|
|
|
hEntity SplitLine(hEntity he, Vector pinter);
|
|
|
|
hEntity SplitCircle(hEntity he, Vector pinter);
|
|
|
|
hEntity SplitCubic(hEntity he, Vector pinter);
|
2009-01-03 20:27:33 +08:00
|
|
|
void ReplacePointInConstraints(hEntity oldpt, hEntity newpt);
|
2009-07-08 17:36:18 +08:00
|
|
|
void FixConstraintsForRequestBeingDeleted(hRequest hr);
|
|
|
|
void FixConstraintsForPointBeingDeleted(hEntity hpt);
|
2008-04-11 20:47:14 +08:00
|
|
|
|
2008-04-12 22:12:26 +08:00
|
|
|
// The current selection.
|
|
|
|
class Selection {
|
|
|
|
public:
|
2009-11-04 02:54:49 +08:00
|
|
|
int tag;
|
|
|
|
|
2008-04-12 22:12:26 +08:00
|
|
|
hEntity entity;
|
2008-04-14 18:28:32 +08:00
|
|
|
hConstraint constraint;
|
2008-05-26 17:56:50 +08:00
|
|
|
bool emphasized;
|
2008-04-12 22:12:26 +08:00
|
|
|
|
|
|
|
void Draw(void);
|
|
|
|
|
|
|
|
void Clear(void);
|
|
|
|
bool IsEmpty(void);
|
|
|
|
bool Equals(Selection *b);
|
2009-09-24 23:52:48 +08:00
|
|
|
bool IsStylable(void);
|
2009-11-04 02:54:49 +08:00
|
|
|
bool HasEndpoints(void);
|
2008-04-12 22:12:26 +08:00
|
|
|
};
|
|
|
|
Selection hover;
|
2010-01-03 18:26:15 +08:00
|
|
|
bool hoverWasSelectedOnMousedown;
|
2009-11-04 02:54:49 +08:00
|
|
|
List<Selection> selection;
|
2008-04-23 15:29:19 +08:00
|
|
|
void HitTestMakeSelection(Point2d mp);
|
2008-04-12 23:17:58 +08:00
|
|
|
void ClearSelection(void);
|
2008-05-17 19:15:14 +08:00
|
|
|
void ClearNonexistentSelectionItems(void);
|
2013-09-10 03:50:32 +08:00
|
|
|
enum { MAX_SELECTED = 32 };
|
2008-04-12 23:17:58 +08:00
|
|
|
struct {
|
2008-04-19 19:09:47 +08:00
|
|
|
hEntity point[MAX_SELECTED];
|
2008-04-12 23:17:58 +08:00
|
|
|
hEntity entity[MAX_SELECTED];
|
2008-05-09 13:33:23 +08:00
|
|
|
hEntity anyNormal[MAX_SELECTED];
|
|
|
|
hEntity vector[MAX_SELECTED];
|
2008-06-01 08:26:41 +08:00
|
|
|
hEntity face[MAX_SELECTED];
|
2008-05-17 19:15:14 +08:00
|
|
|
hConstraint constraint[MAX_SELECTED];
|
2008-04-12 23:17:58 +08:00
|
|
|
int points;
|
|
|
|
int entities;
|
2008-04-27 11:26:27 +08:00
|
|
|
int workplanes;
|
2008-06-01 08:26:41 +08:00
|
|
|
int faces;
|
2008-04-14 18:28:32 +08:00
|
|
|
int lineSegments;
|
2008-05-07 16:19:37 +08:00
|
|
|
int circlesOrArcs;
|
2008-07-13 20:44:05 +08:00
|
|
|
int arcs;
|
|
|
|
int cubics;
|
2009-11-10 11:57:24 +08:00
|
|
|
int periodicCubics;
|
2008-05-09 13:33:23 +08:00
|
|
|
int anyNormals;
|
|
|
|
int vectors;
|
2008-05-17 19:15:14 +08:00
|
|
|
int constraints;
|
2009-09-24 23:52:48 +08:00
|
|
|
int stylables;
|
2009-09-29 19:35:19 +08:00
|
|
|
int comments;
|
2009-11-04 02:54:49 +08:00
|
|
|
int withEndpoints;
|
2008-04-12 23:17:58 +08:00
|
|
|
int n;
|
|
|
|
} gs;
|
|
|
|
void GroupSelection(void);
|
2010-01-03 18:26:15 +08:00
|
|
|
bool IsSelected(Selection *s);
|
|
|
|
bool IsSelected(hEntity he);
|
|
|
|
void MakeSelected(hEntity he);
|
|
|
|
void MakeSelected(Selection *s);
|
|
|
|
void MakeUnselected(hEntity he, bool coincidentPointTrick);
|
|
|
|
void MakeUnselected(Selection *s, bool coincidentPointTrick);
|
2009-11-04 15:52:58 +08:00
|
|
|
void SelectByMarquee(void);
|
2008-05-17 19:15:14 +08:00
|
|
|
void ClearSuper(void);
|
|
|
|
|
2013-09-10 03:50:32 +08:00
|
|
|
enum {
|
|
|
|
CMNU_UNSELECT_ALL = 0x100,
|
|
|
|
CMNU_UNSELECT_HOVERED = 0x101,
|
|
|
|
CMNU_CUT_SEL = 0x102,
|
|
|
|
CMNU_COPY_SEL = 0x103,
|
|
|
|
CMNU_PASTE_SEL = 0x104,
|
|
|
|
CMNU_DELETE_SEL = 0x105,
|
|
|
|
CMNU_SELECT_CHAIN = 0x106,
|
|
|
|
CMNU_NEW_CUSTOM_STYLE = 0x110,
|
|
|
|
CMNU_NO_STYLE = 0x111,
|
|
|
|
CMNU_GROUP_INFO = 0x120,
|
|
|
|
CMNU_STYLE_INFO = 0x121,
|
|
|
|
CMNU_REFERENCE_DIM = 0x130,
|
|
|
|
CMNU_OTHER_ANGLE = 0x131,
|
|
|
|
CMNU_DEL_COINCIDENT = 0x132,
|
|
|
|
CMNU_SNAP_TO_GRID = 0x140,
|
|
|
|
CMNU_FIRST_STYLE = 0x40000000
|
|
|
|
};
|
2009-09-23 18:59:59 +08:00
|
|
|
void ContextMenuListStyles(void);
|
2009-12-22 00:44:00 +08:00
|
|
|
SDWORD contextMenuCancelTime;
|
2009-09-23 18:59:59 +08:00
|
|
|
|
2009-01-02 18:38:36 +08:00
|
|
|
// The toolbar, in toolbar.cpp
|
|
|
|
bool ToolbarDrawOrHitTest(int x, int y, bool paint, int *menu);
|
|
|
|
void ToolbarDraw(void);
|
|
|
|
bool ToolbarMouseMoved(int x, int y);
|
|
|
|
bool ToolbarMouseDown(int x, int y);
|
|
|
|
static void TimerCallback(void);
|
|
|
|
int toolbarHovered;
|
|
|
|
int toolbarTooltipped;
|
|
|
|
int toolbarMouseX, toolbarMouseY;
|
|
|
|
|
2008-04-11 20:47:14 +08:00
|
|
|
// This sets what gets displayed.
|
2008-04-27 11:26:27 +08:00
|
|
|
bool showWorkplanes;
|
2008-05-05 14:18:01 +08:00
|
|
|
bool showNormals;
|
2008-04-11 20:47:14 +08:00
|
|
|
bool showPoints;
|
|
|
|
bool showConstraints;
|
2008-04-27 13:00:12 +08:00
|
|
|
bool showTextWindow;
|
2008-05-28 18:34:55 +08:00
|
|
|
bool showShaded;
|
2009-03-18 12:26:04 +08:00
|
|
|
bool showEdges;
|
2008-06-02 13:38:12 +08:00
|
|
|
bool showFaces;
|
2008-05-28 18:34:55 +08:00
|
|
|
bool showMesh;
|
2008-05-02 18:54:22 +08:00
|
|
|
bool showHdnLines;
|
2010-05-03 13:04:42 +08:00
|
|
|
void ToggleBool(bool *v);
|
2008-03-25 18:02:13 +08:00
|
|
|
|
2009-09-29 19:35:19 +08:00
|
|
|
bool showSnapGrid;
|
|
|
|
|
2009-11-04 02:54:49 +08:00
|
|
|
void AddPointToDraggedList(hEntity hp);
|
|
|
|
void StartDraggingByEntity(hEntity he);
|
|
|
|
void StartDraggingBySelection(void);
|
2008-05-05 14:18:01 +08:00
|
|
|
void UpdateDraggedNum(Vector *pos, double mx, double my);
|
|
|
|
void UpdateDraggedPoint(hEntity hp, double mx, double my);
|
2008-04-13 18:57:41 +08:00
|
|
|
|
2008-03-25 18:02:13 +08:00
|
|
|
// These are called by the platform-specific code.
|
2010-05-03 13:04:42 +08:00
|
|
|
void Paint(void);
|
2008-03-25 18:02:13 +08:00
|
|
|
void MouseMoved(double x, double y, bool leftDown, bool middleDown,
|
2008-03-27 17:53:51 +08:00
|
|
|
bool rightDown, bool shiftDown, bool ctrlDown);
|
|
|
|
void MouseLeftDown(double x, double y);
|
2008-04-22 18:53:42 +08:00
|
|
|
void MouseLeftUp(double x, double y);
|
2008-03-25 18:02:13 +08:00
|
|
|
void MouseLeftDoubleClick(double x, double y);
|
2008-07-06 15:56:24 +08:00
|
|
|
void MouseMiddleOrRightDown(double x, double y);
|
2009-09-23 18:59:59 +08:00
|
|
|
void MouseRightUp(double x, double y);
|
2008-04-01 18:48:44 +08:00
|
|
|
void MouseScroll(double x, double y, int delta);
|
2009-01-02 18:38:36 +08:00
|
|
|
void MouseLeave(void);
|
2009-09-28 18:01:34 +08:00
|
|
|
bool KeyDown(int c);
|
2008-04-21 18:12:04 +08:00
|
|
|
void EditControlDone(char *s);
|
2009-07-21 03:05:33 +08:00
|
|
|
|
|
|
|
SDWORD lastSpaceNavigatorTime;
|
|
|
|
hGroup lastSpaceNavigatorGroup;
|
|
|
|
void SpaceNavigatorMoved(double tx, double ty, double tz,
|
|
|
|
double rx, double ry, double rz, bool shiftDown);
|
|
|
|
void SpaceNavigatorButtonUp(void);
|
2008-03-28 18:00:37 +08:00
|
|
|
};
|
2008-03-25 18:02:13 +08:00
|
|
|
|
2008-03-26 17:18:12 +08:00
|
|
|
|
2008-03-25 18:02:13 +08:00
|
|
|
#endif
|