[TD]Py Cosmetic Vertex, Line, Circle Arc

This commit is contained in:
wandererfan
2019-06-10 15:48:56 -04:00
committed by WandererFan
parent 237182e0d5
commit fbfdb69c20
48 changed files with 1529 additions and 840 deletions

View File

@@ -221,7 +221,7 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void)
BRepBuilderAPI_Copy BuilderCopy(shape);
TopoDS_Shape myShape = BuilderCopy.Shape();
gp_Pnt gpCenter = TechDrawGeometry::findCentroid(myShape,
gp_Pnt gpCenter = TechDraw::findCentroid(myShape,
dirDetail);
Base::Vector3d shapeCenter = Base::Vector3d(gpCenter.X(),gpCenter.Y(),gpCenter.Z());
@@ -233,9 +233,9 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void)
viewAxis = dvp->getViewAxis(shapeCenter, dirDetail,false);
}
myShape = TechDrawGeometry::moveShape(myShape, //centre on origin
myShape = TechDraw::moveShape(myShape, //centre on origin
-shapeCenter);
gpCenter = TechDrawGeometry::findCentroid(myShape, //sb origin!
gpCenter = TechDraw::findCentroid(myShape, //sb origin!
dirDetail);
shapeCenter = Base::Vector3d(gpCenter.X(),gpCenter.Y(),gpCenter.Z());
@@ -293,7 +293,7 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void)
BRepBndLib::Add(detail, testBox);
if (testBox.IsVoid()) {
// Base::Console().Warning("DrawViewDetail - detail area contains no geometry\n");
TechDrawGeometry::GeometryObject* go = getGeometryObject();
TechDraw::GeometryObject* go = getGeometryObject();
if (go != nullptr) {
go->clear();
}
@@ -311,9 +311,9 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void)
gp_Pnt inputCenter;
try {
inputCenter = TechDrawGeometry::findCentroid(tool,
inputCenter = TechDraw::findCentroid(tool,
dirDetail);
TopoDS_Shape mirroredShape = TechDrawGeometry::mirrorShape(detail,
TopoDS_Shape mirroredShape = TechDraw::mirrorShape(detail,
inputCenter,
scale);
@@ -322,11 +322,11 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void)
double shapeRotate = dvp->Rotation.getValue(); //degrees CW?
if (!DrawUtil::fpCompare(shapeRotate,0.0)) {
mirroredShape = TechDrawGeometry::rotateShape(mirroredShape,
mirroredShape = TechDraw::rotateShape(mirroredShape,
viewAxis,
shapeRotate);
}
inputCenter = TechDrawGeometry::findCentroid(mirroredShape,
inputCenter = TechDraw::findCentroid(mirroredShape,
dirDetail);
geometryObject = buildGeometryObject(mirroredShape,viewAxis);
@@ -352,16 +352,16 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void)
}
//add back the cosmetic vertices
for (auto& v: cosmoVertex) {
int idx = geometryObject->addRandomVertex(v->pageLocation * getScale());
for (auto& v: vertexCosmetic) {
int idx = geometryObject->addCosmeticVertex(v->point() * getScale());
v->linkGeom = idx;
}
//add the cosmetic Edges to geometry Edges list
for (auto& e: cosmoEdge) {
TechDrawGeometry::BaseGeom* scaledGeom = e->scaledGeometry(getScale());
int idx = geometryObject->addRandomEdge(scaledGeom);
e->linkGeom = idx;
for (auto& e: edgeCosmetic) {
TechDraw::BaseGeom* scaledGeom = e->scaledGeometry(getScale());
int idx = geometryObject->addCosmeticEdge(scaledGeom);
e->m_linkGeom = idx;
}
requestPaint();