![]() |
KiCad PCB EDA Suite
|
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstring>
#include <map>
#include <vector>
#include <wx/filename.h>
#include <wx/stdpaths.h>
#include <wx/string.h>
#include <wx/utils.h>
#include <wx/wfstream.h>
#include <wx/zipstrm.h>
#include <decompress.hpp>
#include <TDocStd_Document.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <Quantity_Color.hxx>
#include <XCAFApp_Application.hxx>
#include <AIS_Shape.hxx>
#include <IGESControl_Reader.hxx>
#include <IGESCAFControl_Reader.hxx>
#include <Interface_Static.hxx>
#include <STEPControl_Reader.hxx>
#include <STEPCAFControl_Reader.hxx>
#include <XCAFDoc_DocumentTool.hxx>
#include <XCAFDoc_ColorTool.hxx>
#include <XCAFDoc_ShapeTool.hxx>
#include <BRep_Tool.hxx>
#include <BRepMesh_IncrementalMesh.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Compound.hxx>
#include <TopExp_Explorer.hxx>
#include <Poly_Triangulation.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
#include <Precision.hxx>
#include <TDF_LabelSequence.hxx>
#include <TDF_ChildIterator.hxx>
#include "plugins/3dapi/ifsg_all.h"
Go to the source code of this file.
Classes | |
struct | DATA |
Macros | |
#define | MASK_OCE "PLUGIN_OCE" |
#define | USER_PREC (0.14) |
#define | USER_ANGLE (0.52359878) |
Typedefs | |
typedef std::map< Standard_Real, SGNODE * > | COLORMAP |
typedef std::map< std::string, SGNODE * > | FACEMAP |
typedef std::map< std::string, std::vector< SGNODE * > > | NODEMAP |
typedef std::pair< std::string, std::vector< SGNODE * > > | NODEITEM |
Enumerations | |
enum | FormatType { FMT_NONE = 0, FMT_STEP, FMT_STPZ, FMT_IGES } |
Functions | |
bool | processNode (const TopoDS_Shape &shape, DATA &data, SGNODE *parent, std::vector< SGNODE * > *items) |
bool | processComp (const TopoDS_Shape &shape, DATA &data, SGNODE *parent, std::vector< SGNODE * > *items) |
bool | processFace (const TopoDS_Face &face, DATA &data, SGNODE *parent, std::vector< SGNODE * > *items, Quantity_Color *color) |
FormatType | fileType (const char *aFileName) |
void | getTag (TDF_Label &label, std::string &aTag) |
bool | getColor (DATA &data, TDF_Label label, Quantity_Color &color) |
void | addItems (SGNODE *parent, std::vector< SGNODE * > *lp) |
bool | readIGES (Handle(TDocStd_Document)&m_doc, const char *fname) |
bool | readSTEP (Handle(TDocStd_Document)&m_doc, const char *fname) |
bool | readSTEPZ (Handle(TDocStd_Document)&m_doc, const char *aFileName) |
SCENEGRAPH * | LoadModel (char const *filename) |
bool | processShell (const TopoDS_Shape &shape, DATA &data, SGNODE *parent, std::vector< SGNODE * > *items, Quantity_Color *color) |
bool | processSolid (const TopoDS_Shape &shape, DATA &data, SGNODE *parent, std::vector< SGNODE * > *items) |
#define MASK_OCE "PLUGIN_OCE" |
Definition at line 80 of file loadmodel.cpp.
#define USER_ANGLE (0.52359878) |
Definition at line 89 of file loadmodel.cpp.
#define USER_PREC (0.14) |
Definition at line 83 of file loadmodel.cpp.
Definition at line 91 of file loadmodel.cpp.
Definition at line 92 of file loadmodel.cpp.
Definition at line 94 of file loadmodel.cpp.
Definition at line 93 of file loadmodel.cpp.
enum FormatType |
Enumerator | |
---|---|
FMT_NONE | |
FMT_STEP | |
FMT_STPZ | |
FMT_IGES |
Definition at line 264 of file loadmodel.cpp.
Definition at line 373 of file loadmodel.cpp.
References S3D::AddSGNodeChild(), S3D::AddSGNodeRef(), S3D::GetSGNodeParent(), and NULL.
Referenced by processSolid().
FormatType fileType | ( | const char * | aFileName | ) |
Definition at line 273 of file loadmodel.cpp.
References FMT_IGES, FMT_NONE, FMT_STEP, and FMT_STPZ.
Referenced by PANEL_FP_LIB_TABLE::browseLibrariesHandler(), GRAPHICS_IMPORT_MGR::GetPluginByExt(), SCH_EDIT_FRAME::importFile(), FOOTPRINT_EDIT_FRAME::ImportFootprint(), LoadModel(), PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE(), GERBVIEW_CONTROL::ReloadAllLayers(), and SYMBOL_EDIT_FRAME::saveLibrary().
bool getColor | ( | DATA & | data, |
TDF_Label | label, | ||
Quantity_Color & | color | ||
) |
Definition at line 352 of file loadmodel.cpp.
References color, and DATA::GetColor().
Referenced by processSolid().
void getTag | ( | TDF_Label & | label, |
std::string & | aTag | ||
) |
SCENEGRAPH* LoadModel | ( | char const * | filename | ) |
Definition at line 532 of file loadmodel.cpp.
References fileType(), FMT_IGES, FMT_STEP, FMT_STPZ, IFSG_NODE::GetRawPtr(), DATA::GetShape(), NULL, processNode(), readIGES(), readSTEP(), readSTEPZ(), DATA::renderBoth, DATA::scene, and S3D::WriteVRML().
Referenced by Load().
bool processComp | ( | const TopoDS_Shape & | shape, |
DATA & | data, | ||
SGNODE * | parent, | ||
std::vector< SGNODE * > * | items | ||
) |
Definition at line 752 of file loadmodel.cpp.
References PNS::angle(), IFSG_NODE::Destroy(), IFSG_NODE::GetRawPtr(), DATA::hasSolid, NULL, processFace(), processShell(), processSolid(), IFSG_TRANSFORM::SetRotation(), and IFSG_TRANSFORM::SetTranslation().
Referenced by processNode().
bool processFace | ( | const TopoDS_Face & | face, |
DATA & | data, | ||
SGNODE * | parent, | ||
std::vector< SGNODE * > * | items, | ||
Quantity_Color * | color | ||
) |
Definition at line 854 of file loadmodel.cpp.
References S3D::AddSGNodeChild(), S3D::AddSGNodeRef(), IFSG_FACESET::CalcNormals(), color, DATA::faces, DATA::GetColor(), DATA::GetFace(), IFSG_NODE::GetRawPtr(), S3D::GetSGNodeParent(), getTag(), DATA::hasSolid, NULL, DATA::renderBoth, IFSG_COORDS::SetCoordsList(), IFSG_INDEX::SetIndices(), IFSG_NODE::SetParent(), USER_ANGLE, and USER_PREC.
Referenced by processComp(), processNode(), and processShell().
bool processNode | ( | const TopoDS_Shape & | shape, |
DATA & | data, | ||
SGNODE * | parent, | ||
std::vector< SGNODE * > * | items | ||
) |
Definition at line 816 of file loadmodel.cpp.
References DATA::hasSolid, NULL, processComp(), processFace(), processShell(), and processSolid().
Referenced by LoadModel().
bool processShell | ( | const TopoDS_Shape & | shape, |
DATA & | data, | ||
SGNODE * | parent, | ||
std::vector< SGNODE * > * | items, | ||
Quantity_Color * | color | ||
) |
Definition at line 620 of file loadmodel.cpp.
References color, and processFace().
Referenced by processComp(), processNode(), and processSolid().
bool processSolid | ( | const TopoDS_Shape & | shape, |
DATA & | data, | ||
SGNODE * | parent, | ||
std::vector< SGNODE * > * | items | ||
) |
Definition at line 638 of file loadmodel.cpp.
References addItems(), PNS::angle(), IFSG_NODE::Destroy(), getColor(), IFSG_NODE::GetRawPtr(), DATA::GetShape(), getTag(), DATA::hasSolid, NULL, processShell(), IFSG_TRANSFORM::SetRotation(), and IFSG_TRANSFORM::SetTranslation().
Referenced by processComp(), and processNode().
bool readIGES | ( | Handle(TDocStd_Document)& | m_doc, |
const char * | fname | ||
) |
bool readSTEP | ( | Handle(TDocStd_Document)& | m_doc, |
const char * | fname | ||
) |
Definition at line 427 of file loadmodel.cpp.
References USER_PREC.
Referenced by LoadModel(), and readSTEPZ().
bool readSTEPZ | ( | Handle(TDocStd_Document)& | m_doc, |
const char * | aFileName | ||
) |
Definition at line 462 of file loadmodel.cpp.
References readSTEP().
Referenced by LoadModel().