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

#include <exporter_vrml.h>

Public Member Functions

 EXPORTER_PCB_VRML (BOARD *aBoard)
 
 ~EXPORTER_PCB_VRML ()
 
bool ExportVRML_File (PROJECT *aProject, wxString *aMessages, const wxString &aFullFileName, double aMMtoWRMLunit, bool aIncludeUnspecified, bool aIncludeDNP, bool aExport3DFiles, bool aUseRelativePaths, const wxString &a3D_Subdir, double aXRef, double aYRef)
 Export a VRML file image of the board.
 

Private Member Functions

VRML_COLORGetColor (VRML_COLOR_INDEX aIndex)
 
void SetOffset (double aXoff, double aYoff)
 
double GetLayerZ (int aLayer)
 
void SetLayerZ (int aLayer, double aValue)
 
bool SetScale (double aWorldScale)
 
void initStaticColorList ()
 
void ExportVrmlSolderMask ()
 
void ExportStandardLayers ()
 
void ExportVrmlFootprint (FOOTPRINT *aFootprint, std::ostream *aOutputFile)
 
void ExportVrmlBoard ()
 
void ExportVrmlViaHoles ()
 
void ExportFp3DModelsAsLinkedFile (const wxString &aFullFileName)
 
void ExportVrmlPadHole (PAD *aPad)
 
void ExportVrmlPolygonSet (VRML_LAYER *aVlayer, const SHAPE_POLY_SET &aOutlines)
 
void writeLayers (const char *aFileName, OSTREAM *aOutputFile)
 
bool GetLayer3D (int layer, VRML_LAYER **vlayer)
 
void ComputeLayer3D_Zpos ()
 
void write_triangle_bag (std::ostream &aOut_file, const VRML_COLOR &aColor, VRML_LAYER *aLayer, bool aPlane, bool aTop, double aTop_z, double aBottom_z)
 
void create_vrml_shell (IFSG_TRANSFORM &PcbOutput, VRML_COLOR_INDEX colorID, VRML_LAYER *layer, double top_z, double bottom_z)
 
void create_vrml_plane (IFSG_TRANSFORM &PcbOutput, VRML_COLOR_INDEX colorID, VRML_LAYER *layer, double aHeight, bool aTopPlane)
 
SGNODEgetSGColor (VRML_COLOR_INDEX colorIdx)
 

Private Attributes

IFSG_TRANSFORM m_OutputPCB
 
VRML_LAYER m_holes
 
VRML_LAYER m_3D_board
 
VRML_LAYER m_top_copper
 
VRML_LAYER m_bot_copper
 
VRML_LAYER m_top_silk
 
VRML_LAYER m_bot_silk
 
VRML_LAYER m_top_soldermask
 
VRML_LAYER m_bot_soldermask
 
VRML_LAYER m_top_paste
 
VRML_LAYER m_bot_paste
 
VRML_LAYER m_plated_holes
 
std::list< SGNODE * > m_components
 
S3D_CACHEm_Cache3Dmodels
 
bool m_UseInlineModelsInBrdfile
 
wxString m_Subdir3DFpModels
 
bool m_UseRelPathIn3DModelFilename
 
bool m_ReuseDef
 
bool m_includeUnspecified
 
bool m_includeDNP
 
double m_WorldScale = 1.0
 
double m_BoardToVrmlScale
 
double m_tx
 
double m_ty
 
double m_brd_thickness
 
BOARDm_board
 
VRML_COLOR vrml_colors_list [VRML_COLOR_LAST]
 
double m_layer_z [PCB_LAYER_ID_COUNT]
 
SHAPE_POLY_SET m_pcbOutlines
 
int m_precision
 
SGNODEm_sgmaterial [VRML_COLOR_LAST]
 

Static Private Attributes

static CUSTOM_COLORS_LIST m_SilkscreenColors
 
static CUSTOM_COLORS_LIST m_MaskColors
 
static CUSTOM_COLORS_LIST m_PasteColors
 
static CUSTOM_COLORS_LIST m_FinishColors
 
static CUSTOM_COLORS_LIST m_BoardColors
 
static KIGFX::COLOR4D m_DefaultBackgroundTop
 
static KIGFX::COLOR4D m_DefaultBackgroundBot
 
static KIGFX::COLOR4D m_DefaultSilkscreen
 
static KIGFX::COLOR4D m_DefaultSolderMask
 
static KIGFX::COLOR4D m_DefaultSolderPaste
 
static KIGFX::COLOR4D m_DefaultSurfaceFinish
 
static KIGFX::COLOR4D m_DefaultBoardBody
 

Detailed Description

Definition at line 104 of file exporter_vrml.h.

Constructor & Destructor Documentation

◆ EXPORTER_PCB_VRML()

◆ ~EXPORTER_PCB_VRML()

Member Function Documentation

◆ ComputeLayer3D_Zpos()

◆ create_vrml_plane()

void EXPORTER_PCB_VRML::create_vrml_plane ( IFSG_TRANSFORM PcbOutput,
VRML_COLOR_INDEX  colorID,
VRML_LAYER *  layer,
double  aHeight,
bool  aTopPlane 
)
private

◆ create_vrml_shell()

◆ ExportFp3DModelsAsLinkedFile()

void EXPORTER_PCB_VRML::ExportFp3DModelsAsLinkedFile ( const wxString &  aFullFileName)
private

◆ ExportStandardLayers()

◆ ExportVRML_File()

bool EXPORTER_PCB_VRML::ExportVRML_File ( PROJECT aProject,
wxString *  aMessages,
const wxString &  aFullFileName,
double  aMMtoWRMLunit,
bool  aIncludeUnspecified,
bool  aIncludeDNP,
bool  aExport3DFiles,
bool  aUseRelativePaths,
const wxString &  a3D_Subdir,
double  aXRef,
double  aYRef 
)

Export a VRML file image of the board.

Parameters
aProjectis the current project (cannot be null)
aMessageswill contain error message(s)
aFullFileNamethe full filename of the file to create
aMMtoWRMLunitthe VRML scaling factor: 1.0 to export in mm. 0.001 for meters
aExport3DFilestrue to copy 3D shapes in the subir a3D_Subdir
aUseRelativePathsset to true to use relative paths instead of absolute paths in the board VRML file URLs.
a3D_Subdirsub directory where 3D shapes files are copied. This is only used when aExport3DFiles == true.
aXRefX value of PCB (0,0) reference point.
aYRefY value of PCB (0,0) reference point.
Returns
true if Ok.

Definition at line 1243 of file exporter_vrml.cpp.

References _, ComputeLayer3D_Zpos(), ExportFp3DModelsAsLinkedFile(), ExportStandardLayers(), ExportVrmlBoard(), ExportVrmlFootprint(), ExportVrmlSolderMask(), ExportVrmlViaHoles(), BOARD::Footprints(), From_UTF8(), PROJECT_PCB::Get3DCacheManager(), m_board, m_BoardToVrmlScale, m_Cache3Dmodels, m_includeDNP, m_includeUnspecified, m_Subdir3DFpModels, m_UseInlineModelsInBrdfile, m_UseRelPathIn3DModelFilename, EDA_IU_SCALE::MM_PER_IU, pcbIUScale, SetOffset(), SetScale(), TO_UTF8, and writeLayers().

Referenced by EXPORTER_VRML::ExportVRML_File().

◆ ExportVrmlBoard()

◆ ExportVrmlFootprint()

◆ ExportVrmlPadHole()

◆ ExportVrmlPolygonSet()

void EXPORTER_PCB_VRML::ExportVrmlPolygonSet ( VRML_LAYER *  aVlayer,
const SHAPE_POLY_SET aOutlines 
)
private

◆ ExportVrmlSolderMask()

◆ ExportVrmlViaHoles()

◆ GetColor()

VRML_COLOR & EXPORTER_PCB_VRML::GetColor ( VRML_COLOR_INDEX  aIndex)
inlineprivate

Definition at line 133 of file exporter_vrml.h.

References vrml_colors_list.

Referenced by writeLayers().

◆ GetLayer3D()

bool EXPORTER_PCB_VRML::GetLayer3D ( int  layer,
VRML_LAYER **  vlayer 
)
private

◆ GetLayerZ()

double EXPORTER_PCB_VRML::GetLayerZ ( int  aLayer)
inlineprivate

Definition at line 140 of file exporter_vrml.h.

References arrayDim(), and m_layer_z.

Referenced by ExportVrmlFootprint(), and writeLayers().

◆ getSGColor()

◆ initStaticColorList()

◆ SetLayerZ()

void EXPORTER_PCB_VRML::SetLayerZ ( int  aLayer,
double  aValue 
)
inlineprivate

Definition at line 148 of file exporter_vrml.h.

References m_layer_z.

Referenced by ComputeLayer3D_Zpos().

◆ SetOffset()

void EXPORTER_PCB_VRML::SetOffset ( double  aXoff,
double  aYoff 
)
private

◆ SetScale()

bool EXPORTER_PCB_VRML::SetScale ( double  aWorldScale)
private

Definition at line 334 of file exporter_vrml.cpp.

References m_OutputPCB, m_WorldScale, and IFSG_TRANSFORM::SetScale().

Referenced by ExportVRML_File().

◆ write_triangle_bag()

void EXPORTER_PCB_VRML::write_triangle_bag ( std::ostream &  aOut_file,
const VRML_COLOR aColor,
VRML_LAYER *  aLayer,
bool  aPlane,
bool  aTop,
double  aTop_z,
double  aBottom_z 
)
private

◆ writeLayers()

Member Data Documentation

◆ m_3D_board

VRML_LAYER EXPORTER_PCB_VRML::m_3D_board
private

Definition at line 218 of file exporter_vrml.h.

Referenced by ExportVrmlBoard(), SetOffset(), and writeLayers().

◆ m_board

◆ m_BoardColors

CUSTOM_COLORS_LIST EXPORTER_PCB_VRML::m_BoardColors
staticprivate

Definition at line 206 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), and initStaticColorList().

◆ m_BoardToVrmlScale

◆ m_bot_copper

VRML_LAYER EXPORTER_PCB_VRML::m_bot_copper
private

Definition at line 220 of file exporter_vrml.h.

Referenced by ExportStandardLayers(), GetLayer3D(), SetOffset(), and writeLayers().

◆ m_bot_paste

VRML_LAYER EXPORTER_PCB_VRML::m_bot_paste
private

Definition at line 226 of file exporter_vrml.h.

Referenced by ExportStandardLayers(), GetLayer3D(), SetOffset(), and writeLayers().

◆ m_bot_silk

VRML_LAYER EXPORTER_PCB_VRML::m_bot_silk
private

Definition at line 222 of file exporter_vrml.h.

Referenced by ExportStandardLayers(), GetLayer3D(), SetOffset(), and writeLayers().

◆ m_bot_soldermask

VRML_LAYER EXPORTER_PCB_VRML::m_bot_soldermask
private

Definition at line 224 of file exporter_vrml.h.

Referenced by ExportVrmlSolderMask(), GetLayer3D(), SetOffset(), and writeLayers().

◆ m_brd_thickness

double EXPORTER_PCB_VRML::m_brd_thickness
private

Definition at line 263 of file exporter_vrml.h.

Referenced by ComputeLayer3D_Zpos(), EXPORTER_PCB_VRML(), and writeLayers().

◆ m_Cache3Dmodels

S3D_CACHE* EXPORTER_PCB_VRML::m_Cache3Dmodels
private

Definition at line 230 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), ExportVRML_File(), and ExportVrmlFootprint().

◆ m_components

std::list<SGNODE*> EXPORTER_PCB_VRML::m_components
private

Definition at line 229 of file exporter_vrml.h.

Referenced by ExportVrmlFootprint(), and ~EXPORTER_PCB_VRML().

◆ m_DefaultBackgroundBot

KIGFX::COLOR4D EXPORTER_PCB_VRML::m_DefaultBackgroundBot
staticprivate

Definition at line 209 of file exporter_vrml.h.

◆ m_DefaultBackgroundTop

KIGFX::COLOR4D EXPORTER_PCB_VRML::m_DefaultBackgroundTop
staticprivate

Definition at line 208 of file exporter_vrml.h.

◆ m_DefaultBoardBody

KIGFX::COLOR4D EXPORTER_PCB_VRML::m_DefaultBoardBody
staticprivate

Definition at line 214 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), and initStaticColorList().

◆ m_DefaultSilkscreen

KIGFX::COLOR4D EXPORTER_PCB_VRML::m_DefaultSilkscreen
staticprivate

Definition at line 210 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), and initStaticColorList().

◆ m_DefaultSolderMask

KIGFX::COLOR4D EXPORTER_PCB_VRML::m_DefaultSolderMask
staticprivate

Definition at line 211 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), and initStaticColorList().

◆ m_DefaultSolderPaste

KIGFX::COLOR4D EXPORTER_PCB_VRML::m_DefaultSolderPaste
staticprivate

Definition at line 212 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), and initStaticColorList().

◆ m_DefaultSurfaceFinish

KIGFX::COLOR4D EXPORTER_PCB_VRML::m_DefaultSurfaceFinish
staticprivate

Definition at line 213 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), and initStaticColorList().

◆ m_FinishColors

CUSTOM_COLORS_LIST EXPORTER_PCB_VRML::m_FinishColors
staticprivate

Definition at line 205 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), and initStaticColorList().

◆ m_holes

VRML_LAYER EXPORTER_PCB_VRML::m_holes
private

◆ m_includeDNP

bool EXPORTER_PCB_VRML::m_includeDNP
private

Definition at line 252 of file exporter_vrml.h.

Referenced by ExportVRML_File(), and ExportVrmlFootprint().

◆ m_includeUnspecified

bool EXPORTER_PCB_VRML::m_includeUnspecified
private

Definition at line 249 of file exporter_vrml.h.

