KiCad PCB EDA Suite
Loading...
Searching...
No Matches
VRML_LAYER Class Reference

#include <vrml_layer.h>

Public Member Functions

 VRML_LAYER ()
 
virtual ~VRML_LAYER ()
 
void GetArcParams (int &aMaxSeg, double &aMinLength, double &aMaxLength)
 Retrieve the parameters used in calculating the number of vertices in an arc.
 
bool SetArcParams (int aMaxSeg, double aMinLength, double aMaxLength)
 Set the parameters used in calculating the number of vertices in an arc.
 
void ResetArcParams ()
 Reset the parameters used in calculating the number of vertices in an arc to default values.
 
void Clear (void)
 Erase all data except for arc parameters.
 
int GetSize (void)
 
int GetNContours (void)
 
int NewContour (bool aPlatedHole=false)
 Create a new list of vertices and returns an index to the list.
 
bool AddVertex (int aContourID, double aXpos, double aYpos)
 Add a point to the requested contour.
 
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 AppendCircle (double aXpos, double aYpos, double aRadius, int aContourID, bool aHoleFlag=false)
 Add a circular contour to the specified (empty) contour.
 
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 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 AppendArc (double aCenterX, double aCenterY, double aRadius, double aStartAngle, double aAngle, int aContourID)
 Add an arc to the specified contour.
 
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.
 
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.
 
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.
 
bool WriteVertices (double aZcoord, std::ostream &aOutFile, int aPrecision)
 Write out the list of vertices required to render a planar surface.
 
bool Write3DVertices (double aTopZ, double aBottomZ, std::ostream &aOutFile, int aPrecision)
 Write out the list of vertices required to render an extruded solid.
 
bool WriteIndices (bool aTopFlag, std::ostream &aOutFile)
 Write out the vertex sets required to render a planar surface.
 
bool Write3DIndices (std::ostream &aOutFile, bool aIncludePlatedHoles=false)
 Write out the vertex sets required to render an extruded solid.
 
VERTEX_3D * AddExtraVertex (double aXpos, double aYpos, bool aPlatedHole)
 Add an extra vertex as required by the GLU tesselator.
 
void glStart (GLenum cmd)
 Invoked by the GLU tesselator callback to notify this object of the type of GL command which is applicable to the upcoming vertex list.
 
void glPushVertex (VERTEX_3D *vertex)
 Invoked by the GLU tesselator callback; the supplied vertex is added to the internal list of vertices awaiting processing upon execution of glEnd()
 
void glEnd (void)
 Invoked by the GLU tesselator callback to notify this object that the vertex list is complete and ready for processing.
 
void SetGLError (GLenum error_id)
 Set the error message according to the specified OpenGL error.
 
int Import (int start, GLUtesselator *aTesselator)
 Inserts all contours into the given tesselator.
 
VERTEX_3D * GetVertexByIndex (int aPointIndex)
 Return a pointer to the requested vertex or NULL if no such vertex exists.
 
const std::string & GetError (void)
 
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 rendering a volume.
 
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 rendering a plane.
 

Public Attributes

bool Fault
 set to true when a fault is encountered during tesselation
 

Private Member Functions

void clearTmp (void)
 
bool addTriplet (VERTEX_3D *p0, VERTEX_3D *p1, VERTEX_3D *p2)
 
VERTEX_3D * getVertexByIndex (int aPointIndex, VRML_LAYER *holes)
 
void processFan (void)
 
void processStrip (void)
 
void processTri (void)
 
void pushVertices (bool holes)
 
bool pushOutline (VRML_LAYER *holes)
 
int calcNSides (double aRadius, double aAngle)
 
int checkNContours (bool holes)
 

Private Attributes

int maxArcSeg
 
double minSegLength
 
double maxSegLength
 
double offsetX
 
double offsetY
 
bool fix
 
int idx
 
int ord
 
std::vector< VERTEX_3D * > vertices
 
std::vector< std::list< int > * > contours
 
