Skip to content

Commit

Permalink
Fix #3698 Detail of Section View
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan authored and wwmayer committed Nov 19, 2018
1 parent 893f038 commit e67b84c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Mod/TechDraw/App/DrawViewDetail.cpp
Expand Up @@ -84,6 +84,7 @@
#include "DrawUtil.h"
#include "DrawViewDetail.h"
#include "DrawProjGroupItem.h"
#include "DrawViewSection.h"

using namespace TechDraw;
using namespace std;
Expand Down Expand Up @@ -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");
}
Expand Down
1 change: 1 addition & 0 deletions src/Mod/TechDraw/App/DrawViewSection.cpp
Expand Up @@ -250,6 +250,7 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void)
return DrawView::execute();
}

m_cutShape = rawShape;
gp_Pnt inputCenter;
try {
inputCenter = TechDrawGeometry::findCentroid(rawShape,
Expand Down
4 changes: 4 additions & 0 deletions src/Mod/TechDraw/App/DrawViewSection.h
Expand Up @@ -30,6 +30,7 @@
#include <App/FeaturePython.h>
#include <App/Material.h>

#include <TopoDS_Shape.hxx>
#include <TopoDS_Compound.hxx>

#include "DrawViewPart.h"
Expand Down Expand Up @@ -94,6 +95,8 @@ class TechDrawExport DrawViewSection : public DrawViewPart
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:
Expand All @@ -108,6 +111,7 @@ class TechDrawExport DrawViewSection : public DrawViewPart
gp_Pnt faceCenter,
const Base::Vector3d &direction);
void getParameters(void);
TopoDS_Shape m_cutShape;
};

typedef App::FeaturePythonT<DrawViewSection> DrawViewSectionPython;
Expand Down

0 comments on commit e67b84c

Please sign in to comment.