#include <GCS.h>
Public Member Functions | |
int | addConstraint (Constraint *constr) |
int | addConstraintArcRadius (Arc &a, double *radius, int tagId=0) |
int | addConstraintArcRules (Arc &a, int tagId=0) |
int | addConstraintCircleRadius (Circle &c, double *radius, int tagId=0) |
int | addConstraintCoordinateX (Point &p, double *x, int tagId=0) |
int | addConstraintCoordinateY (Point &p, double *y, int tagId=0) |
int | addConstraintDifference (double *param1, double *param2, double *difference, int tagId=0) |
int | addConstraintEqual (double *param1, double *param2, int tagId=0) |
int | addConstraintEqualLength (Line &l1, Line &l2, double *length, int tagId=0) |
int | addConstraintEqualRadius (Arc &a1, Arc &a2, int tagId=0) |
int | addConstraintEqualRadius (Circle &c1, Arc &a2, int tagId=0) |
int | addConstraintEqualRadius (Circle &c1, Circle &c2, int tagId=0) |
int | addConstraintHorizontal (Point &p1, Point &p2, int tagId=0) |
int | addConstraintHorizontal (Line &l, int tagId=0) |
int | addConstraintL2LAngle (Point &l1p1, Point &l1p2, Point &l2p1, Point &l2p2, double *angle, int tagId=0) |
int | addConstraintL2LAngle (Line &l1, Line &l2, double *angle, int tagId=0) |
int | addConstraintMidpointOnLine (Point &l1p1, Point &l1p2, Point &l2p1, Point &l2p2, int tagId=0) |
int | addConstraintMidpointOnLine (Line &l1, Line &l2, int tagId=0) |
int | addConstraintP2LDistance (Point &p, Line &l, double *distance, int tagId=0) |
int | addConstraintP2PAngle (Point &p1, Point &p2, double *angle, int tagId=0) |
int | addConstraintP2PAngle (Point &p1, Point &p2, double *angle, double incr_angle, int tagId=0) |
int | addConstraintP2PCoincident (Point &p1, Point &p2, int tagId=0) |
int | addConstraintP2PDistance (Point &p1, Point &p2, double *distance, int tagId=0) |
int | addConstraintP2PSymmetric (Point &p1, Point &p2, Line &l, int tagId=0) |
int | addConstraintParallel (Line &l1, Line &l2, int tagId=0) |
int | addConstraintPerpendicular (Point &l1p1, Point &l1p2, Point &l2p1, Point &l2p2, int tagId=0) |
int | addConstraintPerpendicular (Line &l1, Line &l2, int tagId=0) |
int | addConstraintPointOnArc (Point &p, Arc &a, int tagId=0) |
int | addConstraintPointOnCircle (Point &p, Circle &c, int tagId=0) |
int | addConstraintPointOnLine (Point &p, Line &l, int tagId=0) |
int | addConstraintTangent (Line &l, Arc &a, int tagId=0) |
int | addConstraintTangent (Line &l, Circle &c, int tagId=0) |
int | addConstraintTangentArc2Line (Arc &a, Point &p1, Point &p2, int tagId=0) |
int | addConstraintTangentLine2Arc (Point &p1, Point &p2, Arc &a, int tagId=0) |
int | addConstraintVertical (Point &p1, Point &p2, int tagId=0) |
int | addConstraintVertical (Line &l, int tagId=0) |
void | applySolution () |
void | clear () |
void | clearByTag (int tagId) |
int | diagnose (VEC_pD ¶ms, VEC_I &conflicting) |
void | getSubSystems (std::vector< SubSystem * > &subsysvec) |
void | initSolution (VEC_pD ¶ms) |
bool | isInit () const |
void | removeConstraint (Constraint *constr) |
void | rescaleConstraint (int id, double coeff) |
int | solve (SubSystem *subsysA, SubSystem *subsysB, bool isFine=true) |
int | solve (SubSystem *subsys, bool isFine=true, Algorithm alg=DogLeg) |
int | solve (VEC_pD ¶ms, bool isFine=true, Algorithm alg=DogLeg) |
int | solve (bool isFine=true, Algorithm alg=DogLeg) |
System (std::vector< Constraint * > clist_) | |
System () | |
void | undoSolution () |
~System () |
Definition at line 47 of file GCS.h.
GCS::System::System | ( | std::vector< Constraint * > | clist_ | ) |
Definition at line 49 of file GCS.cpp.
References addConstraint(), GCS::Difference, GCS::Equal, GCS::L2LAngle, GCS::MidpointOnLine, GCS::None, GCS::P2LDistance, GCS::P2PAngle, GCS::P2PDistance, GCS::Parallel, GCS::Perpendicular, and GCS::PointOnLine.
int GCS::System::addConstraint | ( | Constraint * | constr | ) |
Definition at line 148 of file GCS.cpp.
References GCS::Constraint::params().
Referenced by addConstraintDifference(), addConstraintEqual(), addConstraintL2LAngle(), addConstraintMidpointOnLine(), addConstraintP2LDistance(), addConstraintP2PAngle(), addConstraintP2PDistance(), addConstraintParallel(), addConstraintPerpendicular(), addConstraintPointOnLine(), and System().
int GCS::System::addConstraintArcRadius | ( | Arc & | a, | |
double * | radius, | |||
int | tagId = 0 | |||
) |
Definition at line 374 of file GCS.cpp.
References addConstraintEqual(), and GCS::Arc::rad.
Referenced by Sketcher::Sketch::addRadiusConstraint().
int GCS::System::addConstraintArcRules | ( | Arc & | a, | |
int | tagId = 0 | |||
) |
Definition at line 327 of file GCS.cpp.
References addConstraintP2PAngle(), addConstraintP2PDistance(), GCS::Arc::center, GCS::Arc::end, GCS::Arc::endAngle, GCS::Arc::rad, GCS::Arc::start, and GCS::Arc::startAngle.
Referenced by Sketcher::Sketch::addArc().
int GCS::System::addConstraintCircleRadius | ( | Circle & | c, | |
double * | radius, | |||
int | tagId = 0 | |||
) |
Definition at line 369 of file GCS.cpp.
References addConstraintEqual(), and GCS::Circle::rad.
Referenced by Sketcher::Sketch::addRadiusConstraint().
int GCS::System::addConstraintCoordinateX | ( | Point & | p, | |
double * | x, | |||
int | tagId = 0 | |||
) |
Definition at line 317 of file GCS.cpp.
References addConstraintEqual(), and GCS::Point::x.
Referenced by Sketcher::Sketch::addCoordinateXConstraint().
int GCS::System::addConstraintCoordinateY | ( | Point & | p, | |
double * | y, | |||
int | tagId = 0 | |||
) |
Definition at line 322 of file GCS.cpp.
References addConstraintEqual(), and GCS::Point::y.
Referenced by Sketcher::Sketch::addCoordinateYConstraint().
int GCS::System::addConstraintDifference | ( | double * | param1, | |
double * | param2, | |||
double * | difference, | |||
int | tagId = 0 | |||
) |
Definition at line 195 of file GCS.cpp.
References addConstraint(), and GCS::Constraint::setTag().
Referenced by Sketcher::Sketch::addDistanceXConstraint(), and Sketcher::Sketch::addDistanceYConstraint().
int GCS::System::addConstraintEqual | ( | double * | param1, | |
double * | param2, | |||
int | tagId = 0 | |||
) |
Definition at line 188 of file GCS.cpp.
References addConstraint(), and GCS::Constraint::setTag().
Referenced by addConstraintArcRadius(), addConstraintCircleRadius(), addConstraintCoordinateX(), addConstraintCoordinateY(), addConstraintEqualRadius(), addConstraintHorizontal(), addConstraintP2PCoincident(), addConstraintVertical(), and Sketcher::Sketch::solve().
Definition at line 379 of file GCS.cpp.
References addConstraintP2PDistance(), GCS::Line::p1, and GCS::Line::p2.
Referenced by Sketcher::Sketch::addEqualConstraint().
Definition at line 395 of file GCS.cpp.
References addConstraintEqual(), and GCS::Arc::rad.
Definition at line 390 of file GCS.cpp.
References addConstraintEqual(), GCS::Arc::rad, and GCS::Circle::rad.
Definition at line 385 of file GCS.cpp.
References addConstraintEqual(), and GCS::Circle::rad.
Referenced by Sketcher::Sketch::addEqualConstraint().
Definition at line 302 of file GCS.cpp.
References addConstraintEqual(), and GCS::Point::y.
int GCS::System::addConstraintHorizontal | ( | Line & | l, | |
int | tagId = 0 | |||
) |
Definition at line 297 of file GCS.cpp.
References addConstraintEqual(), GCS::Line::p1, GCS::Line::p2, and GCS::Point::y.
Referenced by Sketcher::Sketch::addHorizontalConstraint().
int GCS::System::addConstraintL2LAngle | ( | Point & | l1p1, | |
Point & | l1p2, | |||
Point & | l2p1, | |||
Point & | l2p2, | |||
double * | angle, | |||
int | tagId = 0 | |||
) |
Definition at line 266 of file GCS.cpp.
References addConstraint(), and GCS::Constraint::setTag().
Definition at line 259 of file GCS.cpp.
References addConstraint(), and GCS::Constraint::setTag().
Referenced by Sketcher::Sketch::addAngleConstraint().
int GCS::System::addConstraintMidpointOnLine | ( | Point & | l1p1, | |
Point & | l1p2, | |||
Point & | l2p1, | |||
Point & | l2p2, | |||
int | tagId = 0 | |||
) |
Definition at line 281 of file GCS.cpp.
References addConstraint(), and GCS::Constraint::setTag().
Definition at line 274 of file GCS.cpp.
References addConstraint(), and GCS::Constraint::setTag().
Referenced by addConstraintP2PSymmetric().
Definition at line 223 of file GCS.cpp.
References addConstraint(), and GCS::Constraint::setTag().
Referenced by addConstraintTangent(), and Sketcher::Sketch::addDistanceConstraint().
Definition at line 218 of file GCS.cpp.
References addConstraintP2PAngle().
int GCS::System::addConstraintP2PAngle | ( | Point & | p1, | |
Point & | p2, | |||
double * | angle, | |||
double | incr_angle, | |||
int | tagId = 0 | |||
) |
Definition at line 210 of file GCS.cpp.
References addConstraint(), and GCS::Constraint::setTag().
Referenced by Sketcher::Sketch::addAngleConstraint(), addConstraintArcRules(), addConstraintP2PAngle(), addConstraintTangentArc2Line(), and addConstraintTangentLine2Arc().
Definition at line 291 of file GCS.cpp.
References addConstraintEqual(), GCS::Point::x, and GCS::Point::y.
Referenced by addConstraintTangentArc2Line(), addConstraintTangentLine2Arc(), Sketcher::Sketch::addPointCoincidentConstraint(), Sketcher::Sketch::addTangentConstraint(), and Sketcher::Sketch::initMove().
int GCS::System::addConstraintP2PDistance | ( | Point & | p1, | |
Point & | p2, | |||
double * | distance, | |||
int | tagId = 0 | |||
) |
Definition at line 203 of file GCS.cpp.
References addConstraint(), and GCS::Constraint::setTag().
Referenced by addConstraintArcRules(), addConstraintEqualLength(), addConstraintPointOnArc(), addConstraintPointOnCircle(), and Sketcher::Sketch::addDistanceConstraint().
Definition at line 400 of file GCS.cpp.
References addConstraintMidpointOnLine(), addConstraintPerpendicular(), GCS::Line::p1, and GCS::Line::p2.
Referenced by Sketcher::Sketch::addSymmetricConstraint().
Definition at line 237 of file GCS.cpp.
References addConstraint(), and GCS::Constraint::setTag().
Referenced by Sketcher::Sketch::addParallelConstraint(), and Sketcher::Sketch::addTangentConstraint().
int GCS::System::addConstraintPerpendicular | ( | Point & | l1p1, | |
Point & | l1p2, | |||
Point & | l2p1, | |||
Point & | l2p2, | |||
int | tagId = 0 | |||
) |
Definition at line 251 of file GCS.cpp.
References addConstraint(), and GCS::Constraint::setTag().
Definition at line 244 of file GCS.cpp.
References addConstraint(), and GCS::Constraint::setTag().
Referenced by addConstraintP2PSymmetric(), and Sketcher::Sketch::addPerpendicularConstraint().
Definition at line 340 of file GCS.cpp.
References addConstraintP2PDistance(), GCS::Arc::center, and GCS::Arc::rad.
Referenced by Sketcher::Sketch::addPointOnObjectConstraint(), Sketcher::Sketch::addTangentConstraint(), and Sketcher::Sketch::initMove().
Definition at line 335 of file GCS.cpp.
References addConstraintP2PDistance(), GCS::Circle::center, and GCS::Circle::rad.
Referenced by Sketcher::Sketch::addPointOnObjectConstraint(), Sketcher::Sketch::addTangentConstraint(), and Sketcher::Sketch::initMove().
Definition at line 230 of file GCS.cpp.
References addConstraint(), and GCS::Constraint::setTag().
Referenced by Sketcher::Sketch::addPointOnObjectConstraint(), and Sketcher::Sketch::addTangentConstraint().
Definition at line 350 of file GCS.cpp.
References addConstraintP2LDistance(), GCS::Arc::center, and GCS::Arc::rad.
Definition at line 345 of file GCS.cpp.
References addConstraintP2LDistance(), GCS::Circle::center, and GCS::Circle::rad.
Referenced by Sketcher::Sketch::addTangentConstraint().
Definition at line 362 of file GCS.cpp.
References addConstraintP2PAngle(), addConstraintP2PCoincident(), GCS::Arc::end, GCS::Arc::endAngle, M_PI, and GCS::Arc::startAngle.
Referenced by Sketcher::Sketch::addTangentConstraint().
Definition at line 355 of file GCS.cpp.
References addConstraintP2PAngle(), addConstraintP2PCoincident(), GCS::Arc::endAngle, M_PI, GCS::Arc::start, and GCS::Arc::startAngle.
Referenced by Sketcher::Sketch::addTangentConstraint().
Definition at line 312 of file GCS.cpp.
References addConstraintEqual(), and GCS::Point::x.
int GCS::System::addConstraintVertical | ( | Line & | l, | |
int | tagId = 0 | |||
) |
Definition at line 307 of file GCS.cpp.
References addConstraintEqual(), GCS::Line::p1, GCS::Line::p2, and GCS::Point::x.
Referenced by Sketcher::Sketch::addVerticalConstraint().
void GCS::System::applySolution | ( | ) |
Definition at line 1060 of file GCS.cpp.
References GCS::SubSystem::applySolution().
Referenced by Sketcher::Sketch::solve().
void GCS::System::clear | ( | void | ) |
Definition at line 125 of file GCS.cpp.
References GCS::free().
Referenced by Sketcher::Sketch::clear(), and ~System().
void GCS::System::clearByTag | ( | int | tagId | ) |
Definition at line 134 of file GCS.cpp.
References removeConstraint().
Referenced by Sketcher::Sketch::initMove(), Sketcher::Sketch::setUpSketch(), and Sketcher::Sketch::solve().
Definition at line 1079 of file GCS.cpp.
References draftlibs::dxfLibrary::copy, RobotExampleTrajectoryOutOfShapes::count, Py::int, and KDL::Upper().
Referenced by Sketcher::Sketch::diagnose().
void GCS::System::getSubSystems | ( | std::vector< SubSystem * > & | subsysvec | ) |
void GCS::System::initSolution | ( | VEC_pD & | params | ) |
Definition at line 415 of file GCS.cpp.
References GCS::Equal, and Py::int.
Referenced by Sketcher::Sketch::initMove(), Sketcher::Sketch::setUpSketch(), Sketcher::Sketch::solve(), and solve().
bool GCS::System::isInit | ( | ) | const [inline] |
Definition at line 140 of file GCS.h.
Referenced by Sketcher::Sketch::diagnose().
void GCS::System::removeConstraint | ( | Constraint * | constr | ) |
Definition at line 163 of file GCS.cpp.
References draftlibs::fcvec::find(), and GCS::free().
Referenced by clearByTag().
void GCS::System::rescaleConstraint | ( | int | id, | |
double | coeff | |||
) |
Definition at line 406 of file GCS.cpp.
Referenced by Sketcher::Sketch::initMove().
Definition at line 888 of file GCS.cpp.
References GCS::SubSystem::calcGrad(), GCS::SubSystem::calcJacobi(), GCS::SubSystem::calcResidual(), GCS::Converged, GCS::SubSystem::cSize(), GCS::SubSystem::error(), SketcherExample::f, GCS::Failed, GCS::SubSystem::getParamList(), GCS::SubSystem::getParams(), KDL::max(), MaxIterations, GCS::SubSystem::maxStep(), zipios::min(), GCS::SubSystem::pSize(), qp_eq(), GCS::SubSystem::redirectParams(), GCS::SubSystem::revertParams(), GCS::SubSystem::setParams(), smallF, GCS::Success, MovieTool::x, XconvergenceFine, XconvergenceRough, and MovieTool::y.
Definition at line 531 of file GCS.cpp.
References GCS::BFGS, GCS::DogLeg, and GCS::LevenbergMarquardt.
Definition at line 496 of file GCS.cpp.
References initSolution(), and solve().
int GCS::System::solve | ( | bool | isFine = true , |
|
Algorithm | alg = DogLeg | |||
) |
Definition at line 502 of file GCS.cpp.
References GCS::Success.
Referenced by Sketcher::Sketch::solve(), and solve().
void GCS::System::undoSolution | ( | ) |
Definition at line 1074 of file GCS.cpp.
Referenced by Sketcher::Sketch::solve().