std::vector< bool > pth
 
std::vector< bool > solid
 
std::vector< double > areas
 
std::list< TRIPLET_3D > triplets
 
std::list< std::list< int > * > outline
 
std::vector< int > ordmap
 
std::string error
 
int hidx
 
int eidx
 
std::vector< VERTEX_3D * > extra_verts
 
std::vector< VERTEX_3D * > vlist
 
VRML_LAYER * pholes
 
GLUtesselator * tess
 
GLenum glcmd
 

Detailed Description

Definition at line 76 of file vrml_layer.h.

Constructor & Destructor Documentation

◆ VRML_LAYER()

◆ ~VRML_LAYER()

VRML_LAYER::~VRML_LAYER ( )
virtual

Definition at line 205 of file vrml_layer.cpp.

References Clear(), and tess.

Member Function Documentation

◆ AddArc()

bool VRML_LAYER::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.

Parameters
aCenterXis the X coordinate of the arc's center.
aCenterYis the Y coordinate of the arc's center.
aStartXis the X coordinate of the starting point.
aStartYis the Y coordinate of the starting point.
aArcWidthis the width of the arc.
aAngleis the included angle (degrees).
aHoleFlagdetermines whether the arc is to be a hole or a solid.
aPlatedHoleis true if this is a plated slotted arc.
Returns
true if the feature was successfully created.

Definition at line 636 of file vrml_layer.cpp.

References AddVertex(), calcNSides(), error, M_PI, and NewContour().

◆ AddCircle()

bool VRML_LAYER::AddCircle ( double aXpos,
double aYpos,
double aRadius,
bool aHoleFlag = false,
bool aPlatedHole = false )

Create a circular contour and adds it to the internal list.

Parameters
aXposis the X coordinate of the hole center.
aYposis the Y coordinate of the hole center.
aRadiusis the radius of the hole.
aHoleFlagdetermines if the contour to be created is a cutout.
aPlatedHoleis true if this is a plated hole.
Returns
true if the new contour was successfully created.

Definition at line 461 of file vrml_layer.cpp.

References AppendCircle(), error, NewContour(), and pad.

Referenced by makeBoard().

◆ AddExtraVertex()

VERTEX_3D * VRML_LAYER::AddExtraVertex ( double aXpos,
double aYpos,
bool aPlatedHole )

Add an extra vertex as required by the GLU tesselator.

Parameters
aXposis the X coordinate of the newly created point.
aYposis the Y coordinate of the newly created point.
aPlatedHoleis true if this point is part of a plated hole.
Returns
is the new vertex or NULL if a vertex could not be created.

Definition at line 1401 of file vrml_layer.cpp.

References eidx, extra_verts, hidx, VERTEX_3D::i, idx, VERTEX_3D::o, VERTEX_3D::pth, VERTEX_3D::x, and VERTEX_3D::y.

Referenced by vrml_tess_combine().

◆ AddPolygon()

bool VRML_LAYER::AddPolygon ( const std::vector< wxRealPoint > & aPolySet,
double aCenterX,
double aCenterY,
double aAngle )

Create an arbitrary polygon and adds it to the list of contours.

Parameters
aPolySetis the set of polygon points.
aCenterXis the X coordinate of the polygon's center.
aCenterYis the Y coordinate of the polygon's center.
aAngleis the rotation angle (degrees) of the pad.

Definition at line 567 of file vrml_layer.cpp.

References AddVertex(), DEGREES_T, EnsureWinding(), error, NewContour(), pad, and RotatePoint().

◆ AddSlot()

bool VRML_LAYER::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.

Parameters
aCenterXis the X coordinate of the slot's center.
aCenterYis the Y coordinate of the slot's center.
aSlotLengthis the length of the slot along the major axis.
aSlotWidthis the width of the slot along the minor axis.
aAngle(degrees) is the orientation of the slot.
aHoleFlagdetermines whether the slot is a hole or a solid.
aPlatedHoleis true if this is a plated slot.
Returns
true if the slot was successfully created.