Referenced by ExportVRML_File(), and ExportVrmlFootprint().

◆ m_layer_z

double EXPORTER_PCB_VRML::m_layer_z[PCB_LAYER_ID_COUNT]
private

Definition at line 268 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), GetLayerZ(), and SetLayerZ().

◆ m_MaskColors

CUSTOM_COLORS_LIST EXPORTER_PCB_VRML::m_MaskColors
staticprivate

Definition at line 203 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), and initStaticColorList().

◆ m_OutputPCB

IFSG_TRANSFORM EXPORTER_PCB_VRML::m_OutputPCB
private

Definition at line 216 of file exporter_vrml.h.

Referenced by ExportVrmlFootprint(), SetScale(), writeLayers(), and ~EXPORTER_PCB_VRML().

◆ m_PasteColors

CUSTOM_COLORS_LIST EXPORTER_PCB_VRML::m_PasteColors
staticprivate

Definition at line 204 of file exporter_vrml.h.

Referenced by initStaticColorList().

◆ m_pcbOutlines

SHAPE_POLY_SET EXPORTER_PCB_VRML::m_pcbOutlines
private

Definition at line 269 of file exporter_vrml.h.

Referenced by ExportStandardLayers(), ExportVrmlBoard(), and ExportVrmlSolderMask().

◆ m_plated_holes

VRML_LAYER EXPORTER_PCB_VRML::m_plated_holes
private

Definition at line 227 of file exporter_vrml.h.

Referenced by ExportVrmlPadHole(), ExportVrmlViaHoles(), SetOffset(), and writeLayers().

◆ m_precision

int EXPORTER_PCB_VRML::m_precision
private

◆ m_ReuseDef

bool EXPORTER_PCB_VRML::m_ReuseDef
private

Definition at line 246 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), and ExportVrmlFootprint().

◆ m_sgmaterial

SGNODE* EXPORTER_PCB_VRML::m_sgmaterial[VRML_COLOR_LAST]
private

Definition at line 273 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), getSGColor(), and ~EXPORTER_PCB_VRML().

◆ m_SilkscreenColors

CUSTOM_COLORS_LIST EXPORTER_PCB_VRML::m_SilkscreenColors
staticprivate

Definition at line 202 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), and initStaticColorList().

◆ m_Subdir3DFpModels

wxString EXPORTER_PCB_VRML::m_Subdir3DFpModels
private

◆ m_top_copper

VRML_LAYER EXPORTER_PCB_VRML::m_top_copper
private

Definition at line 219 of file exporter_vrml.h.

Referenced by ExportStandardLayers(), GetLayer3D(), SetOffset(), and writeLayers().

◆ m_top_paste

VRML_LAYER EXPORTER_PCB_VRML::m_top_paste
private

Definition at line 225 of file exporter_vrml.h.

Referenced by ExportStandardLayers(), GetLayer3D(), SetOffset(), and writeLayers().

◆ m_top_silk

VRML_LAYER EXPORTER_PCB_VRML::m_top_silk
private

Definition at line 221 of file exporter_vrml.h.

Referenced by ExportStandardLayers(), GetLayer3D(), SetOffset(), and writeLayers().

◆ m_top_soldermask

VRML_LAYER EXPORTER_PCB_VRML::m_top_soldermask
private

Definition at line 223 of file exporter_vrml.h.

Referenced by ExportVrmlSolderMask(), GetLayer3D(), SetOffset(), and writeLayers().

◆ m_tx

double EXPORTER_PCB_VRML::m_tx
private

Definition at line 260 of file exporter_vrml.h.

Referenced by ExportVrmlFootprint(), and SetOffset().

◆ m_ty

double EXPORTER_PCB_VRML::m_ty
private

Definition at line 261 of file exporter_vrml.h.

Referenced by ExportVrmlFootprint(), and SetOffset().

◆ m_UseInlineModelsInBrdfile

bool EXPORTER_PCB_VRML::m_UseInlineModelsInBrdfile
private

◆ m_UseRelPathIn3DModelFilename

bool EXPORTER_PCB_VRML::m_UseRelPathIn3DModelFilename
private

Definition at line 243 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), ExportVRML_File(), and ExportVrmlFootprint().

◆ m_WorldScale

double EXPORTER_PCB_VRML::m_WorldScale = 1.0
private

Definition at line 255 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), ExportFp3DModelsAsLinkedFile(), and SetScale().

◆ vrml_colors_list

VRML_COLOR EXPORTER_PCB_VRML::vrml_colors_list[VRML_COLOR_LAST]
private

Definition at line 267 of file exporter_vrml.h.

Referenced by EXPORTER_PCB_VRML(), GetColor(), and getSGColor().


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