Allow datum points and lines to have offsets from their references

This commit is contained in:
jrheinlaender
2013-09-16 20:36:00 +02:00
committed by Stefan Tröger
parent 20b8b53851
commit 5aa16e7807
8 changed files with 359 additions and 36 deletions

View File

@@ -179,7 +179,7 @@ void Plane::onChanged(const App::Property *prop)
refTypes.erase(ANGLE);
}
if (prop == &References) {
if ((prop == &References) || (prop == &Offset)) {
refTypes.clear();
std::vector<App::DocumentObject*> refs = References.getValues();
std::vector<std::string> refnames = References.getSubValues();
@@ -315,11 +315,11 @@ void Plane::onChanged(const App::Property *prop)
if (!intersector.IsDone() || (intersector.NbPoints() == 0))
return;
if (intersector.NbPoints() > 1)
Base::Console().Warning("More than one intersection point for datum plane from cylinder and plane");
Base::Console().Warning("More than one intersection point for datum plane from cylinder and plane\n");
gp_Pnt inter = intersector.Point(1);
p1 = new Base::Vector3d(inter.X(), inter.Y(), inter.Z());
// TODO: Allow to control which side of the cylinder the plane is create on - there are always two possibilities
// TODO: Allow to control which side of the cylinder the plane is created on - there are always two possibilities
} else if ((p1 != NULL) && (normal != NULL)) {
// plane from other plane. Nothing to be done
} else if ((p1 != NULL) && (p2 != NULL) && (p3 != NULL)) {
@@ -366,6 +366,11 @@ const std::set<QString> Plane::getHint()
return std::set<QString>();
}
const int Plane::offsetsAllowed() const
{
return 1;
}
Base::Vector3d Plane::getBasePoint()
{
return Placement.getValue().getPosition();