Definition at line 481 of file vrml_layer.cpp.

References AddVertex(), calcNSides(), error, M_PI, M_PI2, NewContour(), and pad.

◆ addTriplet()

bool VRML_LAYER::addTriplet ( VERTEX_3D * p0,
VERTEX_3D * p1,
VERTEX_3D * p2 )
private

Definition at line 1363 of file vrml_layer.cpp.

References VERTEX_3D::o, triplets, VERTEX_3D::x, and VERTEX_3D::y.

Referenced by processFan(), processStrip(), and processTri().

◆ AddVertex()

bool VRML_LAYER::AddVertex ( int aContourID,
double aXpos,
double aYpos )

Add a point to the requested contour.

Parameters
aContouris an index previously returned by a call to NewContour().
aXposis the X coordinate of the vertex.
aYposis the Y coordinate of the vertex.
Returns
true if the vertex was added.

Definition at line 331 of file vrml_layer.cpp.

References areas, contours, error, fix, VERTEX_3D::i, idx, VERTEX_3D::o, VERTEX_3D::pth, pth, v2, vertices, VERTEX_3D::x, and VERTEX_3D::y.

Referenced by AddArc(), AddPolygon(), AddSlot(), AppendArc(), AppendCircle(), and EXPORTER_PCB_VRML::ExportVrmlPolygonSet().

◆ AppendArc()

bool VRML_LAYER::AppendArc ( double aCenterX,
double aCenterY,
double aRadius,
double aStartAngle,
double aAngle,
int aContourID )

Add an arc to the specified contour.

Parameters
aCenterXis the X coordinate of the arc's center.
aCenterYis the Y coordinate of the arc's center.
aRadiusis the radius of the arc.
aStartAngle(degrees) is the starting angle of the arc.
aAngle(degrees) is the measure of the arc.
aContourIDis the contour's index.
Returns
true if the slot was successfully created.

Definition at line 593 of file vrml_layer.cpp.

References AddVertex(), calcNSides(), contours, error, and M_PI.

◆ AppendCircle()

bool VRML_LAYER::AppendCircle ( double aXpos,
double aYpos,
double aRadius,
int aContourID,
bool aHoleFlag = false )

Add a circular contour to the specified (empty) contour.

Parameters
aXposis the X coordinate of the hole center.
aYposis the Y coordinate of the hole center.
aRadiusis the radius of the hole.
aContourIDis the contour index.
aHoleFlagdetermines if the contour to be created is a cutout.
Returns
true if the new contour was successfully created.

Definition at line 401 of file vrml_layer.cpp.

References AddVertex(), contours, error, M_PI, maxArcSeg, maxSegLength, MIN_NSIDES, and minSegLength.

Referenced by AddCircle().

◆ calcNSides()

int VRML_LAYER::calcNSides ( double aRadius,
double aAngle )
private

Definition at line 83 of file vrml_layer.cpp.

References M_PI, maxArcSeg, maxSegLength, and minSegLength.

Referenced by AddArc(), AddSlot(), and AppendArc().

◆ checkNContours()

int VRML_LAYER::checkNContours ( bool holes)
private

Definition at line 1596 of file vrml_layer.cpp.

References areas, and contours.

Referenced by Tesselate().

◆ Clear()

void VRML_LAYER::Clear ( void )

Erase all data except for arc parameters.

Definition at line 249 of file vrml_layer.cpp.

References areas, clearTmp(), contours, fix, idx, pth, and vertices.

Referenced by makeOtherOutlines(), and ~VRML_LAYER().

◆ clearTmp()

void VRML_LAYER::clearTmp ( void )
private

Definition at line 276 of file vrml_layer.cpp.

References eidx, extra_verts, Fault, glcmd, hidx, ord, ordmap, outline, solid, triplets, vertices, and vlist.

Referenced by Clear(), and Tesselate().

◆ EnsureWinding()

bool VRML_LAYER::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.

