Commit ef2e41e3 authored by charras's avatar charras

--no commit message

--no commit message
parent 90228980
......@@ -4,6 +4,14 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with
email address.
2009-sept-10 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++pcbnew
Work on undo/redo in pcbnew finished.
Used kbool V2.0. This version solves some problems in zones calculationsb but not all.
The Kbool author, Klaas Holveda, is still working on these problems
Thanks to Klaas
2009-aug-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++pcbnew
......
......@@ -185,7 +185,7 @@ int MarkItemsInBloc( EDA_LibComponentStruct* LibComponent,
case COMPONENT_FIELD_DRAW_TYPE:
break;
defualt:
default:
break;
}
}
......
......@@ -40,7 +40,7 @@ void WinEDA_LibeditFrame::OnImportPart( wxCommandEvent& event )
wxFileName fn;
LibraryStruct* LibTmp;
LibCmpEntry* LibEntry;
bool entryLoaded;
bool entryLoaded = false;
LibItemToRepeat = NULL;
......
......@@ -63,7 +63,6 @@ private:
DRC* m_drc; ///< the DRC controller, see drc.cpp
// we'll use lower case function names for private member functions.
void createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu );
void createPopUpMenuForFootprints( MODULE* aModule, wxMenu* aPopMenu );
......@@ -263,6 +262,12 @@ public:
*/
bool Clear_Pcb( bool aQuery );
// Drc control
/* function GetDrcController
* @return the DRC controller
*/
DRC* GetDrcController() {return m_drc;} ///< return the DRC controller, see drc.cpp
/**
* Function RecreateBOMFileFromBoard
* Recreates a .cmp file from the current loaded board
......
No preview for this file type
This diff is collapsed.
......@@ -16,13 +16,6 @@ set(PCBNEW_SRCS
board.cpp
board_undo_redo.cpp
build_BOM_from_board.cpp
# class_board_item.cpp
# class_drawsegment.cpp
# class_edge_mod.cpp
# class_equipot.cpp
# class_module.cpp
# class_text_mod.cpp
# class_track.cpp
clean.cpp
# cleaningoptions_dialog.cpp
connect.cpp
......@@ -30,6 +23,7 @@ set(PCBNEW_SRCS
# copy_track.cpp <-- not used
cotation.cpp
cross-probing.cpp
debug_kbool_key_file_fct.cpp
deltrack.cpp
dialog_copper_zones.cpp
dialog_copper_zones_base.cpp
......@@ -140,7 +134,6 @@ set(PCBNEW_SRCS
tool_modedit.cpp
tool_onrightclick.cpp
tool_pcb.cpp
# tracemod.cpp
tracepcb.cpp
track.cpp
tr_modif.cpp
......
......@@ -52,6 +52,7 @@ public:
* from outlines (m_Poly) but unlike m_Poly these filled polygons have no hole (they are all in one piece)
* In very simple cases m_FilledPolysList is same as m_Poly
* In less simple cases (when m_Poly has holes) m_FilledPolysList is a polygon equivalent to m_Poly, without holes
* but with extra outline segment connecting "holes" with external main outline
* In complex cases an ouline decribed by m_Poly can have many filled areas
*/
std::vector <SEGMENT> m_FillSegmList; /* set of segments used to fill area, when fill zone by segment is used.
......
/* file debug_kbool_key_file_fct.cpp
*/
#include <vector>
#include "fctsys.h"
#include "common.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "zones.h"
#include "PolyLine.h"
#include "debug_kbool_key_file_fct.h"
#ifdef CREATE_KBOOL_KEY_FILES
static FILE* kdebugFile;
static const char * sDate_Time = "2009-09-07 15:59:24";
void CreateKeyFile()
{
kdebugFile = fopen( KEYFILE_FILENAME, "wt" );
if( kdebugFile )
{
fprintf( kdebugFile, "# KEY file for GDS-II postprocessing tool\n" );
fprintf( kdebugFile, "# File = %s\n", KEYFILE_FILENAME );
fprintf( kdebugFile, "# ====================================================================\n");
fprintf( kdebugFile, "\nHEADER 5; # version\n");
fprintf( kdebugFile, "BGNLIB;\n");
fprintf( kdebugFile, "LASTMOD {%s}; # last modification time\n",sDate_Time );
fprintf( kdebugFile, "LASTACC {%s}; # last access time\n",sDate_Time );
fprintf( kdebugFile, "LIBNAME trial;\n" );
fprintf( kdebugFile, "UNITS;\n# Units are in 0.0001 inch\n" );
fprintf( kdebugFile, "USERUNITS 1; PHYSUNITS 0.0001;\n\n" );
}
else
{
wxMessageBox( wxT( "CreateKeyFile() cannot create output file" ) );
}
}
void CloseKeyFile()
{
if( kdebugFile )
{
fprintf( kdebugFile, "\nENDLIB;\n" );
fclose( kdebugFile );
}
}
const char* sCurrEntityName = NULL;
static int s_count;
void OpenEntity( const char* aName )
{
if( kdebugFile )
{
fprintf( kdebugFile, "\nBGNSTR; # Begin of structure\n" );
fprintf( kdebugFile, "CREATION {%s}; # creation time\n",sDate_Time);
fprintf( kdebugFile, "LASTMOD {%s}; # last modification time\n",sDate_Time);
fprintf( kdebugFile, "STRNAME %s;\n", aName );
}
sCurrEntityName = aName;
s_count = 0;
}
void CloseEntity()
{
if( kdebugFile )
fprintf( kdebugFile, "\nENDSTR %s;\n", sCurrEntityName );
}
void StartPolygon(int aCornersCount, int aLayer)
{
fprintf( kdebugFile, "\nBOUNDARY; LAYER %d; DATATYPE 0;\n", aLayer );
fprintf( kdebugFile, " XY %d;\n", aCornersCount );
s_count = 0;
}
void EndElement()
{
if ( s_count == 1 )
fprintf( kdebugFile, "\n");
fprintf( kdebugFile, "\nENDEL;\n" );
s_count = 0;
}
void CopyPolygonsFromFilledPolysListToKeyFile( ZONE_CONTAINER* aZone, int aLayer )
{
if( !kdebugFile )
return;
unsigned corners_count = aZone->m_FilledPolysList.size();
int count = 0;
unsigned ic = 0;
CPolyPt* corner;
while( ic < corners_count )
{
// Count corners:
count = 0;
for( unsigned ii = ic; ii < corners_count; ii++ )
{
corner = &aZone->m_FilledPolysList[ii];
count++;
if( corner->end_contour )
break;
}
// write corners:
StartPolygon( count+1, aLayer );
corner = &aZone->m_FilledPolysList[ic];
int startpointX = corner->x;
int startpointY = corner->y;
for( ; ic < corners_count; ic++ )
{
corner = &aZone->m_FilledPolysList[ic];
AddPointXY( corner->x, corner->y );
if( corner->end_contour )
{
ic++;
break;
}
}
// Close polygon:
AddPointXY( startpointX, startpointY );
EndElement();
}
}
void AddPointXY( int aXcoord, int aYcoord)
{
if ( s_count >= 2 )
{
s_count = 0;
fprintf( kdebugFile, "\n");
}
SetLocaleTo_C_standard();
fprintf( kdebugFile, " X %d; Y %d;", aXcoord, aYcoord );
SetLocaleTo_Default( );
s_count ++;
}
#endif
/* debug_kbool_key_file_fct.h
*/
#ifndef _DEBUG_KBOOL_KEY_FILE_FCT_H_
#define _DEBUG_KBOOL_KEY_FILE_FCT_H_
/* This line must be uncommented only if you wan to produce a file
* to debug kbool
*/
//#define CREATE_KBOOL_KEY_FILES
#ifdef CREATE_KBOOL_KEY_FILES
#define KEYFILE_FILENAME "dbgfile.key"
/** function CreateKeyFile
* open KEYFILE_FILENAME file
* and create header
*/
void CreateKeyFile();
/** function CloseKeyFile
* close KEYFILE_FILENAME file
*/
void CloseKeyFile();
/* create header to start an entity description
*/
void OpenEntity(const char * aName);
/* close the entity description
*/
void CloseEntity();
/* polygon creations:
*/
void CopyPolygonsFromFilledPolysListToKeyFile( ZONE_CONTAINER* aZone, int aLayer);
void StartPolygon(int aCornersCount, int aLayer);
void AddPointXY( int aXcoord, int aYcoord);
void EndElement();
#endif // CREATE_KBOOL_KEY_FILES
#endif // _DEBUG_KBOOL_KEY_FILE_FCT_H_
......@@ -1077,8 +1077,7 @@ bool DRC::checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad, const int dist_mi
shape_pos = aRefPad->ReturnShapePos();
// rel_pos is pad position relative to the aRefPad position
rel_pos.x -= shape_pos.x;
rel_pos.y -= shape_pos.y;
rel_pos -= shape_pos;
dist = (int) hypot( rel_pos.x, rel_pos.y );
......@@ -1101,8 +1100,7 @@ bool DRC::checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad, const int dist_mi
if( swap_pads )
{
EXCHG( aRefPad, aPad );
rel_pos.x = -rel_pos.x;
rel_pos.y = -rel_pos.y;
rel_pos = -rel_pos;
}
switch( aRefPad->m_PadShape )
......@@ -1230,7 +1228,6 @@ bool DRC::checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad, const int dist_mi
m_finx = -sx;
m_finy = -sy; // end of segment coordinate
diag = checkClearanceSegmToPad( aPad, segm_width / 2, dist_min );
break;
}
......
......@@ -500,7 +500,7 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
{
int diag;
// Init zone params to reasonnable values
zone->SetLayer( ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer );
zone->SetLayer( GetScreen()->m_Active_Layer );
// Prompt user for parameters:
DrawPanel->m_IgnoreMouseEvents = TRUE;
......@@ -518,6 +518,7 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
wxGetApp().m_EDA_Config->Read( ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY,
&g_Zone_Default_Setting.m_ThermalReliefCopperBridgeValue );
g_Zone_Default_Setting.m_CurrentZone_Layer = zone->GetLayer();
dialog_copper_zone* frame = new dialog_copper_zone( this, &g_Zone_Default_Setting );
diag = frame->ShowModal();
frame->Destroy();
......@@ -534,7 +535,7 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
return 0;
// Switch active layer to the selectec zonz layer
( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = g_Zone_Default_Setting.m_CurrentZone_Layer;
GetScreen()->m_Active_Layer = g_Zone_Default_Setting.m_CurrentZone_Layer;
}
else // Start a new contour: init zone params (net and layer) from an existing zone (add cutout or similar zone)
{
......
......@@ -952,7 +952,7 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E
}
int bstyle = Area_To_Test->m_Poly->GetSideStyle( ic2 );
int x, y;
int d = ::GetClearanceBetweenSegments(
int d = GetClearanceBetweenSegments(
bx1, by1, bx2, by2, bstyle,
0,
ax1, ay1, ax2,
......@@ -1081,7 +1081,7 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex )
}
int bstyle = Area_To_Test->m_Poly->GetSideStyle( ic2 );
int x, y;
int d = ::GetClearanceBetweenSegments( bx1, by1, bx2, by2, bstyle,
int d = GetClearanceBetweenSegments( bx1, by1, bx2, by2, bstyle,
0,
ax1, ay1, ax2, ay2, astyle,
0,
......
......@@ -538,13 +538,16 @@ void ArmBoolEng( Bool_Engine* aBooleng, bool aConvertHoles )
Within the algorithm all input data is multiplied with DGRID, and the result
is rounded to an integer.
*/
double DGRID = 1.0; // round coordinate X or Y value in calculations to this (initial value = 1000.0 in kbool example)
// Note: in kicad, coordinates are already integer so DGRID can be set to 1
double DGRID = 10.0; // round coordinate X or Y value in calculations to this (initial value = 1000.0 in kbool example)
// Note: in kicad, coordinates are already integer so DGRID could be set to 1
// we choose a DGRID = 10 to have a MARGE = 1.0
double MARGE = 0.001; // snap with in this range points to lines in the intersection routines
// should always be > DGRID a MARGE >= 10*DGRID is ok
double MARGE = 1.0; // snap with in this range points to lines in the intersection routines
// should always be > 1/DGRID a MARGE >= 10/DGRID is ok
// this is also used to remove small segments and to decide when
// two segments are in line. ( initial value = 0.001 )
// For kicad we choose MARGE = 1, with DGRID = 10
double CORRECTIONFACTOR = 0.0; // correct the polygons by this number: used in BOOL_CORRECTION operation
// this operation shrinks a polygon if CORRECTIONFACTOR < 0
// or stretch it if CORRECTIONFACTOR > 0
......
......@@ -4,9 +4,9 @@
Copyright: 2001-2004 (C) Probably Klaas Holwerda
Licence: wxWidgets Licence
Licence: see kboollicense.txt
RCS-ID: $Id: _dl_itr.cpp,v 1.3 2006/12/13 21:43:33 titato Exp $
RCS-ID: $Id: _dl_itr.cpp,v 1.5 2009/04/23 19:35:24 titato Exp $
*/
#ifdef __UNIX__
......@@ -116,20 +116,20 @@ Error("remove_all",ITER_GT_O);
\param error code to generate a message for
*/
template <class Dtype>
void DL_List<Dtype>::Error( const char* function, Lerror a_error )
void DL_List<Dtype>::Error( string function, Lerror a_error )
{
char buf[100];
strcpy( buf, "DL_List<Dtype>::" );
strcat( buf, function );
string buf;
buf += "DL_List<Dtype>::";
buf += function;
switch ( a_error )
{
case NO_MES: strcat( buf, "" ); break;
case EMPTY: strcat( buf, "list is empty" ); break;
case ITER_GT_0: strcat( buf, "more then zero iter" ); break;
case NO_LIST: strcat( buf, "no list attached" ); break;
case SAME_LIST: strcat( buf, "same list not allowed" ); break;
case AC_ITER_LIST_OTHER: strcat( buf, "iter not allowed on other list" ); break;
default: strcat( buf, "unhandled error" ); break;
case NO_MES: buf += ""; break;
case EMPTY: buf += "list is empty"; break;
case ITER_GT_0: buf += "more then zero iter"; break;
case NO_LIST: buf += "no list attached"; break;
case SAME_LIST: buf += "same list not allowed"; break;
case AC_ITER_LIST_OTHER: buf += "iter not allowed on other list"; break;
default: buf += "unhandled error"; break;
}
throw Bool_Engine_Error( buf, "list error", 0, 1 );
......@@ -532,28 +532,28 @@ void DL_List<Dtype>::takeover( DL_List<Dtype>* otherlist )
\param a_error: error code to generate a message for
*/
template <class Dtype>
void DL_Iter<Dtype>::Error( const char* function, Lerror a_error )
void DL_Iter<Dtype>::Error( string function, Lerror a_error )
{
char buf[100];
strcpy( buf, "DL_Iter<Dtype>::" );
strcat( buf, function );
string buf;
buf = "DL_Iter<Dtype>::";
buf += function;
switch ( a_error )
{
case NO_MES: strcat( buf, "" ); break;
case NO_LIST: strcat( buf, "no list attached" ); break;
case NO_LIST_OTHER: strcat( buf, "no list on other iter" ); break;
case AC_ITER_LIST_OTHER: strcat( buf, "iter not allowed on other list" ); break;
case SAME_LIST: strcat( buf, "same list not allowed" ); break;
case NOT_SAME_LIST: strcat( buf, "must be same list" ); break;
case ITER_GT_1: strcat( buf, "more then one iter" ); break;
case ITER_HITROOT: strcat( buf, "iter at root" ); break;
case NO_ITEM: strcat( buf, "no item at current" ); break;
case NO_NEXT: strcat( buf, "no next after current" ); break;
case NO_PREV: strcat( buf, "no prev before current" ); break;
case EMPTY: strcat( buf, "list is empty" ); break;
case NOT_ALLOW: strcat( buf, "not allowed" ); break;
case ITER_NEG: strcat( buf, "to much iters deleted" ); break;
default: strcat( buf, "unhandled error" ); break;
case NO_MES: buf += ""; break;
case NO_LIST: buf += "no list attached"; break;
case NO_LIST_OTHER: buf += "no list on other iter"; break;
case AC_ITER_LIST_OTHER: buf += "iter not allowed on other list"; break;
case SAME_LIST: buf += "same list not allowed"; break;
case NOT_SAME_LIST: buf += "must be same list"; break;
case ITER_GT_1: buf += "more then one iter"; break;
case ITER_HITROOT: buf += "iter at root"; break;
case NO_ITEM: buf += "no item at current"; break;
case NO_NEXT: buf += "no next after current"; break;
case NO_PREV: buf += "no prev before current"; break;
case EMPTY: buf += "list is empty"; break;
case NOT_ALLOW: buf += "not allowed"; break;
case ITER_NEG: buf += "to much iters deleted"; break;
default: buf += "unhandled error"; break;
}
throw Bool_Engine_Error( buf, "list error", 0, 1 );
}
......
/*! \file kbool/include/kbool/_dl_itr.h
\author Probably Klaas Holwerda
\author Klaas Holwerda
Copyright: 2001-2004 (C) Probably Klaas Holwerda
Copyright: 2001-2004 (C) Klaas Holwerda
Licence: wxWidgets Licence
Licence: see kboollicense.txt
RCS-ID: $Id: _dl_itr.h,v 1.3 2008/06/04 21:23:21 titato Exp $
RCS-ID: $Id: _dl_itr.h,v 1.5 2009/04/23 19:35:24 titato Exp $
*/
//! author="Klaas Holwerda"
......@@ -22,7 +22,9 @@
#include "kbool/booleng.h"
#include <stdlib.h>
#include <string>
using namespace std;
#ifndef _STATUS_ENUM
#define _STATUS_ENUM
......@@ -103,7 +105,7 @@ public:
~DL_List();
//!Report off List Errors
void Error( const char* function, Lerror a_error );
void Error( string function, Lerror a_error );
//!Number of items in the list
int count();
......@@ -168,7 +170,7 @@ public:
~DL_Iter();
//!Report off Iterator Errors
void Error( const char* function, Lerror a_error );
void Error( string function, Lerror a_error );
//!This attaches an iterator to a list of a given type.
void Attach( DL_List<Dtype>* newlist );
......
......@@ -3,9 +3,9 @@
Copyright: 2001-2004 (C) Probably Klaas Holwerda
Licence: wxWidgets Licence
Licence: see kboollicense.txt
RCS-ID: $Id: _lnk_itr.cpp,v 1.3 2006/12/13 21:43:33 titato Exp $
RCS-ID: $Id: _lnk_itr.cpp,v 1.4 2009/02/06 21:33:03 titato Exp $
*/
#ifdef __UNIX__
......
/*! \file kbool/include/kbool/_lnk_itr.h
\author Probably Klaas Holwerda
\author Klaas Holwerda
Copyright: 2001-2004 (C) Probably Klaas Holwerda
Copyright: 2001-2004 (C) Klaas Holwerda
Licence: wxWidgets Licence
Licence: see kboollicense.txt
RCS-ID: $Id: _lnk_itr.h,v 1.2 2006/12/15 21:00:05 titato Exp $
RCS-ID: $Id: _lnk_itr.h,v 1.3 2009/02/06 21:33:03 titato Exp $
*/
//! author="Klaas Holwerda"
......
......@@ -5,7 +5,7 @@
Licence: see kboollicense.txt
RCS-ID: $Id: booleng.h,v 1.4 2008/09/05 19:01:14 titato Exp $
RCS-ID: $Id: booleng.h,v 1.6 2009/09/07 19:23:28 titato Exp $
*/
#ifndef BOOLENG_H
......@@ -19,9 +19,13 @@
#include <limits.h>
#include <assert.h>
#include <math.h>
#include <string>
using namespace std;
#if 0 // Kicad does not use kbool in dll version
#if defined(__WXMSW__)
/*
__declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well
......@@ -58,6 +62,7 @@
# define WXEXPORT __declspec(dllexport)
# define WXIMPORT __declspec(dllimport)
#endif
#endif // if 0 for kicad
/* for other platforms/compilers we don't anything */
......@@ -80,13 +85,13 @@
#define A2DKBOOLDLLEXP_CTORFN
#endif
#define KBOOL_VERSION "1.9"
#define KBOOL_VERSION "2.0"
#define KBOOL_DEBUG 0
#define KBOOL_LOG 0
#define KBOOL_INT64 1
class KBoolLink;
class kbLink;
#define LINELENGTH 200
......@@ -163,17 +168,17 @@ B_INT bmax( B_INT value1, B_INT value2 );
class A2DKBOOLDLLEXP Bool_Engine_Error
{
public:
Bool_Engine_Error( const char* message, const char* header = 0, int degree = 9, int fatal = 0 );
Bool_Engine_Error( string message, string header = 0, int degree = 9, int fatal = 0 );
Bool_Engine_Error( const Bool_Engine_Error& a );
~Bool_Engine_Error();
char* GetErrorMessage();
char* GetHeaderMessage();
string GetErrorMessage();
string GetHeaderMessage();
int GetErrorDegree();
int GetFatal();
protected:
char* _message;
char* _header;
string _message;
string _header;
int _degree;
int _fatal;
};
......@@ -207,10 +212,10 @@ enum BOOL_OP
BOOL_MAKERING /*!< create a ring on all polygons */
};
class GraphList;
class Graph;
class KBoolLink;
class Node;
class kbGraphList;
class kbGraph;
class kbLink;
class kbNode;
template<class Type> class TDLI;
//! boolean engine to perform operation on two sets of polygons.
......@@ -234,16 +239,16 @@ public:
//! destructor
virtual ~Bool_Engine();
const char* GetVersion() { return KBOOL_VERSION; }
string GetVersion() { return KBOOL_VERSION; }
//! reports progress of algorithm.
virtual void SetState( const char* = 0 );
virtual void SetState( string );
//! called at an internal error.
virtual void error( const char *text, const char *title );
virtual void error( string text, string title );
//! called at an internal generated possible error.
virtual void info( const char *text, const char *title );
virtual void info( string text, string title );
bool Do_Operation( BOOL_OP operation );
......@@ -422,13 +427,13 @@ public:
void SetLog( bool OnOff );
//! used to write to log file
void Write_Log( const char * );
void Write_Log( string);
//! used to write to log file
void Write_Log( const char *, const char * );
void Write_Log( string, string );
//! used to write to log file
void Write_Log( const char *, double );
void Write_Log( string, double );
//! used to write to log file
void Write_Log( const char *, B_INT );
void Write_Log( string, B_INT );
FILE* GetLogFile() { return m_logfile; }
......@@ -492,7 +497,7 @@ public:
//! see StartPolygonGet
/*!
This iterates through the first graph in the graphlist.
Setting the current Node properly by following the links in the graph
Setting the current kbNode properly by following the links in the graph
through its nodes.
*/
bool PolygonHasMorePoints();
......@@ -526,7 +531,7 @@ private:
bool m_doLog;
//! contains polygons in graph form
GraphList* m_graphlist;
kbGraphList* m_graphlist;
double m_MARGE;
B_INT m_GRID;
......@@ -544,21 +549,21 @@ private:
bool m_doLinkHoles;
//! used in the StartPolygonAdd, AddPt, EndPolygonAdd sequence
Graph* m_GraphToAdd;
kbGraph* m_GraphToAdd;
//! used in the StartPolygonAdd, AddPt, EndPolygonAdd sequence
Node* m_lastNodeToAdd;
kbNode* m_lastNodeToAdd;
//! used in the StartPolygonAdd, AddPt, EndPolygonAdd sequence
Node* m_firstNodeToAdd;
kbNode* m_firstNodeToAdd;
//! the current group type ( group A or B )
GroupType m_groupType;
//! used in extracting the points from the resultant polygons
Graph* m_getGraph;
kbGraph* m_getGraph;
//! used in extracting the points from the resultant polygons
KBoolLink* m_getLink;
kbLink* m_getLink;
//! used in extracting the points from the resultant polygons
Node* m_getNode;
kbNode* m_getNode;
//! used in extracting the points from the resultant polygons
double m_PolygonXPoint;
//! used in extracting the points from the resultant polygons
......@@ -572,8 +577,8 @@ private:
public:
//! use in Node to iterate links.
TDLI<KBoolLink>* _linkiter;
//! use in kbNode to iterate links.
TDLI<kbLink>* _linkiter;
//! how many time run intersections fase.
unsigned int m_intersectionruns;
......
......@@ -5,10 +5,10 @@
Licence: see kboollicense.txt
RCS-ID: $Id: graph.h,v 1.3 2008/06/04 21:23:21 titato Exp $
RCS-ID: $Id: graph.h,v 1.4 2009/09/07 19:23:28 titato Exp $
*/
/* @@(#) $Source: /cvsroot/wxart2d/wxArt2D/thirdparty/kbool/include/kbool/graph.h,v $ $Revision: 1.3 $ $Date: 2008/06/04 21:23:21 $ */
/* @@(#) $Source: /cvsroot/wxart2d/wxArt2D/thirdparty/kbool/include/kbool/graph.h,v $ $Revision: 1.4 $ $Date: 2009/09/07 19:23:28 $ */
/*
Program GRAPH.H
......@@ -25,23 +25,23 @@ Last Update 03-04-1996
#include "kbool/line.h"
#include "kbool/scanbeam.h"
class Node;
class kbNode;
class GraphList;
class kbGraphList;
//! one graph containing links that cab be connected.
class A2DKBOOLDLLEXP Graph
class A2DKBOOLDLLEXP kbGraph
{
protected:
Bool_Engine* _GC;
public:
Graph( Bool_Engine* GC );
Graph( KBoolLink*, Bool_Engine* GC );
kbGraph( Bool_Engine* GC );
kbGraph( kbLink*, Bool_Engine* GC );
Graph( Graph* other );
kbGraph( kbGraph* other );
~Graph();
~kbGraph();
bool GetBin() { return _bin; };
void SetBin( bool b ) { _bin = b; };
......@@ -51,10 +51,10 @@ public:
void Rotate( bool plus90 );
//! adds a link to the linklist
void AddLink( Node *begin, Node *end );
void AddLink( kbNode *begin, kbNode *end );
//! adds a link to the linklist
void AddLink( KBoolLink *a_link );
void AddLink( kbLink *a_link );
bool AreZeroLines( B_INT Marge );
......@@ -79,42 +79,42 @@ public:
// Remove unused links
void ReverseAllLinks();
//! Simplify the graph
//! Simplify the kbGraph
bool Simplify( B_INT Marge );
//! Takes over all links of the argument
bool Smoothen( B_INT Marge );
void TakeOver( Graph* );
void TakeOver( kbGraph* );
//! function for maximum performance
//! Get the First link from the graph
KBoolLink* GetFirstLink();
Node* GetTopNode();
//! Get the First link from the kbGraph
kbLink* GetFirstLink();
kbNode* GetTopNode();
void SetBeenHere( bool );
void Reset_flags();
//! Set the group of a graph
//! Set the group of a kbGraph
void SetGroup( GroupType );
//! Set the number of the graph
//! Set the number of the kbGraph
void SetNumber( int );
void Reset_Mark_and_Bin();
bool GetBeenHere();
int GetGraphNum();
int GetNumberOfLinks();
void Boolean( BOOL_OP operation, GraphList* Result );
void Correction( GraphList* Result, double factor );
void MakeRing( GraphList* Result, double factor );
void CreateRing( GraphList *ring, double factor );
void CreateRing_fast( GraphList *ring, double factor );
void CreateArc( Node* center, KBoolLine* incoming, Node* end, double radius, double aber );
void CreateArc( Node* center, Node* begin, Node* end, double radius, bool clock, double aber );
void Boolean( BOOL_OP operation, kbGraphList* Result );
void Correction( kbGraphList* Result, double factor );
void MakeRing( kbGraphList* Result, double factor );
void CreateRing( kbGraphList *ring, double factor );
void CreateRing_fast( kbGraphList *ring, double factor );
void CreateArc( kbNode* center, kbLine* incoming, kbNode* end, double radius, double aber );
void CreateArc( kbNode* center, kbNode* begin, kbNode* end, double radius, bool clock, double aber );
void MakeOneDirection();
void Make_Rounded_Shape( KBoolLink* a_link, double factor );
void Make_Rounded_Shape( kbLink* a_link, double factor );
bool MakeClockWise();
bool writegraph( bool linked );
bool writeintersections();
......@@ -137,7 +137,7 @@ protected:
void Extract_Simples( BOOL_OP operation, bool detecthole, bool& foundholes );
//! split graph into small graph, using the numbers in links.
void Split( GraphList* partlist );
void Split( kbGraphList* partlist );
//! Collect a graph by starting at argument link
/*
......@@ -150,16 +150,16 @@ protected:
\param graphnumber number to be given to links in the extracted graph piece
\param foundholes when holes are found this flag is set true.
*/
void CollectGraph( Node *current_node, BOOL_OP operation, bool detecthole, int graphnumber, bool& foundholes );
void CollectGraph( kbNode *current_node, BOOL_OP operation, bool detecthole, int graphnumber, bool& foundholes );
void CollectGraphLast( Node *current_node, BOOL_OP operation, bool detecthole, int graphnumber, bool& foundholes );
void CollectGraphLast( kbNode *current_node, BOOL_OP operation, bool detecthole, int graphnumber, bool& foundholes );
//! find a link not bin in the top left corner ( links should be sorted already )
/*!
Last found position is used to find it quickly.
Used in ExtractSimples()
*/
Node* GetMostTopLeft( TDLI<KBoolLink>* _LI );
kbNode* GetMostTopLeft( TDLI<kbLink>* _LI );
//! calculates crossing for all links in a graph, and add those as part of the graph.
/*
......
......@@ -28,21 +28,21 @@ Last Update 11-03-1996
class Debug_driver;
class A2DKBOOLDLLEXP GraphList: public DL_List<void*>
class A2DKBOOLDLLEXP kbGraphList: public DL_List<void*>
{
protected:
Bool_Engine* _GC;
public:
GraphList( Bool_Engine* GC );
kbGraphList( Bool_Engine* GC );
GraphList( GraphList* other );
kbGraphList( kbGraphList* other );
~GraphList();
~kbGraphList();
void MakeOneGraph( Graph *total );
void MakeOneGraph( kbGraph *total );
void Prepare( Graph *total );
void Prepare( kbGraph *total );
void MakeRings();
void Correction();
......
......@@ -6,7 +6,7 @@
Licence: see kboollicense.txt
RCS-ID: $Id: line.h,v 1.3 2008/06/04 21:23:21 titato Exp $
RCS-ID: $Id: line.h,v 1.4 2009/09/07 19:23:28 titato Exp $
*/
#ifndef LINE_H
......@@ -20,72 +20,72 @@ class A2DKBOOLDLLEXP Bool_Engine;
// Status of a point to a line
enum PointStatus {LEFT_SIDE, RIGHT_SIDE, ON_AREA, IN_AREA};
class A2DKBOOLDLLEXP Graph;
class A2DKBOOLDLLEXP kbGraph;
class A2DKBOOLDLLEXP KBoolLine
class A2DKBOOLDLLEXP kbLine
{
protected:
Bool_Engine* m_GC;
public:
// constructors and destructor
KBoolLine( Bool_Engine* GC );
KBoolLine( KBoolLink*, Bool_Engine* GC );
~KBoolLine();
kbLine( Bool_Engine* GC );
kbLine( kbLink*, Bool_Engine* GC );
~kbLine();
void Set( KBoolLink * );
KBoolLink* GetLink();
void Set( kbLink * );
kbLink* GetLink();
//! Get the beginnode from a line
Node* GetBeginNode();
kbNode* GetBeginNode();
//! Get the endnode from a line
Node* GetEndNode();
kbNode* GetEndNode();
//! Check if two lines intersects
int CheckIntersect( KBoolLine*, double Marge );
int CheckIntersect( kbLine*, double Marge );
//! Intersects two lines
int Intersect( KBoolLine*, double Marge );
int Intersect_simple( KBoolLine * lijn );
bool Intersect2( Node* crossing, KBoolLine * lijn );
int Intersect( kbLine*, double Marge );
int Intersect_simple( kbLine * lijn );
bool Intersect2( kbNode* crossing, kbLine * lijn );
//!For an infinite line
PointStatus PointOnLine( Node* a_node, double& Distance, double Marge );
PointStatus PointOnLine( kbNode* a_node, double& Distance, double Marge );
//!For a non-infinite line
PointStatus PointInLine( Node* a_node, double& Distance, double Marge );
PointStatus PointInLine( kbNode* a_node, double& Distance, double Marge );
//! Caclulate Y if X is known
B_INT Calculate_Y( B_INT X );
B_INT Calculate_Y_from_X( B_INT X );
void Virtual_Point( LPoint *a_point, double distance );
void Virtual_Point( kbLPoint *a_point, double distance );
//! assignment operator
KBoolLine& operator=( const KBoolLine& );
kbLine& operator=( const kbLine& );
Node* OffsetContour( KBoolLine* const nextline, Node* last_ins, double factor, Graph *shape );
Node* OffsetContour_rounded( KBoolLine* const nextline, Node* _last_ins, double factor, Graph *shape );
bool OkeForContour( KBoolLine* const nextline, double factor, Node* LastLeft, Node* LastRight, LinkStatus& _outproduct );
bool Create_Ring_Shape( KBoolLine* nextline, Node** _last_ins_left, Node** _last_ins_right, double factor, Graph *shape );
void Create_Begin_Shape( KBoolLine* nextline, Node** _last_ins_left, Node** _last_ins_right, double factor, Graph *shape );
void Create_End_Shape( KBoolLine* nextline, Node* _last_ins_left, Node* _last_ins_right, double factor, Graph *shape );
kbNode* OffsetContour( kbLine* const nextline, kbNode* last_ins, double factor, kbGraph *shape );
kbNode* OffsetContour_rounded( kbLine* const nextline, kbNode* _last_ins, double factor, kbGraph *shape );
bool OkeForContour( kbLine* const nextline, double factor, kbNode* LastLeft, kbNode* LastRight, LinkStatus& _outproduct );
bool Create_Ring_Shape( kbLine* nextline, kbNode** _last_ins_left, kbNode** _last_ins_right, double factor, kbGraph *shape );
void Create_Begin_Shape( kbLine* nextline, kbNode** _last_ins_left, kbNode** _last_ins_right, double factor, kbGraph *shape );
void Create_End_Shape( kbLine* nextline, kbNode* _last_ins_left, kbNode* _last_ins_right, double factor, kbGraph *shape );
//! Calculate the parameters if nessecary
void CalculateLineParameters();
//! Adds a crossing between the intersecting lines
void AddLineCrossing( B_INT , B_INT , KBoolLine * );
void AddLineCrossing( B_INT , B_INT , kbLine * );
void AddCrossing( Node *a_node );
Node* AddCrossing( B_INT X, B_INT Y );
bool ProcessCrossings( TDLI<KBoolLink>* _LI );
void AddCrossing( kbNode *a_node );
kbNode* AddCrossing( B_INT X, B_INT Y );
bool ProcessCrossings( TDLI<kbLink>* _LI );
// Linecrosslist
void SortLineCrossings();
bool CrossListEmpty();
DL_List<void*>* GetCrossList();
// bool HasInCrossList(Node*);
// bool HasInCrossList(kbNode*);
private:
......@@ -97,7 +97,7 @@ private:
double m_AA;
double m_BB;
double m_CC;
KBoolLink* m_link;
kbLink* m_link;
bool m_valid_parameters;
//! List with crossings through this link
......
......@@ -6,7 +6,7 @@
Licence: see kboollicense.txt
RCS-ID: $Id: link.h,v 1.3 2008/06/04 21:23:22 titato Exp $
RCS-ID: $Id: link.h,v 1.4 2009/09/07 19:23:28 titato Exp $
*/
#ifndef LINK_H
......@@ -17,53 +17,53 @@
enum LinkStatus {IS_LEFT, IS_ON, IS_RIGHT};
class LPoint;
class Node;
class Record;
class kbLPoint;
class kbNode;
class kbRecord;
//! segment within a graph
/*
A Graph contains a list of KBoolLink, the KBoolLink or connected by Node's.
Several KBoolLink can be connected to one Node.
A KBoolLink has a direction defined by its begin and end node.
Node do have a list of connected KBoolLink's.
A Graph contains a list of kbLink, the kbLink or connected by Node's.
Several kbLink can be connected to one Node.
A kbLink has a direction defined by its begin and end node.
Node do have a list of connected kbLink's.
So one can walk trough a graph in two ways:
1- via its KBoolLink list
2- via the node connected to the KBoolLink's
1- via its kbLink list
2- via the node connected to the kbLink's
*/
class A2DKBOOLDLLEXP KBoolLink
class A2DKBOOLDLLEXP kbLink
{
protected:
Bool_Engine* _GC;
public:
//! contructors
KBoolLink( Bool_Engine* GC );
kbLink( Bool_Engine* GC );
//! contructors
KBoolLink( int graphnr, Node* begin, Node* end, Bool_Engine* GC );
kbLink( int graphnr, kbNode* begin, kbNode* end, Bool_Engine* GC );
//! contructors
KBoolLink( Node *begin, Node *end, Bool_Engine* GC );
kbLink( kbNode *begin, kbNode *end, Bool_Engine* GC );
//! destructors
~KBoolLink();
~kbLink();
//! Merges the other node with argument
void MergeNodes( Node* const );
void MergeNodes( kbNode* const );
//! outproduct of two links
LinkStatus OutProduct( KBoolLink* const two, double accur );
LinkStatus OutProduct( kbLink* const two, double accur );
//! link three compared to this and two
LinkStatus PointOnCorner( KBoolLink* const, KBoolLink* const );
LinkStatus PointOnCorner( kbLink* const, kbLink* const );
//! Removes argument from the link
void Remove( Node* );
void Remove( kbNode* );
//! replaces olddone in the link by newnode
void Replace( Node* oldnode, Node* newnode );
void Replace( kbNode* oldnode, kbNode* newnode );
//!top hole marking
void SetTopHole( bool value );
......@@ -97,15 +97,15 @@ public:
void UnLink();
//! functions for maximum performance
Node* GetBeginNode();
kbNode* GetBeginNode();
//! Datamember access functions
Node* GetEndNode();
Node* GetLowNode();
Node* GetHighNode();
kbNode* GetEndNode();
kbNode* GetLowNode();
kbNode* GetHighNode();
//! Returns a next link beginning with argument
KBoolLink* Forth( Node* );
kbLink* Forth( kbNode* );
int GetGraphNum();
bool GetInc();
......@@ -113,10 +113,10 @@ public:
bool GetLeftB();
bool GetRightA();
bool GetRightB();
void GetLRO( LPoint*, int&, int&, double );
void GetLRO( kbLPoint*, int&, int&, double );
//! Return a node not equal to arg.
Node* GetOther( const Node* const );
kbNode* GetOther( const kbNode* const );
//! Is this link unused ?
bool IsUnused();
......@@ -143,10 +143,10 @@ public:
bool ShorterThan( B_INT marge );
//! Resets the link
void Reset( Node* begin, Node* end, int graphnr = 0 );
void Set( Node* begin, Node* end );
void SetBeginNode( Node* );
void SetEndNode( Node* );
void Reset( kbNode* begin, kbNode* end, int graphnr = 0 );
void Set( kbNode* begin, kbNode* end );
void SetBeginNode( kbNode* );
void SetEndNode( kbNode* );
void SetGraphNum( int );
void SetInc( bool );
void SetLeftA( bool );
......@@ -162,18 +162,18 @@ public:
void Reset_flags();
//!put in this direction
void Redirect( Node* a_node );
void Redirect( kbNode* a_node );
void TakeOverOperationFlags( KBoolLink* link );
void TakeOverOperationFlags( kbLink* link );
void SetRecordNode( DL_Node<Record*>* recordNode ) { m_record = recordNode; }
void SetRecordNode( DL_Node<kbRecord*>* recordNode ) { m_record = recordNode; }
DL_Node<Record*>* GetRecordNode() { return m_record; }
DL_Node<kbRecord*>* GetRecordNode() { return m_record; }
protected:
//! The mainitems of a link
Node *m_beginnode, *m_endnode;
kbNode *m_beginnode, *m_endnode;
//! Marker for walking over the graph
bool m_bin : 1;
//! Is this a part of hole ?
......@@ -223,7 +223,7 @@ GroupType m_group : 1;
//! belongs to this polygon part in the graph.
int m_graphnum;
DL_Node<Record*>* m_record;
DL_Node<kbRecord*>* m_record;
};
#endif
......
......@@ -21,35 +21,35 @@ Last Update 12-12-1995
#include "kbool/booleng.h"
class A2DKBOOLDLLEXP LPoint
class A2DKBOOLDLLEXP kbLPoint
{
public:
LPoint();
LPoint( B_INT const , B_INT const );
LPoint( LPoint* const );
kbLPoint();
kbLPoint( B_INT const , B_INT const );
kbLPoint( kbLPoint* const );
void Set( const B_INT, const B_INT );
void Set( const LPoint & );
void Set( const kbLPoint & );
LPoint GetPoint();
kbLPoint GetPoint();
B_INT GetX();
B_INT GetY();
void SetX( B_INT );
void SetY( B_INT );
bool Equal( const LPoint a_point, B_INT Marge );
bool Equal( const kbLPoint a_point, B_INT Marge );
bool Equal( const B_INT, const B_INT , B_INT Marge );
bool ShorterThan( const LPoint a_point, B_INT marge );
bool ShorterThan( const kbLPoint a_point, B_INT marge );
bool ShorterThan( const B_INT X, const B_INT Y, B_INT );
LPoint &operator=( const LPoint & );
LPoint &operator+( const LPoint & );
LPoint &operator-( const LPoint & );
kbLPoint &operator=( const kbLPoint & );
kbLPoint &operator+( const kbLPoint & );
kbLPoint &operator-( const kbLPoint & );
LPoint &operator*( int );
LPoint &operator/( int );
kbLPoint &operator*( int );
kbLPoint &operator/( int );
int operator==( const LPoint & ) const;
int operator!=( const LPoint & ) const;
int operator==( const kbLPoint & ) const;
int operator!=( const kbLPoint & ) const;
protected:
B_INT _x;
......
......@@ -6,7 +6,7 @@
Licence: see kboollicense.txt
RCS-ID: $Id: node.h,v 1.3 2008/06/04 21:23:22 titato Exp $
RCS-ID: $Id: node.h,v 1.4 2009/09/07 19:23:28 titato Exp $
*/
#ifndef NODE_H
......@@ -22,7 +22,7 @@
enum NodePosition { N_LEFT, N_ON, N_RIGHT};
class A2DKBOOLDLLEXP Node : public LPoint
class A2DKBOOLDLLEXP kbNode : public kbLPoint
{
protected:
Bool_Engine* _GC;
......@@ -31,52 +31,52 @@ public:
friend class Debug_driver;
// constructors and destructors
Node( Bool_Engine* GC );
kbNode( Bool_Engine* GC );
Node( const B_INT, const B_INT, Bool_Engine* GC );
kbNode( const B_INT, const B_INT, Bool_Engine* GC );
Node( LPoint* const a_point, Bool_Engine* GC );
Node( Node * const, Bool_Engine* GC );
Node& operator=( const Node &other_node );
~Node();
kbNode( kbLPoint* const a_point, Bool_Engine* GC );
kbNode( kbNode * const, Bool_Engine* GC );
kbNode& operator=( const kbNode &other_node );
~kbNode();
//public member functions
void AddLink( KBoolLink* );
void AddLink( kbLink* );
DL_List<void*>* GetLinklist();
//! check two link for its operation flags to be the same when coming from the prev link.
bool SameSides( KBoolLink* const prev , KBoolLink* const link, BOOL_OP operation );
bool SameSides( kbLink* const prev , kbLink* const link, BOOL_OP operation );
//! get the link most right or left to the current link, but with the specific operation
/*! flags the same on the sides of the new link.
*/
KBoolLink* GetMost( KBoolLink* const prev , LinkStatus whatside, BOOL_OP operation );
kbLink* GetMost( kbLink* const prev , LinkStatus whatside, BOOL_OP operation );
//! get link that is leading to a hole ( hole segment or linking segment )
KBoolLink* GetMostHole( KBoolLink* const prev , LinkStatus whatside, BOOL_OP operation );
kbLink* GetMostHole( kbLink* const prev , LinkStatus whatside, BOOL_OP operation );
//! get link that is not vertical.
KBoolLink* GetNotFlat();
kbLink* GetNotFlat();
//! get a link to a hole or from a hole.
KBoolLink* GetHoleLink( KBoolLink* const prev, bool checkbin, BOOL_OP operation );
kbLink* GetHoleLink( kbLink* const prev, bool checkbin, BOOL_OP operation );
int Merge( Node* );
void RemoveLink( KBoolLink* );
bool Simplify( Node* First, Node* Second, B_INT Marge );
int Merge( kbNode* );
void RemoveLink( kbLink* );
bool Simplify( kbNode* First, kbNode* Second, B_INT Marge );
// memberfunctions for maximum performance
void RoundInt( B_INT grid );
KBoolLink* GetIncomingLink();
kbLink* GetIncomingLink();
int GetNumberOfLinks();
KBoolLink* GetNextLink();
KBoolLink* GetOtherLink( KBoolLink* );
KBoolLink* GetOutgoingLink();
KBoolLink* GetPrevLink();
kbLink* GetNextLink();
kbLink* GetOtherLink( kbLink* );
kbLink* GetOutgoingLink();
kbLink* GetPrevLink();
KBoolLink* Follow( KBoolLink* const prev );
KBoolLink* GetBinHighest( bool binset );
kbLink* Follow( kbLink* const prev );
kbLink* GetBinHighest( bool binset );
protected:
DL_List<void*>* _linklist;
......
......@@ -5,13 +5,13 @@
Licence: see kboollicense.txt
RCS-ID: $Id: record.h,v 1.3 2008/06/04 21:23:22 titato Exp $
RCS-ID: $Id: record.h,v 1.4 2009/09/07 19:23:28 titato Exp $
*/
#ifndef RECORD_H
#define RECORD_H
class Node;
class kbNode;
#include "kbool/booleng.h"
#include "kbool/link.h"
......@@ -24,30 +24,30 @@ enum DIRECTION {GO_LEFT, GO_RIGHT};
//extern void DeleteRecordPool();
class A2DKBOOLDLLEXP Bool_Engine;
class A2DKBOOLDLLEXP Record
class A2DKBOOLDLLEXP kbRecord
{
protected:
Bool_Engine* _GC;
public:
// void deletepool();
Record( KBoolLink* link, Bool_Engine* GC );
kbRecord( kbLink* link, Bool_Engine* GC );
~Record();
~kbRecord();
// void* operator new(size_t size);
// void operator delete(void* recordptr);
void SetNewLink( KBoolLink* link );
void SetNewLink( kbLink* link );
void Set_Flags();
void Calc_Ysp( Node* low );
void Calc_Ysp( kbNode* low );
KBoolLink* GetLink();
kbLink* GetLink();
KBoolLine* GetLine();
kbLine* GetLine();
B_INT Ysp();
......@@ -55,12 +55,12 @@ public:
DIRECTION Direction();
bool Calc_Left_Right( Record* record_above_me );
bool Calc_Left_Right( kbRecord* record_above_me );
bool Equal( Record* );
bool Equal( kbRecord* );
private:
KBoolLine _line;
kbLine _line;
B_INT _ysp;
......
......@@ -5,7 +5,7 @@
Licence: see kboollicense.txt
RCS-ID: $Id: scanbeam.h,v 1.4 2008/09/05 19:01:14 titato Exp $
RCS-ID: $Id: scanbeam.h,v 1.5 2009/09/07 19:23:28 titato Exp $
*/
#ifndef SCANBEAM_H
......@@ -20,10 +20,10 @@
enum SCANTYPE{NODELINK, LINKLINK, GENLR, LINKHOLES, INOUT};
#if defined(WXART2D_USINGDLL)
template class A2DKBOOLDLLEXP DL_Iter<Record*>;
template class A2DKBOOLDLLEXP DL_Iter<kbRecord*>;
#endif
class A2DKBOOLDLLEXP ScanBeam : public DL_List<Record*>
class A2DKBOOLDLLEXP ScanBeam : public DL_List<kbRecord*>
{
protected:
Bool_Engine* _GC;
......@@ -31,26 +31,26 @@ protected:
public:
ScanBeam( Bool_Engine* GC );
~ScanBeam();
void SetType( Node* low, Node* high );
void SetType( kbNode* low, kbNode* high );
bool FindNew( SCANTYPE scantype, TDLI<KBoolLink>* _I, bool& holes );
bool RemoveOld( SCANTYPE scantype, TDLI<KBoolLink>* _I, bool& holes );
bool FindNew( SCANTYPE scantype, TDLI<kbLink>* _I, bool& holes );
bool RemoveOld( SCANTYPE scantype, TDLI<kbLink>* _I, bool& holes );
private:
bool ProcessHoles( bool atinsert, TDLI<KBoolLink>* _LI );
bool ProcessHoles( bool atinsert, TDLI<kbLink>* _LI );
int Process_LinkToLink_Crossings(); // find crossings
int Process_PointToLink_Crossings();
int Process_LinkToLink_Flat( KBoolLine* flatline );
int Process_LinkToLink_Flat( kbLine* flatline );
void SortTheBeam( bool backangle );
bool checksort();
bool writebeam();
void Calc_Ysp();
//int FindCloseLinksAndCross(TDLI<KBoolLink>* _I,Node* _lowf);
//int FindCloseLinksAndCross(TDLI<kbLink>* _I,kbNode* _lowf);
void Generate_INOUT( int graphnumber );
Node* _low;
DL_Iter<Record*> _BI;
kbNode* _low;
DL_Iter<kbRecord*> _BI;
int lastinserted;
BEAM_TYPE _type;
};
......
......@@ -3,12 +3,12 @@
Copyright: 2001-2004 (C) Probably Klaas Holwerda
Licence: wxWidgets Licence
Licence: see kboollicense.txt
RCS-ID: $Id: statusb.h,v 1.2 2006/12/15 21:00:06 titato Exp $
RCS-ID: $Id: statusb.h,v 1.3 2009/02/06 21:33:03 titato Exp $
*/
/* @@(#) $Source: /cvsroot/wxart2d/wxArt2D/thirdparty/kbool/include/kbool/statusb.h,v $ $Revision: 1.2 $ $Date: 2006/12/15 21:00:06 $ */
/* @@(#) $Source: /cvsroot/wxart2d/wxArt2D/thirdparty/kbool/include/kbool/statusb.h,v $ $Revision: 1.3 $ $Date: 2009/02/06 21:33:03 $ */
/*
Program STATUSB.H
......
......@@ -3,7 +3,7 @@
Copyright: 2001-2004 (C) Probably Klaas Holwerda
Licence: wxWidgets Licence
Licence: see kboollicense.txt
RCS-ID: $Id: valuesvc.h,v 1.1 2006/11/04 21:49:01 titato Exp $
RCS-ID: $Id: valuesvc.h,v 1.2 2009/02/06 21:33:03 titato Exp $
*/
This diff is collapsed.
......@@ -3,28 +3,24 @@
Copyright: 2001-2004 (C) Probably Klaas Holwerda
Licence: wxWidgets Licence
Licence: see kboollicense.txt
RCS-ID: $Id: boolonly.h,v 1.5 2005/05/24 19:13:38 titato Exp $
RCS-ID: $Id: boolonly.h,v 1.5 2009/02/06 21:33:03 titato Exp $
*/
#ifdef __GNUG__
#pragma implementation
#endif
#include "kbool/include/_lnk_itr.h"
#include "kbool/include/booleng.h"
#include "kbool/booleng.h"
#include "kbool/_lnk_itr.h"
class KBoolPoint
{
public:
public:
KBoolPoint();
KBoolPoint(double const ,double const);
KBoolPoint( double const , double const );
double GetX();
double GetY();
private:
private:
double _x;
double _y;
......
mondrian ICON "sample.ico"
#include "wx/msw/wx.rc"
......@@ -5,7 +5,7 @@
Licence: see kboollicense.txt
RCS-ID: $Id: booleng.cpp,v 1.3 2008/06/04 21:23:22 titato Exp $
RCS-ID: $Id: booleng.cpp,v 1.5 2009/09/07 19:23:28 titato Exp $
*/
#include "kbool/booleng.h"
......@@ -38,19 +38,10 @@ B_INT babs( B_INT a )
//----------------- Bool_Engine_Error -------------------------------/
//-------------------------------------------------------------------/
Bool_Engine_Error::Bool_Engine_Error( const char* message, const char* header, int degree, int fatal )
Bool_Engine_Error::Bool_Engine_Error( string message, string header, int degree, int fatal )
{
_message = new char[LINELENGTH];
_header = new char[LINELENGTH];
if ( message )
strcpy( _message, message );
else
strcpy( _message, "non specified" );
if ( header )
strcpy( _header, header );
else
strcpy( _header, "non specified" );
_message = message;
_header = header;
_degree = degree;
_fatal = fatal;
......@@ -59,17 +50,8 @@ Bool_Engine_Error::Bool_Engine_Error( const char* message, const char* header, i
Bool_Engine_Error::Bool_Engine_Error( const Bool_Engine_Error& a )
{
_message = new char[LINELENGTH];
_header = new char[LINELENGTH];
if ( a._message )
strcpy( _message, a._message );
else
strcpy( _message, "non specified" );
if ( a._header )
strcpy( _header, a._header );
else
strcpy( _header, "non specified" );
_message = a._message;
_header = a._header;
_degree = a._degree;
_fatal = a._fatal;
......@@ -78,18 +60,16 @@ Bool_Engine_Error::Bool_Engine_Error( const Bool_Engine_Error& a )
Bool_Engine_Error::~Bool_Engine_Error()
{
strcpy( _message, "" );
strcpy( _header, "" );
delete _message;
delete _header;
_message = "";
_header = "";
}
char* Bool_Engine_Error::GetErrorMessage()
string Bool_Engine_Error::GetErrorMessage()
{
return _message;
}
char* Bool_Engine_Error::GetHeaderMessage()
string Bool_Engine_Error::GetHeaderMessage()
{
return _header;
}
......@@ -110,13 +90,13 @@ int Bool_Engine_Error::GetFatal()
Bool_Engine::Bool_Engine()
{
_linkiter = new TDLI<KBoolLink>();
_linkiter = new TDLI<kbLink>();
m_intersectionruns = 1;
m_orientationEntryMode = false;
m_doLinkHoles = true;
m_graphlist = new GraphList( this );
m_graphlist = new kbGraphList( this );
m_ACCUR = 1e-4;
m_WINDINGRULE = true;
m_GraphToAdd = NULL;
......@@ -173,19 +153,19 @@ void Bool_Engine::SetLog( bool OnOff )
}
}
void Bool_Engine::SetState( const char* process )
void Bool_Engine::SetState( string process )
{
Write_Log( process );
}
void Bool_Engine::error( const char *text, const char *title )
void Bool_Engine::error( string text, string title )
{
Write_Log( "FATAL ERROR: ", title );
Write_Log( "FATAL ERROR: ", text );
throw Bool_Engine_Error( " Fatal Error", "Fatal Error", 9, 1 );
};
void Bool_Engine::info( const char *text, const char *title )
void Bool_Engine::info( string text, string title )
{
Write_Log( "FATAL ERROR: ", title );
Write_Log( "FATAL ERROR: ", text );
......@@ -331,7 +311,7 @@ bool Bool_Engine::Do_Operation( BOOL_OP operation )
{
#if KBOOL_DEBUG
GraphList * saveme = new GraphList( m_graphlist );
kbGraphList * saveme = new kbGraphList( m_graphlist );
#endif
try
......@@ -366,7 +346,7 @@ bool Bool_Engine::Do_Operation( BOOL_OP operation )
#if KBOOL_DEBUG
delete m_graphlist;
m_graphlist = new GraphList( saveme );
m_graphlist = new kbGraphList( saveme );
m_graphlist->WriteGraphsKEY( this );
#endif
......@@ -384,7 +364,7 @@ bool Bool_Engine::Do_Operation( BOOL_OP operation )
#if KBOOL_DEBUG
delete m_graphlist;
m_graphlist = new GraphList( saveme );
m_graphlist = new kbGraphList( saveme );
m_graphlist->WriteGraphsKEY( this );
#endif
......@@ -414,7 +394,7 @@ bool Bool_Engine::StartPolygonAdd( GroupType A_or_B )
if ( m_GraphToAdd != NULL )
return false;
Graph *myGraph = new Graph( this );
kbGraph *myGraph = new kbGraph( this );
m_graphlist->insbegin( myGraph );
m_GraphToAdd = myGraph;
m_groupType = A_or_B;
......@@ -437,7 +417,7 @@ bool Bool_Engine::AddPoint( double x, double y )
B_INT rintx = ( ( B_INT ) ( x * m_DGRID ) ) * m_GRID;
B_INT rinty = ( ( B_INT ) ( y * m_DGRID ) ) * m_GRID;
Node *myNode = new Node( rintx, rinty, this );
kbNode *myNode = new kbNode( rintx, rinty, this );
// adding first point to graph
if ( m_firstNodeToAdd == NULL )
......@@ -451,8 +431,8 @@ bool Bool_Engine::AddPoint( double x, double y )
}
#endif
m_firstNodeToAdd = ( Node * ) myNode;
m_lastNodeToAdd = ( Node * ) myNode;
m_firstNodeToAdd = ( kbNode * ) myNode;
m_lastNodeToAdd = ( kbNode * ) myNode;
}
else
{
......@@ -466,7 +446,7 @@ bool Bool_Engine::AddPoint( double x, double y )
#endif
m_GraphToAdd->AddLink( m_lastNodeToAdd, myNode );
m_lastNodeToAdd = ( Node * ) myNode;
m_lastNodeToAdd = ( kbNode * ) myNode;
}
return true;
......@@ -489,7 +469,7 @@ bool Bool_Engine::StartPolygonGet()
{
if ( !m_graphlist->empty() )
{
m_getGraph = ( Graph* ) m_graphlist->headitem();
m_getGraph = ( kbGraph* ) m_graphlist->headitem();
m_getLink = m_getGraph->GetFirstLink();
m_getNode = m_getLink->GetBeginNode();
m_numPtsInPolygon = m_getGraph->GetNumberOfLinks();
......@@ -571,34 +551,34 @@ kbEdgeType Bool_Engine::GetPolygonPointEdgeType()
}
void Bool_Engine::Write_Log( const char *msg1 )
void Bool_Engine::Write_Log( string msg1 )
{
if ( m_logfile == NULL )
return;
fprintf( m_logfile, "%s \n", msg1 );
fprintf( m_logfile, "%s \n", msg1.c_str() );
}
void Bool_Engine::Write_Log( const char *msg1, const char*msg2 )
void Bool_Engine::Write_Log( string msg1, string msg2 )
{
if ( m_logfile == NULL )
return;
fprintf( m_logfile, "%s %s\n", msg1, msg2 );
fprintf( m_logfile, "%s %s\n", msg1.c_str(), msg2.c_str() );
}
void Bool_Engine::Write_Log( const char *fmt, double dval )
void Bool_Engine::Write_Log( string fmt, double dval )
{
if ( m_logfile == NULL )
return;
fprintf( m_logfile, fmt, dval );
fprintf( m_logfile, fmt.c_str(), dval );
}
void Bool_Engine::Write_Log( const char *fmt, B_INT bval )
void Bool_Engine::Write_Log( string fmt, B_INT bval )
{
if ( m_logfile == NULL )
return;
fprintf( m_logfile, fmt, bval );
fprintf( m_logfile, fmt.c_str(), bval );
}
This diff is collapsed.
......@@ -17,37 +17,37 @@
//this here is to initialize the static iterator of graphlist
//with NOLIST constructor
int graphsorterX( Graph *, Graph * );
int graphsorterY( Graph *, Graph * );
int graphsorterX( kbGraph *, kbGraph * );
int graphsorterY( kbGraph *, kbGraph * );
GraphList::GraphList( Bool_Engine* GC )
kbGraphList::kbGraphList( Bool_Engine* GC )
{
_GC = GC;
}
GraphList::GraphList( GraphList* other )
kbGraphList::kbGraphList( kbGraphList* other )
{
_GC = other->_GC;
TDLI<Graph> _LI = TDLI<Graph>( other );
TDLI<kbGraph> _LI = TDLI<kbGraph>( other );
_LI.tohead();
while ( !_LI.hitroot() )
{
insend( new Graph( _LI.item() ) );
insend( new kbGraph( _LI.item() ) );
_LI++;
}
}
GraphList::~GraphList()
kbGraphList::~kbGraphList()
{
TDLI<Graph> _LI = TDLI<Graph>( this );
TDLI<kbGraph> _LI = TDLI<kbGraph>( this );
//first empty the graph
_LI.delete_all();
}
//prepare the graphlist for the boolean operations
//group all graphs into ONE graph
void GraphList::Prepare( Graph* total )
void kbGraphList::Prepare( kbGraph* total )
{
if ( empty() )
return;
......@@ -60,7 +60,7 @@ void GraphList::Prepare( Graph* total )
if ( ! _GC->GetOrientationEntryMode() )
{
TDLI<Graph> _LI = TDLI<Graph>( this );
TDLI<kbGraph> _LI = TDLI<kbGraph>( this );
_LI.tohead();
while ( !_LI.hitroot() )
{
......@@ -78,9 +78,9 @@ void GraphList::Prepare( Graph* total )
// the function will make from all the graphs in the graphlist one graph,
// simply by throwing all the links in one graph, the graphnumbers will
// not be changed
void GraphList::MakeOneGraph( Graph* total )
void kbGraphList::MakeOneGraph( kbGraph* total )
{
TDLI<Graph> _LI = TDLI<Graph>( this );
TDLI<kbGraph> _LI = TDLI<kbGraph>( this );
_LI.tohead();
while( !_LI.hitroot() )
{
......@@ -93,11 +93,11 @@ void GraphList::MakeOneGraph( Graph* total )
//
// Renumber all the graphs
//
void GraphList::Renumber()
void kbGraphList::Renumber()
{
if ( _GC->GetOrientationEntryMode() )
{
TDLI<Graph> _LI = TDLI<Graph>( this );
TDLI<kbGraph> _LI = TDLI<kbGraph>( this );
_LI.tohead();
while ( !_LI.hitroot() )
{
......@@ -111,7 +111,7 @@ void GraphList::Renumber()
else
{
unsigned int Number = 1;
TDLI<Graph> _LI = TDLI<Graph>( this );
TDLI<kbGraph> _LI = TDLI<kbGraph>( this );
_LI.tohead();
while ( !_LI.hitroot() )
{
......@@ -123,10 +123,10 @@ void GraphList::Renumber()
// Simplify the graphs
void GraphList::Simplify( double marge )
void kbGraphList::Simplify( double marge )
{
TDLI<Graph> _LI = TDLI<Graph>( this );
_LI.foreach_mf( &Graph::Reset_Mark_and_Bin );
TDLI<kbGraph> _LI = TDLI<kbGraph>( this );
_LI.foreach_mf( &kbGraph::Reset_Mark_and_Bin );
_LI.tohead();
while ( !_LI.hitroot() )
......@@ -146,10 +146,10 @@ void GraphList::Simplify( double marge )
}
// Smoothen the graphs
void GraphList::Smoothen( double marge )
void kbGraphList::Smoothen( double marge )
{
TDLI<Graph> _LI = TDLI<Graph>( this );
_LI.foreach_mf( &Graph::Reset_Mark_and_Bin );
TDLI<kbGraph> _LI = TDLI<kbGraph>( this );
_LI.foreach_mf( &kbGraph::Reset_Mark_and_Bin );
_LI.tohead();
while ( !_LI.hitroot() )
......@@ -170,10 +170,10 @@ void GraphList::Smoothen( double marge )
// Turn off all markers in all the graphs
void GraphList::UnMarkAll()
void kbGraphList::UnMarkAll()
{
TDLI<Graph> _LI = TDLI<Graph>( this );
_LI.foreach_mf( &Graph::Reset_Mark_and_Bin );
TDLI<kbGraph> _LI = TDLI<kbGraph>( this );
_LI.foreach_mf( &kbGraph::Reset_Mark_and_Bin );
}
//==============================================================================
......@@ -182,9 +182,9 @@ void GraphList::UnMarkAll()
//
//==============================================================================
void GraphList::Correction()
void kbGraphList::Correction()
{
TDLI<Graph> _LI = TDLI<Graph>( this );
TDLI<kbGraph> _LI = TDLI<kbGraph>( this );
int todo = _LI.count();
if ( _GC->GetInternalCorrectionFactor() ) //not zero
......@@ -193,7 +193,7 @@ void GraphList::Correction()
for( int i = 0; i < todo ; i++ )
{
//the input graph will be empty in the end
GraphList *_correct = new GraphList( _GC );
kbGraphList *_correct = new kbGraphList( _GC );
{
_LI.item()->MakeClockWise();
_LI.item()->Correction( _correct, _GC->GetInternalCorrectionFactor() );
......@@ -205,7 +205,7 @@ void GraphList::Correction()
while ( !_correct->empty() )
{
//add to end
_LI.insend( ( Graph* )_correct->headitem() );
_LI.insend( ( kbGraph* )_correct->headitem() );
_correct->removehead();
}
}
......@@ -214,16 +214,16 @@ void GraphList::Correction()
}
}
void GraphList::MakeRings()
void kbGraphList::MakeRings()
{
TDLI<Graph> _LI = TDLI<Graph>( this );
TDLI<kbGraph> _LI = TDLI<kbGraph>( this );
int todo = _LI.count();
_LI.tohead();
for( int i = 0; i < todo ; i++ )
{
//the input graph will be empty in the end
GraphList *_ring = new GraphList( _GC );
kbGraphList *_ring = new kbGraphList( _GC );
{
_LI.item()->MakeClockWise();
_LI.item()->MakeRing( _ring, _GC->GetInternalCorrectionFactor() );
......@@ -235,8 +235,8 @@ void GraphList::MakeRings()
while ( !_ring->empty() )
{
//add to end
( ( Graph* )_ring->headitem() )->MakeClockWise();
_LI.insend( ( Graph* )_ring->headitem() );
( ( kbGraph* )_ring->headitem() )->MakeClockWise();
_LI.insend( ( kbGraph* )_ring->headitem() );
_ring->removehead();
}
}
......@@ -246,13 +246,13 @@ void GraphList::MakeRings()
}
//merge the graphs in the list and return the merged result
void GraphList::Merge()
void kbGraphList::Merge()
{
if ( count() <= 1 )
return;
{
TDLI<Graph> _LI = TDLI<Graph>( this );
TDLI<kbGraph> _LI = TDLI<kbGraph>( this );
_LI.tohead();
while ( !_LI.hitroot() )
{
......@@ -261,7 +261,7 @@ void GraphList::Merge()
}
}
Graph* _tomerge = new Graph( _GC );
kbGraph* _tomerge = new kbGraph( _GC );
Renumber();
......@@ -279,14 +279,14 @@ void GraphList::Merge()
#define SAVEME 1
//perform boolean operation on the graphs in the list
void GraphList::Boolean( BOOL_OP operation, int intersectionRunsMax )
void kbGraphList::Boolean( BOOL_OP operation, int intersectionRunsMax )
{
_GC->SetState( "Performing Boolean Operation" );
if ( count() == 0 )
return;
Graph* _prepared = new Graph( _GC );
kbGraph* _prepared = new kbGraph( _GC );
if ( empty() )
return;
......@@ -345,9 +345,9 @@ void GraphList::Boolean( BOOL_OP operation, int intersectionRunsMax )
}
void GraphList::WriteGraphs()
void kbGraphList::WriteGraphs()
{
TDLI<Graph> _LI = TDLI<Graph>( this );
TDLI<kbGraph> _LI = TDLI<kbGraph>( this );
_LI.tohead();
while( !_LI.hitroot() )
{
......@@ -356,7 +356,7 @@ void GraphList::WriteGraphs()
}
}
void GraphList::WriteGraphsKEY( Bool_Engine* GC )
void kbGraphList::WriteGraphsKEY( Bool_Engine* GC )
{
FILE * file = fopen( "graphkeyfile.key", "w" );
......@@ -375,7 +375,7 @@ void GraphList::WriteGraphsKEY( Bool_Engine* GC )
STRNAME top; \
");
TDLI<Graph> _LI=TDLI<Graph>(this);
TDLI<kbGraph> _LI=TDLI<kbGraph>(this);
_LI.tohead();
while(!_LI.hitroot())
{
......
......@@ -3,9 +3,9 @@
Copyright: 2001-2004 (C) Probably Klaas Holwerda
Licence: wxWidgets Licence
Licence: see kboollicense.txt
RCS-ID: $Id: instonly.cpp,v 1.2 2006/11/05 14:59:31 titato Exp $
RCS-ID: $Id: instonly.cpp,v 1.3 2009/02/06 21:33:03 titato Exp $
*/
#ifdef __GNUG__
......
This diff is collapsed.
This diff is collapsed.
/*! \file src/lpoint.cpp
\brief Definition of GDSII LPoint type structure
\brief Definition of GDSII kbLPoint type structure
\author Klaas Holwerda
Copyright: 2001-2004 (C) Klaas Holwerda
......@@ -13,73 +13,73 @@
#include <math.h>
// Constructors
LPoint::LPoint()
kbLPoint::kbLPoint()
{
_x = 0;
_y = 0;
}
LPoint::LPoint( B_INT const X, B_INT const Y )
kbLPoint::kbLPoint( B_INT const X, B_INT const Y )
{
_x = X;
_y = Y;
}
LPoint::LPoint( LPoint* const a_point )
kbLPoint::kbLPoint( kbLPoint* const a_point )
{
if ( !a_point )
throw Bool_Engine_Error( "Cannot copy a NULL Point Object.\n\nCould not create a LPoint Object.",
throw Bool_Engine_Error( "Cannot copy a NULL Point Object.\n\nCould not create a kbLPoint Object.",
"Fatal Creation Error", 0, 1 );
_x = a_point->_x;
_y = a_point->_y;
}
B_INT LPoint::GetX()
B_INT kbLPoint::GetX()
{
return _x;
}
B_INT LPoint::GetY()
B_INT kbLPoint::GetY()
{
return _y;
}
void LPoint::SetX( B_INT a_point_x )
void kbLPoint::SetX( B_INT a_point_x )
{
_x = a_point_x;
}
void LPoint::SetY( B_INT a_point_y )
void kbLPoint::SetY( B_INT a_point_y )
{
_y = a_point_y;
}
LPoint LPoint::GetPoint()
kbLPoint kbLPoint::GetPoint()
{
return * this;
}
void LPoint::Set( const B_INT X, const B_INT Y )
void kbLPoint::Set( const B_INT X, const B_INT Y )
{
_x = X;
_y = Y;
}
void LPoint::Set( const LPoint &a_point )
void kbLPoint::Set( const kbLPoint &a_point )
{
_x = a_point._x;
_y = a_point._y;
}
bool LPoint::Equal( const LPoint a_point, B_INT Marge )
bool kbLPoint::Equal( const kbLPoint a_point, B_INT Marge )
{
B_INT delta_x, delta_y;
......@@ -93,12 +93,12 @@ bool LPoint::Equal( const LPoint a_point, B_INT Marge )
}
bool LPoint::Equal( const B_INT X, const B_INT Y, B_INT Marge )
bool kbLPoint::Equal( const B_INT X, const B_INT Y, B_INT Marge )
{
return ( bool )( ( babs( _x - X ) <= Marge ) && ( babs( _y - Y ) <= Marge ) );
}
bool LPoint::ShorterThan( const LPoint a_point, B_INT Marge )
bool kbLPoint::ShorterThan( const kbLPoint a_point, B_INT Marge )
{
double a, b;
a = ( double ) ( a_point._x - _x );
......@@ -110,7 +110,7 @@ bool LPoint::ShorterThan( const LPoint a_point, B_INT Marge )
}
bool LPoint::ShorterThan( const B_INT X, const B_INT Y, B_INT Marge )
bool kbLPoint::ShorterThan( const B_INT X, const B_INT Y, B_INT Marge )
{
double a, b;
a = ( double ) ( X - _x );
......@@ -125,7 +125,7 @@ bool LPoint::ShorterThan( const B_INT X, const B_INT Y, B_INT Marge )
// overload the assign (=) operator
// usage : a_point = another_point;
LPoint &LPoint::operator=( const LPoint &other_point )
kbLPoint &kbLPoint::operator=( const kbLPoint &other_point )
{
_x = other_point._x;
_y = other_point._y;
......@@ -136,7 +136,7 @@ LPoint &LPoint::operator=( const LPoint &other_point )
// overload the + operator
// usage : a_point = point1 + point2;
LPoint &LPoint::operator+( const LPoint &other_point )
kbLPoint &kbLPoint::operator+( const kbLPoint &other_point )
{
_x += other_point._x;
_y += other_point._y;
......@@ -148,7 +148,7 @@ LPoint &LPoint::operator+( const LPoint &other_point )
// overload the - operator
// usage : a_point = point1 - point2;
LPoint &LPoint::operator-( const LPoint &other_point )
kbLPoint &kbLPoint::operator-( const kbLPoint &other_point )
{
_x -= other_point._x;
_y -= other_point._y;
......@@ -159,7 +159,7 @@ LPoint &LPoint::operator-( const LPoint &other_point )
// overload the * operator
// usage: a_point = point1 * 100;
LPoint &LPoint::operator*( int factor )
kbLPoint &kbLPoint::operator*( int factor )
{
_x *= factor;
_y *= factor;
......@@ -170,7 +170,7 @@ LPoint &LPoint::operator*( int factor )
// overload the / operator
// usage: a_point = point1 / 100;
LPoint &LPoint::operator/( int factor )
kbLPoint &kbLPoint::operator/( int factor )
{
_x /= factor;
_y /= factor;
......@@ -181,7 +181,7 @@ LPoint &LPoint::operator/( int factor )
// overload the compare (==) operator
// usage: if (point1 == point2) { };
int LPoint::operator==( const LPoint &other_point ) const
int kbLPoint::operator==( const kbLPoint &other_point ) const
{
return ( ( other_point._x == _x ) && ( other_point._y == _y ) );
}
......@@ -190,7 +190,7 @@ int LPoint::operator==( const LPoint &other_point ) const
// overload the diffrent (!=) operator
// usage: if (point1 != point2) { };
int LPoint::operator!=( const LPoint &other_point ) const
int kbLPoint::operator!=( const kbLPoint &other_point ) const
{
return ( ( other_point._x != _x ) || ( other_point._y != _y ) );
}
......
This diff is collapsed.
......@@ -5,7 +5,7 @@
Licence: see kboollicense.txt
RCS-ID: $Id: record.cpp,v 1.3 2008/06/04 21:23:22 titato Exp $
RCS-ID: $Id: record.cpp,v 1.4 2009/09/07 19:23:28 titato Exp $
*/
#include "kbool/booleng.h"
......@@ -28,11 +28,11 @@
// }
//}
Record::~Record()
kbRecord::~kbRecord()
{}
//void* Record::operator new(size_t size)
//void* kbRecord::operator new(size_t size)
//{
//
// if (r_index!=-1)
......@@ -43,7 +43,7 @@ Record::~Record()
// return malloc(size);
//}
//void Record::operator delete(void* recordptr)
//void kbRecord::operator delete(void* recordptr)
//{
//
// if (r_index < 28)
......@@ -55,7 +55,7 @@ Record::~Record()
// free (recordptr);
//}
//void Record::deletepool()
//void kbRecord::deletepool()
//{
//
// while (r_index!=-1)
......@@ -64,7 +64,7 @@ Record::~Record()
// }
//}
Record::Record( KBoolLink* link, Bool_Engine* GC )
kbRecord::kbRecord( kbLink* link, Bool_Engine* GC )
: _line( GC )
{
_GC = GC;
......@@ -77,14 +77,14 @@ Record::Record( KBoolLink* link, Bool_Engine* GC )
//when the dimensions of a link for a record changes, its line parameters need to be recalculated
void Record::SetNewLink( KBoolLink* link )
void kbRecord::SetNewLink( kbLink* link )
{
_line.Set( link );
_line.CalculateLineParameters();
}
//for beams calculate the ysp on the low scanline
void Record::Calc_Ysp( Node* low )
void kbRecord::Calc_Ysp( kbNode* low )
{
if ( ( LNK->GetEndNode() == low ) || ( LNK->GetBeginNode() == low ) )
{
......@@ -103,7 +103,7 @@ void Record::Calc_Ysp( Node* low )
}
//to set the _dir for new links in the beam
void Record::Set_Flags()
void kbRecord::Set_Flags()
{
if ( LNK->GetEndNode()->GetX() == LNK->GetBeginNode()->GetX() ) //flatlink ?
{ //only happens in flat beams
......@@ -121,27 +121,27 @@ void Record::Set_Flags()
}
}
KBoolLink* Record::GetLink()
kbLink* kbRecord::GetLink()
{
return LNK;
}
B_INT Record::Ysp()
B_INT kbRecord::Ysp()
{
return _ysp;
}
void Record::SetYsp( B_INT ysp )
void kbRecord::SetYsp( B_INT ysp )
{
_ysp = ysp;
}
DIRECTION Record::Direction()
DIRECTION kbRecord::Direction()
{
return DIRECTION( _dir );
}
bool Record::Calc_Left_Right( Record* record_above_me )
bool kbRecord::Calc_Left_Right( kbRecord* record_above_me )
{
bool par = false;
......@@ -337,14 +337,14 @@ bool Record::Calc_Left_Right( Record* record_above_me )
return par;
}
bool Record::Equal( Record *a )
bool kbRecord::Equal( kbRecord *a )
{
return( ( bool )( ( LNK->GetOther( a->LNK->GetBeginNode() ) == a->LNK->GetEndNode() ) &&
( LNK->GetOther( a->LNK->GetEndNode() ) == a->LNK->GetBeginNode() ) ) );
}
KBoolLine* Record::GetLine()
kbLine* kbRecord::GetLine()
{
return & _line;
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment