412 lines
31 KiB
HTML
412 lines
31 KiB
HTML
|
|
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html><head><title>Python: module geosolver.geometric</title>
|
|
</head><body bgcolor="#f0f0f8">
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
|
<tr bgcolor="#7799ee">
|
|
<td valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="geosolver.html"><font color="#ffffff">geosolver</font></a>.geometric</strong></big></big></font></td
|
|
><td align=right valign=bottom
|
|
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/rick/Programming/Python/GeoSolver/geosolver/geometric.py">/home/rick/Programming/Python/GeoSolver/geosolver/geometric.py</a></font></td></tr></table>
|
|
<p><tt>Geometric constraint problem and solver. Uses ClusterSolver for solving<br>
|
|
problems incrementally.</tt></p>
|
|
<p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#aa55cc">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
|
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="math.html">math</a><br>
|
|
</td><td width="25%" valign=top><a href="geosolver.vector.html">geosolver.vector</a><br>
|
|
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ee77aa">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
|
<td width="100%"><dl>
|
|
<dt><font face="helvetica, arial"><a href="geosolver.constraint.html#Constraint">geosolver.constraint.Constraint</a>
|
|
</font></dt><dd>
|
|
<dl>
|
|
<dt><font face="helvetica, arial"><a href="geosolver.geometric.html#ParametricConstraint">ParametricConstraint</a>(<a href="geosolver.constraint.html#Constraint">geosolver.constraint.Constraint</a>, <a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a>)
|
|
</font></dt><dd>
|
|
<dl>
|
|
<dt><font face="helvetica, arial"><a href="geosolver.geometric.html#AngleConstraint">AngleConstraint</a>
|
|
</font></dt><dt><font face="helvetica, arial"><a href="geosolver.geometric.html#DistanceConstraint">DistanceConstraint</a>
|
|
</font></dt><dt><font face="helvetica, arial"><a href="geosolver.geometric.html#FixConstraint">FixConstraint</a>
|
|
</font></dt></dl>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
<dt><font face="helvetica, arial"><a href="geosolver.geometric.html#GeometricCluster">GeometricCluster</a>
|
|
</font></dt><dt><font face="helvetica, arial"><a href="geosolver.notify.html#Listener">geosolver.notify.Listener</a>
|
|
</font></dt><dd>
|
|
<dl>
|
|
<dt><font face="helvetica, arial"><a href="geosolver.geometric.html#GeometricProblem">GeometricProblem</a>(<a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a>, <a href="geosolver.notify.html#Listener">geosolver.notify.Listener</a>)
|
|
</font></dt><dt><font face="helvetica, arial"><a href="geosolver.geometric.html#GeometricSolver">GeometricSolver</a>
|
|
</font></dt></dl>
|
|
</dd>
|
|
<dt><font face="helvetica, arial"><a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a>
|
|
</font></dt><dd>
|
|
<dl>
|
|
<dt><font face="helvetica, arial"><a href="geosolver.geometric.html#GeometricProblem">GeometricProblem</a>(<a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a>, <a href="geosolver.notify.html#Listener">geosolver.notify.Listener</a>)
|
|
</font></dt><dt><font face="helvetica, arial"><a href="geosolver.geometric.html#ParametricConstraint">ParametricConstraint</a>(<a href="geosolver.constraint.html#Constraint">geosolver.constraint.Constraint</a>, <a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a>)
|
|
</font></dt><dd>
|
|
<dl>
|
|
<dt><font face="helvetica, arial"><a href="geosolver.geometric.html#AngleConstraint">AngleConstraint</a>
|
|
</font></dt><dt><font face="helvetica, arial"><a href="geosolver.geometric.html#DistanceConstraint">DistanceConstraint</a>
|
|
</font></dt><dt><font face="helvetica, arial"><a href="geosolver.geometric.html#FixConstraint">FixConstraint</a>
|
|
</font></dt></dl>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
<p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="AngleConstraint">class <strong>AngleConstraint</strong></a>(<a href="geosolver.geometric.html#ParametricConstraint">ParametricConstraint</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>A constraint on the angle in point B of a triangle ABC<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
|
<dd><a href="geosolver.geometric.html#AngleConstraint">AngleConstraint</a></dd>
|
|
<dd><a href="geosolver.geometric.html#ParametricConstraint">ParametricConstraint</a></dd>
|
|
<dd><a href="geosolver.constraint.html#Constraint">geosolver.constraint.Constraint</a></dd>
|
|
<dd><a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a></dd>
|
|
</dl>
|
|
<hr>
|
|
Methods defined here:<br>
|
|
<dl><dt><a name="AngleConstraint-__init__"><strong>__init__</strong></a>(self, a, b, c, ang)</dt><dd><tt>Create a new <a href="#AngleConstraint">AngleConstraint</a> instance. <br>
|
|
<br>
|
|
keyword args:<br>
|
|
a - a point variable name<br>
|
|
b - a point variable name<br>
|
|
c - a point variable name<br>
|
|
ang - the angle parameter value</tt></dd></dl>
|
|
|
|
<dl><dt><a name="AngleConstraint-__str__"><strong>__str__</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="AngleConstraint-satisfied"><strong>satisfied</strong></a>(self, mapping)</dt><dd><tt>return True iff mapping from variable names to points satisfies constraint</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="geosolver.geometric.html#ParametricConstraint">ParametricConstraint</a>:<br>
|
|
<dl><dt><a name="AngleConstraint-get_parameter"><strong>get_parameter</strong></a>(self)</dt><dd><tt>get parameter value</tt></dd></dl>
|
|
|
|
<dl><dt><a name="AngleConstraint-set_parameter"><strong>set_parameter</strong></a>(self, value)</dt><dd><tt>set parameter value and notify any listeners</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="geosolver.constraint.html#Constraint">geosolver.constraint.Constraint</a>:<br>
|
|
<dl><dt><a name="AngleConstraint-variables"><strong>variables</strong></a>(self)</dt><dd><tt>return a list of variables<br>
|
|
<br>
|
|
If an attribute '_variables' has been defined, a new list<br>
|
|
with the contents of that attribute will be returned. <br>
|
|
Subclasses may choose to initialise this variable or to <br>
|
|
override this function.</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a>:<br>
|
|
<dl><dt><a name="AngleConstraint-add_listener"><strong>add_listener</strong></a>(self, listener)</dt><dd><tt>add a listener to the list (and self to listers' list)</tt></dd></dl>
|
|
|
|
<dl><dt><a name="AngleConstraint-rem_listener"><strong>rem_listener</strong></a>(self, listener)</dt><dd><tt>remove a listener from the list (and self from listers' list)</tt></dd></dl>
|
|
|
|
<dl><dt><a name="AngleConstraint-send_notify"><strong>send_notify</strong></a>(self, message)</dt><dd><tt>send a message to all listeners</tt></dd></dl>
|
|
|
|
</td></tr></table> <p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="DistanceConstraint">class <strong>DistanceConstraint</strong></a>(<a href="geosolver.geometric.html#ParametricConstraint">ParametricConstraint</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>A constraint on the Euclidean distance between two points<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
|
<dd><a href="geosolver.geometric.html#DistanceConstraint">DistanceConstraint</a></dd>
|
|
<dd><a href="geosolver.geometric.html#ParametricConstraint">ParametricConstraint</a></dd>
|
|
<dd><a href="geosolver.constraint.html#Constraint">geosolver.constraint.Constraint</a></dd>
|
|
<dd><a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a></dd>
|
|
</dl>
|
|
<hr>
|
|
Methods defined here:<br>
|
|
<dl><dt><a name="DistanceConstraint-__init__"><strong>__init__</strong></a>(self, a, b, dist)</dt><dd><tt>Create a new <a href="#DistanceConstraint">DistanceConstraint</a> instance<br>
|
|
<br>
|
|
keyword args:<br>
|
|
a - a point variable name <br>
|
|
b - a point variable name<br>
|
|
dist - the distance parameter value</tt></dd></dl>
|
|
|
|
<dl><dt><a name="DistanceConstraint-__str__"><strong>__str__</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="DistanceConstraint-satisfied"><strong>satisfied</strong></a>(self, mapping)</dt><dd><tt>return True iff mapping from variable names to points satisfies constraint</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="geosolver.geometric.html#ParametricConstraint">ParametricConstraint</a>:<br>
|
|
<dl><dt><a name="DistanceConstraint-get_parameter"><strong>get_parameter</strong></a>(self)</dt><dd><tt>get parameter value</tt></dd></dl>
|
|
|
|
<dl><dt><a name="DistanceConstraint-set_parameter"><strong>set_parameter</strong></a>(self, value)</dt><dd><tt>set parameter value and notify any listeners</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="geosolver.constraint.html#Constraint">geosolver.constraint.Constraint</a>:<br>
|
|
<dl><dt><a name="DistanceConstraint-variables"><strong>variables</strong></a>(self)</dt><dd><tt>return a list of variables<br>
|
|
<br>
|
|
If an attribute '_variables' has been defined, a new list<br>
|
|
with the contents of that attribute will be returned. <br>
|
|
Subclasses may choose to initialise this variable or to <br>
|
|
override this function.</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a>:<br>
|
|
<dl><dt><a name="DistanceConstraint-add_listener"><strong>add_listener</strong></a>(self, listener)</dt><dd><tt>add a listener to the list (and self to listers' list)</tt></dd></dl>
|
|
|
|
<dl><dt><a name="DistanceConstraint-rem_listener"><strong>rem_listener</strong></a>(self, listener)</dt><dd><tt>remove a listener from the list (and self from listers' list)</tt></dd></dl>
|
|
|
|
<dl><dt><a name="DistanceConstraint-send_notify"><strong>send_notify</strong></a>(self, message)</dt><dd><tt>send a message to all listeners</tt></dd></dl>
|
|
|
|
</td></tr></table> <p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="FixConstraint">class <strong>FixConstraint</strong></a>(<a href="geosolver.geometric.html#ParametricConstraint">ParametricConstraint</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>A constraint to fix a point relative to the coordinate system<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
|
<dd><a href="geosolver.geometric.html#FixConstraint">FixConstraint</a></dd>
|
|
<dd><a href="geosolver.geometric.html#ParametricConstraint">ParametricConstraint</a></dd>
|
|
<dd><a href="geosolver.constraint.html#Constraint">geosolver.constraint.Constraint</a></dd>
|
|
<dd><a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a></dd>
|
|
</dl>
|
|
<hr>
|
|
Methods defined here:<br>
|
|
<dl><dt><a name="FixConstraint-__init__"><strong>__init__</strong></a>(self, var, pos)</dt><dd><tt>Create a new <a href="#DistanceConstraint">DistanceConstraint</a> instance<br>
|
|
<br>
|
|
keyword args:<br>
|
|
var - a point variable name <br>
|
|
pos - the position parameter</tt></dd></dl>
|
|
|
|
<dl><dt><a name="FixConstraint-__str__"><strong>__str__</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="FixConstraint-satisfied"><strong>satisfied</strong></a>(self, mapping)</dt><dd><tt>return True iff mapping from variable names to points satisfies constraint</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="geosolver.geometric.html#ParametricConstraint">ParametricConstraint</a>:<br>
|
|
<dl><dt><a name="FixConstraint-get_parameter"><strong>get_parameter</strong></a>(self)</dt><dd><tt>get parameter value</tt></dd></dl>
|
|
|
|
<dl><dt><a name="FixConstraint-set_parameter"><strong>set_parameter</strong></a>(self, value)</dt><dd><tt>set parameter value and notify any listeners</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="geosolver.constraint.html#Constraint">geosolver.constraint.Constraint</a>:<br>
|
|
<dl><dt><a name="FixConstraint-variables"><strong>variables</strong></a>(self)</dt><dd><tt>return a list of variables<br>
|
|
<br>
|
|
If an attribute '_variables' has been defined, a new list<br>
|
|
with the contents of that attribute will be returned. <br>
|
|
Subclasses may choose to initialise this variable or to <br>
|
|
override this function.</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a>:<br>
|
|
<dl><dt><a name="FixConstraint-add_listener"><strong>add_listener</strong></a>(self, listener)</dt><dd><tt>add a listener to the list (and self to listers' list)</tt></dd></dl>
|
|
|
|
<dl><dt><a name="FixConstraint-rem_listener"><strong>rem_listener</strong></a>(self, listener)</dt><dd><tt>remove a listener from the list (and self from listers' list)</tt></dd></dl>
|
|
|
|
<dl><dt><a name="FixConstraint-send_notify"><strong>send_notify</strong></a>(self, message)</dt><dd><tt>send a message to all listeners</tt></dd></dl>
|
|
|
|
</td></tr></table> <p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="GeometricCluster">class <strong>GeometricCluster</strong></a></font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>Represents the result of solving a <a href="#GeometricProblem">GeometricProblem</a>. A cluster is a list of <br>
|
|
point variable names and a list of solutions for<br>
|
|
those variables. A solution is a dictionary mapping variable names to<br>
|
|
points. The cluster also keeps a list of sub-clusters (<a href="#GeometricCluster">GeometricCluster</a>)<br>
|
|
and a set of flags, indicating incidental/structural<br>
|
|
under/overconstrained<br>
|
|
<br>
|
|
instance attributes:<br>
|
|
variables - a list of point variable names<br>
|
|
solutions - a list of solutions. Each solution is a dictionary <br>
|
|
mapping variable names to vectors. <br>
|
|
subs - a list of sub-clusters <br>
|
|
flag - value meaning<br>
|
|
OK well constrained<br>
|
|
I_OVER incicental over-constrained<br>
|
|
I_UNDER incidental under-constrained<br>
|
|
S_OVER structural overconstrained <br>
|
|
S_UNDER structural underconstrained<br>
|
|
UNSOLVED unsolved<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="GeometricCluster-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>initialise an empty new cluster</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricCluster-__str__"><strong>__str__</strong></a>(self)</dt></dl>
|
|
|
|
<hr>
|
|
Data and other attributes defined here:<br>
|
|
<dl><dt><strong>I_OVER</strong> = 'incidental over-constrained'</dl>
|
|
|
|
<dl><dt><strong>I_UNDER</strong> = 'incidental under-constrained'</dl>
|
|
|
|
<dl><dt><strong>OK</strong> = 'well constrained'</dl>
|
|
|
|
<dl><dt><strong>S_OVER</strong> = 'structral over-constrained'</dl>
|
|
|
|
<dl><dt><strong>S_UNDER</strong> = 'structural under-constrained'</dl>
|
|
|
|
<dl><dt><strong>UNSOLVED</strong> = 'unsolved'</dl>
|
|
|
|
</td></tr></table> <p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="GeometricProblem">class <strong>GeometricProblem</strong></a>(<a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a>, <a href="geosolver.notify.html#Listener">geosolver.notify.Listener</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>A geometric constraint problem with a prototype.<br>
|
|
<br>
|
|
A problem consists of point variables (just variables for short), prototype<br>
|
|
points for each variable and constraints.<br>
|
|
Variables are just names and can be any hashable object (recommend strings)<br>
|
|
Supported constraints are instances of <a href="#DistanceConstraint">DistanceConstraint</a>,<a href="#AngleConstraint">AngleConstraint</a>,<br>
|
|
<a href="#FixConstraint">FixConstraint</a> or SelectionConstraint.<br>
|
|
<br>
|
|
Prototype points are instances of vector.<br>
|
|
<br>
|
|
<a href="#GeometricProblem">GeometricProblem</a> listens for changes in constraint parameters and passes<br>
|
|
these changes, and changes in the system of constraints and the prototype, <br>
|
|
to any other listerers (e.g. <a href="#GeometricSolver">GeometricSolver</a>) <br>
|
|
<br>
|
|
instance attributes:<br>
|
|
cg - a ConstraintGraph instance<br>
|
|
prototype - a dictionary mapping variables to points<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
|
<dd><a href="geosolver.geometric.html#GeometricProblem">GeometricProblem</a></dd>
|
|
<dd><a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a></dd>
|
|
<dd><a href="geosolver.notify.html#Listener">geosolver.notify.Listener</a></dd>
|
|
</dl>
|
|
<hr>
|
|
Methods defined here:<br>
|
|
<dl><dt><a name="GeometricProblem-__init__"><strong>__init__</strong></a>(self, dimension)</dt><dd><tt>initialize a new problem</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-__str__"><strong>__str__</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-add_constraint"><strong>add_constraint</strong></a>(self, con)</dt><dd><tt>add a constraint</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-add_point"><strong>add_point</strong></a>(self, variable, position)</dt><dd><tt>add a point variable with a prototype position</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-get_angle"><strong>get_angle</strong></a>(self, a, b, c)</dt><dd><tt>return the angle constraint on given points, or None</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-get_distance"><strong>get_distance</strong></a>(self, a, b)</dt><dd><tt>return the distance constraint on given points, or None</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-get_fix"><strong>get_fix</strong></a>(self, p)</dt><dd><tt>return the fix constraint on given point, or None</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-get_point"><strong>get_point</strong></a>(self, variable)</dt><dd><tt>get prototype position of point variable</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-has_point"><strong>has_point</strong></a>(self, variable)</dt></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-receive_notify"><strong>receive_notify</strong></a>(self, object, notify)</dt><dd><tt>When notified of changed constraint parameters, pass on to listeners</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-rem_constraint"><strong>rem_constraint</strong></a>(self, con)</dt><dd><tt>remove a constraint from the constraint system</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-rem_point"><strong>rem_point</strong></a>(self, var)</dt><dd><tt>remove a point variable from the constraint system</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-set_point"><strong>set_point</strong></a>(self, variable, position)</dt><dd><tt>set prototype position of point variable</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-verify"><strong>verify</strong></a>(self, solution)</dt><dd><tt>returns true iff all constraints satisfied by given solution. <br>
|
|
solution is a dictionary mapping variables (names) to values (points)</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a>:<br>
|
|
<dl><dt><a name="GeometricProblem-add_listener"><strong>add_listener</strong></a>(self, listener)</dt><dd><tt>add a listener to the list (and self to listers' list)</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-rem_listener"><strong>rem_listener</strong></a>(self, listener)</dt><dd><tt>remove a listener from the list (and self from listers' list)</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-send_notify"><strong>send_notify</strong></a>(self, message)</dt><dd><tt>send a message to all listeners</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="geosolver.notify.html#Listener">geosolver.notify.Listener</a>:<br>
|
|
<dl><dt><a name="GeometricProblem-add_notifier"><strong>add_notifier</strong></a>(self, notifier)</dt><dd><tt>add a notifier to the list (and self to notifiers' list)</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricProblem-rem_notifier"><strong>rem_notifier</strong></a>(self, notifier)</dt><dd><tt>remove a notifier from the list (and self from notifiers' list)</tt></dd></dl>
|
|
|
|
</td></tr></table> <p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="GeometricSolver">class <strong>GeometricSolver</strong></a>(<a href="geosolver.notify.html#Listener">geosolver.notify.Listener</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>The <a href="#GeometricSolver">GeometricSolver</a> monitors changes in a <a href="#GeometricProblem">GeometricProblem</a> and <br>
|
|
mappes any changes to corresponding changes in a <a href="#GeometricCluster">GeometricCluster</a><br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="GeometricSolver-__init__"><strong>__init__</strong></a>(self, problem)</dt><dd><tt>Create a new <a href="#GeometricSolver">GeometricSolver</a> instance<br>
|
|
<br>
|
|
keyword args<br>
|
|
problem - the <a href="#GeometricProblem">GeometricProblem</a> instance to be monitored for changes</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricSolver-get_constrainedness"><strong>get_constrainedness</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="GeometricSolver-get_result"><strong>get_result</strong></a>(self)</dt><dd><tt>returns the result as a <a href="#GeometricCluster">GeometricCluster</a></tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricSolver-receive_notify"><strong>receive_notify</strong></a>(self, object, message)</dt><dd><tt>Take notice of changes in constraint graph</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="geosolver.notify.html#Listener">geosolver.notify.Listener</a>:<br>
|
|
<dl><dt><a name="GeometricSolver-add_notifier"><strong>add_notifier</strong></a>(self, notifier)</dt><dd><tt>add a notifier to the list (and self to notifiers' list)</tt></dd></dl>
|
|
|
|
<dl><dt><a name="GeometricSolver-rem_notifier"><strong>rem_notifier</strong></a>(self, notifier)</dt><dd><tt>remove a notifier from the list (and self from notifiers' list)</tt></dd></dl>
|
|
|
|
</td></tr></table> <p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="ParametricConstraint">class <strong>ParametricConstraint</strong></a>(<a href="geosolver.constraint.html#Constraint">geosolver.constraint.Constraint</a>, <a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>A constraint with a parameter and notification when parameter changes<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
|
<dd><a href="geosolver.geometric.html#ParametricConstraint">ParametricConstraint</a></dd>
|
|
<dd><a href="geosolver.constraint.html#Constraint">geosolver.constraint.Constraint</a></dd>
|
|
<dd><a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a></dd>
|
|
</dl>
|
|
<hr>
|
|
Methods defined here:<br>
|
|
<dl><dt><a name="ParametricConstraint-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>initialize <a href="#ParametricConstraint">ParametricConstraint</a></tt></dd></dl>
|
|
|
|
<dl><dt><a name="ParametricConstraint-get_parameter"><strong>get_parameter</strong></a>(self)</dt><dd><tt>get parameter value</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ParametricConstraint-set_parameter"><strong>set_parameter</strong></a>(self, value)</dt><dd><tt>set parameter value and notify any listeners</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="geosolver.constraint.html#Constraint">geosolver.constraint.Constraint</a>:<br>
|
|
<dl><dt><a name="ParametricConstraint-satisfied"><strong>satisfied</strong></a>(self, mapping)</dt><dd><tt>return true iff constraint is satisfied by given mapping<br>
|
|
from variables to values (dictionary)</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ParametricConstraint-variables"><strong>variables</strong></a>(self)</dt><dd><tt>return a list of variables<br>
|
|
<br>
|
|
If an attribute '_variables' has been defined, a new list<br>
|
|
with the contents of that attribute will be returned. <br>
|
|
Subclasses may choose to initialise this variable or to <br>
|
|
override this function.</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="geosolver.notify.html#Notifier">geosolver.notify.Notifier</a>:<br>
|
|
<dl><dt><a name="ParametricConstraint-add_listener"><strong>add_listener</strong></a>(self, listener)</dt><dd><tt>add a listener to the list (and self to listers' list)</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ParametricConstraint-rem_listener"><strong>rem_listener</strong></a>(self, listener)</dt><dd><tt>remove a listener from the list (and self from listers' list)</tt></dd></dl>
|
|
|
|
<dl><dt><a name="ParametricConstraint-send_notify"><strong>send_notify</strong></a>(self, message)</dt><dd><tt>send a message to all listeners</tt></dd></dl>
|
|
|
|
</td></tr></table></td></tr></table>
|
|
</body></html> |