Fix bad highlight position in Detail from ProjGroup
This commit is contained in:
@@ -380,6 +380,7 @@ App::DocumentObject * DrawProjGroup::addProjection(const char *viewProjType)
|
||||
view->Direction.setValue(vecs.first);
|
||||
view->RotationVector.setValue(vecs.second);
|
||||
} else { //Front
|
||||
//where do direction & Rotation Vector get set for front???
|
||||
view->LockPosition.setValue(true); //lock "Front" position within DPG (note not Page!).
|
||||
view->LockPosition.setStatus(App::Property::ReadOnly,true); //Front should stay locked.
|
||||
App::GetApplication().signalChangePropertyEditor(view->LockPosition);
|
||||
@@ -1055,7 +1056,7 @@ void DrawProjGroup::spinCW()
|
||||
Base::Vector3d org(0.0,0.0,0.0);
|
||||
Base::Vector3d curRot = anchor->RotationVector.getValue();
|
||||
Base::Vector3d curDir = anchor->Direction.getValue();
|
||||
Base::Vector3d newRot = DrawUtil::vecRotate(curRot,-angle,curDir,org);
|
||||
Base::Vector3d newRot = DrawUtil::vecRotate(curRot,angle,curDir,org);
|
||||
anchor->RotationVector.setValue(newRot);
|
||||
updateSecondaryDirs();
|
||||
}
|
||||
@@ -1068,7 +1069,7 @@ void DrawProjGroup::spinCCW()
|
||||
Base::Vector3d org(0.0,0.0,0.0);
|
||||
Base::Vector3d curRot = anchor->RotationVector.getValue();
|
||||
Base::Vector3d curDir = anchor->Direction.getValue();
|
||||
Base::Vector3d newRot = DrawUtil::vecRotate(curRot,angle,curDir,org);
|
||||
Base::Vector3d newRot = DrawUtil::vecRotate(curRot,-angle,curDir,org);
|
||||
anchor->RotationVector.setValue(newRot);
|
||||
|
||||
updateSecondaryDirs();
|
||||
|
||||
@@ -182,6 +182,8 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void)
|
||||
TopoDS_Shape shape;
|
||||
if (dvs != nullptr) {
|
||||
shape = dvs->getCutShape();
|
||||
} else if (dpgi != nullptr) {
|
||||
shape = dpgi->getSourceShapeFused();
|
||||
} else {
|
||||
shape = dvp->getSourceShapeFused();
|
||||
}
|
||||
@@ -207,25 +209,6 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void)
|
||||
gp_Ax2 vaBase;
|
||||
if (dpgi != nullptr) {
|
||||
viewAxis = dpgi->getViewAxis(shapeCenter, dirDetail);
|
||||
vaBase = TechDrawGeometry::getViewAxis(shapeCenter,dirDetail,false);
|
||||
|
||||
Base::Vector3d vaDir(vaBase.Direction().X(),vaBase.Direction().Y(),vaBase.Direction().Z());
|
||||
Base::Vector3d vabDir(vaBase.Direction().X(),vaBase.Direction().Y(),vaBase.Direction().Z());
|
||||
double vaDot = vaDir.Dot(vabDir);
|
||||
|
||||
if (DrawUtil::fpCompare(vaDot,-1.0)) { //anti-parallel, flip
|
||||
myShape = TechDrawGeometry::rotateShape(myShape,
|
||||
viewAxis,
|
||||
180.0);
|
||||
}
|
||||
Base::Vector3d vaxDir(vaBase.XDirection().X(),vaBase.XDirection().Y(),vaBase.XDirection().Z());
|
||||
Base::Vector3d vabxDir(vaBase.XDirection().X(),vaBase.XDirection().Y(),vaBase.XDirection().Z());
|
||||
double vaxDot = vaxDir.Dot(vabxDir);
|
||||
if (DrawUtil::fpCompare(vaxDot,-1.0)) {
|
||||
myShape = TechDrawGeometry::rotateShape(myShape,
|
||||
viewAxis,
|
||||
180.0);
|
||||
}
|
||||
} else {
|
||||
viewAxis = dvp->getViewAxis(shapeCenter, dirDetail,false);
|
||||
}
|
||||
@@ -311,9 +294,6 @@ App::DocumentObjectExecReturn *DrawViewDetail::execute(void)
|
||||
viewAxis = getViewAxis(Base::Vector3d(inputCenter.X(),inputCenter.Y(),inputCenter.Z()),dirDetail);
|
||||
|
||||
double shapeRotate = dvp->Rotation.getValue(); //degrees CW?
|
||||
if (dpgi != nullptr) {
|
||||
shapeRotate += dpgi->getRotateAngle() * 180.0/M_PI; // to degrees from radians
|
||||
}
|
||||
|
||||
if (!DrawUtil::fpCompare(shapeRotate,0.0)) {
|
||||
mirroredShape = TechDrawGeometry::rotateShape(mirroredShape,
|
||||
|
||||
Reference in New Issue
Block a user