2013-07-28 22:08:34 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Anything relating to plane polygons and triangles, and (generally, non-
|
|
|
|
// planar) meshes thereof.
|
|
|
|
//
|
|
|
|
// Copyright 2008-2013 Jonathan Westhues.
|
|
|
|
//-----------------------------------------------------------------------------
|
2008-04-23 07:29:19 +00:00
|
|
|
|
|
|
|
#ifndef __POLYGON_H
|
|
|
|
#define __POLYGON_H
|
|
|
|
|
2009-07-07 08:21:59 +00:00
|
|
|
class SPointList;
|
2008-04-25 07:04:09 +00:00
|
|
|
class SPolygon;
|
2008-06-21 10:18:20 +00:00
|
|
|
class SContour;
|
2008-05-22 10:28:28 +00:00
|
|
|
class SMesh;
|
2008-05-24 10:34:06 +00:00
|
|
|
class SBsp3;
|
2008-04-25 07:04:09 +00:00
|
|
|
|
2008-04-24 06:22:16 +00:00
|
|
|
class SEdge {
|
2008-04-23 07:29:19 +00:00
|
|
|
public:
|
2008-04-25 07:04:09 +00:00
|
|
|
int tag;
|
2009-01-25 11:52:29 +00:00
|
|
|
int auxA, auxB;
|
2008-04-24 06:22:16 +00:00
|
|
|
Vector a, b;
|
2008-05-30 08:01:19 +00:00
|
|
|
|
|
|
|
static SEdge From(Vector a, Vector b);
|
2009-11-09 11:51:38 +00:00
|
|
|
bool EdgeCrosses(Vector a, Vector b, Vector *pi=NULL, SPointList *spl=NULL);
|
2008-04-24 06:22:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SEdgeList {
|
|
|
|
public:
|
2009-01-13 06:56:05 +00:00
|
|
|
List<SEdge> l;
|
2008-04-24 06:22:16 +00:00
|
|
|
|
2008-05-22 10:28:28 +00:00
|
|
|
void Clear(void);
|
2009-01-25 11:52:29 +00:00
|
|
|
void AddEdge(Vector a, Vector b, int auxA=0, int auxB=0);
|
2009-01-25 09:19:59 +00:00
|
|
|
bool AssemblePolygon(SPolygon *dest, SEdge *errorAt, bool keepDir=false);
|
2008-06-21 10:18:20 +00:00
|
|
|
bool AssembleContour(Vector first, Vector last, SContour *dest,
|
2009-01-25 09:19:59 +00:00
|
|
|
SEdge *errorAt, bool keepDir);
|
2009-07-07 08:21:59 +00:00
|
|
|
int AnyEdgeCrossings(Vector a, Vector b,
|
|
|
|
Vector *pi=NULL, SPointList *spl=NULL);
|
2009-06-30 04:38:40 +00:00
|
|
|
bool ContainsEdgeFrom(SEdgeList *sel);
|
|
|
|
bool ContainsEdge(SEdge *se);
|
2009-03-15 23:04:45 +00:00
|
|
|
void CullExtraneousEdges(void);
|
2009-04-08 04:54:07 +00:00
|
|
|
void MergeCollinearSegments(Vector a, Vector b);
|
2008-04-25 07:04:09 +00:00
|
|
|
};
|
|
|
|
|
2009-11-09 11:51:38 +00:00
|
|
|
// A kd-tree element needs to go on a side of a node if it's when KDTREE_EPS
|
|
|
|
// of the boundary. So increasing this number never breaks anything, but may
|
|
|
|
// result in more duplicated elements. So it's conservative to be sloppy here.
|
|
|
|
#define KDTREE_EPS (20*LENGTH_EPS)
|
|
|
|
|
|
|
|
class SEdgeLl {
|
|
|
|
public:
|
|
|
|
SEdge *se;
|
|
|
|
SEdgeLl *next;
|
|
|
|
|
|
|
|
static SEdgeLl *Alloc(void);
|
|
|
|
};
|
|
|
|
|
|
|
|
class SKdNodeEdges {
|
|
|
|
public:
|
|
|
|
int which; // whether c is x, y, or z
|
|
|
|
double c;
|
|
|
|
SKdNodeEdges *gt;
|
|
|
|
SKdNodeEdges *lt;
|
|
|
|
|
|
|
|
SEdgeLl *edges;
|
|
|
|
|
|
|
|
static SKdNodeEdges *From(SEdgeList *sel);
|
|
|
|
static SKdNodeEdges *From(SEdgeLl *sell);
|
|
|
|
static SKdNodeEdges *Alloc(void);
|
|
|
|
int AnyEdgeCrossings(Vector a, Vector b, int cnt,
|
|
|
|
Vector *pi=NULL, SPointList *spl=NULL);
|
|
|
|
};
|
|
|
|
|
2008-04-25 07:04:09 +00:00
|
|
|
class SPoint {
|
|
|
|
public:
|
|
|
|
int tag;
|
2009-01-21 05:04:38 +00:00
|
|
|
|
2013-09-09 19:50:32 +00:00
|
|
|
enum {
|
|
|
|
UNKNOWN = 0,
|
|
|
|
NOT_EAR = 1,
|
|
|
|
EAR = 2
|
|
|
|
};
|
2009-01-21 05:04:38 +00:00
|
|
|
int ear;
|
|
|
|
|
2008-04-25 07:04:09 +00:00
|
|
|
Vector p;
|
2009-06-21 09:02:36 +00:00
|
|
|
Vector auxv;
|
2008-04-23 07:29:19 +00:00
|
|
|
};
|
|
|
|
|
2009-06-19 07:56:33 +00:00
|
|
|
class SPointList {
|
|
|
|
public:
|
|
|
|
List<SPoint> l;
|
|
|
|
|
|
|
|
void Clear(void);
|
|
|
|
bool ContainsPoint(Vector pt);
|
2009-10-12 11:34:43 +00:00
|
|
|
int IndexForPoint(Vector pt);
|
2009-06-27 05:53:56 +00:00
|
|
|
void IncrementTagFor(Vector pt);
|
2009-06-19 07:56:33 +00:00
|
|
|
void Add(Vector pt);
|
|
|
|
};
|
|
|
|
|
2008-04-23 07:29:19 +00:00
|
|
|
class SContour {
|
|
|
|
public:
|
2009-01-19 03:33:15 +00:00
|
|
|
int tag;
|
2009-01-21 05:04:38 +00:00
|
|
|
int timesEnclosed;
|
2009-01-22 10:02:46 +00:00
|
|
|
Vector xminPt;
|
2009-01-13 06:56:05 +00:00
|
|
|
List<SPoint> l;
|
2008-05-02 10:54:22 +00:00
|
|
|
|
2008-06-21 10:18:20 +00:00
|
|
|
void AddPoint(Vector p);
|
2008-05-02 10:54:22 +00:00
|
|
|
void MakeEdgesInto(SEdgeList *el);
|
2008-05-05 09:47:23 +00:00
|
|
|
void Reverse(void);
|
|
|
|
Vector ComputeNormal(void);
|
2010-03-01 17:23:57 +00:00
|
|
|
double SignedAreaProjdToNormal(Vector n);
|
2008-05-05 09:47:23 +00:00
|
|
|
bool IsClockwiseProjdToNormal(Vector n);
|
|
|
|
bool ContainsPointProjdToNormal(Vector n, Vector p);
|
2008-08-14 08:28:25 +00:00
|
|
|
void OffsetInto(SContour *dest, double r);
|
2009-01-21 05:04:38 +00:00
|
|
|
void CopyInto(SContour *dest);
|
2009-01-22 10:02:46 +00:00
|
|
|
void FindPointWithMinX(void);
|
2009-06-08 16:21:33 +00:00
|
|
|
Vector AnyEdgeMidpoint(void);
|
2009-01-21 05:04:38 +00:00
|
|
|
|
2009-08-21 04:58:28 +00:00
|
|
|
bool IsEar(int bp, double scaledEps);
|
2009-01-21 05:04:38 +00:00
|
|
|
bool BridgeToContour(SContour *sc, SEdgeList *el, List<Vector> *vl);
|
2009-08-21 04:58:28 +00:00
|
|
|
void ClipEarInto(SMesh *m, int bp, double scaledEps);
|
2009-02-27 14:05:08 +00:00
|
|
|
void UvTriangulateInto(SMesh *m, SSurface *srf);
|
2008-04-23 07:29:19 +00:00
|
|
|
};
|
|
|
|
|
2008-06-26 07:28:29 +00:00
|
|
|
typedef struct {
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
uint32_t face;
|
Replaced RGB-color integers with dedicated data structure
RGB colors were represented using a uint32_t with the red, green and blue
values stuffed into the lower three octets (i.e. 0x00BBGGRR), like
Microsoft's COLORREF. This approach did not lend itself to type safety,
however, so this change replaces it with an RgbColor class that provides
the same infomation plus a handful of useful methods to work with it. (Note
that sizeof(RgbColor) == sizeof(uint32_t), so this change should not lead
to memory bloat.)
Some of the new methods/fields replace what were previously macro calls;
e.g. RED(c) is now c.red, REDf(c) is now c.redF(). The .Equals() method is
now used instead of == to compare colors.
RGB colors still need to be represented as packed integers in file I/O and
preferences, so the methods .FromPackedInt() and .ToPackedInt() are
provided. Also implemented are Cnf{Freeze,Thaw}Color(), type-safe wrappers
around Cnf{Freeze,Thaw}Int() that facilitate I/O with preferences.
(Cnf{Freeze,Thaw}Color() are defined outside of the system-dependent code
to minimize the footprint of the latter; because the same can be done with
Cnf{Freeze,Thaw}Bool(), those are also moved out of the system code with
this commit.)
Color integers were being OR'ed with 0x80000000 in some places for two
distinct purposes: One, to indicate use of a default color in
glxFillMesh(); this has been replaced by use of the .UseDefault() method.
Two, to indicate to TextWindow::Printf() that the format argument of a
"%Bp"/"%Fp" specifier is an RGB color rather than a color "code" from
TextWindow::bgColors[] or TextWindow::fgColors[] (as the specifier can
accept either); instead, we define a new flag "z" (as in "%Bz" or "%Fz") to
indicate an RGBcolor pointer, leaving "%Bp"/"%Fp" to indicate a color code
exclusively.
(This also allows TextWindow::meta[][].bg to be a char instead of an int,
partly compensating for the new .bgRgb field added immediately after.)
In array declarations, RGB colors could previously be specified as 0 (often
in a terminating element). As that no longer works, we define NULL_COLOR,
which serves much the same purpose for RgbColor variables as NULL serves
for pointers.
2013-10-16 20:00:58 +00:00
|
|
|
RgbColor color;
|
2008-06-26 07:28:29 +00:00
|
|
|
} STriMeta;
|
|
|
|
|
2008-04-24 06:22:16 +00:00
|
|
|
class SPolygon {
|
|
|
|
public:
|
2009-01-13 06:56:05 +00:00
|
|
|
List<SContour> l;
|
2008-05-05 09:47:23 +00:00
|
|
|
Vector normal;
|
2008-04-25 07:04:09 +00:00
|
|
|
|
2008-05-05 09:47:23 +00:00
|
|
|
Vector ComputeNormal(void);
|
2008-04-25 07:04:09 +00:00
|
|
|
void AddEmptyContour(void);
|
2008-06-21 10:18:20 +00:00
|
|
|
int WindingNumberForPoint(Vector p);
|
2010-03-01 17:23:57 +00:00
|
|
|
double SignedArea(void);
|
2008-05-19 09:23:49 +00:00
|
|
|
bool ContainsPoint(Vector p);
|
2008-05-02 10:54:22 +00:00
|
|
|
void MakeEdgesInto(SEdgeList *el);
|
2008-05-05 09:47:23 +00:00
|
|
|
void FixContourDirections(void);
|
2008-04-25 07:04:09 +00:00
|
|
|
void Clear(void);
|
2009-01-23 03:30:30 +00:00
|
|
|
bool SelfIntersecting(Vector *intersectsAt);
|
2008-06-21 10:18:20 +00:00
|
|
|
bool IsEmpty(void);
|
|
|
|
Vector AnyPoint(void);
|
2008-08-14 08:28:25 +00:00
|
|
|
void OffsetInto(SPolygon *dest, double r);
|
2009-02-27 14:05:08 +00:00
|
|
|
void UvTriangulateInto(SMesh *m, SSurface *srf);
|
2009-05-08 08:33:04 +00:00
|
|
|
void UvGridTriangulateInto(SMesh *m, SSurface *srf);
|
2008-05-21 03:58:14 +00:00
|
|
|
};
|
2008-05-19 09:23:49 +00:00
|
|
|
|
2008-05-21 03:58:14 +00:00
|
|
|
class STriangle {
|
|
|
|
public:
|
2008-05-30 06:09:41 +00:00
|
|
|
int tag;
|
|
|
|
STriMeta meta;
|
|
|
|
Vector a, b, c;
|
2009-01-19 10:37:10 +00:00
|
|
|
Vector an, bn, cn;
|
2008-05-23 10:05:07 +00:00
|
|
|
|
2008-05-30 06:09:41 +00:00
|
|
|
static STriangle From(STriMeta meta, Vector a, Vector b, Vector c);
|
2008-05-23 10:05:07 +00:00
|
|
|
Vector Normal(void);
|
2008-06-06 11:35:28 +00:00
|
|
|
void FlipNormal(void);
|
2008-07-02 04:32:24 +00:00
|
|
|
double MinAltitude(void);
|
2008-06-21 10:18:20 +00:00
|
|
|
int WindingNumberForPoint(Vector p);
|
2008-05-24 10:34:06 +00:00
|
|
|
bool ContainsPoint(Vector p);
|
2008-06-02 03:31:37 +00:00
|
|
|
bool ContainsPointProjd(Vector n, Vector p);
|
2008-05-21 03:58:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SBsp2 {
|
2008-05-22 10:28:28 +00:00
|
|
|
public:
|
2008-05-24 10:34:06 +00:00
|
|
|
Vector np; // normal to the plane
|
|
|
|
|
|
|
|
Vector no; // outer normal to the edge
|
|
|
|
double d;
|
2008-05-21 03:58:14 +00:00
|
|
|
SEdge edge;
|
2008-05-19 09:23:49 +00:00
|
|
|
|
2008-05-22 10:28:28 +00:00
|
|
|
SBsp2 *pos;
|
|
|
|
SBsp2 *neg;
|
|
|
|
|
|
|
|
SBsp2 *more;
|
2008-05-23 10:05:07 +00:00
|
|
|
|
2013-09-09 19:50:32 +00:00
|
|
|
enum { POS = 100, NEG = 101, COPLANAR = 200 };
|
2008-05-24 23:10:00 +00:00
|
|
|
void InsertTriangleHow(int how, STriangle *tr, SMesh *m, SBsp3 *bsp3);
|
|
|
|
void InsertTriangle(STriangle *tr, SMesh *m, SBsp3 *bsp3);
|
2008-05-24 10:34:06 +00:00
|
|
|
Vector IntersectionWith(Vector a, Vector b);
|
|
|
|
SBsp2 *InsertEdge(SEdge *nedge, Vector nnp, Vector out);
|
2008-05-23 10:05:07 +00:00
|
|
|
static SBsp2 *Alloc(void);
|
2008-05-24 10:34:06 +00:00
|
|
|
|
|
|
|
void DebugDraw(Vector n, double d);
|
2008-04-24 06:22:16 +00:00
|
|
|
};
|
|
|
|
|
2008-05-21 03:58:14 +00:00
|
|
|
class SBsp3 {
|
2008-04-23 07:29:19 +00:00
|
|
|
public:
|
2008-05-23 10:05:07 +00:00
|
|
|
Vector n;
|
|
|
|
double d;
|
|
|
|
|
2008-05-21 03:58:14 +00:00
|
|
|
STriangle tri;
|
|
|
|
SBsp3 *pos;
|
|
|
|
SBsp3 *neg;
|
2008-05-19 09:23:49 +00:00
|
|
|
|
2008-05-21 03:58:14 +00:00
|
|
|
SBsp3 *more;
|
|
|
|
|
|
|
|
SBsp2 *edges;
|
2008-05-23 10:05:07 +00:00
|
|
|
|
|
|
|
static SBsp3 *Alloc(void);
|
|
|
|
static SBsp3 *FromMesh(SMesh *m);
|
|
|
|
|
|
|
|
Vector IntersectionWith(Vector a, Vector b);
|
|
|
|
|
2013-09-09 19:50:32 +00:00
|
|
|
enum { POS = 100, NEG = 101, COPLANAR = 200 };
|
2008-05-24 23:10:00 +00:00
|
|
|
void InsertHow(int how, STriangle *str, SMesh *instead);
|
|
|
|
SBsp3 *Insert(STriangle *str, SMesh *instead);
|
2008-05-23 10:05:07 +00:00
|
|
|
|
2008-05-30 06:09:41 +00:00
|
|
|
void InsertConvexHow(int how, STriMeta meta, Vector *vertex, int n,
|
|
|
|
SMesh *instead);
|
|
|
|
SBsp3 *InsertConvex(STriMeta meta, Vector *vertex, int n, SMesh *instead);
|
2008-05-24 23:10:00 +00:00
|
|
|
|
|
|
|
void InsertInPlane(bool pos2, STriangle *tr, SMesh *m);
|
2008-05-24 10:34:06 +00:00
|
|
|
|
2009-03-17 16:33:46 +00:00
|
|
|
void GenerateInPaintOrder(SMesh *m);
|
|
|
|
|
2008-05-23 10:05:07 +00:00
|
|
|
void DebugDraw(void);
|
2008-05-21 03:58:14 +00:00
|
|
|
};
|
2008-05-19 09:23:49 +00:00
|
|
|
|
2008-05-21 03:58:14 +00:00
|
|
|
class SMesh {
|
|
|
|
public:
|
2009-01-13 06:56:05 +00:00
|
|
|
List<STriangle> l;
|
2008-05-22 10:28:28 +00:00
|
|
|
|
2008-05-24 23:10:00 +00:00
|
|
|
bool flipNormal;
|
|
|
|
bool keepCoplanar;
|
|
|
|
bool atLeastOneDiscarded;
|
|
|
|
|
2008-05-22 10:28:28 +00:00
|
|
|
void Clear(void);
|
2008-05-24 12:23:25 +00:00
|
|
|
void AddTriangle(STriangle *st);
|
2008-05-30 06:09:41 +00:00
|
|
|
void AddTriangle(STriMeta meta, Vector a, Vector b, Vector c);
|
2008-06-21 10:18:20 +00:00
|
|
|
void AddTriangle(STriMeta meta, Vector n, Vector a, Vector b, Vector c);
|
2008-05-24 12:23:25 +00:00
|
|
|
void DoBounding(Vector v, Vector *vmax, Vector *vmin);
|
|
|
|
void GetBounding(Vector *vmax, Vector *vmin);
|
2008-05-24 23:10:00 +00:00
|
|
|
|
2008-05-26 03:39:45 +00:00
|
|
|
void Simplify(int start);
|
|
|
|
|
2008-05-24 23:10:00 +00:00
|
|
|
void AddAgainstBsp(SMesh *srcm, SBsp3 *bsp3);
|
2009-05-24 11:37:07 +00:00
|
|
|
void MakeFromUnionOf(SMesh *a, SMesh *b);
|
|
|
|
void MakeFromDifferenceOf(SMesh *a, SMesh *b);
|
|
|
|
|
|
|
|
void MakeFromCopyOf(SMesh *a);
|
2009-12-15 12:26:22 +00:00
|
|
|
void MakeFromTransformationOf(SMesh *a,
|
|
|
|
Vector trans, Quaternion q, double scale);
|
2009-05-24 11:37:07 +00:00
|
|
|
void MakeFromAssemblyOf(SMesh *a, SMesh *b);
|
|
|
|
|
2009-05-28 07:07:54 +00:00
|
|
|
void MakeEdgesInPlaneInto(SEdgeList *sel, Vector n, double d);
|
2009-05-29 05:40:17 +00:00
|
|
|
void MakeEmphasizedEdgesInto(SEdgeList *sel);
|
2009-05-28 07:07:54 +00:00
|
|
|
|
2009-05-24 11:37:07 +00:00
|
|
|
bool IsEmpty(void);
|
|
|
|
void RemapFaces(Group *g, int remap);
|
2008-06-02 03:31:37 +00:00
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
uint32_t FirstIntersectionWith(Point2d mp);
|
2008-04-23 07:29:19 +00:00
|
|
|
};
|
|
|
|
|
2008-05-27 09:52:36 +00:00
|
|
|
// A linked list of triangles
|
|
|
|
class STriangleLl {
|
|
|
|
public:
|
2008-06-30 09:34:03 +00:00
|
|
|
STriangle *tri;
|
2008-05-27 09:52:36 +00:00
|
|
|
|
|
|
|
STriangleLl *next;
|
2008-07-06 07:56:24 +00:00
|
|
|
|
|
|
|
static STriangleLl *Alloc(void);
|
2008-05-27 09:52:36 +00:00
|
|
|
};
|
|
|
|
|
2008-07-06 07:56:24 +00:00
|
|
|
class SKdNode {
|
2008-05-27 09:52:36 +00:00
|
|
|
public:
|
2009-11-09 11:51:38 +00:00
|
|
|
int which; // whether c is x, y, or z
|
2008-05-27 09:52:36 +00:00
|
|
|
double c;
|
|
|
|
|
2008-07-06 07:56:24 +00:00
|
|
|
SKdNode *gt;
|
|
|
|
SKdNode *lt;
|
2008-05-27 09:52:36 +00:00
|
|
|
|
2008-06-30 09:34:03 +00:00
|
|
|
STriangleLl *tris;
|
2008-07-06 07:56:24 +00:00
|
|
|
|
|
|
|
static SKdNode *Alloc(void);
|
|
|
|
static SKdNode *From(SMesh *m);
|
2009-11-09 11:51:38 +00:00
|
|
|
static SKdNode *From(STriangleLl *tll);
|
2008-07-06 07:56:24 +00:00
|
|
|
|
|
|
|
void AddTriangle(STriangle *tr);
|
|
|
|
void MakeMeshInto(SMesh *m);
|
|
|
|
void ClearTags(void);
|
2009-05-22 10:02:02 +00:00
|
|
|
|
|
|
|
void FindEdgeOn(Vector a, Vector b, int *n, int cnt, bool coplanarIsInter,
|
2009-05-29 05:40:17 +00:00
|
|
|
bool *inter, bool *fwd,
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
uint32_t *face);
|
2013-09-09 19:50:32 +00:00
|
|
|
enum {
|
|
|
|
NAKED_OR_SELF_INTER_EDGES = 100,
|
|
|
|
SELF_INTER_EDGES = 200,
|
|
|
|
TURNING_EDGES = 300,
|
|
|
|
EMPHASIZED_EDGES = 400
|
|
|
|
};
|
2009-05-29 05:40:17 +00:00
|
|
|
void MakeCertainEdgesInto(SEdgeList *sel, int how, bool coplanarIsInter,
|
2009-05-22 10:02:02 +00:00
|
|
|
bool *inter, bool *leaky);
|
2009-03-17 16:33:46 +00:00
|
|
|
|
|
|
|
void OcclusionTestLine(SEdge orig, SEdgeList *sel, int cnt);
|
|
|
|
void SplitLinesAgainstTriangle(SEdgeList *sel, STriangle *tr);
|
2009-05-28 07:07:54 +00:00
|
|
|
|
|
|
|
void SnapToMesh(SMesh *m);
|
|
|
|
void SnapToVertex(Vector v, SMesh *extras);
|
2008-05-27 09:52:36 +00:00
|
|
|
};
|
|
|
|
|
2008-04-23 07:29:19 +00:00
|
|
|
#endif
|
2008-04-24 06:22:16 +00:00
|
|
|
|