Removed obsolete library.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19736 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-03-23 19:06:57 +00:00
parent ce109c530a
commit 6ceef8efe9
39 changed files with 0 additions and 8905 deletions

View File

@@ -1,102 +0,0 @@
# Microsoft Developer Studio Project File - Name="CanvasVC" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=CanvasVC - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "CanvasVC.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "CanvasVC.mak" CFG="CanvasVC - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "CanvasVC - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "CanvasVC - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "CanvasVC - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../../include" /I "../../include" /I "../../../lib/msw" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x809
# ADD RSC /l 0x809
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\..\..\lib\canvas.lib"
!ELSEIF "$(CFG)" == "CanvasVC - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "../../../include" /I "../../include" /I "../../../lib/mswd" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x809
# ADD RSC /l 0x809
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\..\..\lib\canvasd.lib"
!ENDIF
# Begin Target
# Name "CanvasVC - Win32 Release"
# Name "CanvasVC - Win32 Debug"
# Begin Source File
SOURCE=.\bbox.cpp
# End Source File
# Begin Source File
SOURCE=.\canvas.cpp
# End Source File
# Begin Source File
SOURCE=.\liner.cpp
# End Source File
# Begin Source File
SOURCE=.\polygon.cpp
# End Source File
# End Target
# End Project

View File

@@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "CanvasVC"=.\CanvasVC.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -1,26 +0,0 @@
# $Id$
top_srcdir = @top_srcdir@/..
top_builddir = ../../..
libsrc_dir = contrib/src/canvas
TARGET_LIBNAME=lib@WX_LIBRARY_BASENAME@_canvas-@WX_RELEASE@
LIBVERSION_CURRENT=@WX_CURRENT@
LIBVERSION_REVISION=@WX_REVISION@
LIBVERSION_AGE=@WX_AGE@
HEADER_PATH=$(top_srcdir)/contrib/include/wx
HEADER_SUBDIR=canvas
HEADERS=canvas.h bbox.h liner.h polygon.h
OBJECTS=canvas.o bbox.o liner.o polygon.o
DEPFILES=$(OBJECTS:.o=.d)
APPEXTRADEFS=-I$(top_srcdir)/contrib/include
include $(top_builddir)/src/makelib.env
-include $(DEPFILES)

View File