Parameters
hole.
aContouris an index to a contour as returned by NewContour().
aHoleFlagdetermines if the contour must be a hole.
Returns
true if the operation succeeded.

Definition at line 367 of file vrml_layer.cpp.

References areas, contours, error, vertices, VERTEX_3D::x, and VERTEX_3D::y.

Referenced by addOutline(), AddPolygon(), EXPORTER_PCB_VRML::ExportVrmlPolygonSet(), makeBoard(), and makeOtherOutlines().

◆ Get2DTriangles()

bool VRML_LAYER::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 rendering a plane.

Parameters
aVertexListwill store the vertices.
aIndexPlanewill store the indices for the plane.
aHeightis the plane of the model.
aTopPlaneis true if the plane is a top plane (false = reverse indices).

Definition at line 1960 of file vrml_layer.cpp.

References getVertexByIndex(), offsetX, offsetY, ordmap, outline, pholes, triplets, VERTEX_3D::x, and VERTEX_3D::y.

◆ Get3DTriangles()

bool VRML_LAYER::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 rendering a volume.

Parameters
aVertexListwill store the vertices.
aIndexPlanewill store the indices for the top + bottom planes.
aIndexSidewill store the indices for the vertical wall.
aTopZis the top plane of the model.
aBotZis the bottom plane of the model.

Definition at line 1788 of file vrml_layer.cpp.

References getVertexByIndex(), offsetX, offsetY, ordmap, outline, pholes, triplets, VERTEX_3D::x, and VERTEX_3D::y.

Referenced by vrmlToSG().

◆ GetArcParams()

void VRML_LAYER::GetArcParams ( int & aMaxSeg,
double & aMinLength,
double & aMaxLength )

Retrieve the parameters used in calculating the number of vertices in an arc.

Parameters
aMaxSegis the maximum number of segments for an arc with cords of length aMinLength.
aMinLengthis the minimum length of cords in an arc.
aMaxLengthis the maximum length of cords in an arc.

Definition at line 226 of file vrml_layer.cpp.

References maxArcSeg, maxSegLength, and minSegLength.

◆ GetError()

const std::string & VRML_LAYER::GetError ( void )
Returns
the error message related to the last failed operation.

Definition at line 1774 of file vrml_layer.cpp.

References error.

Referenced by EXPORTER_PCB_VRML::ExportVrmlPolygonSet(), getVertexByIndex(), and Tesselate().

◆ GetNContours()

int VRML_LAYER::GetNContours ( void )
inline
Returns
the number of stored contours.

Definition at line 121 of file vrml_layer.h.

References contours.

Referenced by makeBoard(), and makeOtherOutlines().

◆ GetSize()

int VRML_LAYER::GetSize ( void )
Returns
the total number of vertices indexed.

Definition at line 1698 of file vrml_layer.cpp.

References vertices.

Referenced by Tesselate().

◆ GetVertexByIndex()

VERTEX_3D * VRML_LAYER::GetVertexByIndex ( int aPointIndex)

Return a pointer to the requested vertex or NULL if no such vertex exists.

Parameters
aPointIndexis a vertex index.
Returns
the requested vertex or NULL

Definition at line 1760 of file vrml_layer.cpp.

References error, and vertices.

Referenced by getVertexByIndex().

◆ getVertexByIndex()

VERTEX_3D * VRML_LAYER::getVertexByIndex ( int aPointIndex,
VRML_LAYER * holes )
private

◆ glEnd()

void VRML_LAYER::glEnd ( void )

Invoked by the GLU tesselator callback to notify this object that the vertex list is complete and ready for processing.

Definition at line 1441 of file vrml_layer.cpp.

References glcmd, outline, processFan(), processStrip(), processTri(), solid, and vlist.

Referenced by vrml_tess_end().

◆ glPushVertex()

void VRML_LAYER::glPushVertex ( VERTEX_3D * vertex)

Invoked by the GLU tesselator callback; the supplied vertex is added to the internal list of vertices awaiting processing upon execution of glEnd()

