25#ifndef OCE_VIS_OCE_UTILS_H
26#define OCE_VIS_OCE_UTILS_H
34#include <Standard_Handle.hxx>
35#include <TDF_Label.hxx>
36#include <TopoDS_Shape.hxx>
69class TDocStd_Document;
70class XCAFApp_Application;
71class XCAFDoc_ShapeTool;
74typedef std::map< std::string, TDF_Label >
MODEL_MAP;
98 const VECTOR2D& aOrigin,
bool aTrack );
101 bool AddComponent(
const std::string& aFileName,
const std::string& aRefDes,
bool aBottom,
135 bool aConvertToArcs,
double aThickness,
double aZposition,
149 double aThickness,
double aZposition,
const VECTOR2D& aOrigin );
165 double aWidth,
double aThickness,
double aZposition,
170 bool WriteIGES(
const wxString& aFileName );
174 bool WriteSTEP(
const wxString& aFileName,
bool aOptimize );
177 bool WriteBREP(
const wxString& aFileName );
180 bool WriteXAO(
const wxString& aFileName );
196 bool WriteGLTF(
const wxString& aFileName );
221 bool aSubstituteModels, wxString* aErrorMessage =
nullptr );
224 VECTOR3D aOrientation, TopLoc_Location& aLocation );
226 bool readIGES(
Handle( TDocStd_Document )& m_doc,
const char* fname );
227 bool readSTEP(
Handle( TDocStd_Document )& m_doc,
const char* fname );
Manage layers needed to make a physical board.
LSET is a set of PCB_LAYER_IDs.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Represent a set of closed polygons.
void SetCopperColor(double r, double g, double b)
bool isBoardOutlineValid()
bool CreatePCB(SHAPE_POLY_SET &aOutline, VECTOR2D aOrigin, bool aPushBoardBody)
bool MakeShapeAsThickSegment(TopoDS_Shape &aShape, VECTOR2D aStartPoint, VECTOR2D aEndPoint, double aWidth, double aThickness, double aZposition, const VECTOR2D &aOrigin)
Convert a SHAPE_LINE_CHAIN containing only one 360 deg arc to a TopoDS_Shape ( vertical cylinder) it ...
bool AddComponent(const std::string &aFileName, const std::string &aRefDes, bool aBottom, VECTOR2D aPosition, double aRotation, VECTOR3D aOffset, VECTOR3D aOrientation, VECTOR3D aScale, bool aSubstituteModels=true)
wxString m_pcbName
Name of the PCB, which will most likely be the file name of the path.
std::vector< TopoDS_Shape > m_boardCutouts
void getBoardBodyZPlacement(double &aZPos, double &aThickness)
std::vector< TopoDS_Shape > m_board_copper_fused
void SetFuseShapes(bool aValue)
bool WriteXAO(const wxString &aFileName)
bool WriteGLTF(const wxString &aFileName)
Write the assembly in binary GLTF Format.
Handle(XCAFDoc_ShapeTool) m_assy
bool AddPadHole(const PAD *aPad, const VECTOR2D &aOrigin)
std::vector< TDF_Label > m_pcb_labels
bool MakeShapeAsCylinder(TopoDS_Shape &aShape, const SHAPE_LINE_CHAIN &aChain, double aThickness, double aZposition, const VECTOR2D &aOrigin)
Convert a SHAPE_LINE_CHAIN containing only one 360 deg arc to a TopoDS_Shape ( vertical cylinder) it ...
void getLayerZPlacement(const PCB_LAYER_ID aLayer, double &aZPos, double &aThickness)
std::vector< TopoDS_Shape > m_board_outlines
bool readIGES(Handle(TDocStd_Document)&m_doc, const char *fname)
void SetBoardColor(double r, double g, double b)
bool AddViaShape(const PCB_VIA *aVia, const VECTOR2D &aOrigin)
void SetEnabledLayers(const LSET &aLayers)
bool readSTEP(Handle(TDocStd_Document)&m_doc, const char *fname)
Handle(TDocStd_Document) m_doc
Handle(XCAFApp_Application) m_app
void SetMaxError(int aMaxError)
bool getModelLocation(bool aBottom, VECTOR2D aPosition, double aRotation, VECTOR3D aOffset, VECTOR3D aOrientation, TopLoc_Location &aLocation)
virtual ~STEP_PCB_MODEL()
std::vector< TopoDS_Shape > m_board_copper_tracks
void SetStackup(const BOARD_STACKUP &aStackup)
void SetNetFilter(const wxString &aFilter)
bool AddPadShape(const PAD *aPad, const VECTOR2D &aOrigin, bool aVia)
bool MakeShapes(std::vector< TopoDS_Shape > &aShapes, const SHAPE_POLY_SET &aPolySet, bool aConvertToArcs, double aThickness, double aZposition, const VECTOR2D &aOrigin)
Convert a SHAPE_POLY_SET to TopoDS_Shape's (polygonal vertical prisms)
bool getModelLabel(const std::string &aFileNameUTF8, VECTOR3D aScale, TDF_Label &aLabel, bool aSubstituteModels, wxString *aErrorMessage=nullptr)
Load a 3D model data.
bool WriteSTEP(const wxString &aFileName, bool aOptimize)
std::vector< TopoDS_Shape > m_copperCutouts
std::vector< TopoDS_Shape > m_board_copper_pads
std::vector< TopoDS_Shape > m_board_copper_zones
std::map< wxString, std::pair< gp_Pnt, TopoDS_Shape > > m_pad_points
bool AddTrackSegment(const PCB_TRACK *aTrack, const VECTOR2D &aOrigin)
TDF_Label transferModel(Handle(TDocStd_Document)&source, Handle(TDocStd_Document) &dest, VECTOR3D aScale)
void OCCSetMergeMaxDistance(double aDistance=OCC_MAX_DISTANCE_TO_MERGE_POINTS)
bool AddCopperPolygonShapes(const SHAPE_POLY_SET *aPolyShapes, PCB_LAYER_ID aLayer, const VECTOR2D &aOrigin, bool aTrack)
bool WriteBREP(const wxString &aFileName)
PCB_LAYER_ID
A quick note on layer IDs:
static constexpr double COPPER_THICKNESS_DEFAULT_MM
static constexpr double OCC_MAX_DISTANCE_TO_MERGE_POINTS
Default distance between points to treat them as separate ones (mm) 0.001 mm or less is a reasonable ...
std::map< std::string, TDF_Label > MODEL_MAP
static constexpr double BOARD_THICKNESS_DEFAULT_MM
std::pair< std::string, TDF_Label > MODEL_DATUM
static constexpr double ARC_TO_SEGMENT_MAX_ERROR_MM
static constexpr double BOARD_THICKNESS_MIN_MM
void ReportMessage(const wxString &aMessage)