46#define M_PI2 ( M_PI / 2.0 )
50#define M_PI4 ( M_PI / 4.0 )
89 void GetArcParams(
int& aMaxSeg,
double& aMinLength,
double& aMaxLength );
101 bool SetArcParams(
int aMaxSeg,
double aMinLength,
double aMaxLength );
142 bool AddVertex(
int aContourID,
double aXpos,
double aYpos );
164 bool AppendCircle(
double aXpos,
double aYpos,
double aRadius,
int aContourID,
165 bool aHoleFlag =
false );
177 bool AddCircle(
double aXpos,
double aYpos,
double aRadius,
bool aHoleFlag =
false,
178 bool aPlatedHole =
false );
192 bool AddSlot(
double aCenterX,
double aCenterY,
double aSlotLength,
double aSlotWidth,
193 double aAngle,
bool aHoleFlag =
false,
bool aPlatedHole =
false );
206 bool AppendArc(
double aCenterX,
double aCenterY,
double aRadius,
double aStartAngle,
207 double aAngle,
int aContourID );
222 bool AddArc(
double aCenterX,
double aCenterY,
double aStartX,
double aStartY,
223 double aArcWidth,
double aAngle,
bool aHoleFlag =
false,
224 bool aPlatedHole =
false );
234 bool AddPolygon(
const std::vector< wxRealPoint >& aPolySet,
double aCenterX,
double aCenterY,
254 bool WriteVertices(
double aZcoord, std::ostream& aOutFile,
int aPrecision );
265 bool Write3DVertices(
double aTopZ,
double aBottomZ, std::ostream& aOutFile,
int aPrecision );
275 bool WriteIndices(
bool aTopFlag, std::ostream& aOutFile );
286 bool Write3DIndices( std::ostream& aOutFile,
bool aIncludePlatedHoles =
false );
335 int Import(
int start, GLUtesselator* aTesselator );
348 const std::string&
GetError(
void );
362 bool Get3DTriangles( std::vector< double >& aVertexList, std::vector< int >& aIndexPlane,
363 std::vector< int >& aIndexSide,
double aTopZ,
double aBotZ );
374 bool Get2DTriangles( std::vector< double >& aVertexList, std::vector< int > &aIndexPlane,
375 double aHeight,
bool aTopPlane );
396 int calcNSides(
double aRadius,
double aAngle );
void GetArcParams(int &aMaxSeg, double &aMinLength, double &aMaxLength)
Retrieve the parameters used in calculating the number of vertices in an arc.
std::vector< double > areas
bool AddSlot(double aCenterX, double aCenterY, double aSlotLength, double aSlotWidth, double aAngle, bool aHoleFlag=false, bool aPlatedHole=false)
Create and add a slot feature to the list of contours.
bool AddPolygon(const std::vector< wxRealPoint > &aPolySet, double aCenterX, double aCenterY, double aAngle)
Create an arbitrary polygon and adds it to the list of contours.
int Import(int start, GLUtesselator *aTesselator)
Inserts all contours into the given tesselator.
bool WriteIndices(bool aTopFlag, std::ostream &aOutFile)
Write out the vertex sets required to render a planar surface.
void ResetArcParams()
Reset the parameters used in calculating the number of vertices in an arc to default values.
std::vector< bool > solid
std::vector< std::list< int > * > contours
bool Tesselate(VRML_LAYER *holes=NULL, bool aHolesOnly=false)
Create a list of outline vertices as well as the vertex sets required to render the surface.
void glStart(GLenum cmd)
Invoked by the GLU tesselator callback to notify this object of the type of GL command which is appli...
bool SetArcParams(int aMaxSeg, double aMinLength, double aMaxLength)
Set the parameters used in calculating the number of vertices in an arc.
std::vector< VERTEX_3D * > extra_verts
bool Fault
set to true when a fault is encountered during tesselation
void SetVertexOffsets(double aXoffset, double aYoffset)
bool Get3DTriangles(std::vector< double > &aVertexList, std::vector< int > &aIndexPlane, std::vector< int > &aIndexSide, double aTopZ, double aBotZ)
Allocate and populate the 3D vertex and index lists with triangular vertices which may be used for re...
bool Write3DIndices(std::ostream &aOutFile, bool aIncludePlatedHoles=false)
Write out the vertex sets required to render an extruded solid.
bool WriteVertices(double aZcoord, std::ostream &aOutFile, int aPrecision)
Write out the list of vertices required to render a planar surface.
bool EnsureWinding(int aContourID, bool aHoleFlag)
Check the winding of a contour and ensures that it is a hole or a solid depending on the value of.
bool addTriplet(VERTEX_3D *p0, VERTEX_3D *p1, VERTEX_3D *p2)
bool AddCircle(double aXpos, double aYpos, double aRadius, bool aHoleFlag=false, bool aPlatedHole=false)
Create a circular contour and adds it to the internal list.
bool AddArc(double aCenterX, double aCenterY, double aStartX, double aStartY, double aArcWidth, double aAngle, bool aHoleFlag=false, bool aPlatedHole=false)
Create a slotted arc and adds it to the internal list of contours.
void SetGLError(GLenum error_id)
Set the error message according to the specified OpenGL error.
bool Get2DTriangles(std::vector< double > &aVertexList, std::vector< int > &aIndexPlane, double aHeight, bool aTopPlane)
Allocate and populate the 3D vertex and index lists with triangular vertices which may be used for re...
bool AppendCircle(double aXpos, double aYpos, double aRadius, int aContourID, bool aHoleFlag=false)
Add a circular contour to the specified (empty) contour.
bool pushOutline(VRML_LAYER *holes)
bool Write3DVertices(double aTopZ, double aBottomZ, std::ostream &aOutFile, int aPrecision)
Write out the list of vertices required to render an extruded solid.
VERTEX_3D * getVertexByIndex(int aPointIndex, VRML_LAYER *holes)
int checkNContours(bool holes)
void glEnd(void)
Invoked by the GLU tesselator callback to notify this object that the vertex list is complete and rea...
std::vector< int > ordmap
std::list< TRIPLET_3D > triplets
int NewContour(bool aPlatedHole=false)
Create a new list of vertices and returns an index to the list.
VERTEX_3D * AddExtraVertex(double aXpos, double aYpos, bool aPlatedHole)
Add an extra vertex as required by the GLU tesselator.
std::vector< VERTEX_3D * > vertices
std::list< std::list< int > * > outline
const std::string & GetError(void)
int calcNSides(double aRadius, double aAngle)
void glPushVertex(VERTEX_3D *vertex)
Invoked by the GLU tesselator callback; the supplied vertex is added to the internal list of vertices...
std::vector< VERTEX_3D * > vlist
bool AppendArc(double aCenterX, double aCenterY, double aRadius, double aStartAngle, double aAngle, int aContourID)
Add an arc to the specified contour.
void Clear(void)
Erase all data except for arc parameters.
void pushVertices(bool holes)
bool AddVertex(int aContourID, double aXpos, double aYpos)
Add a point to the requested contour.
VERTEX_3D * GetVertexByIndex(int aPointIndex)
Return a pointer to the requested vertex or NULL if no such vertex exists.
TRIPLET_3D(int p1, int p2, int p3)