Parameters
vertexis a vertex forming part of the GL command as previously set by glStart.

Definition at line 1429 of file vrml_layer.cpp.

References VERTEX_3D::i, VERTEX_3D::o, ord, ordmap, and vlist.

Referenced by vrml_tess_vertex().

◆ glStart()

void VRML_LAYER::glStart ( GLenum cmd)

Invoked by the GLU tesselator callback to notify this object of the type of GL command which is applicable to the upcoming vertex list.

Parameters
cmdis the GL command.

Definition at line 1420 of file vrml_layer.cpp.

References glcmd, and vlist.

Referenced by vrml_tess_begin().

◆ Import()

int VRML_LAYER::Import ( int start,
GLUtesselator * aTesselator )

Inserts all contours into the given tesselator.

This results in the renumbering of all vertices from start. Take care when using this call since tesselators cannot work on the internal data concurrently.

Parameters
startis the starting number for vertex indices.
tessis a pointer to a GLU Tesselator object.
Returns
the number of vertices exported.

Definition at line 1704 of file vrml_layer.cpp.

References contours, error, vertices, VERTEX_3D::x, and VERTEX_3D::y.

Referenced by Tesselate().

◆ NewContour()

int VRML_LAYER::NewContour ( bool aPlatedHole = false)

Create a new list of vertices and returns an index to the list.

Parameters
aPlatedHoleis true if the new contour will represent a plated hole.
Returns
index to the list or -1 if the operation failed.

Definition at line 315 of file vrml_layer.cpp.

References areas, contours, fix, and pth.

Referenced by AddArc(), AddCircle(), AddPolygon(), AddSlot(), and EXPORTER_PCB_VRML::ExportVrmlPolygonSet().

◆ processFan()

void VRML_LAYER::processFan ( void )
private

Definition at line 1530 of file vrml_layer.cpp.

References addTriplet(), end, and vlist.

Referenced by glEnd().

◆ processStrip()

void VRML_LAYER::processStrip ( void )
private

Definition at line 1547 of file vrml_layer.cpp.

References addTriplet(), end, and vlist.

Referenced by glEnd().

◆ processTri()

void VRML_LAYER::processTri ( void )
private

Definition at line 1579 of file vrml_layer.cpp.

References addTriplet(), end, and vlist.

Referenced by glEnd().

◆ pushOutline()

bool VRML_LAYER::pushOutline ( VRML_LAYER * holes)
private

Definition at line 917 of file vrml_layer.cpp.

References end, error, getVertexByIndex(), ordmap, outline, tess, VRML_LAYER(), VERTEX_3D::x, and VERTEX_3D::y.

Referenced by Tesselate().

◆ pushVertices()

void VRML_LAYER::pushVertices ( bool holes)
private

Definition at line 1618 of file vrml_layer.cpp.

References areas, contours, end, tess, vertices, VERTEX_3D::x, and VERTEX_3D::y.

Referenced by Tesselate().

◆ ResetArcParams()

void VRML_LAYER::ResetArcParams ( )

Reset the parameters used in calculating the number of vertices in an arc to default values.

Definition at line 217 of file vrml_layer.cpp.

References maxArcSeg, maxSegLength, and minSegLength.

Referenced by VRML_LAYER().

◆ SetArcParams()

bool VRML_LAYER::SetArcParams ( int aMaxSeg,
double aMinLength,
double aMaxLength )

Set the parameters used in calculating the number of vertices in an arc.

The default settings are reasonable for rendering for unit lengths of 1mm.

Parameters
aMaxSegis the maximum number of segments for an arc with cords of length aMinLength.
aMinLengthis the minimum length of cords in an arc.
aMaxLengthis the maximum length of cords in an arc.
Returns
true if the parameters were accepted.

Definition at line 234 of file vrml_layer.cpp.

References maxArcSeg, maxSegLength, and minSegLength.

◆ SetGLError()

