Commit 62ae52b2 authored by Dave Cooper's avatar Dave Cooper
Browse files

Merge branch 'feature/svg-dd' into devo

parents 5b01d82f bcf9d98f
......@@ -14,14 +14,9 @@ bin
*.idx
*.log
*.toc
<<<<<<< HEAD
*.ind
*.ilg
=======
*.ilg
*.ind
*.out
>>>>>>> feature/book
configure.el
systems.txt
......
......@@ -278,8 +278,15 @@ re-evaluates the expression to compute the original list of indices)"
(define-object matrix-sequence (standard-sequence)
:documentation (:description "A matrix sequence quantification is generated as a result of specifying
<tt>:sequence (:matrix &lt;direction-keyword&gt; &lt;number&gt; &lt;direction-keyword&gt; &lt;number&gt;))</tt> in an <tt>:objects</tt> specification.")
:documentation (:description "A matrix sequence quantification is
generated as a result of specifying <tt>:sequence (:matrix
direction-keyword number direction-keyword number))</tt> in an
<tt>:objects</tt> specification. The direction-keywords can be one of
<tt>:lateral</tt>, <tt>:longitudinal</tt>, and <tt>:vertical</tt>. The
items will be arranged spread out evenly in the directions specified.
Centers can also be provided explicitly based on the indices. The
indices to a matrix sequence consist of a list of numbers rather than
a single number as with a normal sequence.")
:computed-slots
......
......@@ -780,7 +780,6 @@ toplevel inputs as specified in the snapshot file.
(defparameter *dep-hash-threshhold* 1000)
(defun add-notify-cons (notify-cons value &optional self message)
;;
;; FLAG -- this was added as a fix for github Issue #69, but causes
......
;;;; -*- coding: utf-8 -*-
(asdf:defsystem #:4bar :description
"The Gendl™ 4bar Subsystem" :author "John McCarthy" :license
"Affero Gnu Public License (http://www.gnu.org/licenses/)" :serial t
:version "20130730" :depends-on nil
#+asdf-encoding :encoding #+asdf-encoding :utf-8
:components ((:gdl "source/4bar")))
......@@ -11,19 +11,30 @@
(str (the main-area main-div))
(str (the drop-coord-section main-div))))
(dropped-x-y (the main-area dropped-x-y)))
(dropped-x-y (the main-area dropped-x-y))
(input-link-angle-d nil :settable)
)
:objects ((assembly :type 'assembly
:input-link-angle-d (if (the dropped-x-y)
(angle-between-vectors-d (the (face-normal-vector :right))
(subtract-vectors (the dropped-x-y)
(the assembly ground-2))
(the (face-normal-vector :top)))
90)))
:input-link-angle-d (or nil ;;(the input-link-angle-d)
(if (the dropped-x-y)
(angle-between-vectors-d (the (face-normal-vector :right))
(subtract-vectors (the dropped-x-y)
(the assembly ground-2))
(the (face-normal-vector :top)))
90))))
:hidden-objects ((drop-coord-section :type 'sheet-section
:inner-html (with-cl-who-string ()
(str (the main-area dropped-x-y))))
:js-to-eval :parse
:inner-html (with-cl-who-string ()
(str (the main-area dropped-x-y))
(str (the input-link-angle-d))
#+nil
(:script
(str (the (gdl-ajax-call :function-key :set-slot!
:arguments (list :input-link-angle-d (if (the input-link-angle-d)
(1+ (the input-link-angle-d)) 90 ))))))))
(main-area :type 'base-ajax-graphics-sheet
:respondent self
:vector-graphics-onclick? nil
......@@ -168,7 +179,10 @@
:display-controls (list :color (ecase (the-child index)
(0 :red) (1 :green))
:line-thickness 2
:drag-controls :drag-and-drop)
:drag-controls (ecase (the-child index)
(1 :drag-and-drop)
;;(1 :drop)
(0 nil)))
:circle (the (grounded-link-circles (the-child index)))
:pseudo-inputs (circle)
:start (the-child circle center)
......@@ -181,7 +195,7 @@
(the follower-link-angle))))
(coupler-link :type 'coupler-link
:display-controls (list :line-thickness 2 :color :blue)
:display-controls (list :line-thickness 2 :color :blue :fill-color :blue)
:pass-down (coupler-angle-1 coupler-length-1)
:start (the (grounded-links 0) end)
:end (the (grounded-links 1) end)))
......@@ -205,13 +219,40 @@
(nreverse data)))))
(define-object coupler-link (line)
(define-object coupler-link (global-polyline)
:input-slots (start end coupler-angle-1 coupler-length-1)
:computed-slots ((datum (the edge-1 end))
(direction-vector (subtract-vectors (the end) (the start)))
(vertex-list (list (the start) (the end) (the edge-1 end))))
:hidden-objects
((baseline :type 'line
:pass-down (start end))
(edge-1 :type 'line
:pass-down (start)
:end (rotate-point (translate-along-vector (the start)
(the direction-vector)
(the coupler-length-1))
(the start)
(the (face-normal-vector :top))
:angle (the coupler-angle-1)))
(edge-2 :type 'line
:start (the edge-1 end)
:pass-down (end))))
#+nil
(define-object coupler-link (line outline-specialization-mixin)
:input-slots (coupler-angle-1 coupler-length-1)
:computed-slots ((datum (the edge-1 end)))
:objects
:hidden-objects
((baseline :type 'line
:pass-down (start end))
......@@ -228,7 +269,7 @@
:pass-down (end))))
(publish-gwl-app "/4bar" '4-bar:dd)
......
......@@ -24,11 +24,11 @@
(defparameter *basic-operation*
`((:chapter :title "Basic Operation of the GDL Environment")
"This chapter will lead you through all the basic steps of
operating a typical GDL-based development environment. We will not go
into particular depth about the additional features of the environment
or language syntax in this section --- this chapter is merely for
getting familiar with and practicing with the nuts and bolts of
operating the environment with a keyboard."
operating a typical GDL-based development environment. We will not in
this section go into particular depth about the additional features of
the environment or language syntax --- this chapter is merely to
familiarize you with, and start you practicing with the nuts and bolts
of operating the environment with a keyboard."
((:section :title "What is Different about GDL?")
"GDL is a "
......@@ -51,7 +51,7 @@ function or object, one has "
In GDL, it is typical to keep the same development session up and
running for an entire day or longer, making it unnecessary to
constantly recompile and reload your definitions from scratch. Note,
repeatedly recompile and reload your definitions from scratch. Note,
however, that if you do shut down and restart the system for some
reason, then you will have to recompile and/or reload your
application's definitions in order to bring the system back into a
......@@ -62,13 +62,13 @@ done "
(:emph "automatically")
" in one of two ways:"
(:ol
(:li "using commands placed into
(:li "Using commands placed into
the "
(:texttt "gdlinit.cl")
" initialization file, as described in Section "
(:ref "sec:customizingyourenvironment") ".")
(:li "alternatively, you can compile and load definitions into
(:li "Alternatively, you can compile and load definitions into
your session, then save the ``world'' in that state. That way it is
possible to start a new GDL ``world'' which already has all your
application's definitions loaded and ready for use, without having to
......@@ -284,7 +284,7 @@ This will visit the *slime-repl* buffer. Now type: "
"GDL contains utilities which allow you to treat your
application as a ``project,'' with the ability to compile,
incrementally compile, and load a ``project'' from a directory tree of
source files representing your project. In this section we give an
source files representing your project. In this section we provide an
overview of the expected directory structure and available control
files, followed by a reference for each of the functions included in
the bootstrap module."
......@@ -309,9 +309,7 @@ relatively flat, however.")
apps/yoyodyne/booster-rocket/source/package.gdl
apps/yoyodyne/booster-rocket/source/parameters.gdl
apps/yoyodyne/booster-rocket/source/rules.gdl
"))
)
")))
((:subsection :title "Source Files within a source/ subdirectory")
......@@ -320,7 +318,7 @@ relatively flat, however.")
(:p "Within a source subdirectory, you may have a file called "
(:texttt "file-ordering.isc")
(:footnote (:texttt "isc") " stands for ``Intelligent Source Configuration''")
" to enforce a certain ordering on the files. Here are
" to enforce a certain ordering of the files. Here are
the contents of an example for the above application:")
(:verbatim "(\"package\" \"parameters\")")
......@@ -330,7 +328,8 @@ of the files should not matter (although it will default to
lexigraphical ordering).")
(:p "Now our sample application directory looks like Figure "
(:p "Now our sample application directory appears as in
Figure "
(:ref "fig:yoyodyne-with-file-ordering-isc")
"."))
......@@ -382,14 +381,14 @@ load the system using Quicklisp. To do this for our example, follow these steps:
" for projects you want available during every development session. Note that you should include
the full path prefix for the directory containing the ASDF system file.")
(:item (:verbatim "(ql:quickload :gdl-yoyodyne)")
" this will compile and load the actual system. Quicklisp
" This will compile and load the actual system. Quicklisp
uses ASDF at the low level to compile and load the systems, and
Quicklisp will retrieve any depended-upon third-party libraries from
the Internet on-demand. Source files will be compiled only if the
corresponding binary (fasl) file does not exist or is older than the
source file. By default, ASDF keeps its binary files in a "
(:emph "cache")
" directory, separated according to CL platform and
" directory, separated according to the CL platform and
operating system. The location of this cache is system-dependent, but
you can see where it is by observing the compile and load
process."))))
......
......@@ -94,7 +94,7 @@ an HTML generating library, such as "
(:p "For our examples we will use cl-who, which is currently the
standard default HTML generating library used internally by GDL. Here
we will make note of the major features of cl-who while introducing
the examples; for complete documentation on cl-who, please visit the
the examples. For complete documentation on cl-who, please visit the
page at Edi Weitz' website linked above and listed in the footnote
below.")
......@@ -150,7 +150,7 @@ within a GWL application."
(:item "The " (:texttt "fmt") " symbol has special meaning
within the cl-who environment and works the same as a Common
Lisp " (:texttt "(format nil ...)") ", in order to evaluate a format
Lisp " (:texttt "(format nil ...)") " in order to evaluate a format
string together with matching arguments, and produce a string at
runtime.")
......@@ -346,7 +346,7 @@ available form-controls are:"
(:p "These form-controls are customizable by mixing them into
your own specific form-controls (although this is often not
your own specific form-controls (although this often is not
necessary). New form-controls such as for numbers, dates,
etc will soon be added to correspond to latest HTML
standards."))
......@@ -368,7 +368,7 @@ of the form controls within the " (:texttt "with-html-form") " macro.")
:width "4in" :height "3in"
:label "fig:gwl-3b-image"))
(:p "In Figure "
(:p "Figure "
(:ref "fig:gwl-3b")
" is an example which allows the user to enter a year, and the
application will respond with the revenue amount for that year. Additional
......@@ -407,7 +407,7 @@ page need to be updated after a request.")
represents the page and the page sections is kept identical to the
displayed state of the page. This means that if the user hits the
``Refresh'' button in the browser, the state of the page will remain
unchanged. This ability is not present in some other Ajax
unchanged. This ability is not available in some other Ajax
frameworks.")
((:subsection :title "Steps to Create a gdlAjax Application")
......@@ -417,7 +417,7 @@ still apply for gdlAjax applications --- that is, HTML generation,
page linking, etc. These techniques will all still work in a gdlAjax
application.")
(:p "To produce a gdlAjax application involves three main differences from
(:p "To produce a gdlAjax application entails three main differences from
a standard web application:"
......@@ -438,10 +438,11 @@ a standard web application:"
fills in the body of the page --- everything between the <body>
and </body> tags. The head tag of the page is filled in
automatically and can be customized in various ways.")
(:item "Any sections of the page which you want to be able
to change themselves in response to an Ajax call must be made
into separate page sections, or ``sheet sections,'' and the HTML
for their " (:texttt "main-div") " included in the main page's "
(:item "Any sections of the page which you want to have the
capacity to change themselves in response to an Ajax call must
be made into separate page sections, or ``sheet sections,'' and
the HTML for their " (:texttt "main-div") " included in the main
page's "
(:texttt "main-sheet-body") " by use of cl-who's " (:texttt "str") " directive."))
......@@ -485,7 +486,7 @@ a standard web application:"
" is simply the " (:texttt "inner-html") ", wrapped with
an HTML DIV (i.e. ``division'') tag which contains a unique
identifier for this section, derived from the root-path
to the GDL object in the in tree which represents the
to the GDL object in the tree which represents the
sheet section.")
(:item "We introduce the CL function " (:texttt "gwl:publish-gwl-app")
......@@ -548,8 +549,8 @@ necessary.")
works correctly when the form-controls are set before the
function is called, then you can group the functions
together into a ``wrapper-function,'' and do the entire
processing with a single Ajax (or Sjax) call. Normally this
would be be the recommended approach whenever possible."))
processing with a single Ajax (or Sjax) call. This would be
be the recommended approach whenever possible."))
((:subsection :title "Including Graphics")
......@@ -580,7 +581,7 @@ can be controlled with other optional input-slots.")
(:p "The example in Figure " (:ref "fig:gwl-5")
" contains a simple box with two graphics viewports
and ability to modify the length, height, and and with of the box:")
and ability to modify the length, height, and and width of the box:")
......
......@@ -23,9 +23,9 @@
(defparameter *gendl-geometry*
`((:chapter :title "Working with Geometry in GDL")
(:p "Although Genworks GDL is a powerful framework for all kinds
of general-purpose computing, one of its particular strong points is
generating geometry and processing geometric entities. Geometric
(:p "Although Genworks GDL is a powerful framework for a variety
of general-purpose undertakings, one of its particular strong points
is generating geometry and processing geometric entities. Geometric
capabilities are provided by a library of "
(:emph "low-level primitives")
", or LLPs. LLPs are pre-defined GDL objects which you can
......@@ -36,9 +36,9 @@
(:texttt ":geom-base")
" package, and here are some examples:"
((:list :style :itemize)
(:item (:texttt "base-coordinate-system") " provides an empty 3D Cartesian coordinate system"
(:item (:texttt "base-coordinate-system") " provides an empty 3D Cartesian coordinate system."
(:footnote (:texttt "base-coordinate-system") " is also known by its legacy name "
(:texttt "base-object") "."))
(:texttt "base-object")))
(:item "Simple 2-dimensional primitives include "
(:texttt "line")
......@@ -133,7 +133,7 @@
(:ref "fig:box-code")
" defines an example box, and Figure "
(:ref "fig:tasty-box")
" shows how it will display in tasty.")
" demonstrates how it will display in Tasty.")
(:p "Note the following from the example in "
(:ref "fig:box-code")
......@@ -157,13 +157,14 @@
(:texttt "base-object")
" as "
(:emph "trickle-down-slots")
". For this reason, they are automatically being passed down into into the "
". For this reason they are automatically being passed down
into into the "
(:texttt "box")
" child object. Therefore it is not necessary to pass them down explicitly."))
((:boxed-figure :caption "Definition of a Box" :label "fig:box-code")
(:verbatim (:include "~/gendl/documentation/tutorial/examples/box-1.gdl")))
((:image-figure :image-file "tasty-box-1.png" :caption "Simple box displayed in tasty"
((:image-figure :image-file "tasty-box-1.png" :caption "Simple box displayed in Tasty"
:width "4in" :height "3in"
:label "fig:tasty-box")))
......@@ -182,7 +183,7 @@
(:ref "fig:positioned-boxes-source")
" (rendered in Figure "
(:ref "fig:positioned-boxes")
") shows a second box being positioned next to the first, by using the "
") shows a second box being positioned adjacent to the first, by using the "
(:texttt ":center")
" input. "))
......@@ -202,7 +203,7 @@ can be referenced from within its "
" of each individual child object as it is being processed.
In this manner it is possible to compute a distinct position for each child, as a function of its
index, as demonstrated in Figures "
(:ref "fig:positioned-by-index")
(:ref "fig:positioned-by-index-source")
" and "
(:ref "fig:positioned-by-index")
"."
......@@ -212,7 +213,7 @@ index, as demonstrated in Figures "
((:subsection :title "Relative positioning using the translate operator")
(:p "It is usually wise to position child objects in a "
(:p "It is usually preferable to position child objects in a "
(:emph "relative")
" rather than "
(:emph "absolute")
......@@ -220,14 +221,14 @@ index, as demonstrated in Figures "
(:ref "fig:positioned-by-index-source")
", each child box object is being positioned using an absolute coordinate produced by "
(:texttt "make-point")
". This will work fine as long as the center of the current parent is "
". This will work as long as the center of the current parent is "
(:texttt "#(0.0 0.0 0.0)")
" (which it is, by default). But imagine if this parent
itself is a child of a larger assembly. Imagine further that the
larger assembly specifies a non-default center for this instance
of "
(:texttt "positioned-by-index")
". At this point, the strategy falls apart.")
". At this point, the strategy fails.")
(:p "The solution is to adhere to a consistent Best Practice of positioning child objects according to the "
(:texttt "center")
" (or some other known datum point) of the parent
......@@ -237,7 +238,7 @@ index, as demonstrated in Figures "
" operator. The "
(:texttt "translate")
" operator works within the context of a GDL object, and
allows a 3D point to be translated in up to three directions, chosen from: "
allows a 3D point to be translated in up to three directions, selected from: "
(:texttt ":up")
", "
(:texttt ":down")
......@@ -260,7 +261,7 @@ with all the positioning done relative to the parent's center."
((:subsection :title "Display Controls")
(:p "It is possible to specify certain default display
(:p "It is possible to specify particular default display
characteristics"
(:footnote "In addition to display-controls attached to a geometric entity
itself, GDL also supports the concept of "
......@@ -332,7 +333,7 @@ and is expected to be a "
(:ref "fig:display-color")
" and "
(:ref "fig:display-color-source")
" demonstrates the use of the "
" demonstrate the use of the "
(:texttt ":color")
" keyword in the "
(:texttt "display-controls")
......@@ -351,7 +352,7 @@ the use the "
(:texttt "alignment")
" function. The "
(:texttt "alignment")
" function takes up to three direction keywords, and
" function accepts up to three direction keywords, and
corresponding vectors to which these directions should be aligned. For
example, to obtain an orientation matrix specifying that the Rear of a
reference box should be aligned with the vector "
......@@ -363,13 +364,13 @@ reference box should be aligned with the vector "
((:rendered-figure :caption "Cylinder aligned vertically"
:object "vertical-cylinder"))
(:p "Usually, you will want the orientation of a child object to be
(:p "Generally, you will want the orientation of a child object to be
specified in a "
(:emph "relative")
" manner to that of the current (parent) object. The concept here is
similar to that for positioning with respect to "
(:texttt "(the center)")
". For relative orientation, you can use the various "
". For relative orientation, you can utilize the various "
(:texttt "face-normal-vector")
"s of the parent object. For example, by default, cylinders are aligned with
their flat ends along the longitudinal (Y) axis. Figures "
......@@ -399,10 +400,13 @@ one of the major axes, you can use the "
rotated 2 degrees with respect to the box under it.")
((:subsection :title "Assemblies")
"Objects which you define can be used just like the built-in primitives. This illustrates
why it is important for the positioning and orientation passed into a child object to be "
"Objects which you define with "
(:texttt "define-object")
" can be used no differently from the built-in primitives. This
underscores why it is important for the positioning and orientation
passed into a child object be "
(:emph "relative")
" to that in the parent. Figures "
" to that present in the parent. Figures "
(:ref "fig:tower-assembly")
" and "
(:ref "fig:tower-assembly-source")
......@@ -443,7 +447,7 @@ the file "
source is not printed in the manual.")
((:subsection :title "Other Geometric Primitives")
"This chapter has focused mainly on the "
"This chapter has focused primarily on the "
(:texttt "box")
" primitive, because every type of geometric primitive is based upon a "
(:emph "reference box")
......@@ -465,9 +469,10 @@ the file "
(:li (:texttt "bezier-curve")
(:footnote "The simple cubic bezier curve is supported
in the basic GDL and open-source Gendl. More
sophisticated NURBS based curves and surfaces are
supported in the commercial GDL product with the SMLib
geometry kernel. These are covered in chapter "
sophisticated NURBS-based curves and surfaces are
supported in the commercial GDL product when
accompanied with the SMLib geometry kernel. These are
covered in chapter "
(:ref "chap:advanced-geometry"))
" described on page "
(:pageref "prim:bezier-curve")))
......
......@@ -22,16 +22,16 @@
(in-package :gendl-doc)
(defparameter *installation*
`((:chapter :title "Installation")
`((:chapter :title "Installation [GDL and Gendl]")
"Follow Section "
"Please follow Section "
(:ref "sec:installationofpre-packagedgdl")
" if your email address is registered with Genworks and you will
install a pre-packaged Genworks GDL distribution, including its own
Common Lisp engine. The foundation of Genworks GDL is also available
as open-source software through The Gendl Project"
(:footnote "http://github.com/genworks/gendl")
"; if you want to use that version, then please refer to Section "
"; if you elect to use that version, then please refer to Section "
(:ref "sec:installationofopen-sourcegendl")
"."
((:section :title "Installation of pre-packaged GDL")
......@@ -42,11 +42,11 @@ Gnu Emacs)."
((:subsection :title "Download the Software and retrieve a license key")
((:list :style :enumerate)
(:item "Visit the Downloads section of the "
(:href "http://genworks.com" "Genworks Website"))
(:href "http://genworks.com" "Genworks Website") ";")
(:item "Enter your email address"
(:footnote "if your address is not on file, send mail to licensing@genworks.com")
".")
(:item "Download the latest Payload for Windows, Linux, or Mac")
";")
(:item "Download the latest Payload for Windows, Linux, or Mac;")
(:item "Click to receive the license key file by email.")))
((:subsection :title "Unpack the Distribution")
......@@ -71,10 +71,10 @@ a ``dmg'' application bundle for Mac, and a self-contained zip file for Linux."
"This section is only germane if you have not received a
pre-packaged Gendl or Genworks GDL distribution with its own Common
Lisp engine. If you have received a pre-packaged Gendl distribution,
Lisp engine. If you have received a pre-packaged Gendl distribution
then you may skip this section. In case you want to use the
open-source Gendl, you will use your own Common Lisp installation and
obtain Gendl (Genworks-GDL) using a very powerful and convenient CL
obtain Gendl (Genworks-GDL) using a powerful and convenient CL
package/library manager called "
(:emph "Quicklisp") "."
......@@ -198,7 +198,7 @@ startup process, please contact the following resources:"
(:item "If you are not a supported Genworks customer but you want to report an apparent bug or have other suggestions or inquiries, you may also send email to "
(:href "mailto:support@genworks.com" "support@genworks.com")
", but as a non-customer please understand that Genworks
cannot guarantee a response or a particular timeframe for a
cannot guarantee a response or a particular time frame for a
response. Also note that we are not able to offer guaranteed
support for Trial and Student licenses ")))))
......
......@@ -68,8 +68,8 @@ Our informal definition of a "
(:emph "Object-Oriented")
(:footnote "An " (:emph "Object-Oriented")
" programming environment supports named collections
of values along with procedures to operate on that
data, including the possibility to
of values along with procedures to operate on those
values, including the possibility to
modify (``mutate'') the data. See
https://en.wikipedia.org/wiki/Object-oriented_programming")
" and "
......@@ -83,14 +83,14 @@ http://en.wikipedia.org/wiki/Functional_programming")
(:emph (:indexed "Caching"))
" and "
(:emph (:indexed "Dependency tracking"))
". Caching means that once the KB has computed something, it
generally will not need to repeat that computation if the same
question is asked again. Dependency tracking is the flip side of that
coin --- it ensures that if a cached result is "
". Caching means that once the KB system has computed
something, it generally will not need to repeat that computation if
the same question is asked again. Dependency tracking is the flip side
of that coin --- it ensures that if a cached result is "
(:emph "stale")
", the result will be recomputed the next time it is "
(:emph "demanded")
", so as to give a fresh result.")
", in order to give a fresh result.")
((:section :title "Classic Definition of Knowledge Based Engineering (KBE)")
"Sections "
......@@ -122,13 +122,13 @@ validity of the cached values. As soon as these values are no longer
valid (stale), they are set to unbound and recomputed if and only at
the very moment they are again demanded.")