44 lines
1013 B
C++
44 lines
1013 B
C++
|
|
|||
|
#include "OCCTopoShapeTreeViewer.h"
|
|||
|
#include <qDebug>
|
|||
|
#include "SharedModuleLib/BaseUiTool.h"
|
|||
|
#include <BRep_Tool.hxx>
|
|||
|
#include <TopoDS_Vertex.hxx>
|
|||
|
|
|||
|
|
|||
|
OCCTopoShapeTreeViewer::OCCTopoShapeTreeViewer(QWidget* parent)
|
|||
|
: QTreeWidget(parent)
|
|||
|
{
|
|||
|
// <20><><EFBFBD>캯<EFBFBD><ECBAAF>
|
|||
|
}
|
|||
|
|
|||
|
void OCCTopoShapeTreeViewer::setTopoShape(const TopoDS_Shape& shape)
|
|||
|
{
|
|||
|
this->displayTopoShape(shape);
|
|||
|
}
|
|||
|
|
|||
|
void OCCTopoShapeTreeViewer::displayTopoShape(const TopoDS_Shape& shape)
|
|||
|
{
|
|||
|
// <20><><EFBFBD><EFBFBD>QTreeWidget
|
|||
|
clear();
|
|||
|
|
|||
|
// <20><><EFBFBD>õݹ麯<DDB9><E9BAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Topo_Shape<70>IJ<EFBFBD><C4B2>νṹ
|
|||
|
addTopoShapeToTreeWidget(shape, nullptr);
|
|||
|
|
|||
|
// չ<><D5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ
|
|||
|
expandAll();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void OCCTopoShapeTreeViewer::addTopoShapeToTreeWidget(const TopoDS_Shape& shape, QTreeWidgetItem* parentItem)
|
|||
|
{
|
|||
|
// <20><>ȡ<EFBFBD><C8A1>ǰTopo_Shape<70><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
TopAbs_ShapeEnum shapeType = shape.ShapeType();
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>µ<EFBFBD>QTreeWidgetItem<65><6D><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>ǰTopo_Shape
|
|||
|
QTreeWidgetItem* currentItem = new QTreeWidgetItem(parentItem);
|
|||
|
currentItem->setText(0, TopAbs_ShapeEnum2QString(shapeType));
|
|||
|
|
|||
|
}
|
|||
|
|