#include <wx/wx.h>
#endif
-#ifdef PROLOGIO
#include <wx/wxexpr.h>
-#endif
#include <wx/types.h>
wxList oglObjectCopyMapping(wxKEY_INTEGER);
+
+
void wxOGLInitialize()
{
g_oglBullseyeCursor = new wxCursor(wxCURSOR_BULLSEYE);
// Initialize big buffer used when writing images
oglBuffer = new char[3000];
- if (!oglPopupDivisionMenu)
- {
- oglPopupDivisionMenu = new wxMenu("", (wxFunction)oglGraphicsDivisionMenuProc);
- oglPopupDivisionMenu->Append(DIVISION_MENU_SPLIT_HORIZONTALLY, "Split horizontally");
- oglPopupDivisionMenu->Append(DIVISION_MENU_SPLIT_VERTICALLY, "Split vertically");
- oglPopupDivisionMenu->AppendSeparator();
- oglPopupDivisionMenu->Append(DIVISION_MENU_EDIT_LEFT_EDGE, "Edit left edge");
- oglPopupDivisionMenu->Append(DIVISION_MENU_EDIT_TOP_EDGE, "Edit top edge");
- }
}
void wxOGLCleanUp()
oglBuffer = NULL;
}
oglBuffer = NULL;
- if (oglPopupDivisionMenu)
- {
- delete oglPopupDivisionMenu;
- oglPopupDivisionMenu = NULL;
- }
if (g_oglBullseyeCursor)
{
delete g_oglBullseyeCursor;
return 0;
}
return new_size;
-/*
+/*
char *strings[8];
strings[0] = "4";
strings[1] = "6";
{
word[j] = 0;
j = 0;
- word_list.Append((wxObject *)copystring(word));
+ word_list.Add(word);
end_word = FALSE;
}
if (new_line)
{
- word_list.Append((wxObject *)NULL);
+ word_list.Append(NULL);
new_line = FALSE;
}
}
yoffset = (double)(m_ypos - (height / 2.0));
dc.SetClippingRegion(
- (double)(m_xpos - width/2.0), (double)(m_ypos - height/2.0),
- (double)width, (double)height);
+ (long)(m_xpos - width/2.0), (long)(m_ypos - height/2.0),
+ (long)width, (long)height);
wxNode *current = text_list->First();
while (current)
* Used by functions below.
*
*/
-void oglCheckLineIntersection(double x1, double y1, double x2, double y2,
+void oglCheckLineIntersection(double x1, double y1, double x2, double y2,
double x3, double y3, double x4, double y4,
double *ratio1, double *ratio2)
{
// Check for intersection
if ((line_constant < 1.0) && (line_constant > 0.0))
{
- // Now must check that other line hits
+ // Now must check that other line hits
if (((y4 - y3) < 0.005) && ((y4 - y3) > -0.005))
k_line = ((x1 - x3) + line_constant*(x2 - x1))/(x4 - x3);
else
* (*x3, *y3) is the point where it hits.
*
*/
-void oglFindEndForPolyline(double n, double xvec[], double yvec[],
+void oglFindEndForPolyline(double n, double xvec[], double yvec[],
double x1, double y1, double x2, double y2, double *x3, double *y3)
{
int i;
*
*/
-void oglFindEndForBox(double width, double height,
+void oglFindEndForBox(double width, double height,
double x1, double y1, // Centre of box (possibly)
double x2, double y2, // other end of line
double *x3, double *y3) // End on box edge
*
*/
-void oglFindEndForCircle(double radius,
+void oglFindEndForCircle(double radius,
double x1, double y1, // Centre of circle
double x2, double y2, // Other end of line
double *x3, double *y3)
* This function assumes that the centre of the ellipse is at x1, y1, and the
* ellipse has a width of width1 and a height of height1. It also assumes you are
* wanting to draw an arc FROM point x2, y2 TOWARDS point x3, y3.
- * This function calculates the x,y coordinates of the intersection point of
+ * This function calculates the x,y coordinates of the intersection point of
* the arc with the ellipse.
* Author: Ian Harrison
*/
*y4 = (double)(y1 + b1);
return;
}
-*/
+*/
// Check that x2 != x3
if (fabs(x2 - x3) < 0.05)
{
if (K >= 0)
// In this case the line intersects the ellipse, so calculate intersection
- {
+ {
if(x2 >= x1)
{
ellipse1_x = (double)(((F * -1) + sqrt(K)) / (2 * E));
*x4 = ellipse1_x;
*y4 = ellipse1_y;
-/*
+/*
// Draw a little circle (radius = 2) at the end of the arc where it hits
// the ellipse .
unsigned int oglHexToDec(char* buf)
{
int firstDigit, secondDigit;
-
+
if (buf[0] >= 'A')
firstDigit = buf[0] - 'A' + 10;
else
secondDigit = buf[1] - 'A' + 10;
else
secondDigit = buf[1] - '0';
-
+
return firstDigit * 16 + secondDigit;
}