Fix #3698 Detail of Section View
This commit is contained in:
@@ -84,6 +84,7 @@
|
||||
#include "DrawUtil.h"
|
||||
#include "DrawViewDetail.h"
|
||||
#include "DrawProjGroupItem.h"
|
||||
#include "DrawViewSection.h"
|
||||
|
||||
using namespace TechDraw;
|
||||
using namespace std;
|
||||
@@ -172,7 +173,18 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void)
|
||||
dpgi= static_cast<TechDraw::DrawProjGroupItem*>(dvp);
|
||||
}
|
||||
|
||||
TopoDS_Shape shape = dvp->getSourceShapeFused();
|
||||
DrawViewSection* dvs = nullptr;
|
||||
if (dvp->isDerivedFrom(TechDraw::DrawViewSection::getClassTypeId())) {
|
||||
dvs= static_cast<TechDraw::DrawViewSection*>(dvp);
|
||||
}
|
||||
|
||||
TopoDS_Shape shape;
|
||||
if (dvs != nullptr) {
|
||||
shape = dvs->getCutShape();
|
||||
} else {
|
||||
shape = dvp->getSourceShapeFused();
|
||||
}
|
||||
|
||||
if (shape.IsNull()) {
|
||||
return new App::DocumentObjectExecReturn("DVD - Linked shape object is invalid");
|
||||
}
|
||||
|
||||
@@ -250,6 +250,7 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void)
|
||||
return DrawView::execute();
|
||||
}
|
||||
|
||||
m_cutShape = rawShape;
|
||||
gp_Pnt inputCenter;
|
||||
try {
|
||||
inputCenter = TechDrawGeometry::findCentroid(rawShape,
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <App/FeaturePython.h>
|
||||
#include <App/Material.h>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
|
||||
#include "DrawViewPart.h"
|
||||
@@ -94,6 +95,8 @@ public:
|
||||
std::vector<LineSet> getDrawableLines(int i = 0);
|
||||
std::vector<PATLineSpec> getDecodedSpecsFromFile(std::string fileSpec, std::string myPattern);
|
||||
|
||||
TopoDS_Shape getCutShape(void) {return m_cutShape;}
|
||||
|
||||
static const char* SectionDirEnums[];
|
||||
|
||||
protected:
|
||||
@@ -108,6 +111,7 @@ protected:
|
||||
gp_Pnt faceCenter,
|
||||
const Base::Vector3d &direction);
|
||||
void getParameters(void);
|
||||
TopoDS_Shape m_cutShape;
|
||||
};
|
||||
|
||||
typedef App::FeaturePythonT<DrawViewSection> DrawViewSectionPython;
|
||||
|
||||
Reference in New Issue
Block a user