rename 2d tool classes to be consistent with 3d classes

This commit is contained in:
wmayer
2016-11-21 14:29:51 +01:00
parent 9fe280ed63
commit 2d8e70085e
42 changed files with 950 additions and 951 deletions

View File

@@ -75,7 +75,7 @@ DrawSketchHandler::~DrawSketchHandler()
void DrawSketchHandler::quit(void)
{
assert(sketchgui);
sketchgui->drawEdit(std::vector<Base::Vector2D>());
sketchgui->drawEdit(std::vector<Base::Vector2d>());
resetPositionText();
unsetCursor();
@@ -133,7 +133,7 @@ void DrawSketchHandler::unsetCursor(void)
}
int DrawSketchHandler::seekAutoConstraint(std::vector<AutoConstraint> &suggestedConstraints,
const Base::Vector2D& Pos, const Base::Vector2D& Dir,
const Base::Vector2d& Pos, const Base::Vector2d& Dir,
AutoConstraint::TargetType type)
{
suggestedConstraints.clear();
@@ -191,7 +191,7 @@ int DrawSketchHandler::seekAutoConstraint(std::vector<AutoConstraint> &suggested
constr.Type = Sketcher::Tangent;
if(constr.Type == Sketcher::Tangent && Dir.Length() > 1e-8 && hitShapeDir.Length() > 1e-8) { // We are hitting a line and have hitting vector information
Base::Vector3d dir3d = Base::Vector3d(Dir.fX,Dir.fY,0);
Base::Vector3d dir3d = Base::Vector3d(Dir.x,Dir.y,0);
double cosangle=dir3d.Normalize()*hitShapeDir.Normalize();
// the angle between the line and the hitting direction are over around 6 degrees (it is substantially parallel)
@@ -221,7 +221,7 @@ int DrawSketchHandler::seekAutoConstraint(std::vector<AutoConstraint> &suggested
constr.Type = Sketcher::None;
constr.GeoId = Constraint::GeoUndef;
constr.PosId = Sketcher::none;
double angle = std::abs(atan2(Dir.fY, Dir.fX));
double angle = std::abs(atan2(Dir.y, Dir.x));
if (angle < angleDevRad || (M_PI - angle) < angleDevRad )
// Suggest horizontal constraint
constr.Type = Sketcher::Horizontal;
@@ -243,9 +243,9 @@ int DrawSketchHandler::seekAutoConstraint(std::vector<AutoConstraint> &suggested
// Get geometry list
const std::vector<Part::Geometry *> geomlist = sketchgui->getSketchObject()->getCompleteGeometry();
Base::Vector3d tmpPos(Pos.fX, Pos.fY, 0.f); // Current cursor point
Base::Vector3d tmpDir(Dir.fX, Dir.fY, 0.f); // Direction of line
Base::Vector3d tmpStart(Pos.fX-Dir.fX, Pos.fY-Dir.fY, 0.f); // Start point
Base::Vector3d tmpPos(Pos.x, Pos.y, 0.f); // Current cursor point
Base::Vector3d tmpDir(Dir.x, Dir.y, 0.f); // Direction of line
Base::Vector3d tmpStart(Pos.x-Dir.x, Pos.y-Dir.y, 0.f); // Start point
// Iterate through geometry
int i = 0;
@@ -287,7 +287,7 @@ int DrawSketchHandler::seekAutoConstraint(std::vector<AutoConstraint> &suggested
Base::Vector3d focus1P = center + cf * majdir;
Base::Vector3d focus2P = center - cf * majdir;
Base::Vector3d norm = Base::Vector3d(Dir.fY,-Dir.fX).Normalize();
Base::Vector3d norm = Base::Vector3d(Dir.y,-Dir.x).Normalize();
double distancetoline = norm*(tmpPos - focus1P); // distance focus1 to line
@@ -342,7 +342,7 @@ int DrawSketchHandler::seekAutoConstraint(std::vector<AutoConstraint> &suggested
Base::Vector3d focus1P = center + cf * majdir;
Base::Vector3d focus2P = center - cf * majdir;
Base::Vector3d norm = Base::Vector3d(Dir.fY,-Dir.fX).Normalize();
Base::Vector3d norm = Base::Vector3d(Dir.y,-Dir.x).Normalize();
double distancetoline = norm*(tmpPos - focus1P); // distance focus1 to line
@@ -581,13 +581,13 @@ void DrawSketchHandler::renderSuggestConstraintsCursor(std::vector<AutoConstrain
applyCursor(newCursor);
}
void DrawSketchHandler::setPositionText(const Base::Vector2D &Pos, const SbString &text)
void DrawSketchHandler::setPositionText(const Base::Vector2d &Pos, const SbString &text)
{
sketchgui->setPositionText(Pos, text);
}
void DrawSketchHandler::setPositionText(const Base::Vector2D &Pos)
void DrawSketchHandler::setPositionText(const Base::Vector2d &Pos)
{
sketchgui->setPositionText(Pos);
}