Skip to content

Commit

Permalink
[TD]Py Cosmetic Vertex, Line, Circle Arc
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Jul 15, 2019
1 parent 092aaf1 commit 5970e91
Show file tree
Hide file tree
Showing 48 changed files with 1,531 additions and 842 deletions.
40 changes: 20 additions & 20 deletions src/Mod/TechDraw/App/AppTechDrawPy.cpp
Expand Up @@ -343,31 +343,31 @@ class Module : public Py::ExtensionModule<Module>
if (PyObject_TypeCheck(viewObj, &(TechDraw::DrawViewPartPy::Type))) {
obj = static_cast<App::DocumentObjectPy*>(viewObj)->getDocumentObjectPtr();
dvp = static_cast<TechDraw::DrawViewPart*>(obj);
TechDrawGeometry::GeometryObject* go = dvp->getGeometryObject();
TopoDS_Shape s = TechDrawGeometry::mirrorShape(go->getVisHard());
TechDraw::GeometryObject* go = dvp->getGeometryObject();
TopoDS_Shape s = TechDraw::mirrorShape(go->getVisHard());
ss << dxfOut.exportEdges(s);
s = TechDrawGeometry::mirrorShape(go->getVisOutline());
s = TechDraw::mirrorShape(go->getVisOutline());
ss << dxfOut.exportEdges(s);
if (dvp->SmoothVisible.getValue()) {
s = TechDrawGeometry::mirrorShape(go->getVisSmooth());
s = TechDraw::mirrorShape(go->getVisSmooth());
ss << dxfOut.exportEdges(s);
}
if (dvp->SeamVisible.getValue()) {
s = TechDrawGeometry::mirrorShape(go->getVisSeam());
s = TechDraw::mirrorShape(go->getVisSeam());
ss << dxfOut.exportEdges(s);
}
if (dvp->HardHidden.getValue()) {
s = TechDrawGeometry::mirrorShape(go->getHidHard());
s = TechDraw::mirrorShape(go->getHidHard());
ss << dxfOut.exportEdges(s);
s = TechDrawGeometry::mirrorShape(go->getHidOutline());
s = TechDraw::mirrorShape(go->getHidOutline());
ss << dxfOut.exportEdges(s);
}
if (dvp->SmoothHidden.getValue()) {
s = TechDrawGeometry::mirrorShape(go->getHidSmooth());
s = TechDraw::mirrorShape(go->getHidSmooth());
ss << dxfOut.exportEdges(s);
}
if (dvp->SeamHidden.getValue()) {
s = TechDrawGeometry::mirrorShape(go->getHidSeam());
s = TechDraw::mirrorShape(go->getHidSeam());
ss << dxfOut.exportEdges(s);
}
// ss now contains all edges as Dxf
Expand Down Expand Up @@ -400,7 +400,7 @@ class Module : public Py::ExtensionModule<Module>
if (PyObject_TypeCheck(viewObj, &(TechDraw::DrawViewPartPy::Type))) {
obj = static_cast<App::DocumentObjectPy*>(viewObj)->getDocumentObjectPtr();
dvp = static_cast<TechDraw::DrawViewPart*>(obj);
TechDrawGeometry::GeometryObject* go = dvp->getGeometryObject();
TechDraw::GeometryObject* go = dvp->getGeometryObject();
//visible group begin "<g ... >"
ss << grpHead1;
// double thick = dvp->LineWidth.getValue();
Expand Down Expand Up @@ -461,8 +461,8 @@ class Module : public Py::ExtensionModule<Module>

void write1ViewDxf( ImpExpDxfWrite& writer, TechDraw::DrawViewPart* dvp, bool alignPage)
{
TechDrawGeometry::GeometryObject* go = dvp->getGeometryObject();
TopoDS_Shape s = TechDrawGeometry::mirrorShape(go->getVisHard());
TechDraw::GeometryObject* go = dvp->getGeometryObject();
TopoDS_Shape s = TechDraw::mirrorShape(go->getVisHard());
double offX = 0.0;
double offY = 0.0;
if (dvp->isDerivedFrom(TechDraw::DrawProjGroupItem::getClassTypeId())) {
Expand All @@ -486,40 +486,40 @@ class Module : public Py::ExtensionModule<Module>
BRepBuilderAPI_Transform mkTrf(s, xLate);
s = mkTrf.Shape();
writer.exportShape(s);
s = TechDrawGeometry::mirrorShape(go->getVisOutline());
s = TechDraw::mirrorShape(go->getVisOutline());
mkTrf.Perform(s);
s = mkTrf.Shape();
writer.exportShape(s);
if (dvp->SmoothVisible.getValue()) {
s = TechDrawGeometry::mirrorShape(go->getVisSmooth());
s = TechDraw::mirrorShape(go->getVisSmooth());
mkTrf.Perform(s);
s = mkTrf.Shape();
writer.exportShape(s);
}
if (dvp->SeamVisible.getValue()) {
s = TechDrawGeometry::mirrorShape(go->getVisSeam());
s = TechDraw::mirrorShape(go->getVisSeam());
mkTrf.Perform(s);
s = mkTrf.Shape();
writer.exportShape(s);
}
if (dvp->HardHidden.getValue()) {
s = TechDrawGeometry::mirrorShape(go->getHidHard());
s = TechDraw::mirrorShape(go->getHidHard());
mkTrf.Perform(s);
s = mkTrf.Shape();
writer.exportShape(s);
s = TechDrawGeometry::mirrorShape(go->getHidOutline());
s = TechDraw::mirrorShape(go->getHidOutline());
mkTrf.Perform(s);
s = mkTrf.Shape();
writer.exportShape(s);
}
if (dvp->SmoothHidden.getValue()) {
s = TechDrawGeometry::mirrorShape(go->getHidSmooth());
s = TechDraw::mirrorShape(go->getHidSmooth());
mkTrf.Perform(s);
s = mkTrf.Shape();
writer.exportShape(s);
}
if (dvp->SeamHidden.getValue()) {
s = TechDrawGeometry::mirrorShape(go->getHidSeam());
s = TechDraw::mirrorShape(go->getHidSeam());
mkTrf.Perform(s);
s = mkTrf.Shape();
writer.exportShape(s);
Expand Down Expand Up @@ -723,7 +723,7 @@ class Module : public Py::ExtensionModule<Module>

const TopoDS_Shape& shape = pShape->getTopoShapePtr()->getShape();
Base::Vector3d dir = static_cast<Base::VectorPy*>(pcObjDir)->value();
Base::Vector3d c = TechDrawGeometry::findCentroidVec(shape,dir);
Base::Vector3d c = TechDraw::findCentroidVec(shape,dir);
PyObject* result = nullptr;
result = new Base::VectorPy(new Base::Vector3d(c));
return Py::asObject(result);
Expand Down

0 comments on commit 5970e91

Please sign in to comment.