void VRML_LAYER::SetGLError ( GLenum error_id)

Set the error message according to the specified OpenGL error.

Definition at line 1511 of file vrml_layer.cpp.

References error.

Referenced by vrml_tess_err().

◆ SetVertexOffsets()

void VRML_LAYER::SetVertexOffsets ( double aXoffset,
double aYoffset )

Definition at line 1780 of file vrml_layer.cpp.

References offsetX, and offsetY.

◆ Tesselate()

bool VRML_LAYER::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.

Parameters
holesis an optional pointer to cutouts to be imposed on the surface.
aHolesOnlyis true if the outline contains only holes.
Returns
true if the operation succeeded.

Definition at line 750 of file vrml_layer.cpp.

References areas, checkNContours(), clearTmp(), contours, eidx, error, extra_verts, Fault, fix, GetError(), GetSize(), hidx, idx, Import(), ord, ordmap, outline, pholes, pushOutline(), pushVertices(), solid, tess, vertices, VRML_LAYER(), VERTEX_3D::x, and VERTEX_3D::y.

Referenced by vrmlToSG().

◆ Write3DIndices()

bool VRML_LAYER::Write3DIndices ( std::ostream & aOutFile,
bool aIncludePlatedHoles = false )

Write out the vertex sets required to render an extruded solid.

Parameters
aOutFileis the file to write to.
aIncludePlatedHolesis true if holes marked as plated should be rendered. Default is false since the user will usually render these holes in a different color.
Returns
true if the operation succeeded.

Definition at line 1170 of file vrml_layer.cpp.

References error, getVertexByIndex(), ordmap, outline, pholes, pth, solid, and triplets.

Referenced by EXPORTER_PCB_VRML::write_triangle_bag().

◆ Write3DVertices()

bool VRML_LAYER::Write3DVertices ( double aTopZ,
double aBottomZ,
std::ostream & aOutFile,
int aPrecision )

Write out the list of vertices required to render an extruded solid.

Parameters
aTopZis the Z coordinate of the top plane.
aBottomZis the Z coordinate of the bottom plane.
aOutFileis the file to write to.
aPrecisionis the precision of the output coordinates.
Returns
true if the operation succeeded.

Definition at line 1038 of file vrml_layer.cpp.

References error, FormatDoublet(), FormatSinglet(), getVertexByIndex(), offsetX, offsetY, ordmap, pholes, VERTEX_3D::x, and VERTEX_3D::y.

Referenced by EXPORTER_PCB_VRML::write_triangle_bag().

◆ WriteIndices()

bool VRML_LAYER::WriteIndices ( bool aTopFlag,
std::ostream & aOutFile )

Write out the vertex sets required to render a planar surface.

Parameters
aTopFlagis true if the surface is to be visible from above; if false the surface will be visible from below.
aOutFileis the file to write to.
Returns
true if the operation succeeded.

Definition at line 1123 of file vrml_layer.cpp.

References error, and triplets.

Referenced by EXPORTER_PCB_VRML::write_triangle_bag().

◆ WriteVertices()

bool VRML_LAYER::WriteVertices ( double aZcoord,
std::ostream & aOutFile,
int aPrecision )

Write out the list of vertices required to render a planar surface.

Parameters
aZcoordis the Z coordinate of the plane.
aOutFileis the file to write to.
aPrecisionis the precision of the output coordinates.
Returns
true if the operation succeeded.

Definition at line 995 of file vrml_layer.cpp.

References error, FormatDoublet(), FormatSinglet(), getVertexByIndex(), offsetX, offsetY, ordmap, pholes, VERTEX_3D::x, and VERTEX_3D::y.

Referenced by EXPORTER_PCB_VRML::write_triangle_bag().

Member Data Documentation

◆ areas

std::vector< double > VRML_LAYER::areas
private

◆ contours

std::vector<std::list<int>*> VRML_LAYER::contours
private

◆ eidx

int VRML_LAYER::eidx
private

Definition at line 430 of file vrml_layer.h.

