DLP
DLP
Release Notes
Contents
- Getting Started
- Program Examples
- Builtins / Libraries
- Multi-Threaded Objects
Download
DLP/Java is currently a pre-compiled distribution:
dlp.zip
Overview of the directory structure of the distribution :
dlp/
bin/
dlp ## command line execution
dlpc ## compiler shell script (Cygwin / Linux / Solaris)
classes/
dlpsys.jar ## pre-compiled libraries and run-time system
examples/
README.txt
....
*.pl ## DLP program examples
makefile ## for the compilation of the DLP examples
setvars.j122 ## environment variable settings (Linux / Solaris)
....
lib/
execomp.qlf ## compiler front-end / back-end
Installation
- Installing dlp.zip :
Unzip the zip archive, e.g. :
unzip dlp.zip
creates a "dlp/" subdirectory in the current directory.
- Adjust the required environment variable settings as described in
one of the examples/setvars files.
- Change the first line in file bin/dlpc, examples/pxdemo
and examples/setvars.j122 or examples/setvars.cygw
with respect to the location of the bash shell on your local configuration.
- The implementation requires currently SWI Prolog version 3.3.10 (
local copy :
win32 executable
).
( Used for bootstrapping the DLP compiler, needs to be replaced
by standalone version ).
- Running a DLP program that is compiled to Java requires at least the
Java Runtime Environment.
The JRE distribution contains the JVM, core classes and several other
files, but not the compiler, debugger and a number of other tools.
- Compiling and debugging DLP programs requires a full Java SDK installation.
This distribution includes the JRE.
Don't use the 1.4.X or 1.5.X SDK in combination with a VRML plug-in.
Compilation
When compiling a DLP program "prog.pl" :
dlpc prog.pl
in directory "/home/user/project/qwerty", the generated Java class files
are written to the corresponding "/home/user/project/qwerty/classes"
subdirectory. As mentioned in the setvars files,
this "classes" subdirectory should also be included in your CLASSPATH
environment variable.
Execution
- Command line execution
After compiling a DLP source file that contains for example
an object objectname with method main, start the
program by means of the command :
dlp objectname
Execution will be transferred to method main in
object objectname.
The command "dlp" is basically a wrapper which starts
dlpmain.class with the specified objectname.
This class file as well as the dlpbrow.class and
dlpcons.class files (see next 2 paragraphs) are
included in the classes/dlpsys.jar file of the distribution.
- Execution of DLP in a browser with an output stream area
In case you have written a DLP program, e.g. like the
bounded
buffer example and would like to run it in a browser (without VRML),
create a file as shown below :
<html>
<body>
<applet archive="dlpsys.jar, pxbuff.jar" code="dlpbrow.class" width=500 height=500>
<param name="object" value="pxbuff">
<param name="line" value="80">
<param name="rows" value="25">
<param name="cols" value="80">
</applet>
</body>
</html>
The applet tag tells your browser that there are two jar files
involved : dlpsys.jar , which contains all the pre-compiled DLP libraries
including the dlpbrow.class, and your pxbuff.jar file, containing
your program specific class files.
If the jar files are not located in the same directory as your html file that
contains the above-mentioned definitions, add the corresponding (relative)
URLs.
In addition, the applet tag tells your browser to start
dlpbrow.class. This class file will read the parameter value as mentioned
in the param name=object entry (alternative: param name=ostart
entry in version 1r18K(8) or higher) in order to determine which method / object
to start: in this example method main in object pxbuff.
As opposed to dlpcons.class (see below), the dlpbrow.class creates a
Java TextArea like output stream. The number of rows and columns of the TextArea
can be adjusted by means of the param rows and param cols entries.
When executing DLP methods like text_area(Stream) and
set_output(Stream) as illustrated in the
bounded buffer
program, all subsequent output statements write their output to the
TextArea like output stream in your browser. In case you don't invoke the
text_area(Stream) and set_output(Stream) methods all output will
be written to the browser Java console.
If the optional param line entry is mentioned, dlpbrow
creates a Java TextField like input field. Use the DLP built-in predicate
text_field / 1 to specify to which queue input lines are sent for
further asynchronous processing.
- Execution of DLP + VRML browser plug-in without an output stream area
Executing a DLP program in the context of a browser
VRML plug-in requires for example the following html
definitions :
<html>
<body>
<embed src="root.wrl" width="100%" height="100%">
<applet archive="dlpsys.jar , rotation.jar" code="dlpcons.class" MAYSCRIPT>
<param name="command" value="applet_console('ide')">
<param name="object" value="rotation">
</applet>
</body>
</html>
These definitions are essentially the same as in the previous paragraph.
However, the applet tag contains a reference to the dlpcons.class
file instead of the dlpbrow.class file. When using the dlpcons.class
file, no TextArea like output stream is created and DLP output will always be
written to the browser Java console. An example of the root.wrl file can be found
at the DLP+VRML examples page.
Note that when you've installed multiple VRML plugins, it
may be necessary to specify in an html file which plugin should
be used. A plugin is selected by means of its classid.
The following example shows how
Blaxxun is selected by means of its corresponding class-id.
- Error Messages
The browser Java console as well as the VRML plug-in console are
important in order to determine whether particular errors occurred.
In Netscape Communicator, click "Communicator" -> "Tools" ->
"Java Console".
In Microsoft Internet Explorer, click "View" -> "Java Console".
In case "View" doesn't show a "Java Console" option, activate the console
by means of : "Tools" -> "Internet Options" -> "Advanced" : the "Microsoft VM"
section contains the "Java Console enabled" checkbox.
Blaxxun VRML plug-in: click right mouse button in
VRML area -> "Settings" -> "Console".
- Browser / VRML Cache
Check the cache settings of your browser and VRML plug-in.
When you change your DLP or VRML code, it's not very useful that a browser
or VRML plug-in reload the files from their cache. In addition,
browser Refresh / Reload buttons will often fetch the class files
from cache.
However, when changing your cache settings to "Every visit to the
page" (IExplorer) or "Every time" (Netscape), the class files are
for some browser configurations still fetched from a cache : exit your
browser and restart.
Similar remarks with respect to VRML plug-ins. Use "Empty Cache now ..."
(Blaxxun) to be sure that your new VRML specifications are loaded.
Summary of Built-ins
Arithmetic comparison
- +Eval =:= +Eval (arithmetic equal)
- +Eval =\= +Eval (arithmetic not equal)
- +Eval > +Eval (arithmetic greater than)
- +Eval >= +Eval (arithmetic greater than or equal)
- +Eval < +Eval (arithmetic less than)
- +Eval =< +Eval (arithmetic less than or equal)
Arithmetic evaluation
- LogicalVar is Expression (evaluate expression)
Arithmetic functors :
- '+'/2
- '-'/1
- '-'/2
- '*'/2
- '/'/2
- '//'/2
- '**'/2
- '<<'/2 (bit shl)
- '>>'/2 (bit shr)
- '\'/2 (bit neg)
- '/\'/2 (bit and)
- '\/'/2 (bit ior)
- abs/1
- mod/2
- rem/2
- acos/1
- asin/1
- atan/1
- cos/1
- sin/1
- tan/1
- exp/1
- log/1
- random/0
- round/1
- sign/1
- sqrt/1
- truncate/1
Atomic term processing
- atom_chars(+Atom, ?CharList)
atom_chars(?Atom, +CharList)
- atom_codes(+Atom, ?CodeList)
atom_codes(?Atom, +CodeList)
- atom_concat(+Atom1, +Atom2, ?NewAtom)
- atom_list_concat(+AtomList, ?NewAtom)
- atom_length(+Atom, ?Length)
- atom_number(+Atom, ?Number)
atom_number(?Atom, +Number)
- char_code(+Char, ?Code)
char_code(?Char, +Code)
- number_chars(+Number, ?CharList)
number_chars(?Number, +CharList)
- number_codes(+Number, ?CodeList)
number_codes(?Number, +CodeList)
Character input/output
- get_char(?Char)
- get_char(+Stream, ?Char)
- nl
- nl(+Stream)
- put_char(+Char)
- put_char(+Stream, +Char)
Logic and control
- between /3
- ',' /2 (conjunction)
- '!' /0 (cut)
- fail /0
- halt /1
- repeat /0
- true /0
Stream selection and control
- at_end_of_stream/0
- at_end_of_stream(+Stream)
- close(+Stream)
- open(+Source_Sink, +IOmode, -Stream),
IOmode = {read | write | append}
- set_input(+Stream)
- set_output(+Stream)
Term comparison
- Term1 == Term2
- Term1 \== Term2
- Term1 @< Term2
- Term1 @> Term2
- Term1 @=< Term2
- Term1 @>= Term2
Term creation and decomposition
- arg(+ArgI, +CompoundTerm, ?ArgV)
- copy_term(?Term, ?Copy)
- functor(+Term, ?Name, ?ArgC)
functor(?Term, +Name, +ArgC)
- +Term =.. ?List
?Term =.. +List
Term input/output
- display(?Term)
- display(+Stream, ?Term)
- format(+Format, +ArgList)
- format(+Stream, +Format, +ArgList)
format specifiers : ~k ~n ~q ~t ~w
- write(?Term)
- write(+Stream, ?Term)
- write_canonical(?Term)
- write_canonical(+Stream, ?Term)
- writeq(?Term)
- writeq(+Stream, ?Term)
Term input from constant terms
- read_from_atom(+Atom, ?Term)
- read_from_atom(+Atom, ?Term, ?VarList)
unifies Term with the term representation
of Atom or an error/2 term.
Term output to constant terms
- format_to_atom(?Atom, +Format, +ArgList)
- format_to_chars(?CharList, +Format, +ArgList)
- format_to_codes(?CodeList, +Format, +ArgList)
Term unification
- ?Term1 = ?Term2 (unify)
- ?Term1 \= ?Term2 (not unifiable)
Type testing
- atom(?Term). Term is an atom.
- atomic(?Term). Term is atomic (atom or number).
- compound(?Term). Term is a compound term.
- float(?Term). Term is a float.
- integer(?Term). Term is an integer.
- nonvar(?Term). Term is instantiated.
- number(?Term). Term is a number (integer or float).
- var(?Term). Term is uninstantiated.
List Processing
- append(List1, List2, List12)
- flatten(List, FlattenedList)
- insert(+OldSortedList, +Term, ?NewSortedList) (ascending order)
- length(List, Length)
- member(Element, List)
- memberchk(Element, List)
- nth0(N, List, Element), N >= 0
- nth1(N, List, Element), N >= 1
- reverse(List, RevList)
- select(Element, List, Residue)
- selectchk(Element, List, Residue)
Miscellaneous
- compare(R, Term1, Term2). The first argument
R will be unified with
- '<', when Term1 'term-precedes' Term2
- '=', when Term1 is identical to Term2
- '>', when Term2 'term-precedes' Term1
- numbervars(Term, N0, NL)
- memory(-TotalKBs, -FreeKBs). Get the total number of KBytes and
the currently available free KBytes.
- sleep(+Msecs). Suspend the execution of the current thread
for Msecs milliseconds.
- get_system_property(+Key, -Value)
set_system_property(+Key, +NewValue, -OldValue)
Java run-time system property predicates.
- stack_trace/0. Show the method/predicate continuations until
the current point of execution.
- text_area(BrowserStream). Argument BrowserStream will be
unified with a Java TextArea like stream.
Combining this predicate with set_output(BrowserStream)
redirects the output of a program to the corresponding BrowserStream,
otherwise program output will be written to the browser "Java Console".
- text_field(InputQueueName).
Asynchronous browser input from a TextField like input line is sent to
the queue as an atom.
Input in DLP (and Java), like browser
or socket input, is usually processed by a separate thread. Instead of all
kinds of detailed I/O control facilities as found in programming languages
like C or C++, I/O in DLP (and Java) is handled by a thread that communicates
its I/O results to other threads in a multi-threaded safe way.
TCP / IP Networking
- Host Identification
- host_address(+HostName, -InternetAddress).
- local_host(-HostName, -InternetAddress).
- code_base_host(-HostName).
Unifies HostName with the name of the host from which the
current program objects are loaded.
When running in a browser HostName will be unified with
the name of the originating host.
However, note that some browser configurations don't allow for
the retrieval of the name
of the host and will generate a security exception.
- Server Predicates
- tcp_server(+ServerPort, -ServerSocket).
- tcp_accept(+ServerSocket, -ServerStreamIn,
-ServerStreamOut).
- tcp_accept(+ServerSocket, -ServerStreamIn,
-ServerStreamOut, -ClientHostName).
- Client Predicate
- tcp_client(+ServerHostName, +ServerPort, +TimeOut,
-ClientStreamIn, -ClientStreamOut).
- Bi-Directional Client / Server Communication
- tcp_get_term(+StreamIn, ?Term).
- tcp_put_term(+StreamOut, +Term).
- Closing Client / Server Connection
- tcp_close(+Socket).
- tcp_close(+Stream).
EAI Node::Field like Storage-Retrieval Predicates
The NodeName :: FieldName predicates mentioned below, provide
an EAI-like storage and retrieval functionality. Although
they are primarily intended for stand-alone servers, i.e. servers
not embedded in an VRML / EAI framework, they can also be used for
other purposes.
Typically, such a server will handle multiple independently running
client threads, therefore the storage and retrieval predicates are
extended to deal with event driven, i.e. (internally) wait / notify
based, processing:
Get / Set Field Predicates :
- set_field(+GlobalFieldName, +Term)
- get_field(+GlobalFieldName, ?Term)
- get_field_block(+GlobalFieldName, ?Term)
- get_field_reset(+GlobalFieldName, ?Term)
- get_field_event(+GlobalFieldName, ?Term)
- set_field(+NodeName, +FieldName, +Term)
- get_field(+NodeName, +FieldName, ?Term)
- get_field_block(+NodeName, +FieldName, ?Term)
- get_field_reset(+NodeName, +FieldName, ?Term)
- get_field_event(+NodeName, +FieldName, ?Term)
The GlobalFieldName, NodeName and FieldName predicate
arguments are atoms.
Predicate set_field sets the associated value of the specified
GlobalFieldName or NodeName and FieldName combination
to the term as mentioned in the Term argument.
Predicate get_field returns the stored Term value or
returns the atom undefined when not yet defined by a
set_field predicate. The get_field predicate is
non-blocking; it always returns immediately.
Predicate get_field_event blocks until a set_field
operation sets the corresponding value, after which it
returns that value and "resets" the field.
This blocking and reset behavior can be independently
selected by the get_field_block (no reset) or get_field_reset
(no blocking) predicates respectively.
An implicit (get_field_event) or explicit (get_field_reset)
field reset doesn't set the field value to undefined, but
only flags that the value has been retrieved. This allows non-blocking
predicates to get the latest field value.
Summary: get_field and get_field_reset are non-blocking;
they allow for polling a particular field value. Predicates
get_field_block and get_field_event always block
until a new field value has been defined by the set_field
predicate. Blocking and unblocking are (internally) wait / notify
driven.
Get / Set Queue Predicates :
Queue predicates provide a flexible way to construct special purpose
asynchronous interaction patterns or protocols between active objects.
All queue primitives are safe in multi-threaded execution contexts (atomic
queue update).
- new_queue(+GlobalQueueName, +MaxSize)
- set_queue(+GlobalQueueName, +Term)
- get_queue(+GlobalQueueName, ?Term)
- queue_full(+GlobalQueueName)
- queue_empty(+GlobalQueueName)
- queue_length(+GlobalQueueName, -CurrentLength)
- new_queue(+NodeName, +QueueName, +MaxSize)
- set_queue(+NodeName, +QueueName, +Term)
- get_queue(+NodeName, +QueueName, ?Term)
- queue_full(+NodeName, +QueueName)
- queue_empty(+NodeName, +QueueName)
- queue_length(+NodeName, +QueueName, -CurrentLength)
NodeName and QueueName predicate arguments are atoms.
Predicate new_queue creates a unique queue. The maximum number
of queue elements is defined by MaxSize. When a queue isn't
defined yet by new_queue upon the first invocation of a
set_queue or get_queue predicate, a queue descriptor will
automatically be created with a default maximum size of 100.
Predicate set_queue appends a new Term to the
queue. If the queue contains MaxSize elements this operation
will block until a get_queue operation removes an element from the
queue. Predicate get_queue removes the first element from the queue
and unifies this element with Term. In case the queue is empty, this
operation will block until a set_queue operation adds an element to
the queue.
Conditional Queue Lookup Predicates :
- accept_queue_term( +GlobalQueueName, +AcceptExpressionList, -Term )
- accept_queue_term( +NodeName, +QueueName, +AcceptExpressionList, -Term )
Accept the first entry in the queue that satifies one of the
AcceptExpressions in the AcceptExpressionList.
Get / Set Array Predicates :
- new_array(+NameSpace, +ArrayName, +Dim1)
- get_array(+NameSpace, +ArrayName, +Idx1, ?Elem)
- set_array(+NameSpace, +ArrayName, +Idx1, +Elem)
- new_array(+NameSpace, +ArrayName, +Dim1, +Dim2)
- get_array(+NameSpace, +ArrayName, +Idx1, +Idx2, ?Elem)
- set_array(+NameSpace, +ArrayName, +Idx1, +Idx2, +Elem)
- new_array(+NameSpace, +ArrayName, +Dim1, +Dim2, +Dim3)
- get_array(+NameSpace, +ArrayName, +Idx1, +Idx2, +Idx3, ?Elem)
- set_array(+NameSpace, +ArrayName, +Idx1, +Idx2, +Idx3, +Elem)
- NameSpace and ArrayName are atoms.
- Array elements must be explicitly initialized.
DLP / JavaScript Interface
- DLP methods (object jsilib)
- get_window( -JSObject )
- call( +JSObject, +JSFunctionName, +ArgList, -FunctionResult )
(t.b.d. arrays < = > lists)
- eval( +JSObject, +Evaluate, -Result )
See member example w.r.t. netscape/explorer remarks.
- get_member( +JSObject, +Member, -Result )
- set_member( +JSObject, +Member, +Value )
- get_slot( +Member, +Index, -Value) (netscape)
set_slot( +Member, +Index, +Value) (netscape)
(Use call/4 for a portable solution)
- JS methods (part of object dlpbrow / dlpcons)
- var applet = window.document.applets['dlpbrow'];
var applet = window.document.applets['dlpcons'];
- applet.get_field( "namespace", "fieldname", atomic )
applet.set_field( "namespace", "fieldname", term )
applet.set_queue("namespace", "queuename", term )
- Parameters namespace, fieldname, queuename are strings.
Parameter term is an integer, float, double,
or string :
a string is either :
- "term:" + "aValidTermString"
- "atom:" + "anAtom" (explicit atom)
- or any other string (implicit atom)
- Introductory Examples / Sources :
Multi-threaded Objects (Syntax Summary)
- declaration of objects :
- :-object name .
- :-object name : [ base ].
- :-object name : [ base1, base2, ... ].
- :-end_object name .
- declaration non-logical variables (nlv's) :
var i = 0, j = [1,2,3], k = f(a,b,c).
- destructive assignment :
nlv := Term
nlv := Expression (simplification)
other nlv occurrences are replaced by their current value.
- object creation :
ObjectRef := new(ObjectNameOrConstructor)
- method invocation :
ObjectRef <- method(...)
- accept statement :
accept(AcceptExpression1, AcceptExpression2, ...)
- accept expression:
- method(...) <== [Guard] ==> Body
- method(...) <== [Guard]
- method(...) ==> Body
- method(...)
- any
- accept guard:
- accept body:
- channels :
Channels in DLP provide a way to express synchronous
interactions between independently executing active objects.
The following DLP language constructs deal with channel
communication:
- channel creation : C := new(channel)
- channel output : C ! OutTerm
- channel input : C ? InTerm
Synchronization:
- Invocation of a channel input statement will block until
a client thread executes a channel output statement.
- Invocation of a channel output statement will block until
a server thread executes a channel input statement with an
InTerm that unifies with the OutTerm of the current
channel output statement.
- If an input term and an output term are not unifiable, the
server side will backtrack until a channel input statement has
an InTerm that unifies with the OutTerm of the
current channel output statement.
Vectors / Quaternions (vectorlib)
- Predicates
- vector_dot_product(vector(X1,Y1,Z1), vector(X2,Y2,Z2), V1DotV2)
- vector_cross_product(vector(X1,Y1,Z1), vector(X2,Y2,Z2), vector(XN,YN,ZN))
- vector_cross_product(vector(X1,Y1,Z1), vector(X2,Y2,Z2), vector(XN,YN,ZN), AngleV12)
- quaternion_to_rotation(quaternion(W1,X1,Y1,Z1), rotation(X,Y,Z,R))
- rotation_to_quaternion(rotation(X1,Y1,Z1,R1), quaternion(W,X,Y,Z))
- unit_vector(vector(VX,VY,VZ), vector(UX,UY,UZ))
- unit_quaternion(quaternion(W1,X1,Y1,Z1), quaternion(W,X,Y,Z))
- direction_vector(position(X1,Y1,Z1), position(X2,Y2,Z2), vector(Ux,Uy,Uz))
- quaternion_product(quaternion(W1,X1,Y1,Z1), quaternion(W2,X2,Y2,Z2), quaternion(W,X,Y,Z))
- slerp(F, quaternion(W1,X1,Y1,Z1), quaternion(W2,X2,Y2,Z2), quaternion(W,X,Y,Z))
- cosine_law(A, B, C, AngleAB)
- vector_rotation(vector(X,Y,Z), R, vector(Ux,Uy,Uz))
- position_rotation(position(X,Y,Z), R, position(Px,Py,Pz))
- ....
DLP / EAI: VRML External Authoring Interface Library
-
VRML Browser Predicates
- loadURL( +URL )
- getWorldURL( -URL )
- setDescription( +Description )
Description is an atom
- setDescription( +Format , +Args )
- getCurrentFrameRate( -FrameRate )
- setTimerInterval( +NewMsecs , -OldMsecs )
- beginUpdate / 0, endUpdate / 0
- vrmlNode ( +Name )
succeeds if node Name exists, otherwise fails.
- getNodeType ( +Node, -Type)
- createVrmlFromString( +VrmlAtom , -ObjectRefList)
- createVrmlFromString( +VrmlAtom , +ParentObject , -ObjectRefList)
ObjectRefList is a Foreign Object Reference List.
- createVrmlFromURL( +URL , +NotifyNode , +NotifyField )
- addRoute( +FromObject, +EventOutFieldName , +ToObject , +EventInFieldName )
- deleteRoute( +FromObject, +EventOutFieldName, +ToObject, +EventInFieldName )
-
VRML Event Observers
- eventObserverQueue( +Object, +FieldName, +QueueName )
Object/FieldName events are sent to QueueName as a term:
FieldName(EventValue, EventTime, Object)
- Not available (no EventOut.unAdvise in the current EAI SDK) :
eventObserverQueue( +Object, +FieldName, +QueueName, -Observer )
removeEventObserver( +Observer )
-
Agent / Object Coordinates
- getPosition( +Object , -X , -Y , -Z )
- setPosition( +Object , +X , +Y , +Z )
- getRotation( +Object , -X , -Y , -Z , -R )
- setRotation( +Object , +X , +Y , +Z , +R )
- getViewpointPosition( +Agent , -X , -Y , -Z )
- setViewpointPosition( +Agent , +X , +Y , +Z )
- getViewpointOrientation( +Agent , -X , -Y , -Z , -R )
- setViewpointOrientation( +Agent , +X , +Y , +Z , +R )
X, Y, Z, and R values are integers or floats
-
Single Field Predicates
- getSFBool(+Object, +Field, -Bool)
- setSFBool(+Object, +Field, +Bool)
Bool is an atom : 'true' or 'false'
- getSFFloat(+Object, +Field, -Float)
- setSFFloat(+Object, +Field, +Float)
- getSFInt32(+Object, +Field, -Int32)
- setSFInt32(+Object, +Field, +Int32)
- getSFString(+Object, +Field, -Atom)
- setSFString(+Object, +Field, +Atom)
- setSFString(+Object, +Field, +Format, +ArgList)
- getSFColor(+Object, +Field, -R,-G,-B)
- setSFColor(+Object, +Field, +R,+G,+B)
R, G, and B values are integers or floats
- getSFNode(+Object, +Field, -ObjectRef)
- setSFNode(+Object, +Field, +NameOrRef)
- getSFRotation(+Object, +Field, -X,-Y,-Z, -R)
- setSFRotation(+Object, +Field, +X,+Y,+Z, +R)
- getSFTime(+Object, +Field, -Time)
- setSFTime(+Object, +Field, +Time)
- getSFVec2f(+Object, +Field, -X,-Y)
- setSFVec2f(+Object, +Field, +X,+Y)
- getSFVec3f(+Object, +Field, -X,-Y,-Z)
- setSFVec3f(+Object, +Field, +X,+Y,+Z)
-
Multi Field Predicates
- getMFFloat(+Object, +Field, -FloatList)
- setMFFloat(+Object, +Field, +FloatList)
- getMFInt32(+Object, +Field, -IntegerList)
- setMFInt32(+Object, +Field, +IntegerList)
- getMFString(+Object, +Field, -AtomList)
- setMFString(+Object, +Field, +AtomList)
- setMFString(+Object, +Field, +Format, +ArgList)
- getMFTime(+Object, +Field, -TimeList)
- setMFTime(+Object, +Field, +TimeList)
- getMFColor(+Object, +Field, -RGBList)
- setMFColor(+Object, +Field, +RGBList)
RGBList = [ sfcolor(R1,G1,B1), sfcolor(R2,G2,B2), .... ]
- getMFNode(+Object, +Field, -ObjectRefList)
- setMFNode(+Object, +Field, +ObjectRefList)
- getMFNodeSize(+Object, +Field, -Size)
- getMFNode(+Object, +Field, +Index, -ObjectRef)
- setMFNode(+Object, +Field, +Index, +ObjectRef)
- getMFRotation(+Object, +Field, -XYZRList)
- setMFRotation(+Object, +Field, +XYZRList)
XYZRList = [ sfrotation(X1,Y1,Z1,R1), sfrotation(X2,Y2,Z2,R2), .... ]
- getMFVec2f(+Object, +Field, -XYList)
- setMFVec2f(+Object, +Field, +XYList)
XYList = [ sfvec2f(X1,Y1), sfvec2f(X2,Y2), .... ]
- getMFVec3f(+Object, +Field, -XYZList)
- setMFVec3f(+Object, +Field, +XYZList)
XYZList = [ sfvec3f(X1,Y1,Z1), sfvec3f(X2,Y2,Z2), .... ]
- getMFVec3f(+Object, +Field, +Index, -X, -Y, -Z)
- setMFVec3f(+Object, +Field, +Index, +X, +Y, +Z)
- getMFVec3fSize(+Object, +Field, -Size)
(Generic getMFSize compiles, but r-t in COM unknown)
- getMFVec3fCopy(+Object, +Field, -MFVec3fCopy, -Size)
retrieve a copy of the mfvec3f data.
- setMFVec3fCopy(+Object, +Field, +MFVec3fCopy)
update vrml, store the modified mfvec3f copy.
- getMFVec3fCopy(+MFVec3fCopy, +Index, -X, -Y, -Z)
retrieve the sfvec3f contents from the mfvec3f copy
at index Index.
- setMFVec3fCopy(+MFVec3fCopy, +Index, +X, +Y, +Z)
store the sfvec3f X, Y, and Z
values at index Index.
-
Single / Multi - Field Predicates
- getFieldType( +Object, +Field, ?Type)
- getFieldValue( +Object, +Field, ?Value)
- setFieldValue( +Object, +Field, +Value)
sf values :
sfbool(B),
sfcolor(R,G,B),
sffloat(F),
sfint32(I),
sfnode(N),
sfrotation(X,Y,Z,R),
sfstring(A),
sftime(T),
sfvec2f(X,Y),
sfvec3f(X,Y,Z).
mf values :
mfcolor(SFColorList),
mffloat(FloatList),
mfint32(Int32List),
mfnode(NodeList),
mfrotation(SFRotationList),
mfstring(AtomList),
mftime(TimeList),
mfvec2f(SFVec2fList),
mfvec3f(SFVec3fList).
-
Add / Remove Children Predicates
- addChildren( +ParentObject, +ObjectRefList )
- removeChildren( +ParentObject, +ObjectRefList )
-
Miscellaneous
- distance2D(+X1, +Z1, +X2, +Z2, -Distance)
- distance3D(+X1, +Y1, +Z1, +X2, +Y2, +Z2, -Distance)
- intersection(+Ax1,+Az1, +Ax2,+Az2, +Bx1,+Bz1, +Bx2,+Bz2, -CD, -Ua,-Ub, -Xi,-Zi)
La line segment from (Ax1,Az1) to (Ax2,Az2)
Lb line segment from (Bx1,Bz1) to (Bx2,Bz2)
If CD =:= 0 then the La, Lb line segments are parallel.
If CD =\= 0 and 0 =< Ua =< 1, La segment contains intersection point,
If CD =\= 0 and 0 =< Ub =< 1, Lb segment contains intersection point,
If CD =\= 0 and Ua as well as Ub lie within the [0..1] range then the
intersection point is within both the La and Lb segments.
Xi, Zi : if CD =\= 0, the intersection point coordinates.
- vector_dot_product(+X1,+Y1,+Z1, +X2,+Y2,+Z2, -Angle12, -V1dotV2)
V1 dot V2 = | V1 | . | V2 | . cos(Angle12)
- vector_cross_product(+X1,+Y1,+Z1, +X2,+Y2,+Z2, -XN,-YN,-ZN, -Angle12, -VNSize)
| VN | = | V1 cross V2 | = | V1 | . | V2 | . sin(Angle12)