OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
STEPReader.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <list>
5#include <map>
6
7#include "OldTreeIcon.h"
8
9#include "XCAFDoc_ColorTool.hxx"
10#include "XCAFDoc_ShapeTool.hxx"
11
12class EntityBase;
13class EntityGeometry;
14class Application;
15
16class STEPCAFControl_Reader;
17class TopoDS_Shape;
18class TDF_Label;
19class Model;
20
22{
23public:
24 STEPReader(Application *_app, const std::string &_serviceName) : application(_app), serviceName(_serviceName) { };
25 virtual ~STEPReader() { };
26
27 void importSTEPFile(const std::string &fileName, bool removeFile, const std::string &originalName);
28
29private:
30 void importSTEPFileWorker(const std::string &fileName, bool removeFile, const std::string &originalName);
31 void readStepFile(std::string fileName, const std::string &rootName, bool removeFile, std::string &messages);
32 std::string getNameFromLabel(const TDF_Label &label);
33 std::string getEntityName(const std::string &prefix, const TDF_Label &label, const TopoDS_Shape &theShape, STEPCAFControl_Reader *aReader);
34 Quantity_Color readColor(const TDF_Label &label, const TopoDS_Shape &shape);
35 void processNode(const TDF_Label &itemLabel, std::string prefix, STEPCAFControl_Reader *reader, TopLoc_Location aLocation, const std::string &rootName, std::map<std::string, bool> &existingEntityNames, std::string &messages, int &shapesIndex, int numberOfShapes, bool buildShapes);
36 void splitCompoundShapes(TopoDS_Shape &itemShape, std::list<TopoDS_Shape> &shapeList);
37 void analyzeGeometry(EntityGeometry *entityGeom, std::string &messages);
38 void simplifyComplexSplines(EntityGeometry *entityGeom, double maxRatioForComplexSplines);
39 std::string determineUniqueRootName(const std::string &fileName);
40
41 std::list<EntityGeometry *> entityList;
42
43 Handle(XCAFDoc_ColorTool) colorTool;
44 Handle(XCAFDoc_ShapeTool) shapeTool;
45
46 Application *application;
47 std::string serviceName;
48 static std::string materialsFolder;
49 static ot::UID materialsFolderID;
50};
51
Definition Application.h:25
The Model class is the main interface to the model. There may be multiple instances of this class....
Definition Model.h:94
Definition STEPReader.h:22
STEPReader(Application *_app, const std::string &_serviceName)
Definition STEPReader.h:24
virtual ~STEPReader()
Definition STEPReader.h:25
void importSTEPFile(const std::string &fileName, bool removeFile, const std::string &originalName)
Definition STEPReader.cpp:58
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27