@@ -1,369 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: bbox.cpp
// Author: Klaas Holwerda
// Created: XX/XX/XX
// Copyright: 2000 (c) Klaas Holwerda
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "bbox.cpp"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include "wx/canvas/bbox.h"
wxBoundingBox::wxBoundingBox()
{
m_minx = m_miny = m_maxx = m_maxy = 0.0;
m_validbbox = FALSE;
}
wxBoundingBox::wxBoundingBox(const wxBoundingBox &other)
{
m_minx = other.m_minx;
m_miny = other.m_miny;
m_maxx = other.m_maxx;
m_maxy = other.m_maxy;
m_validbbox= other.m_validbbox;
}
wxBoundingBox::wxBoundingBox(const wxPoint2DDouble& a)
{
m_minx = a.m_x;
m_maxx = a.m_x;
m_miny = a.m_y;
m_maxy = a.m_y;
m_validbbox = TRUE;
}
wxBoundingBox::wxBoundingBox(double xmin, double ymin, double xmax, double ymax)
{
m_minx = xmin;
m_miny = ymin;
m_maxx = xmax;
m_maxy = ymax;
m_validbbox = TRUE;
}
// This function checks if two bboxes intersect
bool wxBoundingBox::And(wxBoundingBox *_bbox, double Marge)
{
assert (m_validbbox == TRUE);
assert (_bbox->GetValid());
m_minx = wxMax(m_minx, _bbox->m_minx);
m_maxx = wxMin(m_maxx, _bbox->m_maxx);
m_miny = wxMax(m_miny, _bbox->m_miny);
m_maxy = wxMin(m_maxy, _bbox->m_maxy);
return (bool)
(
((m_minx - Marge) < (m_maxx + Marge)) &&
((m_miny - Marge) < (m_maxy + Marge))
);
}
// Shrink the boundingbox with the given marge
void wxBoundingBox::Shrink(const double Marge)
{
assert (m_validbbox == TRUE);
m_minx += Marge;
m_maxx -= Marge;
m_miny += Marge;
m_maxy -= Marge;
}
// Expand the boundingbox with another boundingbox
void wxBoundingBox::Expand(const wxBoundingBox &other)
{
if (!m_validbbox)
{
*this=other;
}
else
{
m_minx = wxMin(m_minx, other.m_minx);
m_maxx = wxMax(m_maxx, other.m_maxx);
m_miny = wxMin(m_miny, other.m_miny);
m_maxy = wxMax(m_maxy, other.m_maxy);
}
}
// Expand the boundingbox with a point
void wxBoundingBox::Expand(const wxPoint2DDouble& a_point)
{
if (!m_validbbox)
{
m_minx = m_maxx = a_point.m_x;
m_miny = m_maxy = a_point.m_y;
m_validbbox=TRUE;
}
else
{
m_minx = wxMin(m_minx, a_point.m_x);
m_maxx = wxMax(m_maxx, a_point.m_x);
m_miny = wxMin(m_miny, a_point.m_y);
m_maxy = wxMax(m_maxy, a_point.m_y);
}
}
// Expand the boundingbox with a point
void wxBoundingBox::Expand(double x,double y)
{
if (!m_validbbox)
{
m_minx = m_maxx = x;
m_miny = m_maxy = y;
m_validbbox=TRUE;
}
else
{
m_minx = wxMin(m_minx, x);
m_maxx = wxMax(m_maxx, x);
m_miny = wxMin(m_miny, y);
m_maxy = wxMax(m_maxy, y);
}
}
// Expand the boundingbox with two points
void wxBoundingBox::Expand(const wxPoint2DDouble& a, const wxPoint2DDouble& b)
{
Expand(a);
Expand(b);
}
// Enlarge the boundingbox with the given marge
void wxBoundingBox::EnLarge(const double marge)
{
if (!m_validbbox)
{
m_minx = m_maxx = marge;
m_miny = m_maxy = marge;
m_validbbox=TRUE;
}
else
{
m_minx -= marge;
m_maxx += marge;
m_miny -= marge;
m_maxy += marge;
}
}
// Calculates if two boundingboxes intersect. If so, the function returns _ON.
// If they do not intersect, two scenario's are possible:
// other is outside this -> return _OUT
// other is inside this -> return _IN
OVERLAP wxBoundingBox::Intersect(wxBoundingBox &other, double Marge)
{
assert (m_validbbox == TRUE);
// other boundingbox must exist
assert (&other);
if (((m_minx - Marge) > (other.m_maxx + Marge)) ||
((m_maxx + Marge) < (other.m_minx - Marge)) ||
((m_maxy + Marge) < (other.m_miny - Marge)) ||
((m_miny - Marge) > (other.m_maxy + Marge)))
return _OUT;
// Check if other.bbox is inside this bbox
if ((m_minx <= other.m_minx) &&
(m_maxx >= other.m_maxx) &&
(m_maxy >= other.m_maxy) &&
(m_miny <= other.m_miny))
return _IN;
// Boundingboxes intersect
return _ON;
}
// Checks if a line intersects the boundingbox
bool wxBoundingBox::LineIntersect(const wxPoint2DDouble& begin, const wxPoint2DDouble& end )
{
assert (m_validbbox == TRUE);
return (bool)
!(((begin.m_y > m_maxy) && (end.m_y > m_maxy)) ||
((begin.m_y < m_miny) && (end.m_y < m_miny)) ||
((begin.m_x > m_maxx) && (end.m_x > m_maxx)) ||
((begin.m_x < m_minx) && (end.m_x < m_minx)));
}
// Is the given point in the boundingbox ??
bool wxBoundingBox::PointInBox(double x, double y, double Marge)
{
assert (m_validbbox == TRUE);
if ( x >= (m_minx - Marge) && x <= (m_maxx + Marge) &&
y >= (m_miny - Marge) && y <= (m_maxy + Marge) )
return TRUE;
return FALSE;
}
//
// Is the given point in the boundingbox ??
//
bool wxBoundingBox::PointInBox(const wxPoint2DDouble& a, double Marge)
{
assert (m_validbbox == TRUE);
return PointInBox(a.m_x, a.m_y, Marge);
}
wxPoint2DDouble wxBoundingBox::GetMin()
{
assert (m_validbbox == TRUE);
return wxPoint2DDouble(m_minx, m_miny);
}
wxPoint2DDouble wxBoundingBox::GetMax()
{
assert (m_validbbox == TRUE);
return wxPoint2DDouble(m_maxx, m_maxy);
}
bool wxBoundingBox::GetValid() const
{
return m_validbbox;
}
void wxBoundingBox::SetMin(double px, double py)
{
m_minx = px;
m_miny = py;
if (!m_validbbox)
{
m_maxx = px;
m_maxy = py;
m_validbbox = TRUE;
}
}
void wxBoundingBox::SetMax(double px, double py)
{
m_maxx = px;
m_maxy = py;
if (!m_validbbox)
{
m_minx = px;
m_miny = py;
m_validbbox = TRUE;
}
}
void wxBoundingBox::SetValid(bool value)
{
m_validbbox = value;
}
// adds an offset to the boundingbox
// usage : a_boundingbox.Translate(a_point);
void wxBoundingBox::Translate(wxPoint2DDouble& offset)
{
assert (m_validbbox == TRUE);
m_minx += offset.m_x;
m_maxx += offset.m_x;
m_miny += offset.m_y;
m_maxy += offset.m_y;
}
// clears the bounding box settings
void wxBoundingBox::Reset()
{
m_minx = 0.0;
m_maxx = 0.0;
m_miny = 0.0;
m_maxy = 0.0;
m_validbbox = FALSE;
}
void wxBoundingBox::SetBoundingBox(const wxPoint2DDouble& a_point)
{
m_minx = a_point.m_x;
m_maxx = a_point.m_x;
m_miny = a_point.m_y;
m_maxy = a_point.m_y;
}
// Expands the boundingbox with the given point
// usage : a_boundingbox = a_boundingbox + pointer_to_an_offset;
wxBoundingBox& wxBoundingBox::operator+(wxBoundingBox &other)
{
assert (m_validbbox == TRUE);
assert (other.GetValid());
Expand(other);
return *this;
}
// makes a boundingbox same as the other
wxBoundingBox& wxBoundingBox::operator=( const wxBoundingBox &other)
{
assert (other.GetValid());
m_minx = other.m_minx;
m_maxx = other.m_maxx;
m_miny = other.m_miny;
m_maxy = other.m_maxy;
m_validbbox = other.m_validbbox;
return *this;
}
void wxBoundingBox::MapBbox( const wxTransformMatrix& matrix)
{
assert (m_validbbox == TRUE);
double x1,y1,x2,y2,x3,y3,x4,y4;
matrix.TransformPoint( m_minx, m_miny, x1, y1 );
matrix.TransformPoint( m_minx, m_maxy, x2, y2 );
matrix.TransformPoint( m_maxx, m_maxy, x3, y3 );
matrix.TransformPoint( m_maxx, m_miny, x4, y4 );
double xmin = wxMin(x1,x2);
xmin = wxMin(xmin,x3);
xmin = wxMin(xmin,x4);
double xmax = wxMax( x1, x2);
xmax = wxMax(xmax,x3);
xmax = wxMax(xmax,x4);
double ymin = wxMin(y1, y2);
ymin = wxMin(ymin,y3);
ymin = wxMin(ymin,y4);
double ymax = wxMax(y1,y2);
ymax = wxMax(ymax,y3);
ymax = wxMax(ymax,y4);
// Use these min and max values to set the new boundingbox
m_minx = xmin;
m_miny = ymin;
m_maxx = xmax;
m_maxy = ymax;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,660 +0,0 @@
/*
Program wxLine.CPP
Purpose Mainly used for calculating crossings
Last Update 05-12-1995
*/
#ifdef __GNUG__
#pragma implementation "liner.cpp"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include <math.h>
#include <stdlib.h>
#include "wx/canvas/liner.h"
wxLine::wxLine( double x1, double y1, double x2, double y2 )
{
m_AA = 0.0;
m_BB = 0.0;
m_CC = 0.0;
m_a=wxPoint2DDouble(x1,y1);
m_b=wxPoint2DDouble(x2,y2);
if (m_a==m_b)
assert(0);
m_valid_parameters = FALSE;
}
wxLine::~wxLine()
{
}
wxLine::wxLine(const wxPoint2DDouble& a,const wxPoint2DDouble& b)
{
if (a==b)
assert(0);
m_a=a;
m_b=b;
m_valid_parameters = FALSE;
}
// ActionOnTable1
// This function decide which action must be taken, after PointInLine
// has given the results of two points in relation to a wxLine. See table 1 in the report
//
// input Result_beginPoint:
// Result_endPoint :
// The results can be R_R_LEFT_SIDE, R_R_RIGHT_SIDE, R_R_ON_AREA, R_R_IN_AREA
//
// return -1: Illegal combination
// 0: No action, no crosspoints
// 1: Investigate results points in relation to the other wxLine
// 2: endPoint is a crosspoint, no further investigation
// 3: beginPoint is a crosspoint, no further investigation
// 4: beginPoint and endPoint are crosspoints, no further investigation
// 5: beginPoint is a crosspoint, need further investigation
// 6: endPoint is a crosspoint, need further investigation
int wxLine::ActionOnTable1(R_PointStatus Result_beginPoint, R_PointStatus Result_endPoint)
{
// beginPoint and endPoint are crosspoints
if (
(Result_beginPoint == R_IN_AREA)
&&
(Result_endPoint == R_IN_AREA)
)
return 4;
// there are no crosspoints, no action
if (
(
(Result_beginPoint == R_LEFT_SIDE)
&&
(Result_endPoint == R_LEFT_SIDE)
)
||
(
(Result_beginPoint == R_RIGHT_SIDE)
&&
(Result_endPoint == R_RIGHT_SIDE)
)
)
return 0;
// maybe there is a crosspoint, further investigation needed
if (
(
(Result_beginPoint == R_LEFT_SIDE)
&&
(
(Result_endPoint == R_RIGHT_SIDE)
||
(Result_endPoint == R_ON_AREA)
)
)
||
(
(Result_beginPoint == R_RIGHT_SIDE)
&&
(
(Result_endPoint == R_LEFT_SIDE)
||
(Result_endPoint == R_ON_AREA)
)
)
||
(
(Result_beginPoint == R_ON_AREA)
&&
(
(Result_endPoint == R_LEFT_SIDE)
||
(Result_endPoint == R_RIGHT_SIDE)
||
(Result_endPoint == R_ON_AREA)
)
)
)
return 1;
//there is a crosspoint
if (
(
(Result_beginPoint == R_LEFT_SIDE)
||
(Result_beginPoint == R_RIGHT_SIDE)
)
&&
(Result_endPoint == R_IN_AREA)
)
return 2;
// there is a crosspoint
if (
(Result_beginPoint == R_IN_AREA)
&&
(
(Result_endPoint == R_LEFT_SIDE)
||
(Result_endPoint == R_RIGHT_SIDE)
)
)
return 3;
// beginPoint is a crosspoint, further investigation needed
if (
(Result_beginPoint == R_IN_AREA)
&&
(Result_endPoint == R_ON_AREA)
)
return 5;
// endPoint is a crosspoint, further investigation needed
if (
(Result_beginPoint == R_ON_AREA)
&&
(Result_endPoint == R_IN_AREA)
)
return 6;
// All other combinations are illegal
return -1;
}
// ActionOnTable2
// This function decide which action must be taken, after PointInLine
// has given the results of two points in relation to a wxLine. It can only give a
// correct decision if first the relation of the points from the wxLine
// are investigated in relation to the wxLine wich can be constucted from the points.
//
// input Result_beginPoint:
// Result_endPoint :
// The results can be R_LEFT_SIDE, R_RIGHT_SIDE, R_ON_AREA, R_IN_AREA
//
// return -1: Illegal combination
// 0: No action, no crosspoints
// 1: Calculate crosspoint
// 2: endPoint is a crosspoint
// 3: beginPoint is a crosspoint
// 4: beginPoint and endPoint are crosspoints
int wxLine::ActionOnTable2(R_PointStatus Result_beginPoint, R_PointStatus Result_endPoint)
{
// beginPoint and eindpoint are crosspoints
if (
(Result_beginPoint == R_IN_AREA)
&&
(Result_endPoint == R_IN_AREA)
)
return 4;
// there are no crosspoints
if (
(
(Result_beginPoint == R_LEFT_SIDE)
&&
(
(Result_endPoint == R_LEFT_SIDE)
||
(Result_endPoint == R_ON_AREA)
)
)
||
(
(Result_beginPoint == R_RIGHT_SIDE)
&&
(
(Result_endPoint == R_RIGHT_SIDE)
||
(Result_endPoint == R_ON_AREA)
)
)
||
(
(Result_beginPoint == R_ON_AREA)
&&
(
(Result_endPoint == R_LEFT_SIDE)
||
(Result_endPoint == R_RIGHT_SIDE)
||
(Result_endPoint == R_ON_AREA)
)
)
)
return 0;
// there is a real intersection, which must be calculated
if (
(
(Result_beginPoint == R_LEFT_SIDE)
&&
(Result_endPoint == R_RIGHT_SIDE)
)
||
(
(Result_beginPoint == R_RIGHT_SIDE)
&&
(Result_endPoint == R_LEFT_SIDE)
)
)
return 1;
// endPoint is a crosspoint
if (
(
(Result_beginPoint == R_LEFT_SIDE)
||
(Result_beginPoint == R_RIGHT_SIDE)
||
(Result_beginPoint == R_ON_AREA)
)
&&
(Result_endPoint == R_IN_AREA)
)
return 2;
// beginPoint is a crosspoint
if (
(Result_beginPoint == R_IN_AREA)
&&
(
(Result_endPoint == R_LEFT_SIDE)
||
(Result_endPoint == R_RIGHT_SIDE)
||
(Result_endPoint == R_ON_AREA)
)
)
return 3;
// All other combinations are illegal
return -1;
}
// Calculate the Y when the X is given
double wxLine::Calculate_Y(double X)
{
CalculateLineParameters();
if (m_AA != 0)
return -(m_AA * X + m_CC) / m_BB;
else
// horizontal wxLine
return m_a.m_y;
}
void wxLine::Virtual_Point(wxPoint2DDouble& a_point,double distance) const
{
assert(m_valid_parameters);
//calculate the distance using the slope of the wxLine
//and rotate 90 degrees
a_point.m_y=a_point.m_y + (distance * -m_BB);
a_point.m_x=a_point.m_x - (distance * m_AA );
}
//
// Calculate the lineparameters for the wxLine if nessecary
//
void wxLine::CalculateLineParameters()
{
// if not valid_parameters calculate the parameters
if (!m_valid_parameters)
{
double length;
// bp AND ep may not be the same
if (m_a == m_b)
assert (0);
m_AA = (m_b.m_y - m_a.m_y); // A = (Y2-Y1)
m_BB = (m_a.m_x - m_b.m_x); // B = (X1-X2)
// the parameters A end B can now be normalized
length = sqrt(m_AA*m_AA + m_BB*m_BB);
assert(length !=0);
m_AA = (m_AA / length);
m_BB = (m_BB / length);
m_CC = -((m_AA * m_a.m_x) + (m_a.m_y * m_BB));
m_valid_parameters = TRUE;
}
}
// Checks if a wxLine intersect with another wxLine
// inout wxLine : another wxLine
// Marge: optional, standard on MARGE (declared in MISC.CPP)
//
// return true : wxLines are crossing
// false: wxLines are not crossing
//
bool wxLine::CheckIntersect (wxLine& lijn, double Marge)
{
double distance=0;
// bp AND ep may not be the same
if (m_a == m_b)
assert (0);
int Take_Action1, Take_Action2;
bool Total_Result=FALSE;
R_PointStatus Result_beginPoint,Result_endPoint;
Result_beginPoint = PointInLine(lijn.m_a,distance,Marge);
Result_endPoint = PointInLine(lijn.m_b,distance,Marge);
Take_Action1 = ActionOnTable1(Result_beginPoint,Result_endPoint);
switch (Take_Action1)
{
case 0: Total_Result = FALSE ; break;
case 1: {
Result_beginPoint = lijn.PointInLine(m_a,distance,Marge);
Result_endPoint = lijn.PointInLine(m_b,distance,Marge);
Take_Action2 = ActionOnTable2(Result_beginPoint,Result_endPoint);
switch (Take_Action2)
{
case 0: Total_Result = FALSE; break;
case 1: case 2: case 3: case 4: Total_Result = TRUE; break;
}
}; break; // This break belongs to the switch(Take_Action1)
case 2: case 3: case 4: case 5: case 6: Total_Result = TRUE; break;
}
return Total_Result; //This is the final decision
}
//
// Get the beginPoint from the wxLine
// usage: Point aPoint = a_line.GetBeginPoint()
//
wxPoint2DDouble wxLine::GetBeginPoint()
{
return m_a;
}
//
// Get the endPoint from the wxLine
// usage: Point aPoint = a_line.GetEndPoint()
//
wxPoint2DDouble wxLine::GetEndPoint()
{
return m_b;
}
// Intersects two wxLines
// input wxLine : another wxLine
// Marge: optional, standard on MARGE
//
// return 0: If there are no crossings
// 1: If there is one crossing
// 2: If there are two crossings
int wxLine::Intersect(wxLine& lijn, wxPoint2DDouble& c1 ,wxPoint2DDouble& c2 , double Marge)
{
double distance=0;
// bp AND ep may not be the same
if (m_a == m_b)
assert (0);
R_PointStatus Result_beginPoint,Result_endPoint;
int Take_Action1, Take_Action2, Number_of_Crossings = 0;
Result_beginPoint = PointInLine(lijn.m_a,distance,Marge);
Result_endPoint = PointInLine(lijn.m_b,distance,Marge);
Take_Action1 = ActionOnTable1(Result_beginPoint,Result_endPoint);
// 0: No action, no crosspoints
// 1: Investigate results points in relation to the other wxLine
// 2: endPoint is a crosspoint, no further investigation
// 3: beginPoint is a crosspoint, no further investigation
// 4: beginPoint and endPoint are crosspoints, no further investigation
// 5: beginPoint is a crosspoint, need further investigation
// 6: endPoint is a crosspoint, need further investigation
// The first switch will insert a crosspoint immediatly
switch (Take_Action1)
{
case 2: case 6: c1=lijn.m_b;
Number_of_Crossings = 1;
break;
case 3: case 5: c1=lijn.m_a;
Number_of_Crossings = 1;
break;
case 4: c1=lijn.m_a;
c2=lijn.m_b;
Number_of_Crossings = 2;
break;
default:
break;
}
// This switch wil investigate the points of this wxLine in relation to lijn
// 1: Investigate results points in relation to the other wxLine
// 5: beginPoint is a crosspoint, need further investigation
// 6: endPoint is a crosspoint, need further investigation
switch (Take_Action1)
{
case 1: case 5: case 6:
{
Result_beginPoint = lijn.PointInLine(m_a,distance,Marge);
Result_endPoint = lijn.PointInLine(m_b,distance,Marge);
Take_Action2 = ActionOnTable2(Result_beginPoint,Result_endPoint);
// return -1: Illegal combination
// 0: No action, no crosspoints
// 1: Calculate crosspoint
// 2: endPoint is a crosspoint
// 3: beginPoint is a crosspoint
// 4: beginPoint and endPoint are crosspoints
switch (Take_Action2)
{
// for the cases see the returnvalue of ActionTable2
case 1: { // begin of scope to calculate the intersection
double X, Y, Denominator;
CalculateLineParameters();
Denominator = (m_AA * lijn.m_BB) - (lijn.m_AA * m_BB);
// Denominator may not be 0
assert(Denominator != 0.0);
// Calculate intersection of both linesegments
X = ((m_BB * lijn.m_CC) - (lijn.m_BB * m_CC)) / Denominator;
Y = ((lijn.m_AA * m_CC) - (m_AA * lijn.m_CC)) / Denominator;
c1.m_x=X;
c1.m_y=Y;
}
Number_of_Crossings++;
break;
case 2: c2=m_a;
Number_of_Crossings++;
break;
case 3: c2=m_b;
Number_of_Crossings++;
break;
case 4: c1=m_a;
c2=m_b;
Number_of_Crossings = 2;
break;
}
};
break;
default:
break;
}
return Number_of_Crossings; //This is de final number of crossings
}
//
// test if a point lies in the linesegment. If the point isn't on the wxLine
// the function returns a value that indicates on which side of the
// wxLine the point is (in linedirection from first point to second point
//
// returns R_LEFT_SIDE, when point lies on the left side of the wxLine
// R_RIGHT_SIDE, when point lies on the right side of the wxLine
// R_ON_AREA, when point lies on the infinite wxLine within a range
// R_IN_AREA, when point lies in the area of the linesegment
// the returnvalues are declared in (wxLine.H)
R_PointStatus wxLine::PointInLine(const wxPoint2DDouble& a_Point, double& Distance,double Marge)
{
Distance=0;
// Point may not be the same
assert(m_a != m_b);
int Result_ofm_BBox=FALSE;
R_PointStatus Result_of_Online;
//quick test if point is begin or endpoint
if (a_Point == m_a || a_Point == m_b)
return R_IN_AREA;
// Checking if point is in bounding-box with marge
double xmin=wxMin(m_a.m_x,m_b.m_x);
double xmax=wxMax(m_a.m_x,m_b.m_x);
double ymin=wxMin(m_a.m_y,m_b.m_y);
double ymax=wxMax(m_a.m_y,m_b.m_y);
if ( a_Point.m_x >= (xmin - Marge) && a_Point.m_x <= (xmax + Marge) &&
a_Point.m_y >= (ymin - Marge) && a_Point.m_y <= (ymax + Marge) )
Result_ofm_BBox=TRUE;
// Checking if point is on the infinite wxLine
Result_of_Online = PointOnLine(a_Point, Distance, Marge);
// point in boundingbox of the wxLine and is on the wxLine then the point is R_IN_AREA
if ((Result_ofm_BBox) && (Result_of_Online == R_ON_AREA))
return R_IN_AREA;
else
return Result_of_Online;
}
//
// test if a point lies on the wxLine. If the point isn't on the wxLine
// the function returns a value that indicates on which side of the
// wxLine the point is (in linedirection from first point to second point
//
// returns R_LEFT_SIDE, when point lies on the left side of the wxLine
// R_ON_AREA, when point lies on the infinite wxLine within a range
// R_RIGHT_SIDE, when point lies on the right side of the wxLine
// R_LEFT_SIDE , R_RIGHT_SIDE , R_ON_AREA
R_PointStatus wxLine::PointOnLine(const wxPoint2DDouble& a_Point, double& Distance, double Marge)
{
Distance=0;
// Point may not be queal
assert(m_a!=m_b);
//quick test if point is begin or endpoint
if (a_Point == m_a || a_Point == m_b)
return R_ON_AREA;
CalculateLineParameters();
// calculate the distance of a_Point in relation to the wxLine
Distance = (m_AA * a_Point.m_x)+(m_BB * a_Point.m_y) + m_CC;
if (Distance < -Marge)
return R_LEFT_SIDE;
else
{
if (Distance > Marge)
return R_RIGHT_SIDE;
else
return R_ON_AREA;
}
}
// makes a wxLine same as these
// usage : wxLine1 = wxLine2;
wxLine& wxLine::operator=(const wxLine& a_line)
{
m_AA = a_line.m_AA;
m_BB = a_line.m_BB;
m_CC = a_line.m_CC;
m_a= a_line.m_a;
m_b= a_line.m_b;
m_valid_parameters = a_line.m_valid_parameters;
return *this;
}
void wxLine::OffsetContour(const wxLine& nextline,double factor,wxPoint2DDouble& offsetpoint) const
{
wxPoint2DDouble offs_begin(m_a);
wxPoint2DDouble offs_end(m_b);
wxPoint2DDouble offs_bgn_next(nextline.m_a);
wxPoint2DDouble offs_end_next(nextline.m_b);
// make a wxPoint2DDouble from this point
Virtual_Point(offs_begin,factor);
Virtual_Point(offs_end,factor);
wxLine offs_currentline(offs_begin,offs_end);
nextline.Virtual_Point(offs_bgn_next,factor);
nextline.Virtual_Point(offs_end_next,factor);
wxLine offs_nextline(offs_bgn_next, offs_end_next);
offs_nextline.CalculateLineParameters();
offs_currentline.CalculateLineParameters();
offs_currentline.Intersect(offs_nextline,offsetpoint);
}
// Return the position of the second wxLine compared to this wxLine
// Result = IS_ON | IS_LEFT | IS_RIGHT
// Here Left and Right is defined as being left or right from
// the this wxLine towards the center (common) node
// direction of vetors taken as begin to endpoint with end of this at
// begin of wxLine two
OUTPRODUCT wxLine::OutProduct(const wxLine& two,double accur)
{
R_PointStatus uitp;
double distance;
if (two.m_a==two.m_b)
assert(0);
if (m_a==m_b)
assert(0);
uitp=PointOnLine(two.m_b, distance, accur);
/*double uitp= (_x - first._x) * (third._y - _y) -
(_y - first._y) * (third._x - _x);
if (uitp>0) return IS_LEFT;
if (uitp<0) return IS_RIGHT;
return IS_ON;*/
//depending on direction of this link (going to or coming from centre)
if (uitp==R_LEFT_SIDE)
return R_IS_LEFT;
if (uitp==R_RIGHT_SIDE)
return R_IS_RIGHT;
return R_IS_ON;
}
// Intersects two lines if a crossing return TRUE
// else FALSE
bool wxLine::Intersect(wxLine& lijn,wxPoint2DDouble& crossing)
{
// lijn must exist
assert(m_valid_parameters);
assert(lijn.m_valid_parameters);
double X, Y, Denominator;
Denominator = (m_AA * lijn.m_BB) - (lijn.m_AA * m_BB);
// Denominator may not be 0
if (Denominator == 0.0)
return FALSE;
// Calculate intersection of both linesegments
X = ((m_BB * lijn.m_CC) - (lijn.m_BB * m_CC)) / Denominator;
Y = ((lijn.m_AA * m_CC) - (m_AA * lijn.m_CC)) / Denominator;
crossing.m_x=X;
crossing.m_y=Y;
return TRUE;
}

View File

@@ -1,17 +0,0 @@
#
# File: makefile.b32
# Author: Julian Smart
# Created: 1999
# Updated:
# Copyright:
#
# Makefile : Builds Canvas library for 32-bit BC++
WXDIR = $(WXWIN)
LIBTARGET=$(WXDIR)\lib\canvas.lib
OBJECTS = bbox.obj canvas.obj liner.obj polygon.obj
!include $(WXDIR)\src\makelib.b32

View File

@@ -1,16 +0,0 @@
#
# File: makefile.g95
# Author: Julian Smart
# Created: 1999
# Updated:
# Copyright: (c) Julian Smart, 1999
#
# Makefile for wxWindows Plot library Cygwin/Mingw32).
WXDIR = ../../..
LIBTARGET=$(WXDIR)/lib/libcanvas.a
OBJECTS = bbox.o canvas.o liner.o polygon.o
include $(WXDIR)/src/makelib.g95

View File

@@ -1,159 +0,0 @@
# File: makefile.vc
# Author: Julian Smart
# Created: 2001
# Updated:
# Copyright: (c) 2001, Julian Smart
#
# "%W% %G%"
#
# Makefile : Builds Plot class library (MS VC++).
# Use FINAL=1 argument to nmake to build final version with no debugging
# info
# Set WXDIR for your system
WXDIR = $(WXWIN)
GIZMOSDIR = $(WXDIR)\contrib\src\canvas
GIZMOSINC = $(WXDIR)\contrib\include\wx\canvas
THISDIR = $(WXDIR)\contrib\src\canvas
DOCDIR=$(WXDIR)\contrib\docs
LOCALDOCDIR=$(WXDIR)\contrib\docs\latex\canvas
!include $(WXDIR)\src\makevc.env
OBJECTS = $(D)\bbox.obj $(D)\canvas.obj $(D)\liner.obj $(D)\polygon.obj
LIBTARGET=$(WXDIR)\lib\canvas$(LIBEXT).lib
all: $(D) $(LIBTARGET)
$(D) :
mkdir $(D)
wx:
cd $(WXDIR)\src\msw
nmake -f makefile.vc FINAL=$(FINAL)
cd $(THISDIR)
wxclean:
cd $(WXDIR)\src\msw
nmake -f makefile.vc clean
cd $(THISDIR)
$(LIBTARGET): $(OBJECTS)
-erase $(LIBTARGET)
$(implib) @<<
-out:$(LIBTARGET)
-machine:$(CPU)
$(OBJECTS)
<<
$(D)\bbox.obj: bbox.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
$(D)\canvas.obj: canvas.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
$(D)\liner.obj: liner.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
$(D)\polygon.obj: polygon.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
clean:
-erase $(D)\*.obj
-erase *.sbr
-erase *.exe
-erase *.res
-erase *.map
-erase *.pdb
-erase $(LIBTARGET)
DOCSOURCES=$(LOCALDOCDIR)\canvas.tex \
$(LOCALDOCDIR)\bugs.tex $(LOCALDOCDIR)\changes.tex\
$(LOCALDOCDIR)\classes.tex $(LOCALDOCDIR)\intro.tex\
$(LOCALDOCDIR)\topics.tex $(LOCALDOCDIR)\sample.tex
html: $(DOCDIR)\html\canvas\canvas.htm
htmlhelp: $(DOCDIR)\htmlhelp\canvas.chm
htb: $(DOCDIR)\htb\canvas.htb
hlp: $(DOCDIR)\winhelp\canvas.hlp
pdfrtf: $(DOCDIR)\pdf\canvas.rtf
ps: $(DOCDIR)\ps\canvas.ps
touchmanual:
touch $(LOCALDOCDIR)\canvas.tex
$(DOCDIR)\winhelp\canvas.hlp: $(LOCALDOCDIR)\canvas.rtf $(LOCALDOCDIR)\canvas.hpj
cd $(LOCALDOCDIR)
-erase canvas.ph
hc canvas
move canvas.hlp $(DOCDIR)\winhelp\canvas.hlp
move canvas.cnt $(DOCDIR)\winhelp\canvas.cnt
cd $(THISDIR)
$(LOCALDOCDIR)\canvas.rtf: $(DOCSOURCES)
cd $(LOCALDOCDIR)
-start $(WAITFLAG) tex2rtf $(LOCALDOCDIR)\canvas.tex $(LOCALDOCDIR)\canvas.rtf -twice -winhelp
cd $(THISDIR)
$(DOCDIR)\pdf\canvas.rtf: $(DOCSOURCES)
cd $(LOCALDOCDIR)
-copy *.bmp $(DOCDIR)\pdf
-start $(WAITFLAG) tex2rtf $(LOCALDOCDIR)\canvas.tex $(DOCDIR)\pdf\canvas.rtf -twice -rtf
cd $(THISDIR)
$(DOCDIR)\html\canvas\canvas.htm: $(DOCSOURCES)
cd $(LOCALDOCDIR)
-mkdir $(DOCDIR)\html\canvas
copy *.gif $(DOCDIR)\html\canvas
-start $(WAITFLAG) tex2rtf $(LOCALDOCDIR)\canvas.tex $(DOCDIR)\html\canvas\canvas.htm -twice -html
-erase $(DOCDIR)\html\canvas\*.con
-erase *.con
-erase $(DOCDIR)\html\canvas\*.ref
cd $(THISDIR)
$(DOCDIR)\htmlhelp\canvas.chm: $(DOCDIR)\html\canvas\canvas.htm $(DOCDIR)\html\canvas\canvas.hhp
cd $(DOCDIR)\html\canvas
-hhc canvas.hhp
move canvas.chm $(DOCDIR)\htmlhelp\canvas.chm
cd $(THISDIR)
# An htb file is a zip file containing the .htm, .gif, .hhp, .hhc and .hhk
# files, renamed to htb.
# This can then be used with e.g. helpview.
# Optionally, a cached version of the .hhp file can be generated with hhp2cached.
$(DOCDIR)\htb\canvas.htb: $(DOCDIR)\html\canvas\canvas.htm
cd $(DOCDIR)\html\canvas
-erase canvas.zip canvas.htb
zip canvas.zip *.htm *.gif *.hhp *.hhc *.hhk
-mkdir $(DOCDIR)\htb
move canvas.zip $(DOCDIR)\htb\canvas.htb
cd $(THISDIR)
$(LOCALDOCDIR)\canvas.dvi: $(DOCSOURCES)
cd $(LOCALDOCDIR)
-latex canvas
-latex canvas
-makeindx canvas
-bibtex canvas
-latex canvas
-latex canvas
cd $(THISDIR)
$(WXDIR)\docs\ps\canvas.ps: $(LOCALDOCDIR)\canvas.dvi
cd $(LOCALDOCDIR)
-dvips32 -o canvas.ps canvas
move canvas.ps $(WXDIR)\docs\ps\canvas.ps
cd $(THISDIR)

File diff suppressed because it is too large Load Diff