Referenced by AddExtraVertex(), clearTmp(), Tesselate(), and VRML_LAYER().

◆ error

◆ extra_verts

std::vector<VERTEX_3D*> VRML_LAYER::extra_verts
private

Definition at line 431 of file vrml_layer.h.

Referenced by AddExtraVertex(), clearTmp(), getVertexByIndex(), and Tesselate().

◆ Fault

bool VRML_LAYER::Fault

set to true when a fault is encountered during tesselation

Definition at line 403 of file vrml_layer.h.

Referenced by clearTmp(), Tesselate(), VRML_LAYER(), and vrml_tess_err().

◆ fix

bool VRML_LAYER::fix
private

Definition at line 415 of file vrml_layer.h.

Referenced by AddVertex(), Clear(), NewContour(), Tesselate(), and VRML_LAYER().

◆ glcmd

GLenum VRML_LAYER::glcmd
private

Definition at line 437 of file vrml_layer.h.

Referenced by clearTmp(), glEnd(), glStart(), and VRML_LAYER().

◆ hidx

int VRML_LAYER::hidx
private

Definition at line 429 of file vrml_layer.h.

Referenced by AddExtraVertex(), clearTmp(), getVertexByIndex(), Tesselate(), and VRML_LAYER().

◆ idx

int VRML_LAYER::idx
private

Definition at line 416 of file vrml_layer.h.

Referenced by AddExtraVertex(), AddVertex(), Clear(), getVertexByIndex(), Tesselate(), and VRML_LAYER().

◆ maxArcSeg

int VRML_LAYER::maxArcSeg
private

Definition at line 407 of file vrml_layer.h.

Referenced by AppendCircle(), calcNSides(), GetArcParams(), ResetArcParams(), and SetArcParams().

◆ maxSegLength

double VRML_LAYER::maxSegLength
private

Definition at line 409 of file vrml_layer.h.

Referenced by AppendCircle(), calcNSides(), GetArcParams(), ResetArcParams(), and SetArcParams().

◆ minSegLength

double VRML_LAYER::minSegLength
private

Definition at line 408 of file vrml_layer.h.

Referenced by AppendCircle(), calcNSides(), GetArcParams(), ResetArcParams(), and SetArcParams().

◆ offsetX

double VRML_LAYER::offsetX
private

◆ offsetY

double VRML_LAYER::offsetY
private

◆ ord

int VRML_LAYER::ord
private

Definition at line 417 of file vrml_layer.h.

Referenced by clearTmp(), glPushVertex(), Tesselate(), and VRML_LAYER().

◆ ordmap

std::vector<int> VRML_LAYER::ordmap
private

◆ outline

std::list<std::list<int>*> VRML_LAYER::outline
private

◆ pholes

VRML_LAYER* VRML_LAYER::pholes
private

◆ pth

std::vector<bool> VRML_LAYER::pth
private

Definition at line 420 of file vrml_layer.h.

Referenced by AddVertex(), Clear(), NewContour(), and Write3DIndices().

◆ solid

std::vector<bool> VRML_LAYER::solid
private

Definition at line 421 of file vrml_layer.h.

Referenced by clearTmp(), glEnd(), Tesselate(), and Write3DIndices().

◆ tess

GLUtesselator* VRML_LAYER::tess
private

Definition at line 436 of file vrml_layer.h.

Referenced by pushOutline(), pushVertices(), Tesselate(), VRML_LAYER(), and ~VRML_LAYER().

◆ triplets

std::list<TRIPLET_3D> VRML_LAYER::triplets
private

◆ vertices

std::vector<VERTEX_3D*> VRML_LAYER::vertices
private

◆ vlist

std::vector<VERTEX_3D*> VRML_LAYER::vlist
private

Definition at line 432 of file vrml_layer.h.

Referenced by clearTmp(), glEnd(), glPushVertex(), glStart(), processFan(), processStrip(), and processTri().


The documentation for this class was generated from the following files: