fpl/ 000755 000765 000000 00000000000 12175015256 012101 5 ustar 00carlo wheel 000000 000000 fpl/COPYING 000644 000765 000000 00000104513 12010463520 013125 0 ustar 00carlo wheel 000000 000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
fpl/DESCRIPTION 000644 000765 000000 00000000601 12175015233 013577 0 ustar 00carlo wheel 000000 000000 Name: fpl
Version: 1.3.4
Date: 2013-07-21
Author: Carlo de Falco, Massimiliano Culpo and others
Maintainer: Carlo de Falco, Massimiliano Culpo
Title: Fem PLotting
Description: Collection of routines to export data produced by Finite Elements or Finite Volume Simulations in formats used by some visualization programs.
Categories: Graphics
Depends: octave (>= 3.2.3)
License: GPLv3+
fpl/INDEX 000644 000765 000000 00000000515 12010454601 012661 0 ustar 00carlo wheel 000000 000000 FPL >> FEM Plotting
functions to save data in VTK format
fpl_vtk_write_field.m
fpl_vtk_b64_write_field.m
fpl_vtk_raw_write_field.m
fpl_vtk_assemble_series.m
savevtk
savevtkvector
functions to save data in OpenDX format
fpl_dx_write_field
fpl_dx_write_series
pdetool compatible plotting functions
pdesurf
pdemesh
fpl/inst/ 000755 000765 000000 00000000000 12175015256 013056 5 ustar 00carlo wheel 000000 000000 fpl/NEWS 000644 000765 000000 00000003171 12172707757 012615 0 ustar 00carlo wheel 000000 000000 Summary of important user-visible changes for fpl 1.3.4:
-------------------------------------------------------------------
* Work around a bug in versions of Octave which do not understand
spaces around version numbers.
Summary of important user-visible changes for fpl 1.3.3:
-------------------------------------------------------------------
* Fix for a bug in the ascii vtk unstructurd mesh exporter.
Summary of important user-visible changes for fpl 1.3.2:
-------------------------------------------------------------------
* raw/base64 vtk exporters have been rewritten in a more backward-compatible
way. This should also make fpl easier to install.
Summary of important user-visible changes for fpl 1.3.1:
-------------------------------------------------------------------
* 1.3.1 is just a bugfix release to fix some issues in 1.3.0
Summary of important user-visible changes for fpl 1.3.0:
-------------------------------------------------------------------
* Old OpenDX based functions have been deprecated
* ASCII VTK Unstructured Grid (VTU) exporter has been speeded up via
code vectorization
* A new function to write raw binary VTU files has been added.
A new function to write base64-encoded binary VTU files has been added
(requires Octave >= 3.7, will fall back to ASCII mode otherwise).
As a rule of thumbs, ascii files are about 50% larger than base64 which
are 30% larger than raw files. base64 files are faster to write (about 30% faster
than raw on my machine for large meshes), ASCII files are more portable.
* New functions to write ASCII structured grid VTK files have been added
fpl/inst/deprecated/ 000755 000765 000000 00000000000 12175015256 015156 5 ustar 00carlo wheel 000000 000000 fpl/inst/fpl_dx_write_field.m 000644 000765 000000 00000015732 12010454601 017062 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2006,2007,2008,2009,2010 Carlo de Falco, Massimiliano Culpo
##
## This file is part of:
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
## author: Carlo de Falco
## author: Massimiliano Culpo
## -*- texinfo -*-
## @deftypefn {Function File} {} fpl_dx_writefield (@var{basename}, @
## @var{mesh}, @var{u}, @var{attr_name}, @var{attr_rank}, @
## @var{attr_shape}, @var{endfile})
##
## Output data field in ASCII Open-DX format.
##
## @var{basename} is a string containing the base-name of the dx file where the
## data will be saved.
##
## @var{mesh} is a PDE-tool like mesh, like the ones generated by the
## "msh" package.
##
## @var{u} is the field to be saved. It should represent scalar, vector
## or tensor of doubles.
##
## @var{attr_name} is a descriptive name for the field @var{u}, while
## @var{attr_rank} is the rank of the field (0 for scalar, 1 for vector,
## etc.) and @var{attr_shape} is the number of components of the field
## (assumed 1 for scalar).
##
## @var{endfile} should be 0 if you want to add other variables to the
## same file, 1 otherwise.
##
## Notice that when appending fields to an already existing file:
##
## @itemize
## @item @var{mesh} will not be printed to @var{filename}, but it will
## be only used to determine if the field is piece-wise constant or
## piece-wise linear
## @item @var{u} is not checked for consistency against the @var{mesh}
## already printed in @var{filename}
## @end itemize
##
## Example 1 (wrong usage):
## @example
##
## fpl_dx_write_field("field.dx",msh1,u1,"density",1,0,0);
## fpl_dx_write_field("field.dx",msh2,u2,"temperature",1,0,1);
## @end example
## generate a file that fails at OpenDX run-time.
##
## Example 2:
## @example
##
## fpl_dx_write_field("field",msh1,u1,"density",1,0,0);
## fpl_dx_write_field("field",msh1,u2,"temperature",1,0,1);
## @end example
## will generate a valid OpenDX ASCII data file.
##
## @seealso{fpl_dx_write_series}
##
## @end deftypefn
function fpl_dx_write_field(basename,mesh,u,attr_name,attr_rank,attr_shape,endfile)
## Check input
if nargin!=7
error("fpl_dx_write_field: wrong number of input");
endif
if !ischar(basename)
error("fpl_dx_write_field: basename should be a valid string");
elseif !( isstruct(mesh) )
error("fpl_dx_write_field: mesh should be a valid structure");
elseif !ismatrix(u)
error("fpl_dx_write_field: u should be a valid matrix");
elseif !ischar(attr_name)
error("fpl_dx_write_field: attr_name should be a valid string");
elseif !isscalar(attr_rank)
error("fpl_dx_write_field: attr_rank should be a valid scalar");
elseif !isscalar(attr_shape)
error("fpl_dx_write_field: attr_shape should be a valid scalar");
elseif !isscalar(endfile)
error("fpl_dx_write_field: endfile should be a valid scalar");
endif
filename = [basename ".dx"];
if ! exist(filename,"file")
## If file does not exist, create it
fid = fopen (filename,"w");
create = 1;
else
## FIXME: the following should be performed in a cleaner way! Does a
## backward fgetl function exist?
## If file exist, check if it was already closed
fid = fopen (filename,"r");
fseek(fid,-4,SEEK_END);
tst = fgetl(fid);
if strcmp(tst,"end")
error("fpl_dx_write_field: file %s exist and was already closed",filename);
endif
fclose(fid);
fid = fopen(filename,"a");
create = 0;
endif
p = mesh.p';
dim = columns(p); # 2D or 3D
if dim == 2
t = mesh.t(1:3,:)';
elseif dim == 3
t = mesh.t(1:4,:)';
else
error("fpl_dx_write_field: neither 2D triangle nor 3D tetrahedral mesh");
endif
nnodes = rows(p);
nelems = rows(t);
ndatas = rows(u);
if ndatas == nnodes
dep = "positions";
elseif ndatas == nelems
dep = "connections";
else
error("fpl_dx_write_field: neither position nor connection data type")
endif
if create
## If the file has just been created, print mesh information
print_grid(fid,dim,p,nnodes,t,nelems);
endif
## Otherwise assume the mesh is consistent with the one in the file
## and print only field information
print_data(fid,u,ndatas,dep,attr_name,attr_rank,attr_shape);
if(endfile)
fprintf(fid,"\nend\n");
endif
fclose (fid);
endfunction
## fprint a 2Dtrg or 3Dtet mesh
function print_grid(fid,dim,p,nnodes,t,nelems)
fprintf(fid,"object ""pos""\n");
fprintf(fid,"class array type float rank 1 shape %d items %d data follows",dim,nnodes);
for ii = 1:nnodes
fprintf(fid,"\n");
fprintf(fid," %1.7e",p(ii,:));
endfor
## In DX format nodes are
## numbered starting from zero,
## instead we want to number
## them starting from 1!
## Here we restore the DX
## format
if (min(min(t))==1)
t -= 1;
elseif(min(min(t))~=0)
error("fpl_dx_write_field: check triangle structure")
endif
fprintf(fid,"\n\nobject ""con""\n");
fprintf(fid,"class array type int rank 1 shape %d items %d data follows",dim+1,nelems);
for ii = 1:nelems
fprintf(fid,"\n");
fprintf(fid," %d",t(ii,:));
endfor
fprintf(fid,"\n");
if dim == 2
fprintf(fid,"attribute ""element type"" string ""triangles""\n");
elseif dim == 3
fprintf(fid,"\nattribute ""element type"" string ""tetrahedra""\n");
endif
fprintf(fid,"attribute ""ref"" string ""positions""\n\n");
endfunction
## fprint data on a trg grid
function print_data(fid,u,ndatas,dep,attr_name,attr_rank,attr_shape)
if ((attr_rank == 0) && (min(size(u))==1))
fprintf(fid,"object ""%s.data""\n",attr_name);
fprintf(fid,"class array type double rank 0 items %d data follows",ndatas);
fprintf(fid,"\n %1.7e",u);
else
fprintf(fid,"object ""%s.data""\n",attr_name);
fprintf(fid,"class array type double rank %d shape %d items %d data follows",attr_rank,attr_shape,ndatas);
for ii=1:ndatas
fprintf(fid,"\n");
fprintf(fid," %1.7e",u(ii,:));
endfor
endif
fprintf(fid,"\n");
fprintf(fid,"attribute ""dep"" string ""%s"" \n\n",dep);
fprintf(fid,"object ""%s"" class field\n",attr_name);
fprintf(fid,"component ""positions"" value ""pos""\n");
fprintf(fid,"component ""connections"" value ""con""\n");
fprintf(fid,"component ""data"" value ""%s.data""\n",attr_name);
fprintf(fid,"\n");
endfunction
fpl/inst/fpl_dx_write_series.m 000644 000765 000000 00000007457 12010454601 017276 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2006,2007,2008,2009,2010 Carlo de Falco, Massimiliano Culpo
##
## This file is part of:
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
## author: Carlo de Falco
## author: Massimiliano Culpo
## -*- texinfo -*-
## @deftypefn {Function File} {} fpl_dx_write_series (@var{basename}, @
## @var{mesh}, @var{u}, @var{sp}, @var{attr_name}, @var{attr_rank}, @
## @var{attr_shape})
##
## Output data series in ASCII Open-DX format.
##
## @var{basename} is a string containing the base-name of the dx file where the
## data will be saved.
##
## @var{mesh} is a PDE-tool like mesh, like the ones generated by the
## "msh" package.
##
## @var{u} is the series to be saved. It should represent scalar, vector
## or tensor of doubles. @var{sp} is the vector of the sampled points
## (e.g. time points in the case of a time series).
##
## @var{attr_name} is a descriptive name for the series @var{u}, while
## @var{attr_rank} is the rank of the field items (0 for scalar, 1 for
## vector, etc.) and @var{attr_shape} is the number of components of the
## field items (assumed 1 for scalar).
##
## @seealso{fpl_dx_write_field}
##
## @end deftypefn
function fpl_dx_write_series(basename,mesh,u,tp,attr_name,attr_rank,attr_shape)
## FIXME: add append capabilities as in fpl_dx_write_field??
if nargin!=7
error("fpl_dx_write_series: wrong number of input");
endif
if !ischar(basename)
error("fpl_dx_write_series: basename should be a valid string");
elseif !( isstruct(mesh) )
error("fpl_dx_write_series: mesh should be a valid structure");
elseif !ismatrix(u)
error("fpl_dx_write_series: u should be a valid matrix");
elseif !ischar(attr_name)
error("fpl_dx_write_series: attr_name should be a valid string");
elseif !isscalar(attr_rank)
error("fpl_dx_write_series: attr_rank should be a valid scalar");
elseif !isscalar(attr_shape)
error("fpl_dx_write_series: attr_shape should be a valid scalar");
##elseif !isscalar(endfile)
##error("fpl_dx_write_series: endfile should be a valid scalar");
endif
filename = [basename ".dx"];
npoints = length(tp);
p = mesh.p';
dim = columns(p); # 2D or 3D
if dim == 2
t = mesh.t(1:3,:)';
elseif dim == 3
t = mesh.t(1:4,:)';
else
error("fpl_dx_write_series: neither 2D triangle nor 3D tetrahedral mesh");
endif
nnodes = rows(p);
nelems = rows(t);
ndatas = rows(u);
if ndatas == nnodes
dep = "positions";
elseif ndatas == nelems
dep = "connections";
else
error("fpl_dx_write_series: neither position nor connection data type")
endif
## Write field items to file
idx = (1:attr_shape);
for ii = 1:npoints
field = u(:,idx);
fname = sprintf("%s.%d",attr_name,ii);
fpl_dx_write_field(basename,mesh,field,fname,attr_rank,attr_shape,0);
idx += attr_shape;
endfor
##if endfile
fid = fopen(filename,"a");
fprintf (fid, "object \"%s_series\" class series\n",attr_name);
for ii = 1:npoints
fname = sprintf("%s.%d",attr_name,ii);
fprintf (fid,"member %d position %g value \"%s\"\n",ii-1,tp(ii),fname);
endfor
fprintf (fid, "\nend\n");
fclose(fid);
##endif
endfunction fpl/inst/fpl_vtk_assemble_series.m 000644 000765 000000 00000004206 12010454601 020115 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2011 Carlo de Falco
##
## This file is part of:
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
## author: Carlo de Falco
## -*- texinfo -*-
## @deftypefn {Function File} {} fpl_vtk_assemble_series (@var{collection}, @var{basenanme}, @var{format}, @var{idx}, @var{time})
##
## Assemble a ParaView collection file (pvd) from a set of files representing data at different time-steps.
##
## @var{collection} is a string containing the base-name of the pvd file
## where the data will be saved.
##
## @var{basename}, @var{format}, @var{idx} are two strings and a set of integers, the name of the i-th file in the collection
## will be computed as @code{sprintf ([basename, format, ".vtu"], idx(i))}.
##
## @var{time} is the set of time-steps to which data correspond
##
## @seealso{fpl_vtk_write_field, fpl_dx_write_series}
##
## @end deftypefn
function fpl_vtk_assemble_series (collection, basenanme, format, idx, time)
fid = fopen (strcat (collection, ".pvd"), "w");
## Header
fprintf (fid, "\n");
fprintf (fid, "\n");
fprintf (fid, "\n");
## Series
for ii = 1:ntpoints
fprintf (fid, "\n"), basename, idx(ii));
endfor
## Footer
fprintf (fid, "\n");
fprintf (fid, "\n");
fclose (fid);
endfunction fpl/inst/fpl_vtk_b64_write_field.m 000644 000765 000000 00000017756 12022333226 017740 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2012 Carlo de Falco
## Copyright (C) 2008,2009,2010 Massimiliano Culpo
##
## This file is part of:
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
## author: Carlo de Falco
## author: Massimiliano Culpo
## -*- texinfo -*-
## @deftypefn {Function File} {} fpl_vtk_b64_write_field (@var{basename}, @
## @var{mesh}, @var{nodedata}, @var{celldata})
##
## Output data field in binary serial XML-VTK UnstructuredGrid format.
##
## @var{basename} is a string containing the base-name of the (vtu) file
## where the data will be saved.
##
## @var{mesh} is a PDE-tool like mesh, like the ones generated by the
## "msh" package.
##
## @var{nodedata} and @var{celldata} are (Ndata x 2) cell arrays containing
## respectively and representing scalars or
## vectors:
## @itemize @minus
## @item @var{*data}@{:,1@} = variable data;
## @item @var{*data}@{:,2@} = variable names;
## @end itemize
##
##
## Example:
## @example
## %% generate msh1, node centered field nc1, cell centered field cc1
## fpl_vtk_b64_write_field ("example", msh1, @{nc1, "temperature"@}, @{cc1, "density"@});
## %% generate msh2, node centered field nc2
## fpl_vtk_b64_write_field ("example", msh2, @{nc2, "temperature"@}, @{@});
## @end example
##
## The difference between @code{fpl_vtk_write_field} and @code{fpl_vtk_b64_write_field}
## is that the former saves data in ASCII format while the latter uses base64-encoded
## binary format. To save data in un-encoded binary format use @code{fpl_vtk_raw_write_field}.
##
## @seealso{fpl_dx_write_field, fpl_dx_write_series, @
## fpl_vtk_assemble_series, fpl_vtk_write_field, @
## fpl_vtk_raw_write_field}
##
## @end deftypefn
function fpl_vtk_b64_write_field (basename, mesh, nodedata, celldata)
## Check input
if (nargin != 4)
print_usage ();
endif
if (! ischar (basename))
error ("fpl_vtk_b64_write_field: basename should be a string");
elseif (! isstruct (mesh))
error ("fpl_vtk_b64_write_field: mesh should be a struct");
elseif (! (iscell (nodedata) && iscell (celldata)))
error ("fpl_vtk_b64_write_field: nodedata and celldata should be cell arrays");
endif
if (! exist ("base64_encode", "builtin"))
warning ("fpl_vtk_b64_write_field: Octave >= 3.7 is required to save in binary format, your data will be saved as ascii");
fpl_vtk_write_field (basename, mesh, nodedata, celldata, true);
return;
endif
filename = [basename ".vtu"];
if (! exist (filename, "file"))
fid = fopen (filename, "w");
## Format
fprintf (fid, "\n");
## Start file
fprintf (fid, "\n");
## Start Header
fprintf (fid, " \n");
else
error ("fpl_vtk_b64_write_field: file %s exists", filename);
endif
offset = 0;
data = "";
p = mesh.p;
dim = rows (p); # 2D or 3D
if dim == 2
t = mesh.t (1:3,:);
elseif dim == 3
t = mesh.t (1:4,:);
else
error ("fpl_vtk_b64_write_field: neither 2D triangle nor 3D tetrahedral mesh");
endif
t -= 1;
nnodes = columns (p);
nelems = columns (t);
## Piece
fprintf (fid, " \n", nnodes, nelems);
## Encode data-sets
[data, offset] = print_data_points (fid, nodedata, nnodes, data, offset);
[data, offset] = print_cell_data (fid, celldata, nelems, data, offset);
## Encode mesh
[data, offset] = print_grid (fid, dim, p, nnodes, t, nelems, data, offset);
## End Piece
fprintf (fid, " \n");
## End Header
fprintf (fid, " \n");
## Write data
fprintf (fid, " \n");
fprintf (fid, "_%s\n", data);
fprintf (fid, " >\n");
## End file
fprintf (fid, "");
fclose (fid);
endfunction
## Print Points and Cells Data
function [data, offset] = print_grid (fid, dim, p, nnodes, t, nelems, data, offset)
if dim == 2
p = [p; zeros(1,nnodes)];
eltype = 5;
else
eltype = 10;
endif
## VTK-Points (mesh nodes)
fprintf (fid, " \n");
fprintf (fid, " \n", offset);
newdata = typecast (p, 'uint8')(:);
data = [data, base64_encode([typecast(int32 (numel (newdata)), 'uint8')(:); newdata])];
offset = numel (data);
fprintf (fid, " \n");
## VTK-Cells (mesh elements)
fprintf (fid, " \n");
fprintf (fid, " \n", offset);
newdata = typecast (int32 (t), 'uint8')(:);
data = [data, base64_encode([typecast(int32 (numel (newdata)), 'uint8')(:); newdata])];
offset = numel (data);
fprintf (fid, " \n", offset);
tmp = (dim+1):(dim+1):((dim+1)*nelems);
newdata = typecast(int32 (tmp), 'uint8')(:);
data = [data, base64_encode([typecast(int32 (numel (newdata)), 'uint8')(:); newdata])];
offset = numel (data);
fprintf (fid, " \n", offset);
tmp = eltype*ones(nelems,1);
newdata = typecast(uint8 (tmp), 'uint8')(:);
data = [data, base64_encode([typecast(int32 (numel (newdata)), 'uint8')(:); newdata])];
offset = numel (data);
fprintf (fid, " \n");
endfunction
## Print DataPoints
function [data, offset] = print_data_points (fid, nodedata, nnodes, data, offset)
## # of data to print in
## field
nvdata = size (nodedata, 1);
if (nvdata)
fprintf (fid, " \n");
for ii = 1:nvdata
ndata = nodedata{ii,1};
ndataname = nodedata{ii,2};
nsamples = rows (ndata);
ncomp = columns (ndata);
if (nsamples != nnodes)
error ("fpl_vtk_b64_write_field: wrong number of samples in ""%s""", ndataname);
endif
fprintf (fid, " \n", ncomp, offset);
newdata = typecast (ndata.', 'uint8')(:);
data = [data, base64_encode([typecast(int32 (numel (newdata)), 'uint8')(:); newdata])];
offset = numel (data);
endfor
fprintf (fid, " \n");
endif
endfunction
function [data, offset] = print_cell_data (fid, celldata, nelems, data, offset)
## # of data to print in
## field
nvdata = size (celldata, 1);
if (nvdata)
fprintf (fid, "\n");
for ii = 1:nvdata
cdata = celldata{ii,1};
cdataname = celldata{ii,2};
nsamples = rows (cdata);
ncomp = columns (cdata);
if nsamples != nelems
error ("fpl_vtk_b64_write_field: wrong number of samples in ""%s""", cdataname);
endif
fprintf (fid, " \n", ncomp, offset);
newdata = typecast(cdata.', 'uint8')(:);
data = [data, base64_encode([typecast(int32 (numel (newdata)), 'uint8')(:); newdata])];
offset = numel (data);
endfor
fprintf (fid, " \n");
endif
endfunction
fpl/inst/fpl_vtk_raw_write_field.m 000644 000765 000000 00000017237 12022333226 020130 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2012 Carlo de Falco
## Copyright (C) 2008,2009,2010 Massimiliano Culpo
##
## This file is part of:
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
## author: Carlo de Falco
## author: Massimiliano Culpo
## -*- texinfo -*-
## @deftypefn {Function File} {} fpl_vtk_raw_write_field (@var{basename}, @
## @var{mesh}, @var{nodedata}, @var{celldata})
##
## Output data field in binary serial XML-VTK UnstructuredGrid format.
##
## @var{basename} is a string containing the base-name of the (vtu) file
## where the data will be saved.
##
## @var{mesh} is a PDE-tool like mesh, like the ones generated by the
## "msh" package.
##
## @var{nodedata} and @var{celldata} are (Ndata x 2) cell arrays containing
## respectively and representing scalars or
## vectors:
## @itemize @minus
## @item @var{*data}@{:,1@} = variable data;
## @item @var{*data}@{:,2@} = variable names;
## @end itemize
##
##
## Example:
## @example
## %% generate msh1, node centered field nc1, cell centered field cc1
## fpl_vtk_raw_write_field ("example", msh1, @{nc1, "temperature"@}, @{cc1, "density"@});
## %% generate msh2, node centered field nc2
## fpl_vtk_raw_write_field ("example", msh2, @{nc2, "temperature"@}, @{@});
## @end example
##
## The difference between @code{fpl_vtk_write_field} and @code{fpl_vtk_raw_write_field}
## is that the former saves data in ASCII format while the latter uses raw
## binary format. To save data in b64-encoded binary format use @code{fpl_vtk_b64_write_field}.
##
## @seealso{fpl_dx_write_field, fpl_dx_write_series, @
## fpl_vtk_assemble_series, fpl_vtk_write_field, @
## fpl_vtk_b64_write_field}
##
## @end deftypefn
function fpl_vtk_raw_write_field (basename, mesh, nodedata, celldata, endfile)
## Check input
if (nargin != 4)
print_usage ();
endif
if (! ischar (basename))
error ("fpl_vtk_b64_write_field: basename should be a string");
elseif (! isstruct (mesh))
error ("fpl_vtk_b64_write_field: mesh should be a struct");
elseif (! (iscell (nodedata) && iscell (celldata)))
error ("fpl_vtk_b64_write_field: nodedata and celldata should be cell arrays");
endif
filename = [basename ".vtu"];
if (! exist (filename, "file"))
fid = fopen (filename, "w");
## Format
fprintf (fid, "\n");
## Start file
fprintf (fid, "\n");
## Start Header
fprintf (fid, " \n");
else
error ("fpl_vtk_b64_write_field: file %s exists", filename);
endif
offset = 0;
data = uint8([]);
p = mesh.p;
dim = rows (p); # 2D or 3D
if dim == 2
t = mesh.t (1:3,:);
elseif dim == 3
t = mesh.t (1:4,:);
else
error ("fpl_vtk_b64_write_field: neither 2D triangle nor 3D tetrahedral mesh");
endif
t -= 1;
nnodes = columns (p);
nelems = columns (t);
## Piece
fprintf (fid, " \n", nnodes, nelems);
## assemble data-sets
[data, offset] = print_data_points (fid, nodedata, nnodes, data, offset);
[data, offset] = print_cell_data (fid, celldata, nelems, data, offset);
## assemble mesh data
[data, offset] = print_grid (fid, dim, p, nnodes, t, nelems, data, offset);
## End Piece
fprintf (fid, " \n");
## End Header
fprintf (fid, " \n");
## Write data
fprintf (fid, " \n");
fwrite (fid, "_");
fwrite (fid, data, "uint8");
fprintf (fid, " >\n");
## End file
fprintf (fid, "");
fclose (fid);
endfunction
## Print Points and Cells Data
function [data, offset] = print_grid (fid, dim, p, nnodes, t, nelems, data, offset)
if dim == 2
p = [p; zeros(1,nnodes)];
eltype = 5;
else
eltype = 10;
endif
## VTK-Points (mesh nodes)
fprintf (fid, " \n");
fprintf (fid, " \n", offset);
newdata = typecast (p, 'uint8')(:);
data = [data; typecast(int32 (numel (newdata)), 'uint8')(:); newdata];
offset = numel (data);
fprintf (fid, " \n");
## VTK-Cells (mesh elements)
fprintf (fid, " \n");
fprintf (fid, " \n", offset);
newdata = typecast (int32 (t), 'uint8')(:);
data = [data; typecast(int32 (numel (newdata)), 'uint8')(:); newdata];
offset = numel (data);
fprintf (fid, " \n", offset);
tmp = (dim+1):(dim+1):((dim+1)*nelems);
newdata = typecast (int32 (tmp), 'uint8')(:);
data = [data; typecast(int32 (numel (newdata)), 'uint8')(:); newdata];
offset = numel (data);
fprintf (fid, " \n", offset);
tmp = eltype*ones(nelems,1);
newdata = typecast (uint8 (tmp), 'uint8')(:);
data = [data; typecast(int32 (numel (newdata)), 'uint8')(:); newdata];
offset = numel (data);
fprintf (fid, " \n");
endfunction
## Print DataPoints
function [data, offset] = print_data_points (fid, nodedata, nnodes, data, offset)
## # of data to print in
## field
nvdata = size (nodedata, 1);
if (nvdata)
fprintf (fid, " \n");
for ii = 1:nvdata
ndata = nodedata{ii,1};
ndataname = nodedata{ii,2};
nsamples = rows (ndata);
ncomp = columns (ndata);
if (nsamples != nnodes)
error ("fpl_vtk_b64_write_field: wrong number of samples in ""%s""", ndataname);
endif
fprintf (fid, " \n", ncomp, offset);
newdata = typecast (ndata.', 'uint8')(:);
data = [data; typecast(int32 (numel (newdata)), 'uint8')(:); newdata];
offset = numel (data);
endfor
fprintf (fid, " \n");
endif
endfunction
function [data, offset] = print_cell_data (fid, celldata, nelems, data, offset)
## # of data to print in
## field
nvdata = size (celldata, 1);
if (nvdata)
fprintf (fid, "\n");
for ii = 1:nvdata
cdata = celldata{ii,1};
cdataname = celldata{ii,2};
nsamples = rows (cdata);
ncomp = columns (cdata);
if nsamples != nelems
error ("fpl_vtk_b64_write_field: wrong number of samples in ""%s""", cdataname);
endif
fprintf (fid, " \n", ncomp, offset);
newdata = typecast (cdata.', 'uint8')(:);
data = [data; typecast(int32 (numel (newdata)), 'uint8')(:); newdata];
offset = numel (data);
endfor
fprintf (fid, " \n");
endif
endfunction
fpl/inst/fpl_vtk_write_field.m 000644 000765 000000 00000015565 12044546661 017276 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2006,2007,2008,2009,2010 Carlo de Falco, Massimiliano Culpo
##
## This file is part of:
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
## author: Carlo de Falco
## author: Massimiliano Culpo
## -*- texinfo -*-
## @deftypefn {Function File} {} fpl_vtk_write_field (@var{basename}, @
## @var{mesh}, @var{nodedata}, @var{celldata}, @var{endfile})
##
## Output data field in serial XML-VTK UnstructuredGrid format.
##
## @var{basename} is a string containing the base-name of the (vtu) file
## where the data will be saved.
##
## @var{mesh} is a PDE-tool like mesh, like the ones generated by the
## "msh" package.
##
## @var{nodedata} and @var{celldata} are (Ndata x 2) cell arrays containing
## respectively and representing scalars or
## vectors:
## @itemize @minus
## @item @var{*data}@{:,1@} = variable data;
## @item @var{*data}@{:,2@} = variable names;
## @end itemize
##
## @var{endfile} should be 0 if you want to add other variables to the
## same file, 1 otherwise.
##
## Example:
## @example
##
## fpl_vtk_write_field ("example", msh1, @{nc1, "temperature"@}, @{cc1, "density"@}, 0);
##
## fpl_vtk_write_field ("example", msh2, @{nc2, "temperature"@}, @{@}, 1);
## @end example
## will generate a valid XML-VTK UnstructuredGrid file.
##
## @seealso{fpl_dx_write_field, fpl_dx_write_series, fpl_vtk_assemble_series}
##
## @end deftypefn
function fpl_vtk_write_field (basename, mesh, nodedata, celldata, endfile)
## Check input
if nargin!=5
error ("fpl_vtk_write_field: wrong number of input parameters");
endif
if (! ischar (basename))
error ("fpl_vtk_write_field: basename should be a string");
elseif (! isstruct (mesh))
error ("fpl_vtk_write_field: mesh should be a struct");
elseif (! (iscell (nodedata) && iscell (celldata)))
error ("fpl_vtk_write_field: nodedata and celldata should be cell arrays");
endif
filename = [basename ".vtu"];
if (! exist (filename, "file"))
fid = fopen (filename, "w");
## Header
fprintf (fid, "\n");
fprintf (fid, "\n");
fprintf (fid, "\n");
else
## FIXME: the following should be performed in a cleaner way! Does a
## backward fgetl function exist?
## If file exist, check if it was already closed
fid = fopen (filename, "r");
fseek (fid, -10, SEEK_END);
tst = fgetl (fid);
if (strcmp (tst, ""))
error ("fpl_vtk_write_field: file %s exist and was already closed", filename);
endif
fclose (fid);
fid = fopen (filename, "a");
endif
p = mesh.p;
dim = rows (p); # 2D or 3D
if dim == 2
t = mesh.t (1:3,:);
elseif dim == 3
t = mesh.t (1:4,:);
else
error ("fpl_vtk_write_field: neither 2D triangle nor 3D tetrahedral mesh");
endif
t -= 1;
nnodes = columns (p);
nelems = columns (t);
## Header for
fprintf (fid, "\n", nnodes, nelems);
## Print grid
print_grid (fid, dim, p, nnodes, t, nelems);
## Print Data
print_data_points (fid, nodedata, nnodes)
print_cell_data (fid, celldata, nelems)
## Footer for
fprintf (fid, "\n");
if (endfile)
## Footer
fprintf (fid, "\n");
fprintf (fid, "");
endif
fclose (fid);
endfunction
## Print Points and Cells Data
function print_grid (fid, dim, p, nnodes, t, nelems)
if dim == 2
p = [p; zeros(1,nnodes)];
eltype = 5;
else
eltype = 10;
endif
## VTK-Points (mesh nodes)
fprintf (fid, "\n");
fprintf (fid, "\n");
fprintf (fid, "%.17g %.17g %.17g\n", p);
fprintf (fid, "\n");
fprintf (fid, "\n");
## VTK-Cells (mesh elements)
fprintf (fid, "\n");
fprintf (fid, "\n");
if dim == 2
fprintf (fid, "%d %d %d \n", t);
else
fprintf (fid, "%d %d %d %d \n", t);
endif
fprintf (fid, "\n");
fprintf (fid, "\n");
fprintf (fid, "%d %d %d %d %d %d\n", (dim+1):(dim+1):((dim+1)*nelems));
fprintf (fid, "\n");
fprintf (fid, "\n");
fprintf (fid, "%d %d %d %d %d %d\n", eltype*ones(nelems,1));
fprintf (fid, "\n");
fprintf (fid, "\n");
endfunction
## Print DataPoints
function print_data_points (fid, nodedata, nnodes)
## # of data to print in
## field
nvdata = size (nodedata, 1);
if (nvdata)
fprintf (fid, "\n");
for ii = 1:nvdata
data = nodedata{ii,1};
dataname = nodedata{ii,2};
nsamples = rows (data);
ncomp = columns (data);
if (nsamples != nnodes)
error ("fpl_vtk_write_field: wrong number of samples in ""%s""", dataname);
endif
fprintf (fid, "\n", ncomp);
fprintf (fid, "%.17g ", data.');
fprintf (fid, "\n");
fprintf (fid, "\n");
endfor
fprintf (fid, "\n");
endif
endfunction
function print_cell_data (fid, celldata, nelems)
## # of data to print in
## field
nvdata = size (celldata, 1);
if (nvdata)
fprintf (fid, "\n");
for ii = 1:nvdata
data = celldata{ii,1};
dataname = celldata{ii,2};
nsamples = rows(data);
ncomp = columns(data);
if nsamples != nelems
error ("fpl_vtk_write_field: wrong number of samples in ""%s""", dataname);
endif
fprintf (fid, "\n", ncomp);
fprintf (fid, "%.17g ", data.');
fprintf (fid, "\n");
fprintf (fid, "\n");
endfor
fprintf (fid, "\n");
endif
endfunction fpl/inst/pdemesh.m 000644 000765 000000 00000003652 12010454601 014654 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2010 Carlo de Falco
##
## This file is part of:
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
## author: Carlo de Falco
## -*- texinfo -*-
## @deftypefn {Function File} {@var{h} =} pdemesh (@var{p}, @var{e}, @var{t}, @var{u})
##
## Plot a triangular mesh in 3D given a mesh structure and node data.
## @var{p}, @var{t} are the mesh vertices and connectivity, @var{u} node data.
## @var{e} is ignored and is accepted only for compatibiity.
##
## @seealso{fpl_dx_write_field, fpl_vtk_write_field}
##
## @end deftypefn
function h = pdemesh (p, e, t, u)
## Check input
if (nargin < 3)
error("pdemesh: wrong number of input parameters");
elseif (nargin == 3)
u = zeros (1, columns (p));
endif
nel = columns (t);
npt = columns (p);
if (numel (u) != npt)
error("pdemesh: wrong data size");
endif
hs = ishold ();
### node data
H = trimesh (t(1:3, :).', p(1,:).', p(2,:).', u(:));
if (nargout == 1)
h = H;
endif
if (hs)
hold on;
else
hold off;
endif
endfunction
%!demo
%! msh = msh2m_structured_mesh ([0:.05:1], [0:.1:1], 1, 1:4, 'random');
%! x = msh.p(1,:)'; xm = sum(x(msh.t(1:3,:)),1)/3;
%! y = msh.p(2,:)'; ym = sum(y(msh.t(1:3,:)),1)/3;
%! pdemesh (msh.p, msh.t, msh.t, x.*(1-x).*y.*(1-y))
%! view(3)
fpl/inst/pdesurf.m 000644 000765 000000 00000005172 12010454601 014676 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2010 Carlo de Falco
##
## This file is part of:
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
## author: Carlo de Falco
## -*- texinfo -*-
## @deftypefn {Function File} {@var{h} =} pdesurf (@var{p}, @var{t}, @var{u})
##
## Plot a 3D surface given node or element data on a triangular mesh.
## @var{p}, @var{t} are the mesh vertices and connectivity, @var{u} node or element data.
##
## @seealso{fpl_dx_write_field, fpl_vtk_write_field}
##
## @end deftypefn
function h = pdesurf (p, t, u)
## Check input
if nargin!=3
error("pdesurf: wrong number of input parameters");
endif
nel = columns (t);
npt = columns (p);
if (numel (u) != npt && numel (u) != nel)
error("pdesurf: wrong data size");
endif
hs = ishold ();
### node data
if (numel (u) == npt)
## normalize data
c = colormap;
uc = sum (u(t(1:3, :)), 1)/3;
uc = floor ((rows (c)-1)*(uc - min (uc))/(max (uc) - min (uc))) + 1;
H = patch ('Faces', t(1:3, :)',
'Vertices', [p(1,:)', p(2,:)', u],
'FaceVertexCData', c(uc(:), :));
### triangle data
elseif (numel (u) == nel)
tri = reshape (1:3*nel, 3, [])';
pt(:, 1) = p(1, t(1:3, :));
pt(:, 2) = p(2, t(1:3, :));
pt(:, 3) = repmat (u(:)', 3, 1)(:);
## normalize data
c = colormap;
uc = floor ((rows (c)-1)*(u - min (u))/(max (u) - min (u))) + 1;
H = patch ('Faces', tri,
'Vertices', pt,
'FaceVertexCData', c(uc(:), :),
'FaceColor', 'flat');
endif
if (nargout == 1)
h = H;
endif
if (hs)
hold on;
else
hold off;
endif
endfunction
%!demo
%! msh = msh2m_structured_mesh ([0:.05:1], [0:.1:1], 1, 1:4, 'random');
%! x = msh.p(1,:)'; xm = sum(x(msh.t(1:3,:)),1)/3;
%! y = msh.p(2,:)'; ym = sum(y(msh.t(1:3,:)),1)/3;
%! pdesurf (msh.p, msh.t, x.*(1-x).*y.*(1-y))
%! title ('node data')
%! view(3)
%! figure ()
%! pdesurf (msh.p, msh.t, xm.*(1-xm).*ym.*(1-ym))
%! title ('element data')
%! view(3) fpl/inst/savevtk.m 000644 000765 000000 00000006044 12010454601 014710 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2010 Kurnia Wano, Levente Torok
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; If not, see .
## -*- texinfo -*-
## @deftypefn {Function File} [@var{status}] = savevtk ( @var{X}, @var{Y}, @var{Z}, @var{filename} )
##
## Save a 3-D scalar array @var{array} to the file @var{filename} in VTK structured-grid format.
##
## This file format is used by Mayavi2 or ParaView for example.
## If no write errors occurred, output argument @var{status} is set to 1, otherwise 0.
##
## Example:
##
## @example
## n = 30;
## X = zeros (n, n, n);
## for x = 1:n
## for y = 1:n
## for z = 1:n
## X(x, y, z) = 1 / sqrt (x*x + y*y + z*z);
## endfor
## endfor
## endfor
## X = X * 200 / max (max (max (X)));
## savevtk (X, "spherical.vtk");
## @end example
##
## @seealso{savevtkvector}
##
## @end deftypefn
##
## Author: Kurnia Wano, Levente Torok
## Created: 2010-08-02 matlab version
## Updates: 2010-11-03 octave adoptation
## 2011-08-17 remove matlab style short-cicuit operator, indentation, help text
##
function status = savevtk (array, filename="vtkout.vtk")
status = 0;
if (nargin < 1), usage ("[status] = savevtk (array, filename)"); endif
dims = size (array);
if (numel (dims) != 3)
error ("Save Vtk requires a 3 dimensional array");
endif
[nx, ny, nz] = size (array);
if (ischar (filename))
[fid, msg] = fopen (filename, 'wt');
if (fid < 0)
error ("Cannot open file for saving file. %s", msg);
endif
else
usage ("Filename expected for arg # 2");
endif
try
fprintf (fid, '# vtk DataFile Version 2.0\n');
fprintf (fid, 'Comment goes here\n');
fprintf (fid, 'ASCII\n');
fprintf (fid, '\n');
fprintf (fid, 'DATASET STRUCTURED_POINTS\n');
fprintf (fid, 'DIMENSIONS %d %d %d\n', nx, ny, nz);
fprintf (fid, '\n');
fprintf (fid, 'ORIGIN 0.000 0.000 0.000\n');
fprintf (fid, 'SPACING 1.000 1.000 1.000\n');
fprintf (fid, '\n');
fprintf (fid, 'POINT_DATA %d\n', nx*ny*nz);
fprintf (fid, 'SCALARS scalars double\n');
fprintf (fid, 'LOOKUP_TABLE default\n');
fprintf (fid, '\n');
for a=1:nz
for b=1:ny
for c=1:nx
fprintf (fid, '%d ', array(c, b, a));
endfor
fprintf (fid, '\n');
endfor
endfor
fclose (fid);
status = 1;
catch
error ("Error writing file %s - disk full?", filename);
end_try_catch
endfunction
fpl/inst/savevtkvector.m 000644 000765 000000 00000006064 12010454601 016135 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2010 Kurnia Wano, Levente Torok
##.
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##.
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING. If not, see .
##
## -*- texinfo -*-
## @deftypefn {Function File} [@var{status}] = savevtkvector (@var{X}, @var{Y}, @var{Z}, @var{filename})
##
## Save a 3-D vector field of components @var{X}, @var{Y}, @var{Z} to the file @var{filename} in VTK format.
##
## This file format is used by Mayavi2 or ParaView for example.
## X, Y and Z should be 3-D arrays of the same
## size, each storing vector components in a given Cartesian direction.
##
## If no write errors occurred, output argument @var{status} is set to 1, otherwise 0.
##
## @seealso{savevtk}
## @end deftypefn
##
## Author: Kurnia Wano, Levente Torok
## Created: 2010-08-02 matlab version
## Updates: 2010-11-03 octave adoptatoin
## 2011-08-17 remove matlab style short-cicuit operator, indentation, help text
##
function [status] = savevtkvector (X, Y, Z, filename='vtkvector.vtk')
status = 0;
if (nargin < 4), usage ("[status] = savevtkvector (X, Y, Z, filename='vtkvector.vtk')"); endif
if ((size(X) ~= size(Y)) || (size(X) ~= size(Z)))
error ("Error: velocity arrays of unequal size\n");
end
[ny, nx, nz] = size (datax);
xx = 1:size (datax, 2);
yy = 1:size (datax, 1);
zz = 1:size (datax, 3);
datax = datax(:)';
datay = datay(:)';
dataz = dataz(:)';
## Header
if (ischar (filename))
[ fid, msg ] = fopen (fullfile (outputd, filename), 'w');
if ( fid < 1 )
error ("Cannot open the file for saving: %s", msg);
endif
else
usage ("Filename expected for arg # 2");
endif
try
fprintf (fid, '%s\n', '# vtk DataFile Version 3.0');
fprintf (fid, '%s\n', '3D LFF extrapolation');
fprintf (fid, '%s\n', 'ASCII' );
fprintf (fid, '%s\n', 'DATASET RECTILINEAR_GRID');
fprintf (fid, '%s %1.0i %1.0i %1.0i\n', 'DIMENSIONS',nx, ny, nz);
fprintf (fid, '%s %1.0i %s\n', 'X_COORDINATES', nx, 'float');
fprintf (fid, '%1.0i ', xx);
fprintf (fid, '\n%s %1.0i %s\n', 'Y_COORDINATES', ny, 'float');
fprintf (fid, '%1.0i ', yy);
fprintf (fid, '\n%s %1.0i %s\n', 'Z_COORDINATES', nz, 'float');
fprintf (fid, '%1.0i ', zz);
## Data
fprintf (fid, '\n%s %1.0i','POINT_DATA', nx*ny*nz );
fprintf (fid, '\n%s\n', 'VECTORS BFIELD float');
fprintf (fid, '%6.2f %6.2f %6.2f\n', [datax;datay;dataz]);
fclose (fid);
status = 1;
catch
error ("Error writing file %s - disk full?", filename)
end_try_catch
endfunction
fpl/inst/deprecated/FPL2coloredgradient.net 000644 000765 000000 00000043515 12007306463 021464 0 ustar 00carlo wheel 000000 000000 //
// time: Wed Jun 13 18:54:22 2007
//
// version: 3.2.0 (format), 4.4.4 (DX)
//
//
// MODULE main
// workspace: width = 459, height = 507
// layout: snap = 0, width = 50, height = 50, align = NN
//
macro main(
) -> (
) {
//
// node FileSelector[1]: x = 28, y = 29, inputs = 0, label = FileSelector
// output[1]: visible = 1, type = 32, value = "__FILE__DX__"
// output[2]: visible = 1, type = 32, value = "__FILE__DX__"
//
//
// node Import[1]: x = 34, y = 109, inputs = 6, label = Import
//
main_Import_1_out_1 =
Import(
main_FileSelector_1_out_1,
main_Import_1_in_2,
main_Import_1_in_3,
main_Import_1_in_4,
main_Import_1_in_5,
main_Import_1_in_6
) [instance: 1, cache: 1];
//
// node Post[1]: x = 124, y = 167, inputs = 2, label = Post
// input[2]: defaulting = 0, visible = 1, type = 32, value = "positions"
//
main_Post_1_out_1 =
Post(
main_Import_1_out_1,
main_Post_1_in_2
) [instance: 1, cache: 1];
//
// node Gradient[1]: x = 227, y = 144, inputs = 2, label = Gradient
//
main_Gradient_1_out_1 =
Gradient(
main_Post_1_out_1,
main_Gradient_1_in_2
) [instance: 1, cache: 1];
//
// node AutoGlyph[1]: x = 241, y = 215, inputs = 7, label = AutoGlyph
//
main_AutoGlyph_1_out_1 =
AutoGlyph(
main_Gradient_1_out_1,
main_AutoGlyph_1_in_2,
main_AutoGlyph_1_in_3,
main_AutoGlyph_1_in_4,
main_AutoGlyph_1_in_5,
main_AutoGlyph_1_in_6,
main_AutoGlyph_1_in_7
) [instance: 1, cache: 1];
//
// node AutoColor[1]: x = 253, y = 283, inputs = 10, label = AutoColor
//
main_AutoColor_1_out_1,
main_AutoColor_1_out_2 =
AutoColor(
main_AutoGlyph_1_out_1,
main_AutoColor_1_in_2,
main_AutoColor_1_in_3,
main_AutoColor_1_in_4,
main_AutoColor_1_in_5,
main_AutoColor_1_in_6,
main_AutoColor_1_in_7,
main_AutoColor_1_in_8,
main_AutoColor_1_in_9,
main_AutoColor_1_in_10
) [instance: 1, cache: 1];
//
// node ShowConnections[1]: x = 39, y = 242, inputs = 1, label = ShowConnections
//
main_ShowConnections_1_out_1 =
ShowConnections(
main_Post_1_out_1
) [instance: 1, cache: 1];
//
// node Color[1]: x = 72, y = 328, inputs = 5, label = Color
// input[2]: defaulting = 0, visible = 1, type = 32, value = "black"
// input[3]: defaulting = 0, visible = 1, type = 5, value = .5
//
main_Color_1_out_1 =
Color(
main_ShowConnections_1_out_1,
main_Color_1_in_2,
main_Color_1_in_3,
main_Color_1_in_4,
main_Color_1_in_5
) [instance: 1, cache: 1];
//
// node ColorBar[1]: x = 339, y = 285, inputs = 16, label = ColorBar
// input[9]: defaulting = 0, visible = 0, type = 16777248, value = {"black"}
//
main_ColorBar_1_out_1 =
ColorBar(
main_AutoColor_1_out_2,
main_ColorBar_1_in_2,
main_ColorBar_1_in_3,
main_ColorBar_1_in_4,
main_ColorBar_1_in_5,
main_ColorBar_1_in_6,
main_ColorBar_1_in_7,
main_ColorBar_1_in_8,
main_ColorBar_1_in_9,
main_ColorBar_1_in_10,
main_ColorBar_1_in_11,
main_ColorBar_1_in_12,
main_ColorBar_1_in_13,
main_ColorBar_1_in_14,
main_ColorBar_1_in_15,
main_ColorBar_1_in_16
) [instance: 1, cache: 1];
//
// node Collect[1]: x = 280, y = 393, inputs = 3, label = Collect
//
main_Collect_1_out_1 =
Collect(
main_Color_1_out_1,
main_AutoColor_1_out_1,
main_ColorBar_1_out_1
) [instance: 1, cache: 1];
//
// node Image[1]: x = 188, y = 445, inputs = 49, label = Image
// input[1]: defaulting = 0, visible = 0, type = 67108863, value = "Image_1"
// input[4]: defaulting = 0, visible = 0, type = 1, value = 1
// input[5]: defaulting = 0, visible = 0, type = 8, value = [0.182894 0.102434 0]
// input[6]: defaulting = 0, visible = 0, type = 8, value = [0.182894 0.102434 3.60504]
// input[7]: defaulting = 0, visible = 0, type = 5, value = 0.460265
// input[8]: defaulting = 0, visible = 0, type = 1, value = 772
// input[9]: defaulting = 0, visible = 0, type = 5, value = 0.791
// input[10]: defaulting = 0, visible = 0, type = 8, value = [0 1 0]
// input[11]: defaulting = 1, visible = 0, type = 5, value = 7.30519
// input[12]: defaulting = 0, visible = 0, type = 1, value = 0
// input[14]: defaulting = 0, visible = 0, type = 1, value = 1
// input[15]: defaulting = 1, visible = 0, type = 32, value = "none"
// input[16]: defaulting = 1, visible = 0, type = 32, value = "none"
// input[17]: defaulting = 1, visible = 0, type = 1, value = 1
// input[18]: defaulting = 1, visible = 0, type = 1, value = 1
// input[19]: defaulting = 0, visible = 0, type = 1, value = 0
// input[22]: defaulting = 0, visible = 0, type = 32, value = "snow"
// input[25]: defaulting = 0, visible = 0, type = 32, value = "/Users/carlo/Desktop/COMSONDEMO/CoMSON DP/doping.tif"
// input[26]: defaulting = 0, visible = 0, type = 32, value = "tiff"
// input[29]: defaulting = 0, visible = 0, type = 3, value = 1
// input[31]: defaulting = 0, visible = 0, type = 1, value = -5
// input[33]: defaulting = 0, visible = 0, type = 3, value = 1
// input[34]: defaulting = 0, visible = 0, type = 3, value = 0
// input[36]: defaulting = 0, visible = 0, type = 3, value = 1
// input[37]: defaulting = 0, visible = 0, type = 16777248, value = {"clear", "black", "blue", "blue"}
// input[38]: defaulting = 0, visible = 0, type = 16777248, value = {"background", "grid", "ticks", "labels"}
// input[39]: defaulting = 0, visible = 0, type = 5, value = 0.65
// input[40]: defaulting = 0, visible = 0, type = 32, value = "roman_d"
// input[41]: defaulting = 0, visible = 0, type = 32, value = "panzoom"
// depth: value = 24
// window: position = (0.0000,0.0000), size = 0.6141x0.6396
// internal caching: 1
//
main_Image_1_out_1,
main_Image_1_out_2,
main_Image_1_out_3 =
Image(
main_Image_1_in_1,
main_Collect_1_out_1,
main_Image_1_in_3,
main_Image_1_in_4,
main_Image_1_in_5,
main_Image_1_in_6,
main_Image_1_in_7,
main_Image_1_in_8,
main_Image_1_in_9,
main_Image_1_in_10,
main_Image_1_in_11,
main_Image_1_in_12,
main_Image_1_in_13,
main_Image_1_in_14,
main_Image_1_in_15,
main_Image_1_in_16,
main_Image_1_in_17,
main_Image_1_in_18,
main_Image_1_in_19,
main_Image_1_in_20,
main_Image_1_in_21,
main_Image_1_in_22,
main_Image_1_in_23,
main_Image_1_in_24,
main_Image_1_in_25,
main_Image_1_in_26,
main_Image_1_in_27,
main_Image_1_in_28,
main_Image_1_in_29,
main_Image_1_in_30,
main_Image_1_in_31,
main_Image_1_in_32,
main_Image_1_in_33,
main_Image_1_in_34,
main_Image_1_in_35,
main_Image_1_in_36,
main_Image_1_in_37,
main_Image_1_in_38,
main_Image_1_in_39,
main_Image_1_in_40,
main_Image_1_in_41,
main_Image_1_in_42,
main_Image_1_in_43,
main_Image_1_in_44,
main_Image_1_in_45,
main_Image_1_in_46,
main_Image_1_in_47,
main_Image_1_in_48,
main_Image_1_in_49
) [instance: 1, cache: 1];
// network: end of macro body
CacheScene(main_Image_1_in_1, main_Image_1_out_1, main_Image_1_out_2);
}
main_FileSelector_1_out_1 = "/tmp/SECS2D.6003912.dx";
main_Import_1_in_2 = NULL;
main_Import_1_in_3 = NULL;
main_Import_1_in_4 = NULL;
main_Import_1_in_5 = NULL;
main_Import_1_in_6 = NULL;
main_Import_1_out_1 = NULL;
main_Post_1_in_2 = "positions";
main_Post_1_out_1 = NULL;
main_Gradient_1_in_2 = NULL;
main_Gradient_1_out_1 = NULL;
main_AutoGlyph_1_in_2 = NULL;
main_AutoGlyph_1_in_3 = NULL;
main_AutoGlyph_1_in_4 = NULL;
main_AutoGlyph_1_in_5 = NULL;
main_AutoGlyph_1_in_6 = NULL;
main_AutoGlyph_1_in_7 = NULL;
main_AutoGlyph_1_out_1 = NULL;
main_AutoColor_1_in_2 = NULL;
main_AutoColor_1_in_3 = NULL;
main_AutoColor_1_in_4 = NULL;
main_AutoColor_1_in_5 = NULL;
main_AutoColor_1_in_6 = NULL;
main_AutoColor_1_in_7 = NULL;
main_AutoColor_1_in_8 = NULL;
main_AutoColor_1_in_9 = NULL;
main_AutoColor_1_in_10 = NULL;
main_AutoColor_1_out_1 = NULL;
main_AutoColor_1_out_2 = NULL;
main_ShowConnections_1_out_1 = NULL;
main_Color_1_in_2 = "black";
main_Color_1_in_3 = .5;
main_Color_1_in_4 = NULL;
main_Color_1_in_5 = NULL;
main_Color_1_out_1 = NULL;
main_ColorBar_1_in_2 = NULL;
main_ColorBar_1_in_3 = NULL;
main_ColorBar_1_in_4 = NULL;
main_ColorBar_1_in_5 = NULL;
main_ColorBar_1_in_6 = NULL;
main_ColorBar_1_in_7 = NULL;
main_ColorBar_1_in_8 = NULL;
main_ColorBar_1_in_9 = {"black"};
main_ColorBar_1_in_10 = NULL;
main_ColorBar_1_in_11 = NULL;
main_ColorBar_1_in_12 = NULL;
main_ColorBar_1_in_13 = NULL;
main_ColorBar_1_in_14 = NULL;
main_ColorBar_1_in_15 = NULL;
main_ColorBar_1_in_16 = NULL;
main_ColorBar_1_out_1 = NULL;
main_Collect_1_out_1 = NULL;
macro Image(
id,
object,
where,
useVector,
to,
from,
width,
resolution,
aspect,
up,
viewAngle,
perspective,
options,
buttonState = 1,
buttonUpApprox = "none",
buttonDownApprox = "none",
buttonUpDensity = 1,
buttonDownDensity = 1,
renderMode = 0,
defaultCamera,
reset,
backgroundColor,
throttle,
RECenable = 0,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable = 0,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
interactionMode,
title,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
webOptions) -> (
object,
camera,
where)
{
ImageMessage(
id,
backgroundColor,
throttle,
RECenable,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
interactionMode,
title,
renderMode,
buttonUpApprox,
buttonDownApprox,
buttonUpDensity,
buttonDownDensity) [instance: 1, cache: 1];
autoCamera =
AutoCamera(
object,
"front",
object,
resolution,
aspect,
[0,1,0],
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
realCamera =
Camera(
to,
from,
width,
resolution,
aspect,
up,
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
coloredDefaultCamera =
UpdateCamera(defaultCamera,
background=backgroundColor) [instance: 1, cache: 1];
nullDefaultCamera =
Inquire(defaultCamera,
"is null + 1") [instance: 1, cache: 1];
resetCamera =
Switch(
nullDefaultCamera,
coloredDefaultCamera,
autoCamera) [instance: 1, cache: 1];
resetNull =
Inquire(
reset,
"is null + 1") [instance: 2, cache: 1];
reset =
Switch(
resetNull,
reset,
0) [instance: 2, cache: 1];
whichCamera =
Compute(
"($0 != 0 || $1 == 0) ? 1 : 2",
reset,
useVector) [instance: 1, cache: 1];
camera = Switch(
whichCamera,
resetCamera,
realCamera) [instance: 3, cache: 1];
AAobject =
AutoAxes(
object,
camera,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels) [instance: 1, cache: 1];
switchAAenable = Compute("$0+1",
AAenable) [instance: 2, cache: 1];
object = Switch(
switchAAenable,
object,
AAobject) [instance:4, cache: 1];
SWapproximation_options =
Switch(
buttonState,
buttonUpApprox,
buttonDownApprox) [instance: 5, cache: 1];
SWdensity_options =
Switch(
buttonState,
buttonUpDensity,
buttonDownDensity) [instance: 6, cache: 1];
HWapproximation_options =
Format(
"%s,%s",
buttonDownApprox,
buttonUpApprox) [instance: 1, cache: 1];
HWdensity_options =
Format(
"%d,%d",
buttonDownDensity,
buttonUpDensity) [instance: 2, cache: 1];
switchRenderMode = Compute(
"$0+1",
renderMode) [instance: 3, cache: 1];
approximation_options = Switch(
switchRenderMode,
SWapproximation_options,
HWapproximation_options) [instance: 7, cache: 1];
density_options = Switch(
switchRenderMode,
SWdensity_options,
HWdensity_options) [instance: 8, cache: 1];
renderModeString = Switch(
switchRenderMode,
"software",
"hardware")[instance: 9, cache: 1];
object_tag = Inquire(
object,
"object tag")[instance: 3, cache: 1];
annoted_object =
Options(
object,
"send boxes",
0,
"cache",
1,
"object tag",
object_tag,
"ddcamera",
whichCamera,
"rendering approximation",
approximation_options,
"render every",
density_options,
"button state",
buttonState,
"rendering mode",
renderModeString) [instance: 1, cache: 1];
RECresNull =
Inquire(
RECresolution,
"is null + 1") [instance: 4, cache: 1];
ImageResolution =
Inquire(
camera,
"camera resolution") [instance: 5, cache: 1];
RECresolution =
Switch(
RECresNull,
RECresolution,
ImageResolution) [instance: 10, cache: 1];
RECaspectNull =
Inquire(
RECaspect,
"is null + 1") [instance: 6, cache: 1];
ImageAspect =
Inquire(
camera,
"camera aspect") [instance: 7, cache: 1];
RECaspect =
Switch(
RECaspectNull,
RECaspect,
ImageAspect) [instance: 11, cache: 1];
switchRECenable = Compute(
"$0 == 0 ? 1 : (($2 == $3) && ($4 == $5)) ? ($1 == 1 ? 2 : 3) : 4",
RECenable,
switchRenderMode,
RECresolution,
ImageResolution,
RECaspect,
ImageAspect) [instance: 4, cache: 1];
NoRECobject, RECNoRerenderObject, RECNoRerHW, RECRerenderObject = Route(switchRECenable, annoted_object);
Display(
NoRECobject,
camera,
where,
throttle) [instance: 1, cache: 1];
image =
Render(
RECNoRerenderObject,
camera) [instance: 1, cache: 1];
Display(
image,
NULL,
where,
throttle) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 1, cache: 1];
rec_where = Display(
RECNoRerHW,
camera,
where,
throttle) [instance: 1, cache: 0];
rec_image = ReadImageWindow(
rec_where) [instance: 1, cache: 1];
WriteImage(
rec_image,
RECfile,
RECformat) [instance: 1, cache: 1];
RECupdateCamera =
UpdateCamera(
camera,
resolution=RECresolution,
aspect=RECaspect) [instance: 2, cache: 1];
Display(
RECRerenderObject,
camera,
where,
throttle) [instance: 1, cache: 1];
RECRerenderObject =
ScaleScreen(
RECRerenderObject,
NULL,
RECresolution,
camera) [instance: 1, cache: 1];
image =
Render(
RECRerenderObject,
RECupdateCamera) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 2, cache: 1];
}
main_Image_1_in_1 = "Image_1";
main_Image_1_in_3 = "X24,,";
main_Image_1_in_4 = 1;
main_Image_1_in_5 = [0.182894 0.102434 0];
main_Image_1_in_6 = [0.182894 0.102434 3.60504];
main_Image_1_in_7 = 0.460265;
main_Image_1_in_8 = 772;
main_Image_1_in_9 = 0.791;
main_Image_1_in_10 = [0 1 0];
main_Image_1_in_11 = NULL;
main_Image_1_in_12 = 0;
main_Image_1_in_13 = NULL;
main_Image_1_in_14 = 1;
main_Image_1_in_15 = NULL;
main_Image_1_in_16 = NULL;
main_Image_1_in_17 = NULL;
main_Image_1_in_18 = NULL;
main_Image_1_in_19 = 0;
main_Image_1_in_20 = NULL;
main_Image_1_in_21 = NULL;
main_Image_1_in_22 = "snow";
main_Image_1_in_23 = NULL;
main_Image_1_in_25 = "/Users/carlo/Desktop/COMSONDEMO/CoMSON DP/doping.tif";
main_Image_1_in_26 = "tiff";
main_Image_1_in_27 = NULL;
main_Image_1_in_28 = NULL;
main_Image_1_in_29 = 1;
main_Image_1_in_30 = NULL;
main_Image_1_in_31 = -5;
main_Image_1_in_32 = NULL;
main_Image_1_in_33 = 1;
main_Image_1_in_34 = 0;
main_Image_1_in_35 = NULL;
main_Image_1_in_36 = 1;
main_Image_1_in_37 = {"clear", "black", "blue", "blue"};
main_Image_1_in_38 = {"background", "grid", "ticks", "labels"};
main_Image_1_in_39 = 0.65;
main_Image_1_in_40 = "roman_d";
main_Image_1_in_41 = "panzoom";
main_Image_1_in_42 = NULL;
main_Image_1_in_43 = NULL;
main_Image_1_in_44 = NULL;
main_Image_1_in_45 = NULL;
main_Image_1_in_46 = NULL;
main_Image_1_in_47 = NULL;
main_Image_1_in_48 = NULL;
main_Image_1_in_49 = NULL;
Executive("product version 4 4 4");
$sync
main();
fpl/inst/deprecated/FPL2coloredrubbersheet.net 000644 000765 000000 00000042711 12007306463 022176 0 ustar 00carlo wheel 000000 000000 //
// time: Wed Jun 13 17:16:01 2007
//
// version: 3.2.0 (format), 4.4.4 (DX)
//
//
// MODULE main
// workspace: width = 533, height = 507
// layout: snap = 0, width = 50, height = 50, align = NN
//
macro main(
) -> (
) {
//
// node FileSelector[1]: x = 51, y = 31, inputs = 0, label = FileSelector
// output[1]: visible = 1, type = 32, value = "__FILE__DX__"
// output[2]: visible = 1, type = 32, value = "__FILE__DX__"
//
//
// node Import[1]: x = 104, y = 118, inputs = 6, label = Import
//
main_Import_1_out_1 =
Import(
main_FileSelector_1_out_1,
main_Import_1_in_2,
main_Import_1_in_3,
main_Import_1_in_4,
main_Import_1_in_5,
main_Import_1_in_6
) [instance: 1, cache: 1];
//
// node Post[1]: x = 249, y = 57, inputs = 2, label = Post
// input[2]: defaulting = 0, visible = 1, type = 32, value = "__DATA_DEPENDENCY__"
//
main_Post_1_out_1 =
Post(
main_Import_1_out_1,
main_Post_1_in_2
) [instance: 1, cache: 1];
//
// node RubberSheet[1]: x = 228, y = 142, inputs = 4, label = RubberSheet
//
main_RubberSheet_1_out_1 =
RubberSheet(
main_Post_1_out_1,
main_RubberSheet_1_in_2,
main_RubberSheet_1_in_3,
main_RubberSheet_1_in_4
) [instance: 1, cache: 1];
//
// node AutoColor[1]: x = 253, y = 283, inputs = 10, label = AutoColor
//
main_AutoColor_1_out_1,
main_AutoColor_1_out_2 =
AutoColor(
main_RubberSheet_1_out_1,
main_AutoColor_1_in_2,
main_AutoColor_1_in_3,
main_AutoColor_1_in_4,
main_AutoColor_1_in_5,
main_AutoColor_1_in_6,
main_AutoColor_1_in_7,
main_AutoColor_1_in_8,
main_AutoColor_1_in_9,
main_AutoColor_1_in_10
) [instance: 1, cache: 1];
//
// node ShowConnections[1]: x = 49, y = 232, inputs = 1, label = ShowConnections
//
main_ShowConnections_1_out_1 =
ShowConnections(
main_RubberSheet_1_out_1
) [instance: 1, cache: 1];
//
// node Color[1]: x = 72, y = 328, inputs = 5, label = Color
// input[2]: defaulting = 0, visible = 1, type = 32, value = "black"
// input[3]: defaulting = 0, visible = 1, type = 5, value = .5
//
main_Color_1_out_1 =
Color(
main_ShowConnections_1_out_1,
main_Color_1_in_2,
main_Color_1_in_3,
main_Color_1_in_4,
main_Color_1_in_5
) [instance: 1, cache: 1];
//
// node ColorBar[1]: x = 413, y = 290, inputs = 16, label = ColorBar
// input[9]: defaulting = 0, visible = 0, type = 16777248, value = {"black"}
//
main_ColorBar_1_out_1 =
ColorBar(
main_AutoColor_1_out_2,
main_ColorBar_1_in_2,
main_ColorBar_1_in_3,
main_ColorBar_1_in_4,
main_ColorBar_1_in_5,
main_ColorBar_1_in_6,
main_ColorBar_1_in_7,
main_ColorBar_1_in_8,
main_ColorBar_1_in_9,
main_ColorBar_1_in_10,
main_ColorBar_1_in_11,
main_ColorBar_1_in_12,
main_ColorBar_1_in_13,
main_ColorBar_1_in_14,
main_ColorBar_1_in_15,
main_ColorBar_1_in_16
) [instance: 1, cache: 1];
//
// node Collect[1]: x = 280, y = 393, inputs = 3, label = Collect
//
main_Collect_1_out_1 =
Collect(
main_Color_1_out_1,
main_AutoColor_1_out_1,
main_ColorBar_1_out_1
) [instance: 1, cache: 1];
//
// node Image[1]: x = 188, y = 445, inputs = 49, label = Image
// input[1]: defaulting = 0, visible = 0, type = 67108863, value = "Image_1"
// input[4]: defaulting = 0, visible = 0, type = 1, value = 1
// input[5]: defaulting = 0, visible = 0, type = 8, value = [0.466889 0.863877 0.166499]
// input[6]: defaulting = 0, visible = 0, type = 8, value = [0.466889 0.863877 4.74189]
// input[7]: defaulting = 0, visible = 0, type = 5, value = 1.01623
// input[8]: defaulting = 0, visible = 0, type = 1, value = 1254
// input[9]: defaulting = 0, visible = 0, type = 5, value = 0.730064
// input[10]: defaulting = 0, visible = 0, type = 8, value = [0 1 0]
// input[11]: defaulting = 1, visible = 0, type = 5, value = 12.6739
// input[12]: defaulting = 0, visible = 0, type = 1, value = 0
// input[14]: defaulting = 0, visible = 0, type = 1, value = 1
// input[15]: defaulting = 1, visible = 0, type = 32, value = "none"
// input[16]: defaulting = 1, visible = 0, type = 32, value = "none"
// input[17]: defaulting = 1, visible = 0, type = 1, value = 1
// input[18]: defaulting = 1, visible = 0, type = 1, value = 1
// input[19]: defaulting = 0, visible = 0, type = 1, value = 0
// input[22]: defaulting = 0, visible = 0, type = 32, value = "snow"
// input[25]: defaulting = 0, visible = 0, type = 32, value = "/Users/carlo/Desktop/COMSONDEMO/CoMSON DP/doping.tif"
// input[26]: defaulting = 0, visible = 0, type = 32, value = "tiff"
// input[29]: defaulting = 0, visible = 0, type = 3, value = 1
// input[31]: defaulting = 0, visible = 0, type = 1, value = -5
// input[33]: defaulting = 0, visible = 0, type = 3, value = 1
// input[34]: defaulting = 0, visible = 0, type = 3, value = 0
// input[36]: defaulting = 0, visible = 0, type = 3, value = 1
// input[37]: defaulting = 0, visible = 0, type = 16777248, value = {"clear", "black", "blue", "blue"}
// input[38]: defaulting = 0, visible = 0, type = 16777248, value = {"background", "grid", "ticks", "labels"}
// input[39]: defaulting = 0, visible = 0, type = 5, value = 0.65
// input[40]: defaulting = 0, visible = 0, type = 32, value = "roman_d"
// input[41]: defaulting = 0, visible = 0, type = 32, value = "panzoom"
// depth: value = 24
// window: position = (0.0000,0.0283), size = 0.9906x0.9375
// internal caching: 1
//
main_Image_1_out_1,
main_Image_1_out_2,
main_Image_1_out_3 =
Image(
main_Image_1_in_1,
main_Collect_1_out_1,
main_Image_1_in_3,
main_Image_1_in_4,
main_Image_1_in_5,
main_Image_1_in_6,
main_Image_1_in_7,
main_Image_1_in_8,
main_Image_1_in_9,
main_Image_1_in_10,
main_Image_1_in_11,
main_Image_1_in_12,
main_Image_1_in_13,
main_Image_1_in_14,
main_Image_1_in_15,
main_Image_1_in_16,
main_Image_1_in_17,
main_Image_1_in_18,
main_Image_1_in_19,
main_Image_1_in_20,
main_Image_1_in_21,
main_Image_1_in_22,
main_Image_1_in_23,
main_Image_1_in_24,
main_Image_1_in_25,
main_Image_1_in_26,
main_Image_1_in_27,
main_Image_1_in_28,
main_Image_1_in_29,
main_Image_1_in_30,
main_Image_1_in_31,
main_Image_1_in_32,
main_Image_1_in_33,
main_Image_1_in_34,
main_Image_1_in_35,
main_Image_1_in_36,
main_Image_1_in_37,
main_Image_1_in_38,
main_Image_1_in_39,
main_Image_1_in_40,
main_Image_1_in_41,
main_Image_1_in_42,
main_Image_1_in_43,
main_Image_1_in_44,
main_Image_1_in_45,
main_Image_1_in_46,
main_Image_1_in_47,
main_Image_1_in_48,
main_Image_1_in_49
) [instance: 1, cache: 1];
// network: end of macro body
CacheScene(main_Image_1_in_1, main_Image_1_out_1, main_Image_1_out_2);
}
main_FileSelector_1_out_1 = "__FILE__DX__";
main_Import_1_in_2 = NULL;
main_Import_1_in_3 = NULL;
main_Import_1_in_4 = NULL;
main_Import_1_in_5 = NULL;
main_Import_1_in_6 = NULL;
main_Import_1_out_1 = NULL;
main_Post_1_in_2 = "positions";
main_Post_1_out_1 = NULL;
main_RubberSheet_1_in_2 = NULL;
main_RubberSheet_1_in_3 = NULL;
main_RubberSheet_1_in_4 = NULL;
main_RubberSheet_1_out_1 = NULL;
main_AutoColor_1_in_2 = NULL;
main_AutoColor_1_in_3 = NULL;
main_AutoColor_1_in_4 = NULL;
main_AutoColor_1_in_5 = NULL;
main_AutoColor_1_in_6 = NULL;
main_AutoColor_1_in_7 = NULL;
main_AutoColor_1_in_8 = NULL;
main_AutoColor_1_in_9 = NULL;
main_AutoColor_1_in_10 = NULL;
main_AutoColor_1_out_1 = NULL;
main_AutoColor_1_out_2 = NULL;
main_ShowConnections_1_out_1 = NULL;
main_Color_1_in_2 = "black";
main_Color_1_in_3 = .5;
main_Color_1_in_4 = NULL;
main_Color_1_in_5 = NULL;
main_Color_1_out_1 = NULL;
main_ColorBar_1_in_2 = NULL;
main_ColorBar_1_in_3 = NULL;
main_ColorBar_1_in_4 = NULL;
main_ColorBar_1_in_5 = NULL;
main_ColorBar_1_in_6 = NULL;
main_ColorBar_1_in_7 = NULL;
main_ColorBar_1_in_8 = NULL;
main_ColorBar_1_in_9 = {"black"};
main_ColorBar_1_in_10 = NULL;
main_ColorBar_1_in_11 = NULL;
main_ColorBar_1_in_12 = NULL;
main_ColorBar_1_in_13 = NULL;
main_ColorBar_1_in_14 = NULL;
main_ColorBar_1_in_15 = NULL;
main_ColorBar_1_in_16 = NULL;
main_ColorBar_1_out_1 = NULL;
main_Collect_1_out_1 = NULL;
macro Image(
id,
object,
where,
useVector,
to,
from,
width,
resolution,
aspect,
up,
viewAngle,
perspective,
options,
buttonState = 1,
buttonUpApprox = "none",
buttonDownApprox = "none",
buttonUpDensity = 1,
buttonDownDensity = 1,
renderMode = 0,
defaultCamera,
reset,
backgroundColor,
throttle,
RECenable = 0,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable = 0,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
interactionMode,
title,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
webOptions) -> (
object,
camera,
where)
{
ImageMessage(
id,
backgroundColor,
throttle,
RECenable,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
interactionMode,
title,
renderMode,
buttonUpApprox,
buttonDownApprox,
buttonUpDensity,
buttonDownDensity) [instance: 1, cache: 1];
autoCamera =
AutoCamera(
object,
"front",
object,
resolution,
aspect,
[0,1,0],
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
realCamera =
Camera(
to,
from,
width,
resolution,
aspect,
up,
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
coloredDefaultCamera =
UpdateCamera(defaultCamera,
background=backgroundColor) [instance: 1, cache: 1];
nullDefaultCamera =
Inquire(defaultCamera,
"is null + 1") [instance: 1, cache: 1];
resetCamera =
Switch(
nullDefaultCamera,
coloredDefaultCamera,
autoCamera) [instance: 1, cache: 1];
resetNull =
Inquire(
reset,
"is null + 1") [instance: 2, cache: 1];
reset =
Switch(
resetNull,
reset,
0) [instance: 2, cache: 1];
whichCamera =
Compute(
"($0 != 0 || $1 == 0) ? 1 : 2",
reset,
useVector) [instance: 1, cache: 1];
camera = Switch(
whichCamera,
resetCamera,
realCamera) [instance: 3, cache: 1];
AAobject =
AutoAxes(
object,
camera,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels) [instance: 1, cache: 1];
switchAAenable = Compute("$0+1",
AAenable) [instance: 2, cache: 1];
object = Switch(
switchAAenable,
object,
AAobject) [instance:4, cache: 1];
SWapproximation_options =
Switch(
buttonState,
buttonUpApprox,
buttonDownApprox) [instance: 5, cache: 1];
SWdensity_options =
Switch(
buttonState,
buttonUpDensity,
buttonDownDensity) [instance: 6, cache: 1];
HWapproximation_options =
Format(
"%s,%s",
buttonDownApprox,
buttonUpApprox) [instance: 1, cache: 1];
HWdensity_options =
Format(
"%d,%d",
buttonDownDensity,
buttonUpDensity) [instance: 2, cache: 1];
switchRenderMode = Compute(
"$0+1",
renderMode) [instance: 3, cache: 1];
approximation_options = Switch(
switchRenderMode,
SWapproximation_options,
HWapproximation_options) [instance: 7, cache: 1];
density_options = Switch(
switchRenderMode,
SWdensity_options,
HWdensity_options) [instance: 8, cache: 1];
renderModeString = Switch(
switchRenderMode,
"software",
"hardware")[instance: 9, cache: 1];
object_tag = Inquire(
object,
"object tag")[instance: 3, cache: 1];
annoted_object =
Options(
object,
"send boxes",
0,
"cache",
1,
"object tag",
object_tag,
"ddcamera",
whichCamera,
"rendering approximation",
approximation_options,
"render every",
density_options,
"button state",
buttonState,
"rendering mode",
renderModeString) [instance: 1, cache: 1];
RECresNull =
Inquire(
RECresolution,
"is null + 1") [instance: 4, cache: 1];
ImageResolution =
Inquire(
camera,
"camera resolution") [instance: 5, cache: 1];
RECresolution =
Switch(
RECresNull,
RECresolution,
ImageResolution) [instance: 10, cache: 1];
RECaspectNull =
Inquire(
RECaspect,
"is null + 1") [instance: 6, cache: 1];
ImageAspect =
Inquire(
camera,
"camera aspect") [instance: 7, cache: 1];
RECaspect =
Switch(
RECaspectNull,
RECaspect,
ImageAspect) [instance: 11, cache: 1];
switchRECenable = Compute(
"$0 == 0 ? 1 : (($2 == $3) && ($4 == $5)) ? ($1 == 1 ? 2 : 3) : 4",
RECenable,
switchRenderMode,
RECresolution,
ImageResolution,
RECaspect,
ImageAspect) [instance: 4, cache: 1];
NoRECobject, RECNoRerenderObject, RECNoRerHW, RECRerenderObject = Route(switchRECenable, annoted_object);
Display(
NoRECobject,
camera,
where,
throttle) [instance: 1, cache: 1];
image =
Render(
RECNoRerenderObject,
camera) [instance: 1, cache: 1];
Display(
image,
NULL,
where,
throttle) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 1, cache: 1];
rec_where = Display(
RECNoRerHW,
camera,
where,
throttle) [instance: 1, cache: 0];
rec_image = ReadImageWindow(
rec_where) [instance: 1, cache: 1];
WriteImage(
rec_image,
RECfile,
RECformat) [instance: 1, cache: 1];
RECupdateCamera =
UpdateCamera(
camera,
resolution=RECresolution,
aspect=RECaspect) [instance: 2, cache: 1];
Display(
RECRerenderObject,
camera,
where,
throttle) [instance: 1, cache: 1];
RECRerenderObject =
ScaleScreen(
RECRerenderObject,
NULL,
RECresolution,
camera) [instance: 1, cache: 1];
image =
Render(
RECRerenderObject,
RECupdateCamera) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 2, cache: 1];
}
main_Image_1_in_1 = "Image_1";
main_Image_1_in_3 = "X24,,";
main_Image_1_in_4 = 1;
main_Image_1_in_5 = [0.466889 0.863877 0.166499];
main_Image_1_in_6 = [0.466889 0.863877 4.74189];
main_Image_1_in_7 = 1.01623;
main_Image_1_in_8 = 1254;
main_Image_1_in_9 = 0.730064;
main_Image_1_in_10 = [0 1 0];
main_Image_1_in_11 = NULL;
main_Image_1_in_12 = 0;
main_Image_1_in_13 = NULL;
main_Image_1_in_14 = 1;
main_Image_1_in_15 = NULL;
main_Image_1_in_16 = NULL;
main_Image_1_in_17 = NULL;
main_Image_1_in_18 = NULL;
main_Image_1_in_19 = 0;
main_Image_1_in_20 = NULL;
main_Image_1_in_21 = NULL;
main_Image_1_in_22 = "snow";
main_Image_1_in_23 = NULL;
main_Image_1_in_25 = "/Users/carlo/Desktop/COMSONDEMO/CoMSON DP/doping.tif";
main_Image_1_in_26 = "tiff";
main_Image_1_in_27 = NULL;
main_Image_1_in_28 = NULL;
main_Image_1_in_29 = 1;
main_Image_1_in_30 = NULL;
main_Image_1_in_31 = -5;
main_Image_1_in_32 = NULL;
main_Image_1_in_33 = 1;
main_Image_1_in_34 = 0;
main_Image_1_in_35 = NULL;
main_Image_1_in_36 = 1;
main_Image_1_in_37 = {"clear", "black", "blue", "blue"};
main_Image_1_in_38 = {"background", "grid", "ticks", "labels"};
main_Image_1_in_39 = 0.65;
main_Image_1_in_40 = "roman_d";
main_Image_1_in_41 = "panzoom";
main_Image_1_in_42 = NULL;
main_Image_1_in_43 = NULL;
main_Image_1_in_44 = NULL;
main_Image_1_in_45 = NULL;
main_Image_1_in_46 = NULL;
main_Image_1_in_47 = NULL;
main_Image_1_in_48 = NULL;
main_Image_1_in_49 = NULL;
Executive("product version 4 4 4");
$sync
main();
fpl/inst/deprecated/FPL2dxappenddata.m 000644 000765 000000 00000006275 12010454601 020414 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2004-2008 Carlo de Falco, Massimiliano Culpo
##
## This file is part of
##
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
##
## AUTHORS:
## Carlo de Falco
##
## Culpo Massimiliano
## Bergische Universitaet Wuppertal
## Fachbereich C - Mathematik und Naturwissenschaften
## Arbeitsgruppe fuer Angewandte MathematD-42119 Wuppertal Gaussstr. 20
## D-42119 Wuppertal, Germany
## -*- texinfo -*-
## @deftypefn {Function File} {} FPL2dxappenddata ( @var{filename},
## @var{p}, @var{t}, @var{u}, @var{attr_name}, @var{attr_rank},
## @var{attr_shape}, @var{endflie} )
##
## Apends data to a file in DX form.
## Only one variable can be written to the file
## variable must be a scalar, vector or tensor of doubles
## mesh data in the file must be consistent with this variable
##
## Variable must be a scalar, vector or tensor of doubles
##
## @itemize @minus
## @item @var{filename}= name of file to save (type string)
## @item @var{p}, @var{t} = mesh
## @item @var{u} = variable to save
## @item @var{attr_name} = name of the variable (type string)
## @item @var{attr_rank} = rank of variable data (0 for scalar, 1 for vector, etc.)
## @item @var{attr_shape} = number of components of variable data (assumed 1 for scalar)
## @item @var{endfile} = 0 if you want to add other variables to the
## same file, 1 otherwise
## @end itemize
## @end deftypefn
function FPL2dxappenddata(filename,p,t,u,attr_name,attr_rank,attr_shape,endfile)
p = p';
t = t';
t = t(:,1:3);
fid=fopen (filename,'a');
Nnodi = size(p,1);
Ntriangoli = size(t,1);
fprintf(fid,'\nattribute "element type" string "triangles"\nattribute "ref" string "positions"\n\n');
if ((attr_rank==0) && (min(size(u))==1))
fprintf(fid,'object "%s.data"\nclass array type double rank 0 items %d data follows',attr_name,Nnodi);
fprintf(fid,'\n %1.7e',u);
else
fprintf(fid,'object "%s.data"\nclass array type double rank %d shape %d items %d data follows', ...
attr_name,attr_rank,attr_shape,Nnodi);
for i=1:Nnodi
fprintf(fid,'\n');
fprintf(fid,' %1.7e',u(i,:));
endfor
endif
fprintf(fid,['\nattribute "dep" string "positions"\n\n' ...
'object "%s" class field\n'...
'component "positions" value "pos"\n'...
'component "connections" value "con"\n'...
'component "data" value "%s.data"\n'],...
attr_name,attr_name);
if(endfile)
fprintf(fid,'\nend\n');
endif
fclose (fid);
endfunction fpl/inst/deprecated/FPL2dxoutputdata.m 000644 000765 000000 00000007776 12010454601 020514 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2004-2008,2009 Carlo de Falco, Massimiliano Culpo
##
## This file is part of
##
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
##
## AUTHORS:
## Carlo de Falco
##
## Culpo Massimiliano
## Bergische Universitaet Wuppertal
## Fachbereich C - Mathematik und Naturwissenschaften
## Arbeitsgruppe fuer Angewandte MathematD-42119 Wuppertal Gaussstr. 20
## D-42119 Wuppertal, Germany
## -*- texinfo -*-
## @deftypefn {Function File} {} FPL2dxoutputdata ( @var{filename}, @
## @var{p}, @var{t}, @var{u}, @var{attr_name}, @var{attr_rank}, @
## @var{attr_shape}, @var{endfile} )
##
## Outputs data in DX form.
##
## Variable must be a scalar, vector or tensor of doubles
##
## @itemize @minus
## @item @var{filename}= name of file to save (type string)
## @item @var{p}, @var{t} = mesh
## @item @var{u} = variable to save
## @item @var{attr_name} = name of the variable (type string)
## @item @var{attr_rank} = rank of variable data (0 for scalar, 1 for vector, etc.)
## @item @var{attr_shape} = number of components of variable data (assumed 1 for scalar)
## @item @var{endfile} = 0 if you want to add other variables to the
## same file, 1 otherwise
## @end itemize
## @end deftypefn
function FPL2dxoutputdata(filename,p,t,u,attr_name,attr_rank,attr_shape,endfile)
p = p';
t = t';
t = t(:,1:3);
fid=fopen (filename,'w');
Nnodi = size(p,1);
Ntriangoli = size(t,1);
Ndati = size(u,1);
fprintf(fid,"object ""pos""\nclass array type float rank 1 shape 2 items %d data follows",Nnodi);
for i=1:Nnodi
fprintf(fid,"\n");
fprintf(fid," %1.7e",p(i,:));
endfor
if (min(min(t))==1)
t=t-1;
elseif(min(min(t))~=0)
disp('WARNING: check triangle structure')
endif
## In DX format nodes are
## numbered starting from zero,
## instead we want to number
## them starting from 1!
## Here we restore the DX
## format
fprintf(fid,"\n\nobject ""con""\nclass array type int rank 1 shape 3 items %d data follows",Ntriangoli);
for i=1:Ntriangoli
fprintf(fid,"\n");
fprintf(fid," %d",t(i,:));
endfor
fprintf(fid,"\nattribute ""element type"" string ""triangles""\nattribute ""ref"" string ""positions""\n\n");
if ((attr_rank==0) && (min(size(u))==1))
fprintf(fid,"object ""%s.data""\nclass array type double rank 0 items %d data follows",attr_name,Ndati);
fprintf(fid,"\n %1.7e",u);
else
fprintf(fid,"object ""%s.data""\nclass array type double rank %d shape %d items %d data follows", ...
attr_name,attr_rank,attr_shape,Ndati);
for i=1:Ndati
fprintf(fid,"\n");
fprintf(fid," %1.7e",u(i,:));
endfor
endif
if Ndati==Nnodi
fprintf(fid,["\nattribute ""dep"" string ""positions""\n\n" ...
"object ""%s"" class field\n"...
"component ""positions"" value ""pos""\n"...
"component ""connections"" value ""con""\n"...
"component ""data"" value ""%s.data""\n"],...
attr_name,attr_name);
elseif Ndati==Ntriangoli
fprintf(fid,["\nattribute ""dep"" string ""connections""\n\n" ...
"object ""%s"" class field\n"...
"component ""positions"" value ""pos""\n"...
"component ""connections"" value ""con""\n"...
"component ""data"" value ""%s.data""\n"],...
attr_name,attr_name);
endif
if(endfile)
fprintf(fid,"\nend\n");
endif
fclose (fid);
endfunction fpl/inst/deprecated/FPL2dxoutputtimeseries.m 000644 000765 000000 00000004773 12010454601 021746 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2004-2008 Carlo de Falco, Massimiliano Culpo
##
## This file is part of
##
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
##
## AUTHORS:
## Carlo de Falco
##
## Culpo Massimiliano
## Bergische Universitaet Wuppertal
## Fachbereich C - Mathematik und Naturwissenschaften
## Arbeitsgruppe fuer Angewandte MathematD-42119 Wuppertal Gaussstr. 20
## D-42119 Wuppertal, Germany
## -*- texinfo -*-
## @deftypefn {Function File} {} FPL2dxoutputtimeseries ( @var{filename}, @var{p}, @var{t}, @var{u}, @var{attr_name}, @var{attr_rank}, @var{attr_shape}, @var{time} )
##
## Outputs a time series in DX form.
## variable must be a scalar, vector or tensor of doubles
## @itemize @minus
## @item @var{filename}= name of file to save (type string)
## @item @var{p}, @var{t} = mesh
## @item @var{u} = variable to save
## @item @var{attr_name} = name of the variable (type string)
## @item @var{attr_rank} = rank of variable data (0 for scalar, 1 for vector, etc.)
## @item @var{attr_shape} = number of components of variable data (assumed 1 for scalar)
## @item @var{time} = time instants
## @end itemize
## @end deftypefn
function FPL2dxoutputtimeseries(filename,p,t,u,attr_name,attr_rank,attr_shape,time)
Nsteps = length(time);
if (Nsteps<=1)
endfile = 1;
else
endfile = 0;
endif
FPL2dxoutputdata(filename,p,t,u(:,1:attr_shape),[attr_name "1"],attr_rank,attr_shape,endfile);
for it = 2:Nsteps
FPL2dxappenddata(filename,p,t,u(:,[1:attr_shape]+attr_shape*(it-1)),...
[attr_name num2str(it)],attr_rank,attr_shape,endfile);
endfor
fid=fopen(filename,"a");
fprintf (fid, "object \"%s_series\" class series\n",attr_name);
for it = 1:Nsteps
fprintf (fid,"member %d position %g value \"%s\"\n",it-1,time(it),[attr_name num2str(it)]);
endfor
fprintf (fid, "\nend\n");
fclose(fid);
endfunction fpl/inst/deprecated/FPL2pdequiver.m 000644 000765 000000 00000005252 12010454601 017755 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2004-2008 Carlo de Falco, Massimiliano Culpo
##
## This file is part of
##
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
##
## AUTHORS:
## Carlo de Falco
##
## Culpo Massimiliano
## Bergische Universitaet Wuppertal
## Fachbereich C - Mathematik und Naturwissenschaften
## Arbeitsgruppe fuer Angewandte MathematD-42119 Wuppertal Gaussstr. 20
## D-42119 Wuppertal, Germany
## -*- texinfo -*-
## @deftypefn {Function File} {} FPL2pdequiver (@var{mesh}, @
## @var{vx}, @var{vy}, [ @var{property}, @var{value} ...])
##
## Plots the 2D vector field @var{vx}, @var{vy}
## defined on the triangulation @var{mesh} using opendx.
##
## Options (default values):
## @var{sample_density} (100)
##
## @seealso{FPL2pdesurf, FPL2ptcsurf, FPL2ptcquiver}
## @end deftypefn
function FPL2pdequiver(mesh,vecfieldx,vecfieldy,varargin);
sample_density = "100";
if( (nargin >= 3) && (rem(nargin,2)==1) )
for ii=1:2:length(varargin)
[ varargin{ii} " = " varargin{ii+1} ";" ]
eval([ varargin{ii} " = """ varargin{ii+1} """;" ]);
endfor
else
error(["wrong number of parameters " num2str (nargin)])
endif
JX = sum(vecfieldx,1)'/3;
JY = sum(vecfieldy,1)'/3;
dataname = mktemp("/tmp",".dx");
scriptname = mktemp("/tmp",".net");
FPL2dxoutputdata(dataname,mesh.p,mesh.t,[ JX JY],'J',1,2,1);
showmesh = file_in_path(path,"FPL2pdequiver.net");
system (["cp " showmesh " " scriptname]);
system (["sed -i \'s|__FILE__DX__|" dataname "|g\' " scriptname]);
system (["sed -i \'s|__SAMPLE__DENSITY__|" sample_density "|g\' " scriptname]);
command = ["dx -noConfirmedQuit -program " scriptname " -execute -image >& /dev/null & "];
system(command);
endfunction
function filename = mktemp (direct,ext);
if (~exist(direct,"dir"))
error("trying to save temporary file to non existing directory")
endif
done=false;
while ~done
filename = [direct,"/FPL.",num2str(floor(rand*1e7)),ext];
if ~exist(filename,"file")
done =true;
endif
endwhile
endfunction
fpl/inst/deprecated/FPL2pdequiver.net 000644 000765 000000 00000041006 12007306463 020314 0 ustar 00carlo wheel 000000 000000 //
// time: Fri Jun 15 19:24:56 2007
//
// version: 3.2.0 (format), 4.4.4 (DX)
//
//
// MODULE main
// workspace: width = 481, height = 614
// layout: snap = 0, width = 50, height = 50, align = NN
//
macro main(
) -> (
) {
//
// node FileSelector[1]: x = 173, y = 81, inputs = 0, label = FileSelector
// output[1]: visible = 1, type = 32, value = "__FILE__DX__"
// output[2]: visible = 1, type = 32, value = "__FILE__DX__"
//
//
// node Import[1]: x = 203, y = 177, inputs = 6, label = Import
//
main_Import_1_out_1 =
Import(
main_FileSelector_1_out_1,
main_Import_1_in_2,
main_Import_1_in_3,
main_Import_1_in_4,
main_Import_1_in_5,
main_Import_1_in_6
) [instance: 1, cache: 1];
//
// node Sample[1]: x = 89, y = 238, inputs = 2, label = Sample
// input[2]: defaulting = 0, visible = 1, type = 1, value = __SAMPLE__DENSITY__
//
main_Sample_1_out_1 =
Sample(
main_Import_1_out_1,
main_Sample_1_in_2
) [instance: 1, cache: 1];
//
// node AutoGlyph[1]: x = 64, y = 323, inputs = 7, label = AutoGlyph
//
main_AutoGlyph_1_out_1 =
AutoGlyph(
main_Sample_1_out_1,
main_AutoGlyph_1_in_2,
main_AutoGlyph_1_in_3,
main_AutoGlyph_1_in_4,
main_AutoGlyph_1_in_5,
main_AutoGlyph_1_in_6,
main_AutoGlyph_1_in_7
) [instance: 1, cache: 1];
//
// node AutoColor[1]: x = 76, y = 415, inputs = 10, label = AutoColor
//
main_AutoColor_1_out_1,
main_AutoColor_1_out_2 =
AutoColor(
main_AutoGlyph_1_out_1,
main_AutoColor_1_in_2,
main_AutoColor_1_in_3,
main_AutoColor_1_in_4,
main_AutoColor_1_in_5,
main_AutoColor_1_in_6,
main_AutoColor_1_in_7,
main_AutoColor_1_in_8,
main_AutoColor_1_in_9,
main_AutoColor_1_in_10
) [instance: 1, cache: 1];
//
// node ColorBar[1]: x = 238, y = 367, inputs = 16, label = ColorBar
//
main_ColorBar_1_out_1 =
ColorBar(
main_AutoColor_1_out_2,
main_ColorBar_1_in_2,
main_ColorBar_1_in_3,
main_ColorBar_1_in_4,
main_ColorBar_1_in_5,
main_ColorBar_1_in_6,
main_ColorBar_1_in_7,
main_ColorBar_1_in_8,
main_ColorBar_1_in_9,
main_ColorBar_1_in_10,
main_ColorBar_1_in_11,
main_ColorBar_1_in_12,
main_ColorBar_1_in_13,
main_ColorBar_1_in_14,
main_ColorBar_1_in_15,
main_ColorBar_1_in_16
) [instance: 1, cache: 1];
//
// node ShowConnections[1]: x = 348, y = 295, inputs = 1, label = ShowConnections
//
main_ShowConnections_1_out_1 =
ShowConnections(
main_Import_1_out_1
) [instance: 1, cache: 1];
//
// node Color[1]: x = 359, y = 398, inputs = 5, label = Color
// input[2]: defaulting = 0, visible = 1, type = 32, value = "black"
//
main_Color_1_out_1 =
Color(
main_ShowConnections_1_out_1,
main_Color_1_in_2,
main_Color_1_in_3,
main_Color_1_in_4,
main_Color_1_in_5
) [instance: 1, cache: 1];
//
// node Collect[1]: x = 198, y = 465, inputs = 3, label = Collect
//
main_Collect_1_out_1 =
Collect(
main_AutoColor_1_out_1,
main_ColorBar_1_out_1,
main_Color_1_out_1
) [instance: 1, cache: 1];
//
// node Image[1]: x = 195, y = 552, inputs = 49, label = Image
// input[1]: defaulting = 0, visible = 0, type = 67108863, value = "Image_1"
// input[4]: defaulting = 0, visible = 0, type = 1, value = 1
// input[5]: defaulting = 0, visible = 0, type = 8, value = [0.555651 0.5 0]
// input[6]: defaulting = 0, visible = 0, type = 8, value = [0.555651 0.5 3.71222]
// input[7]: defaulting = 0, visible = 0, type = 5, value = 1.98938
// input[8]: defaulting = 0, visible = 0, type = 1, value = 1254
// input[9]: defaulting = 0, visible = 0, type = 5, value = 0.759
// input[10]: defaulting = 0, visible = 0, type = 8, value = [0 1 0]
// input[11]: defaulting = 1, visible = 0, type = 5, value = 30.0001
// input[12]: defaulting = 0, visible = 0, type = 1, value = 0
// input[14]: defaulting = 0, visible = 0, type = 1, value = 1
// input[15]: defaulting = 1, visible = 0, type = 32, value = "none"
// input[16]: defaulting = 1, visible = 0, type = 32, value = "none"
// input[17]: defaulting = 1, visible = 0, type = 1, value = 1
// input[18]: defaulting = 1, visible = 0, type = 1, value = 1
// input[19]: defaulting = 0, visible = 0, type = 1, value = 0
// input[22]: defaulting = 0, visible = 0, type = 32, value = "grey70"
// input[29]: defaulting = 1, visible = 0, type = 3, value = 0
// input[41]: defaulting = 0, visible = 0, type = 32, value = "panzoom"
// depth: value = 24
// window: position = (0.0000,0.0000), size = 0.9906x0.9697
// internal caching: 1
//
main_Image_1_out_1,
main_Image_1_out_2,
main_Image_1_out_3 =
Image(
main_Image_1_in_1,
main_Collect_1_out_1,
main_Image_1_in_3,
main_Image_1_in_4,
main_Image_1_in_5,
main_Image_1_in_6,
main_Image_1_in_7,
main_Image_1_in_8,
main_Image_1_in_9,
main_Image_1_in_10,
main_Image_1_in_11,
main_Image_1_in_12,
main_Image_1_in_13,
main_Image_1_in_14,
main_Image_1_in_15,
main_Image_1_in_16,
main_Image_1_in_17,
main_Image_1_in_18,
main_Image_1_in_19,
main_Image_1_in_20,
main_Image_1_in_21,
main_Image_1_in_22,
main_Image_1_in_23,
main_Image_1_in_24,
main_Image_1_in_25,
main_Image_1_in_26,
main_Image_1_in_27,
main_Image_1_in_28,
main_Image_1_in_29,
main_Image_1_in_30,
main_Image_1_in_31,
main_Image_1_in_32,
main_Image_1_in_33,
main_Image_1_in_34,
main_Image_1_in_35,
main_Image_1_in_36,
main_Image_1_in_37,
main_Image_1_in_38,
main_Image_1_in_39,
main_Image_1_in_40,
main_Image_1_in_41,
main_Image_1_in_42,
main_Image_1_in_43,
main_Image_1_in_44,
main_Image_1_in_45,
main_Image_1_in_46,
main_Image_1_in_47,
main_Image_1_in_48,
main_Image_1_in_49
) [instance: 1, cache: 1];
// network: end of macro body
CacheScene(main_Image_1_in_1, main_Image_1_out_1, main_Image_1_out_2);
}
main_FileSelector_1_out_1 = "__FILE__DX__";
main_Import_1_in_2 = NULL;
main_Import_1_in_3 = NULL;
main_Import_1_in_4 = NULL;
main_Import_1_in_5 = NULL;
main_Import_1_in_6 = NULL;
main_Import_1_out_1 = NULL;
main_Sample_1_in_2 = __SAMPLE__DENSITY__;
main_Sample_1_out_1 = NULL;
main_AutoGlyph_1_in_2 = NULL;
main_AutoGlyph_1_in_3 = NULL;
main_AutoGlyph_1_in_4 = NULL;
main_AutoGlyph_1_in_5 = NULL;
main_AutoGlyph_1_in_6 = NULL;
main_AutoGlyph_1_in_7 = NULL;
main_AutoGlyph_1_out_1 = NULL;
main_AutoColor_1_in_2 = NULL;
main_AutoColor_1_in_3 = NULL;
main_AutoColor_1_in_4 = NULL;
main_AutoColor_1_in_5 = NULL;
main_AutoColor_1_in_6 = NULL;
main_AutoColor_1_in_7 = NULL;
main_AutoColor_1_in_8 = NULL;
main_AutoColor_1_in_9 = NULL;
main_AutoColor_1_in_10 = NULL;
main_AutoColor_1_out_1 = NULL;
main_AutoColor_1_out_2 = NULL;
main_ColorBar_1_in_2 = NULL;
main_ColorBar_1_in_3 = NULL;
main_ColorBar_1_in_4 = NULL;
main_ColorBar_1_in_5 = NULL;
main_ColorBar_1_in_6 = NULL;
main_ColorBar_1_in_7 = NULL;
main_ColorBar_1_in_8 = NULL;
main_ColorBar_1_in_9 = NULL;
main_ColorBar_1_in_10 = NULL;
main_ColorBar_1_in_11 = NULL;
main_ColorBar_1_in_12 = NULL;
main_ColorBar_1_in_13 = NULL;
main_ColorBar_1_in_14 = NULL;
main_ColorBar_1_in_15 = NULL;
main_ColorBar_1_in_16 = NULL;
main_ColorBar_1_out_1 = NULL;
main_ShowConnections_1_out_1 = NULL;
main_Color_1_in_2 = "black";
main_Color_1_in_3 = NULL;
main_Color_1_in_4 = NULL;
main_Color_1_in_5 = NULL;
main_Color_1_out_1 = NULL;
main_Collect_1_out_1 = NULL;
macro Image(
id,
object,
where,
useVector,
to,
from,
width,
resolution,
aspect,
up,
viewAngle,
perspective,
options,
buttonState = 1,
buttonUpApprox = "none",
buttonDownApprox = "none",
buttonUpDensity = 1,
buttonDownDensity = 1,
renderMode = 0,
defaultCamera,
reset,
backgroundColor,
throttle,
RECenable = 0,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable = 0,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
interactionMode,
title,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
webOptions) -> (
object,
camera,
where)
{
ImageMessage(
id,
backgroundColor,
throttle,
RECenable,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
interactionMode,
title,
renderMode,
buttonUpApprox,
buttonDownApprox,
buttonUpDensity,
buttonDownDensity) [instance: 1, cache: 1];
autoCamera =
AutoCamera(
object,
"front",
object,
resolution,
aspect,
[0,1,0],
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
realCamera =
Camera(
to,
from,
width,
resolution,
aspect,
up,
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
coloredDefaultCamera =
UpdateCamera(defaultCamera,
background=backgroundColor) [instance: 1, cache: 1];
nullDefaultCamera =
Inquire(defaultCamera,
"is null + 1") [instance: 1, cache: 1];
resetCamera =
Switch(
nullDefaultCamera,
coloredDefaultCamera,
autoCamera) [instance: 1, cache: 1];
resetNull =
Inquire(
reset,
"is null + 1") [instance: 2, cache: 1];
reset =
Switch(
resetNull,
reset,
0) [instance: 2, cache: 1];
whichCamera =
Compute(
"($0 != 0 || $1 == 0) ? 1 : 2",
reset,
useVector) [instance: 1, cache: 1];
camera = Switch(
whichCamera,
resetCamera,
realCamera) [instance: 3, cache: 1];
AAobject =
AutoAxes(
object,
camera,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels) [instance: 1, cache: 1];
switchAAenable = Compute("$0+1",
AAenable) [instance: 2, cache: 1];
object = Switch(
switchAAenable,
object,
AAobject) [instance:4, cache: 1];
SWapproximation_options =
Switch(
buttonState,
buttonUpApprox,
buttonDownApprox) [instance: 5, cache: 1];
SWdensity_options =
Switch(
buttonState,
buttonUpDensity,
buttonDownDensity) [instance: 6, cache: 1];
HWapproximation_options =
Format(
"%s,%s",
buttonDownApprox,
buttonUpApprox) [instance: 1, cache: 1];
HWdensity_options =
Format(
"%d,%d",
buttonDownDensity,
buttonUpDensity) [instance: 2, cache: 1];
switchRenderMode = Compute(
"$0+1",
renderMode) [instance: 3, cache: 1];
approximation_options = Switch(
switchRenderMode,
SWapproximation_options,
HWapproximation_options) [instance: 7, cache: 1];
density_options = Switch(
switchRenderMode,
SWdensity_options,
HWdensity_options) [instance: 8, cache: 1];
renderModeString = Switch(
switchRenderMode,
"software",
"hardware")[instance: 9, cache: 1];
object_tag = Inquire(
object,
"object tag")[instance: 3, cache: 1];
annoted_object =
Options(
object,
"send boxes",
0,
"cache",
1,
"object tag",
object_tag,
"ddcamera",
whichCamera,
"rendering approximation",
approximation_options,
"render every",
density_options,
"button state",
buttonState,
"rendering mode",
renderModeString) [instance: 1, cache: 1];
RECresNull =
Inquire(
RECresolution,
"is null + 1") [instance: 4, cache: 1];
ImageResolution =
Inquire(
camera,
"camera resolution") [instance: 5, cache: 1];
RECresolution =
Switch(
RECresNull,
RECresolution,
ImageResolution) [instance: 10, cache: 1];
RECaspectNull =
Inquire(
RECaspect,
"is null + 1") [instance: 6, cache: 1];
ImageAspect =
Inquire(
camera,
"camera aspect") [instance: 7, cache: 1];
RECaspect =
Switch(
RECaspectNull,
RECaspect,
ImageAspect) [instance: 11, cache: 1];
switchRECenable = Compute(
"$0 == 0 ? 1 : (($2 == $3) && ($4 == $5)) ? ($1 == 1 ? 2 : 3) : 4",
RECenable,
switchRenderMode,
RECresolution,
ImageResolution,
RECaspect,
ImageAspect) [instance: 4, cache: 1];
NoRECobject, RECNoRerenderObject, RECNoRerHW, RECRerenderObject = Route(switchRECenable, annoted_object);
Display(
NoRECobject,
camera,
where,
throttle) [instance: 1, cache: 1];
image =
Render(
RECNoRerenderObject,
camera) [instance: 1, cache: 1];
Display(
image,
NULL,
where,
throttle) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 1, cache: 1];
rec_where = Display(
RECNoRerHW,
camera,
where,
throttle) [instance: 1, cache: 0];
rec_image = ReadImageWindow(
rec_where) [instance: 1, cache: 1];
WriteImage(
rec_image,
RECfile,
RECformat) [instance: 1, cache: 1];
RECupdateCamera =
UpdateCamera(
camera,
resolution=RECresolution,
aspect=RECaspect) [instance: 2, cache: 1];
Display(
RECRerenderObject,
camera,
where,
throttle) [instance: 1, cache: 1];
RECRerenderObject =
ScaleScreen(
RECRerenderObject,
NULL,
RECresolution,
camera) [instance: 1, cache: 1];
image =
Render(
RECRerenderObject,
RECupdateCamera) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 2, cache: 1];
}
main_Image_1_in_1 = "Image_1";
main_Image_1_in_3 = "X24,,";
main_Image_1_in_4 = 1;
main_Image_1_in_5 = [0.555651 0.5 0];
main_Image_1_in_6 = [0.555651 0.5 3.71222];
main_Image_1_in_7 = 1.98938;
main_Image_1_in_8 = 1254;
main_Image_1_in_9 = 0.759;
main_Image_1_in_10 = [0 1 0];
main_Image_1_in_11 = NULL;
main_Image_1_in_12 = 0;
main_Image_1_in_13 = NULL;
main_Image_1_in_14 = 1;
main_Image_1_in_15 = NULL;
main_Image_1_in_16 = NULL;
main_Image_1_in_17 = NULL;
main_Image_1_in_18 = NULL;
main_Image_1_in_19 = 0;
main_Image_1_in_20 = NULL;
main_Image_1_in_21 = NULL;
main_Image_1_in_22 = "grey70";
main_Image_1_in_23 = NULL;
main_Image_1_in_25 = NULL;
main_Image_1_in_26 = NULL;
main_Image_1_in_27 = NULL;
main_Image_1_in_28 = NULL;
main_Image_1_in_29 = NULL;
main_Image_1_in_30 = NULL;
main_Image_1_in_31 = NULL;
main_Image_1_in_32 = NULL;
main_Image_1_in_33 = NULL;
main_Image_1_in_34 = NULL;
main_Image_1_in_35 = NULL;
main_Image_1_in_36 = NULL;
main_Image_1_in_37 = NULL;
main_Image_1_in_38 = NULL;
main_Image_1_in_39 = NULL;
main_Image_1_in_40 = NULL;
main_Image_1_in_41 = "panzoom";
main_Image_1_in_42 = NULL;
main_Image_1_in_43 = NULL;
main_Image_1_in_44 = NULL;
main_Image_1_in_45 = NULL;
main_Image_1_in_46 = NULL;
main_Image_1_in_47 = NULL;
main_Image_1_in_48 = NULL;
main_Image_1_in_49 = NULL;
Executive("product version 4 4 4");
$sync
main();
fpl/inst/deprecated/FPL2pdeshowmesh.m 000644 000765 000000 00000005216 12010454601 020277 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2004-2008,2009 Carlo de Falco, Massimiliano Culpo
##
## This file is part of
##
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
##
## AUTHORS:
## Carlo de Falco
##
## Culpo Massimiliano
## Bergische Universitaet Wuppertal
## Fachbereich C - Mathematik und Naturwissenschaften
## Arbeitsgruppe fuer Angewandte MathematD-42119 Wuppertal Gaussstr. 20
## D-42119 Wuppertal, Germany
## -*- texinfo -*-
##
## @deftypefn {Function File} {} FPL2pdeshowmesh (@var{mesh},@var{color})
##
## Displays one 2-D triangulations using opendx
##
## Examples:
## @example
##
## FPL2pdeshowmesh(mesh)
## FPL2pdeshowmesh(mesh,"blue")
##
## @end example
##
## @seealso{FPL2ptcshowmesh}
## @end deftypefn
function FPL2pdeshowmesh (varargin)
if nargin == 1
colorname = "red";
else
colorname = varargin{2};
endif
dataname = mktemp("/tmp",".dx");
FPL2dxoutputdata(dataname,varargin{1}.p,varargin{1}.t,varargin{1}.p(1,:)','x',0,1,1);
scriptname = mktemp("/tmp",".net");
showmesh = file_in_path(path,"FPL2pdeshowmesh.net");
system (["cp " showmesh " " scriptname]);
system (["sed -i \'s|FILENAME|" dataname "|g\' " scriptname]);
system (["sed -i \'s|COLORNAME|" colorname "|g\' " scriptname]);
command = ["dx -noConfirmedQuit -program " scriptname " -execute -image >& /dev/null & "];
system(command);
endfunction
function filename = mktemp (direct,ext);
if (~exist(direct,"dir"))
error("trying to save temporary file to non existing directory")
end
done=false;
while ~done
filename = [direct,"/FPL.",num2str(floor(rand*1e7)),ext];
if ~exist(filename,"file")
done =true;
endif
endwhile
endfunction
%!test
%! msh.p = [0 0; 1 0; 1 1; 0 1].';
%! msh.t = [1 2 3 1; 1 3 4 1].';
%! msh.e = [1 2 0 0 1 0 1; 2 3 0 0 2 0 1; 3 4 0 0 3 0 1; 4 1 0 0 4 0 1].';
%! FPL2pdeshowmesh (msh, "red");
%! s = input ("do you see a red outlined square divided in two triangles (if you see an empty plot try ctrl-F)? (y/n): " ,"s");
%! assert(s, "y") fpl/inst/deprecated/FPL2pdeshowmesh.net 000644 000765 000000 00000034734 12007306463 020650 0 ustar 00carlo wheel 000000 000000 //
// time: Sat Jan 5 12:20:20 2008
//
// version: 3.2.0 (format), 4.4.4 (DX)
//
//
// MODULE main
// workspace: width = 260, height = 456
// layout: snap = 1, width = 10, height = 10, align = CC
//
macro main(
) -> (
) {
//
// node String[1]: x = 81, y = 24, inputs = 0, label = String
// output[1]: visible = 1, type = 32, value = "FILENAME"
//
//
// node Import[1]: x = 79, y = 104, inputs = 6, label = Import
//
main_Import_1_out_1 =
Import(
main_String_1_out_1,
main_Import_1_in_2,
main_Import_1_in_3,
main_Import_1_in_4,
main_Import_1_in_5,
main_Import_1_in_6
) [instance: 1, cache: 1];
//
// node String[2]: x = 211, y = 24, inputs = 0, label = String
// output[1]: visible = 1, type = 32, value = "COLORNAME"
//
//
// node Color[1]: x = 149, y = 184, inputs = 5, label = Color
// input[2]: defaulting = 1, visible = 1, type = 32, value = "indianred"
//
main_Color_1_out_1 =
Color(
main_Import_1_out_1,
main_String_2_out_1,
main_Color_1_in_3,
main_Color_1_in_4,
main_Color_1_in_5
) [instance: 1, cache: 1];
//
// node ShowConnections[1]: x = 119, y = 294, inputs = 1, label = ShowConnections
//
main_ShowConnections_1_out_1 =
ShowConnections(
main_Color_1_out_1
) [instance: 1, cache: 1];
//
// node Image[1]: x = 149, y = 394, inputs = 49, label = Image
// input[1]: defaulting = 0, visible = 0, type = 67108863, value = "Image_1"
// input[4]: defaulting = 0, visible = 0, type = 1, value = 1
// input[5]: defaulting = 0, visible = 0, type = 8, value = [7.5 7.5 0]
// input[6]: defaulting = 0, visible = 0, type = 8, value = [7.5 7.5 39.3199]
// input[7]: defaulting = 0, visible = 0, type = 5, value = 21.0715
// input[8]: defaulting = 0, visible = 0, type = 1, value = 804
// input[9]: defaulting = 0, visible = 0, type = 5, value = 0.610075
// input[10]: defaulting = 0, visible = 0, type = 8, value = [0 1 0]
// input[11]: defaulting = 1, visible = 0, type = 5, value = 30.0
// input[12]: defaulting = 0, visible = 0, type = 1, value = 0
// input[14]: defaulting = 0, visible = 0, type = 1, value = 1
// input[15]: defaulting = 1, visible = 0, type = 32, value = "none"
// input[16]: defaulting = 1, visible = 0, type = 32, value = "none"
// input[17]: defaulting = 0, visible = 0, type = 1, value = 1
// input[18]: defaulting = 0, visible = 0, type = 1, value = 1
// input[19]: defaulting = 0, visible = 0, type = 1, value = 1
// input[22]: defaulting = 0, visible = 0, type = 32, value = "snow"
// input[25]: defaulting = 0, visible = 0, type = 32, value = "/Users/carlo/Desktop/COMSONDEMO/CoMSON DP/grid.tif"
// input[26]: defaulting = 0, visible = 0, type = 32, value = "tiff"
// input[29]: defaulting = 0, visible = 0, type = 3, value = 1
// input[31]: defaulting = 0, visible = 0, type = 1, value = -15
// input[33]: defaulting = 0, visible = 0, type = 3, value = 0
// input[34]: defaulting = 0, visible = 0, type = 3, value = 0
// input[37]: defaulting = 0, visible = 0, type = 16777248, value = {"clear", "grey5", "saddlebrown", "saddlebrown"}
// input[38]: defaulting = 0, visible = 0, type = 16777248, value = {"background", "grid", "ticks", "labels"}
// input[39]: defaulting = 0, visible = 0, type = 5, value = 0.7
// input[40]: defaulting = 0, visible = 0, type = 32, value = "roman_s"
// input[41]: defaulting = 0, visible = 0, type = 32, value = "none"
// depth: value = 24
// window: position = (0.2479,0.1267), size = 0.6389x0.6833
// internal caching: 1
//
main_Image_1_out_1,
main_Image_1_out_2,
main_Image_1_out_3 =
Image(
main_Image_1_in_1,
main_ShowConnections_1_out_1,
main_Image_1_in_3,
main_Image_1_in_4,
main_Image_1_in_5,
main_Image_1_in_6,
main_Image_1_in_7,
main_Image_1_in_8,
main_Image_1_in_9,
main_Image_1_in_10,
main_Image_1_in_11,
main_Image_1_in_12,
main_Image_1_in_13,
main_Image_1_in_14,
main_Image_1_in_15,
main_Image_1_in_16,
main_Image_1_in_17,
main_Image_1_in_18,
main_Image_1_in_19,
main_Image_1_in_20,
main_Image_1_in_21,
main_Image_1_in_22,
main_Image_1_in_23,
main_Image_1_in_24,
main_Image_1_in_25,
main_Image_1_in_26,
main_Image_1_in_27,
main_Image_1_in_28,
main_Image_1_in_29,
main_Image_1_in_30,
main_Image_1_in_31,
main_Image_1_in_32,
main_Image_1_in_33,
main_Image_1_in_34,
main_Image_1_in_35,
main_Image_1_in_36,
main_Image_1_in_37,
main_Image_1_in_38,
main_Image_1_in_39,
main_Image_1_in_40,
main_Image_1_in_41,
main_Image_1_in_42,
main_Image_1_in_43,
main_Image_1_in_44,
main_Image_1_in_45,
main_Image_1_in_46,
main_Image_1_in_47,
main_Image_1_in_48,
main_Image_1_in_49
) [instance: 1, cache: 1];
// network: end of macro body
CacheScene(main_Image_1_in_1, main_Image_1_out_1, main_Image_1_out_2);
}
main_String_1_out_1 = "FILENAME";
main_Import_1_in_2 = NULL;
main_Import_1_in_3 = NULL;
main_Import_1_in_4 = NULL;
main_Import_1_in_5 = NULL;
main_Import_1_in_6 = NULL;
main_Import_1_out_1 = NULL;
main_String_2_out_1 = "COLORNAME";
main_Color_1_in_3 = NULL;
main_Color_1_in_4 = NULL;
main_Color_1_in_5 = NULL;
main_Color_1_out_1 = NULL;
main_ShowConnections_1_out_1 = NULL;
macro Image(
id,
object,
where,
useVector,
to,
from,
width,
resolution,
aspect,
up,
viewAngle,
perspective,
options,
buttonState = 1,
buttonUpApprox = "none",
buttonDownApprox = "none",
buttonUpDensity = 1,
buttonDownDensity = 1,
renderMode = 0,
defaultCamera,
reset,
backgroundColor,
throttle,
RECenable = 0,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable = 0,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
interactionMode,
title,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
webOptions) -> (
object,
camera,
where)
{
ImageMessage(
id,
backgroundColor,
throttle,
RECenable,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
interactionMode,
title,
renderMode,
buttonUpApprox,
buttonDownApprox,
buttonUpDensity,
buttonDownDensity) [instance: 1, cache: 1];
autoCamera =
AutoCamera(
object,
"front",
object,
resolution,
aspect,
[0,1,0],
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
realCamera =
Camera(
to,
from,
width,
resolution,
aspect,
up,
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
coloredDefaultCamera =
UpdateCamera(defaultCamera,
background=backgroundColor) [instance: 1, cache: 1];
nullDefaultCamera =
Inquire(defaultCamera,
"is null + 1") [instance: 1, cache: 1];
resetCamera =
Switch(
nullDefaultCamera,
coloredDefaultCamera,
autoCamera) [instance: 1, cache: 1];
resetNull =
Inquire(
reset,
"is null + 1") [instance: 2, cache: 1];
reset =
Switch(
resetNull,
reset,
0) [instance: 2, cache: 1];
whichCamera =
Compute(
"($0 != 0 || $1 == 0) ? 1 : 2",
reset,
useVector) [instance: 1, cache: 1];
camera = Switch(
whichCamera,
resetCamera,
realCamera) [instance: 3, cache: 1];
AAobject =
AutoAxes(
object,
camera,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels) [instance: 1, cache: 1];
switchAAenable = Compute("$0+1",
AAenable) [instance: 2, cache: 1];
object = Switch(
switchAAenable,
object,
AAobject) [instance:4, cache: 1];
SWapproximation_options =
Switch(
buttonState,
buttonUpApprox,
buttonDownApprox) [instance: 5, cache: 1];
SWdensity_options =
Switch(
buttonState,
buttonUpDensity,
buttonDownDensity) [instance: 6, cache: 1];
HWapproximation_options =
Format(
"%s,%s",
buttonDownApprox,
buttonUpApprox) [instance: 1, cache: 1];
HWdensity_options =
Format(
"%d,%d",
buttonDownDensity,
buttonUpDensity) [instance: 2, cache: 1];
switchRenderMode = Compute(
"$0+1",
renderMode) [instance: 3, cache: 1];
approximation_options = Switch(
switchRenderMode,
SWapproximation_options,
HWapproximation_options) [instance: 7, cache: 1];
density_options = Switch(
switchRenderMode,
SWdensity_options,
HWdensity_options) [instance: 8, cache: 1];
renderModeString = Switch(
switchRenderMode,
"software",
"hardware")[instance: 9, cache: 1];
object_tag = Inquire(
object,
"object tag")[instance: 3, cache: 1];
annoted_object =
Options(
object,
"send boxes",
0,
"cache",
1,
"object tag",
object_tag,
"ddcamera",
whichCamera,
"rendering approximation",
approximation_options,
"render every",
density_options,
"button state",
buttonState,
"rendering mode",
renderModeString) [instance: 1, cache: 1];
RECresNull =
Inquire(
RECresolution,
"is null + 1") [instance: 4, cache: 1];
ImageResolution =
Inquire(
camera,
"camera resolution") [instance: 5, cache: 1];
RECresolution =
Switch(
RECresNull,
RECresolution,
ImageResolution) [instance: 10, cache: 1];
RECaspectNull =
Inquire(
RECaspect,
"is null + 1") [instance: 6, cache: 1];
ImageAspect =
Inquire(
camera,
"camera aspect") [instance: 7, cache: 1];
RECaspect =
Switch(
RECaspectNull,
RECaspect,
ImageAspect) [instance: 11, cache: 1];
switchRECenable = Compute(
"$0 == 0 ? 1 : (($2 == $3) && ($4 == $5)) ? ($1 == 1 ? 2 : 3) : 4",
RECenable,
switchRenderMode,
RECresolution,
ImageResolution,
RECaspect,
ImageAspect) [instance: 4, cache: 1];
NoRECobject, RECNoRerenderObject, RECNoRerHW, RECRerenderObject = Route(switchRECenable, annoted_object);
Display(
NoRECobject,
camera,
where,
throttle) [instance: 1, cache: 1];
image =
Render(
RECNoRerenderObject,
camera) [instance: 1, cache: 1];
Display(
image,
NULL,
where,
throttle) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 1, cache: 1];
rec_where = Display(
RECNoRerHW,
camera,
where,
throttle) [instance: 1, cache: 0];
rec_image = ReadImageWindow(
rec_where) [instance: 1, cache: 1];
WriteImage(
rec_image,
RECfile,
RECformat) [instance: 1, cache: 1];
RECupdateCamera =
UpdateCamera(
camera,
resolution=RECresolution,
aspect=RECaspect) [instance: 2, cache: 1];
Display(
RECRerenderObject,
camera,
where,
throttle) [instance: 1, cache: 1];
RECRerenderObject =
ScaleScreen(
RECRerenderObject,
NULL,
RECresolution,
camera) [instance: 1, cache: 1];
image =
Render(
RECRerenderObject,
RECupdateCamera) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 2, cache: 1];
}
main_Image_1_in_1 = "Image_1";
main_Image_1_in_3 = "X24,,";
main_Image_1_in_4 = 1;
main_Image_1_in_5 = [7.5 7.5 0];
main_Image_1_in_6 = [7.5 7.5 39.3199];
main_Image_1_in_7 = 21.0715;
main_Image_1_in_8 = 804;
main_Image_1_in_9 = 0.610075;
main_Image_1_in_10 = [0 1 0];
main_Image_1_in_11 = NULL;
main_Image_1_in_12 = 0;
main_Image_1_in_13 = NULL;
main_Image_1_in_14 = 1;
main_Image_1_in_15 = NULL;
main_Image_1_in_16 = NULL;
main_Image_1_in_17 = 1;
main_Image_1_in_18 = 1;
main_Image_1_in_19 = 1;
main_Image_1_in_20 = NULL;
main_Image_1_in_21 = NULL;
main_Image_1_in_22 = "snow";
main_Image_1_in_23 = NULL;
main_Image_1_in_25 = "/Users/carlo/Desktop/COMSONDEMO/CoMSON DP/grid.tif";
main_Image_1_in_26 = "tiff";
main_Image_1_in_27 = NULL;
main_Image_1_in_28 = NULL;
main_Image_1_in_29 = 1;
main_Image_1_in_30 = NULL;
main_Image_1_in_31 = -15;
main_Image_1_in_32 = NULL;
main_Image_1_in_33 = 0;
main_Image_1_in_34 = 0;
main_Image_1_in_35 = NULL;
main_Image_1_in_36 = NULL;
main_Image_1_in_37 = {"clear", "grey5", "saddlebrown", "saddlebrown"};
main_Image_1_in_38 = {"background", "grid", "ticks", "labels"};
main_Image_1_in_39 = 0.7;
main_Image_1_in_40 = "roman_s";
main_Image_1_in_41 = "none";
main_Image_1_in_42 = NULL;
main_Image_1_in_43 = NULL;
main_Image_1_in_44 = NULL;
main_Image_1_in_45 = NULL;
main_Image_1_in_46 = NULL;
main_Image_1_in_47 = NULL;
main_Image_1_in_48 = NULL;
main_Image_1_in_49 = NULL;
Executive("product version 4 4 4");
$sync
main();
fpl/inst/deprecated/FPL2pdesurf.m 000644 000765 000000 00000010167 12010454601 017422 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2004-2008,2009 Carlo de Falco, Massimiliano Culpo
##
## This file is part of
##
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
##
## AUTHORS:
## Carlo de Falco
##
## Culpo Massimiliano
## Bergische Universitaet Wuppertal
## Fachbereich C - Mathematik und Naturwissenschaften
## Arbeitsgruppe fuer Angewandte MathematD-42119 Wuppertal Gaussstr. 20
## D-42119 Wuppertal, Germany
## -*- texinfo -*-
## @deftypefn {Function File} {} FPL2pdesurf (@var{mesh}, @
## @var{u} [ @var{property}, @var{value} ...])
##
## plots the scalar field @var{u}
## defined on the triangulation @var{mesh} using opendx.
##
## options (default value):
## @itemize @minus
## @item data_dep ("positions") defines wether data depends on
## positions or connections
## @item plot_field ("scalar") defines wether to plot the scalar field
## itself or its gradient
## @end itemize
##
## @seealso{MSH2Mgmsh, MSH2Mstructmesh}
## @end deftypefn
function FPL2pdesurf(varargin)
data_dep = "positions";
plot_field = "scalar";
if nargin == 1
FPL2showmesh(varargin{1});
elseif nargin == 2
mesh = varargin{1};
u = varargin{2};
elseif ( (nargin > 2) && (rem(nargin,2)==0) )
mesh = varargin{1};
u = varargin{2};
for ii=3:2:nargin
eval([ varargin{ii} " = """ varargin{ii+1} """;" ]);
endfor
else
keyboard ,error(["wrong number of parameters " num2str (nargin)])
endif
dataname = mktemp("/tmp",".dx");
scriptname = mktemp("/tmp",".net");
FPL2dxoutputdata(dataname,mesh.p,mesh.t,u,'u',0,1,1);
switch plot_field
case {"scalar","scal"}
showmesh = file_in_path(path,"FPL2coloredrubbersheet.net");
case {"gradient","grad"}
showmesh = file_in_path(path,"FPL2coloredgradient.net");
otherwise
error ([ "incorrect value " plot_field " for option plot_field "])
endswitch
system (["cp " showmesh " " scriptname]);
system (["sed -i \'s|__FILE__DX__|" dataname "|g\' " scriptname]);
switch data_dep
case {"positions","continuous","interpolate","P1"}
system (["sed -i \'s|__DATA_DEPENDENCY__|positions|g\' " scriptname]);
case {"connections","discontinuous","P0"}
system (["sed -i \'s|__DATA_DEPENDENCY__|positions|g\' " scriptname]);
otherwise
error ([ "incorrect value " data_dep " for option data_dep "])
endswitch
##command = ["dx -noConfirmedQuit -noImageRWNetFile -program " scriptname " -execute -image >& /dev/null & "];
command = ["dx -noConfirmedQuit -program " scriptname " -execute -image >& /dev/null & "];
system(command);
endfunction
function filename = mktemp (direct,ext);
if (~exist(direct,"dir"))
error("trying to save temporary file to non existing directory")
endif
done=false;
while ~done
filename = [direct,"/FPL.",num2str(floor(rand*1e7)),ext];
if ~exist(filename,"file")
done =true;
endif
endwhile
endfunction
%!shared msh
%!test
%! msh.p = [0 0; 1 0; 1 1; 0 1].';
%! msh.t = [1 2 3 1; 1 3 4 1].';
%! msh.e = [1 2 0 0 1 0 1; 2 3 0 0 2 0 1; 3 4 0 0 3 0 1; 4 1 0 0 4 0 1].';
%! u = [0 1].';
%! FPL2pdesurf (msh, u, "data_dep", "connections");
%! s = input ("do you see a square divided into two triangles with a diagonal red-to-blue gradient color (if you see an empty plot try ctrl-F)? (y/n): " ,"s");
%! assert(s, "y")
%!test
%! v = [0 0 1 1].';
%! FPL2pdesurf (msh, v);
%! s = input ("do you see a square divided into two triangles with a vertical red-to-blue gradient color (if you see an empty plot try ctrl-F)? (y/n): " ,"s");
fpl/inst/deprecated/FPL2ptcquiver.m 000644 000765 000000 00000005073 12010454601 017774 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2004-2008 Carlo de Falco, Massimiliano Culpo
##
## This file is part of
##
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
##
## AUTHORS:
## Carlo de Falco
##
## Culpo Massimiliano
## Bergische Universitaet Wuppertal
## Fachbereich C - Mathematik und Naturwissenschaften
## Arbeitsgruppe fuer Angewandte MathematD-42119 Wuppertal Gaussstr. 20
## D-42119 Wuppertal, Germany
## -*- texinfo -*-
## @deftypefn {Function File} {} FPL2ptcquiver (@var{mesh1}, @var{color1}
## @var{vx1}, @var{vy1}, [ @var{mesh2}, @var{color2}, @var{vx2}, @var{vy2} ...])
##
## Plots the 2D vector fields @var{vx}, @var{vy}
## defined on the triangulations @var{mesh} using opendx.
##
##
## @seealso{FPL2pdesurf, FPL2ptcsurf, FPL2pdequiver}
## @end deftypefn
function FPL2ptcquiver(varargin)
colorlist = "";
datalist = "";
for ii = 1:4:nargin
dataname{ii} = mktemp("/tmp",".dx");
JX = sum(varargin{ii+2},1)'/3;
JY = sum(varargin{ii+3},1)'/3;
FPL2dxoutputdata(dataname{ii},varargin{ii}.p,varargin{ii}.t,[ JX JY],'J',1,2,1);
datalist = strcat (datalist, """", dataname{ii} , """");
colorlist= strcat (colorlist, """", varargin{ii+1} , """");
endfor
scriptname = mktemp("/tmp",".net");
view = file_in_path(path,"FPL2ptcquiver.net");
system (["cp " view " " scriptname]);
system (["sed -i \'s|""FILELIST""|" datalist "|g\' " scriptname]);
system (["sed -i \'s|""COLORLIST""|" colorlist "|g\' " scriptname]);
command = ["dx -noConfirmedQuit -program " scriptname " -execute -image >& /dev/null & "];
system(command);
endfunction
function filename = mktemp (direct,ext);
if (~exist(direct,"dir"))
error("trying to save temporary file to non existing directory")
endif
done=false;
while ~done
filename = [direct,"/FPL.",num2str(floor(rand*1e7)),ext];
if ~exist(filename,"file")
done =true;
endif
endwhile
endfunction
fpl/inst/deprecated/FPL2ptcquiver.net 000644 000765 000000 00000044554 12007306463 020345 0 ustar 00carlo wheel 000000 000000 //
// time: Mon Jan 7 11:37:04 2008
//
// version: 3.2.0 (format), 4.4.4 (DX)
//
//
// MODULE main
// workspace: width = 875, height = 996
// layout: snap = 1, width = 10, height = 10, align = CC
//
macro main(
) -> (
) {
//
// node CollectMultiGrid[1]: x = 125, y = 584, inputs = 4, label = CollectMultiGrid
//
main_CollectMultiGrid_1_out_1 =
CollectMultiGrid(
main_CollectMultiGrid_1_in_1,
main_CollectMultiGrid_1_in_2,
main_CollectMultiGrid_1_in_3,
main_CollectMultiGrid_1_in_4
) [instance: 1, cache: 1];
//
// node StringList[1]: x = 478, y = 14, inputs = 0, label = StringList
// output[1]: visible = 1, type = 16777248, value = { "FILELIST" }
//
//
// node ForEachMember[1]: x = 455, y = 94, inputs = 1, label = ForEachMember
//
main_ForEachMember_1_out_1,
main_ForEachMember_1_out_2,
main_ForEachMember_1_out_3 =
ForEachMember(
main_StringList_1_out_1
) [instance: 1, cache: 1];
//
// node Import[1]: x = 479, y = 194, inputs = 6, label = Import
//
main_Import_1_out_1 =
Import(
main_ForEachMember_1_out_1,
main_Import_1_in_2,
main_Import_1_in_3,
main_Import_1_in_4,
main_Import_1_in_5,
main_Import_1_in_6
) [instance: 1, cache: 1];
//
// node ShowConnections[1]: x = 239, y = 384, inputs = 1, label = ShowConnections
//
main_ShowConnections_1_out_1 =
ShowConnections(
main_Import_1_out_1
) [instance: 1, cache: 1];
//
// node StringList[2]: x = 418, y = 384, inputs = 0, label = StringList
// output[1]: visible = 1, type = 16777248, value = { "COLORLIST" }
//
//
// node ForEachMember[2]: x = 395, y = 474, inputs = 1, label = ForEachMember
//
main_ForEachMember_2_out_1,
main_ForEachMember_2_out_2,
main_ForEachMember_2_out_3 =
ForEachMember(
main_StringList_2_out_1
) [instance: 2, cache: 1];
//
// node Color[1]: x = 289, y = 584, inputs = 5, label = Color
//
main_Color_1_out_1 =
Color(
main_ShowConnections_1_out_1,
main_ForEachMember_2_out_1,
main_Color_1_in_3,
main_Color_1_in_4,
main_Color_1_in_5
) [instance: 1, cache: 1];
//
// node GetLocal[1]: x = 452, y = 614, inputs = 3, label = GetLocal
//
main_GetLocal_1_out_1,
main_GetLocal_1_out_2 =
GetLocal(
main_GetLocal_1_in_1,
main_GetLocal_1_in_2,
main_GetLocal_1_in_3
) [instance: 1, cache: 1];
//
// node Append[1]: x = 285, y = 724, inputs = 5, label = Append
//
main_Append_1_out_1 =
Append(
main_CollectMultiGrid_1_out_1,
main_Color_1_out_1,
main_Append_1_in_3,
main_GetLocal_1_out_1,
main_Append_1_in_5
) [instance: 1, cache: 1];
//
// node GetLocal[2]: x = 802, y = 264, inputs = 3, label = GetLocal
//
main_GetLocal_2_out_1,
main_GetLocal_2_out_2 =
GetLocal(
main_GetLocal_2_in_1,
main_GetLocal_2_in_2,
main_GetLocal_2_in_3
) [instance: 2, cache: 1];
//
// node Append[2]: x = 595, y = 384, inputs = 5, label = Append
//
main_Append_2_out_1 =
Append(
main_CollectMultiGrid_1_out_1,
main_Import_1_out_1,
main_Append_2_in_3,
main_GetLocal_2_out_1,
main_Append_2_in_5
) [instance: 2, cache: 1];
//
// node Sample[1]: x = 627, y = 474, inputs = 2, label = Sample
//
main_Sample_1_out_1 =
Sample(
main_Append_2_out_1,
main_Sample_1_in_2
) [instance: 1, cache: 1];
//
// node AutoGlyph[1]: x = 625, y = 544, inputs = 7, label = AutoGlyph
//
main_AutoGlyph_1_out_1 =
AutoGlyph(
main_Sample_1_out_1,
main_AutoGlyph_1_in_2,
main_AutoGlyph_1_in_3,
main_AutoGlyph_1_in_4,
main_AutoGlyph_1_in_5,
main_AutoGlyph_1_in_6,
main_AutoGlyph_1_in_7
) [instance: 1, cache: 1];
//
// node AutoColor[1]: x = 626, y = 614, inputs = 10, label = AutoColor
// input[8]: visible = 1
//
main_AutoColor_1_out_1,
main_AutoColor_1_out_2 =
AutoColor(
main_AutoGlyph_1_out_1,
main_AutoColor_1_in_2,
main_AutoColor_1_in_3,
main_AutoColor_1_in_4,
main_AutoColor_1_in_5,
main_AutoColor_1_in_6,
main_AutoColor_1_in_7,
main_AutoColor_1_in_8,
main_AutoColor_1_in_9,
main_AutoColor_1_in_10
) [instance: 1, cache: 1];
//
// node ColorBar[1]: x = 755, y = 724, inputs = 16, label = ColorBar
//
main_ColorBar_1_out_1 =
ColorBar(
main_AutoColor_1_out_2,
main_ColorBar_1_in_2,
main_ColorBar_1_in_3,
main_ColorBar_1_in_4,
main_ColorBar_1_in_5,
main_ColorBar_1_in_6,
main_ColorBar_1_in_7,
main_ColorBar_1_in_8,
main_ColorBar_1_in_9,
main_ColorBar_1_in_10,
main_ColorBar_1_in_11,
main_ColorBar_1_in_12,
main_ColorBar_1_in_13,
main_ColorBar_1_in_14,
main_ColorBar_1_in_15,
main_ColorBar_1_in_16
) [instance: 1, cache: 1];
//
// node Collect[1]: x = 599, y = 844, inputs = 3, label = Collect
//
main_Collect_1_out_1 =
Collect(
main_Append_1_out_1,
main_AutoColor_1_out_1,
main_ColorBar_1_out_1
) [instance: 1, cache: 1];
//
// node Image[1]: x = 599, y = 934, inputs = 49, label = Image
// input[1]: defaulting = 0, visible = 0, type = 32, value = "Image_1"
// input[4]: defaulting = 0, visible = 0, type = 1, value = 0
// input[14]: defaulting = 0, visible = 0, type = 1, value = 1
// input[19]: defaulting = 0, visible = 0, type = 3, value = 0
// depth: value = 24
// internal caching: 1
//
main_Image_1_out_1,
main_Image_1_out_2,
main_Image_1_out_3 =
Image(
main_Image_1_in_1,
main_Collect_1_out_1,
main_Image_1_in_3,
main_Image_1_in_4,
main_Image_1_in_5,
main_Image_1_in_6,
main_Image_1_in_7,
main_Image_1_in_8,
main_Image_1_in_9,
main_Image_1_in_10,
main_Image_1_in_11,
main_Image_1_in_12,
main_Image_1_in_13,
main_Image_1_in_14,
main_Image_1_in_15,
main_Image_1_in_16,
main_Image_1_in_17,
main_Image_1_in_18,
main_Image_1_in_19,
main_Image_1_in_20,
main_Image_1_in_21,
main_Image_1_in_22,
main_Image_1_in_23,
main_Image_1_in_24,
main_Image_1_in_25,
main_Image_1_in_26,
main_Image_1_in_27,
main_Image_1_in_28,
main_Image_1_in_29,
main_Image_1_in_30,
main_Image_1_in_31,
main_Image_1_in_32,
main_Image_1_in_33,
main_Image_1_in_34,
main_Image_1_in_35,
main_Image_1_in_36,
main_Image_1_in_37,
main_Image_1_in_38,
main_Image_1_in_39,
main_Image_1_in_40,
main_Image_1_in_41,
main_Image_1_in_42,
main_Image_1_in_43,
main_Image_1_in_44,
main_Image_1_in_45,
main_Image_1_in_46,
main_Image_1_in_47,
main_Image_1_in_48,
main_Image_1_in_49
) [instance: 1, cache: 1];
//
// node SetLocal[1]: x = 462, y = 724, inputs = 3, label = SetLocal
//
SetLocal(
main_Append_1_out_1,
main_GetLocal_1_out_2,
main_SetLocal_1_in_3
) [instance: 1, cache: 1];
//
// node SetLocal[2]: x = 792, y = 384, inputs = 3, label = SetLocal
//
SetLocal(
main_Append_2_out_1,
main_GetLocal_2_out_2,
main_SetLocal_2_in_3
) [instance: 2, cache: 1];
// network: end of macro body
CacheScene(main_Image_1_in_1, main_Image_1_out_1, main_Image_1_out_2);
}
main_CollectMultiGrid_1_in_1 = NULL;
main_CollectMultiGrid_1_in_2 = NULL;
main_CollectMultiGrid_1_in_3 = NULL;
main_CollectMultiGrid_1_in_4 = NULL;
main_CollectMultiGrid_1_out_1 = NULL;
main_StringList_1_out_1 = { "FILELIST" };
main_ForEachMember_1_out_1 = NULL;
main_Import_1_in_2 = NULL;
main_Import_1_in_3 = NULL;
main_Import_1_in_4 = NULL;
main_Import_1_in_5 = NULL;
main_Import_1_in_6 = NULL;
main_Import_1_out_1 = NULL;
main_ShowConnections_1_out_1 = NULL;
main_StringList_2_out_1 = { "COLORLIST" };
main_ForEachMember_2_out_1 = NULL;
main_Color_1_in_3 = NULL;
main_Color_1_in_4 = NULL;
main_Color_1_in_5 = NULL;
main_Color_1_out_1 = NULL;
main_GetLocal_1_in_1 = NULL;
main_GetLocal_1_in_2 = NULL;
main_GetLocal_1_in_3 = NULL;
main_GetLocal_1_out_1 = NULL;
main_GetLocal_1_out_2 = NULL;
main_Append_1_in_3 = NULL;
main_Append_1_in_5 = NULL;
main_Append_1_out_1 = NULL;
main_GetLocal_2_in_1 = NULL;
main_GetLocal_2_in_2 = NULL;
main_GetLocal_2_in_3 = NULL;
main_GetLocal_2_out_1 = NULL;
main_GetLocal_2_out_2 = NULL;
main_Append_2_in_3 = NULL;
main_Append_2_in_5 = NULL;
main_Append_2_out_1 = NULL;
main_Sample_1_in_2 = NULL;
main_Sample_1_out_1 = NULL;
main_AutoGlyph_1_in_2 = NULL;
main_AutoGlyph_1_in_3 = NULL;
main_AutoGlyph_1_in_4 = NULL;
main_AutoGlyph_1_in_5 = NULL;
main_AutoGlyph_1_in_6 = NULL;
main_AutoGlyph_1_in_7 = NULL;
main_AutoGlyph_1_out_1 = NULL;
main_AutoColor_1_in_2 = NULL;
main_AutoColor_1_in_3 = NULL;
main_AutoColor_1_in_4 = NULL;
main_AutoColor_1_in_5 = NULL;
main_AutoColor_1_in_6 = NULL;
main_AutoColor_1_in_7 = NULL;
main_AutoColor_1_in_8 = NULL;
main_AutoColor_1_in_9 = NULL;
main_AutoColor_1_in_10 = NULL;
main_AutoColor_1_out_1 = NULL;
main_AutoColor_1_out_2 = NULL;
main_ColorBar_1_in_2 = NULL;
main_ColorBar_1_in_3 = NULL;
main_ColorBar_1_in_4 = NULL;
main_ColorBar_1_in_5 = NULL;
main_ColorBar_1_in_6 = NULL;
main_ColorBar_1_in_7 = NULL;
main_ColorBar_1_in_8 = NULL;
main_ColorBar_1_in_9 = NULL;
main_ColorBar_1_in_10 = NULL;
main_ColorBar_1_in_11 = NULL;
main_ColorBar_1_in_12 = NULL;
main_ColorBar_1_in_13 = NULL;
main_ColorBar_1_in_14 = NULL;
main_ColorBar_1_in_15 = NULL;
main_ColorBar_1_in_16 = NULL;
main_ColorBar_1_out_1 = NULL;
main_Collect_1_out_1 = NULL;
macro Image(
id,
object,
where,
useVector,
to,
from,
width,
resolution,
aspect,
up,
viewAngle,
perspective,
options,
buttonState = 1,
buttonUpApprox = "none",
buttonDownApprox = "none",
buttonUpDensity = 1,
buttonDownDensity = 1,
renderMode = 0,
defaultCamera,
reset,
backgroundColor,
throttle,
RECenable = 0,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable = 0,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
interactionMode,
title,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
webOptions) -> (
object,
camera,
where)
{
ImageMessage(
id,
backgroundColor,
throttle,
RECenable,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
interactionMode,
title,
renderMode,
buttonUpApprox,
buttonDownApprox,
buttonUpDensity,
buttonDownDensity) [instance: 1, cache: 1];
autoCamera =
AutoCamera(
object,
"front",
object,
resolution,
aspect,
[0,1,0],
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
realCamera =
Camera(
to,
from,
width,
resolution,
aspect,
up,
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
coloredDefaultCamera =
UpdateCamera(defaultCamera,
background=backgroundColor) [instance: 1, cache: 1];
nullDefaultCamera =
Inquire(defaultCamera,
"is null + 1") [instance: 1, cache: 1];
resetCamera =
Switch(
nullDefaultCamera,
coloredDefaultCamera,
autoCamera) [instance: 1, cache: 1];
resetNull =
Inquire(
reset,
"is null + 1") [instance: 2, cache: 1];
reset =
Switch(
resetNull,
reset,
0) [instance: 2, cache: 1];
whichCamera =
Compute(
"($0 != 0 || $1 == 0) ? 1 : 2",
reset,
useVector) [instance: 1, cache: 1];
camera = Switch(
whichCamera,
resetCamera,
realCamera) [instance: 3, cache: 1];
AAobject =
AutoAxes(
object,
camera,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels) [instance: 1, cache: 1];
switchAAenable = Compute("$0+1",
AAenable) [instance: 2, cache: 1];
object = Switch(
switchAAenable,
object,
AAobject) [instance:4, cache: 1];
SWapproximation_options =
Switch(
buttonState,
buttonUpApprox,
buttonDownApprox) [instance: 5, cache: 1];
SWdensity_options =
Switch(
buttonState,
buttonUpDensity,
buttonDownDensity) [instance: 6, cache: 1];
HWapproximation_options =
Format(
"%s,%s",
buttonDownApprox,
buttonUpApprox) [instance: 1, cache: 1];
HWdensity_options =
Format(
"%d,%d",
buttonDownDensity,
buttonUpDensity) [instance: 2, cache: 1];
switchRenderMode = Compute(
"$0+1",
renderMode) [instance: 3, cache: 1];
approximation_options = Switch(
switchRenderMode,
SWapproximation_options,
HWapproximation_options) [instance: 7, cache: 1];
density_options = Switch(
switchRenderMode,
SWdensity_options,
HWdensity_options) [instance: 8, cache: 1];
renderModeString = Switch(
switchRenderMode,
"software",
"hardware")[instance: 9, cache: 1];
object_tag = Inquire(
object,
"object tag")[instance: 3, cache: 1];
annoted_object =
Options(
object,
"send boxes",
0,
"cache",
1,
"object tag",
object_tag,
"ddcamera",
whichCamera,
"rendering approximation",
approximation_options,
"render every",
density_options,
"button state",
buttonState,
"rendering mode",
renderModeString) [instance: 1, cache: 1];
RECresNull =
Inquire(
RECresolution,
"is null + 1") [instance: 4, cache: 1];
ImageResolution =
Inquire(
camera,
"camera resolution") [instance: 5, cache: 1];
RECresolution =
Switch(
RECresNull,
RECresolution,
ImageResolution) [instance: 10, cache: 1];
RECaspectNull =
Inquire(
RECaspect,
"is null + 1") [instance: 6, cache: 1];
ImageAspect =
Inquire(
camera,
"camera aspect") [instance: 7, cache: 1];
RECaspect =
Switch(
RECaspectNull,
RECaspect,
ImageAspect) [instance: 11, cache: 1];
switchRECenable = Compute(
"$0 == 0 ? 1 : (($2 == $3) && ($4 == $5)) ? ($1 == 1 ? 2 : 3) : 4",
RECenable,
switchRenderMode,
RECresolution,
ImageResolution,
RECaspect,
ImageAspect) [instance: 4, cache: 1];
NoRECobject, RECNoRerenderObject, RECNoRerHW, RECRerenderObject = Route(switchRECenable, annoted_object);
Display(
NoRECobject,
camera,
where,
throttle) [instance: 1, cache: 1];
image =
Render(
RECNoRerenderObject,
camera) [instance: 1, cache: 1];
Display(
image,
NULL,
where,
throttle) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 1, cache: 1];
rec_where = Display(
RECNoRerHW,
camera,
where,
throttle) [instance: 1, cache: 0];
rec_image = ReadImageWindow(
rec_where) [instance: 1, cache: 1];
WriteImage(
rec_image,
RECfile,
RECformat) [instance: 1, cache: 1];
RECupdateCamera =
UpdateCamera(
camera,
resolution=RECresolution,
aspect=RECaspect) [instance: 2, cache: 1];
Display(
RECRerenderObject,
camera,
where,
throttle) [instance: 1, cache: 1];
RECRerenderObject =
ScaleScreen(
RECRerenderObject,
NULL,
RECresolution,
camera) [instance: 1, cache: 1];
image =
Render(
RECRerenderObject,
RECupdateCamera) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 2, cache: 1];
}
main_Image_1_in_1 = "Image_1";
main_Image_1_in_3 = "X24,,";
main_Image_1_in_4 = 0;
main_Image_1_in_5 = NULL;
main_Image_1_in_6 = NULL;
main_Image_1_in_7 = NULL;
main_Image_1_in_8 = NULL;
main_Image_1_in_9 = NULL;
main_Image_1_in_10 = NULL;
main_Image_1_in_11 = NULL;
main_Image_1_in_12 = NULL;
main_Image_1_in_13 = NULL;
main_Image_1_in_14 = 1;
main_Image_1_in_15 = NULL;
main_Image_1_in_16 = NULL;
main_Image_1_in_17 = NULL;
main_Image_1_in_18 = NULL;
main_Image_1_in_19 = 0;
main_Image_1_in_20 = NULL;
main_Image_1_in_21 = NULL;
main_Image_1_in_22 = NULL;
main_Image_1_in_23 = NULL;
main_Image_1_in_25 = NULL;
main_Image_1_in_26 = NULL;
main_Image_1_in_27 = NULL;
main_Image_1_in_28 = NULL;
main_Image_1_in_29 = NULL;
main_Image_1_in_30 = NULL;
main_Image_1_in_31 = NULL;
main_Image_1_in_32 = NULL;
main_Image_1_in_33 = NULL;
main_Image_1_in_34 = NULL;
main_Image_1_in_35 = NULL;
main_Image_1_in_36 = NULL;
main_Image_1_in_37 = NULL;
main_Image_1_in_38 = NULL;
main_Image_1_in_39 = NULL;
main_Image_1_in_40 = NULL;
main_Image_1_in_41 = NULL;
main_Image_1_in_42 = NULL;
main_Image_1_in_43 = NULL;
main_Image_1_in_44 = NULL;
main_Image_1_in_45 = NULL;
main_Image_1_in_46 = NULL;
main_Image_1_in_47 = NULL;
main_Image_1_in_48 = NULL;
main_Image_1_in_49 = NULL;
main_SetLocal_1_in_3 = NULL;
main_SetLocal_2_in_3 = NULL;
Executive("product version 4 4 4");
$sync
main();
fpl/inst/deprecated/FPL2ptcshowmesh.m 000644 000765 000000 00000004621 12010454601 020314 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2004-2008 Carlo de Falco, Massimiliano Culpo
##
## This file is part of
##
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
##
## AUTHORS:
## Carlo de Falco
##
## Culpo Massimiliano
## Bergische Universitaet Wuppertal
## Fachbereich C - Mathematik und Naturwissenschaften
## Arbeitsgruppe fuer Angewandte MathematD-42119 Wuppertal Gaussstr. 20
## D-42119 Wuppertal, Germany
## -*- texinfo -*-
## @deftypefn {Function File} {} FPL2ptcshowmesh (@var{mesh1}, @
## @var{color1}, @ [@var{mesh2}, @var{color2}, ...])
##
## Displays two or more 2-D triangulations using opendx
##
## @seealso{FPL2pdeshowmesh}
## @end deftypefn
function FPL2ptcshowmesh (varargin)
datalist = "";
colorlist= "";
for ii=1:2:nargin
dataname{ii} = mktemp("/tmp",".dx");
FPL2dxoutputdata(dataname{ii},varargin{ii}.p,varargin{ii}.t,...
varargin{ii}.p(1,:)','x',0,1,1);
datalist = strcat (datalist, """", dataname{ii} ,"""");
colorlist= strcat (colorlist, """", varargin{ii+1} ,"""");
endfor
scriptname = mktemp("/tmp",".net");
showmesh = file_in_path(path,"FPL2ptcshowmesh.net");
system (["cp " showmesh " " scriptname]);
system (["sed -i \'s|""FILELIST""|" datalist "|g\' " scriptname]);
system (["sed -i \'s|""COLORLIST""|" colorlist "|g\' " scriptname]);
command = ["dx -noConfirmedQuit -program " scriptname " -execute -image >& /dev/null & "];
system(command);
endfunction
function filename = mktemp (direct,ext);
if (~exist(direct,"dir"))
error("trying to save temporary file to non existing directory")
endif
done=false;
while ~done
filename = [direct,"/FPL.",num2str(floor(rand*1e7)),ext];
if ~exist(filename,"file")
done =true;
endif
endwhile
endfunction fpl/inst/deprecated/FPL2ptcshowmesh.net 000644 000765 000000 00000034772 12007306463 020670 0 ustar 00carlo wheel 000000 000000 //
// time: Sun Jan 6 13:50:14 2008
//
// version: 3.2.0 (format), 4.4.4 (DX)
//
//
// MODULE main
// workspace: width = 489, height = 756
// layout: snap = 1, width = 10, height = 10, align = CC
//
macro main(
) -> (
) {
//
// node CollectMultiGrid[1]: x = 55, y = 504, inputs = 4, label = CollectMultiGrid
//
main_CollectMultiGrid_1_out_1 =
CollectMultiGrid(
main_CollectMultiGrid_1_in_1,
main_CollectMultiGrid_1_in_2,
main_CollectMultiGrid_1_in_3,
main_CollectMultiGrid_1_in_4
) [instance: 1, cache: 1];
//
// node StringList[1]: x = 128, y = 34, inputs = 0, label = StringList
// output[1]: visible = 1, type = 16777248, value = { "FILELIST" }
//
//
// node ForEachMember[1]: x = 105, y = 134, inputs = 1, label = ForEachMember
//
main_ForEachMember_1_out_1,
main_ForEachMember_1_out_2,
main_ForEachMember_1_out_3 =
ForEachMember(
main_StringList_1_out_1
) [instance: 1, cache: 1];
//
// node Import[1]: x = 119, y = 244, inputs = 6, label = Import
//
main_Import_1_out_1 =
Import(
main_ForEachMember_1_out_1,
main_Import_1_in_2,
main_Import_1_in_3,
main_Import_1_in_4,
main_Import_1_in_5,
main_Import_1_in_6
) [instance: 1, cache: 1];
//
// node ShowConnections[1]: x = 89, y = 354, inputs = 1, label = ShowConnections
//
main_ShowConnections_1_out_1 =
ShowConnections(
main_Import_1_out_1
) [instance: 1, cache: 1];
//
// node StringList[2]: x = 278, y = 34, inputs = 0, label = StringList
// output[1]: visible = 1, type = 16777248, value = { "COLORLIST" }
//
//
// node ForEachMember[2]: x = 255, y = 134, inputs = 1, label = ForEachMember
//
main_ForEachMember_2_out_1,
main_ForEachMember_2_out_2,
main_ForEachMember_2_out_3 =
ForEachMember(
main_StringList_2_out_1
) [instance: 2, cache: 1];
//
// node Color[1]: x = 239, y = 454, inputs = 5, label = Color
//
main_Color_1_out_1 =
Color(
main_ShowConnections_1_out_1,
main_ForEachMember_2_out_1,
main_Color_1_in_3,
main_Color_1_in_4,
main_Color_1_in_5
) [instance: 1, cache: 1];
//
// node GetLocal[1]: x = 422, y = 494, inputs = 3, label = GetLocal
//
main_GetLocal_1_out_1,
main_GetLocal_1_out_2 =
GetLocal(
main_GetLocal_1_in_1,
main_GetLocal_1_in_2,
main_GetLocal_1_in_3
) [instance: 1, cache: 1];
//
// node Append[1]: x = 235, y = 574, inputs = 5, label = Append
//
main_Append_1_out_1 =
Append(
main_CollectMultiGrid_1_out_1,
main_Color_1_out_1,
main_Append_1_in_3,
main_GetLocal_1_out_1,
main_Append_1_in_5
) [instance: 1, cache: 1];
//
// node Image[1]: x = 249, y = 694, inputs = 49, label = Image
// input[1]: defaulting = 0, visible = 0, type = 32, value = "Image_1"
// input[4]: defaulting = 0, visible = 0, type = 1, value = 0
// input[14]: defaulting = 0, visible = 0, type = 1, value = 1
// input[19]: defaulting = 0, visible = 0, type = 3, value = 0
// depth: value = 24
// internal caching: 1
//
main_Image_1_out_1,
main_Image_1_out_2,
main_Image_1_out_3 =
Image(
main_Image_1_in_1,
main_Append_1_out_1,
main_Image_1_in_3,
main_Image_1_in_4,
main_Image_1_in_5,
main_Image_1_in_6,
main_Image_1_in_7,
main_Image_1_in_8,
main_Image_1_in_9,
main_Image_1_in_10,
main_Image_1_in_11,
main_Image_1_in_12,
main_Image_1_in_13,
main_Image_1_in_14,
main_Image_1_in_15,
main_Image_1_in_16,
main_Image_1_in_17,
main_Image_1_in_18,
main_Image_1_in_19,
main_Image_1_in_20,
main_Image_1_in_21,
main_Image_1_in_22,
main_Image_1_in_23,
main_Image_1_in_24,
main_Image_1_in_25,
main_Image_1_in_26,
main_Image_1_in_27,
main_Image_1_in_28,
main_Image_1_in_29,
main_Image_1_in_30,
main_Image_1_in_31,
main_Image_1_in_32,
main_Image_1_in_33,
main_Image_1_in_34,
main_Image_1_in_35,
main_Image_1_in_36,
main_Image_1_in_37,
main_Image_1_in_38,
main_Image_1_in_39,
main_Image_1_in_40,
main_Image_1_in_41,
main_Image_1_in_42,
main_Image_1_in_43,
main_Image_1_in_44,
main_Image_1_in_45,
main_Image_1_in_46,
main_Image_1_in_47,
main_Image_1_in_48,
main_Image_1_in_49
) [instance: 1, cache: 1];
//
// node SetLocal[1]: x = 422, y = 644, inputs = 3, label = SetLocal
//
SetLocal(
main_Append_1_out_1,
main_GetLocal_1_out_2,
main_SetLocal_1_in_3
) [instance: 1, cache: 1];
// network: end of macro body
CacheScene(main_Image_1_in_1, main_Image_1_out_1, main_Image_1_out_2);
}
main_CollectMultiGrid_1_in_1 = NULL;
main_CollectMultiGrid_1_in_2 = NULL;
main_CollectMultiGrid_1_in_3 = NULL;
main_CollectMultiGrid_1_in_4 = NULL;
main_CollectMultiGrid_1_out_1 = NULL;
main_StringList_1_out_1 = { "FILELIST" };
main_ForEachMember_1_out_1 = NULL;
main_Import_1_in_2 = NULL;
main_Import_1_in_3 = NULL;
main_Import_1_in_4 = NULL;
main_Import_1_in_5 = NULL;
main_Import_1_in_6 = NULL;
main_Import_1_out_1 = NULL;
main_ShowConnections_1_out_1 = NULL;
main_StringList_2_out_1 = { "COLORLIST" };
main_ForEachMember_2_out_1 = NULL;
main_Color_1_in_3 = NULL;
main_Color_1_in_4 = NULL;
main_Color_1_in_5 = NULL;
main_Color_1_out_1 = NULL;
main_GetLocal_1_in_1 = NULL;
main_GetLocal_1_in_2 = NULL;
main_GetLocal_1_in_3 = NULL;
main_GetLocal_1_out_1 = NULL;
main_GetLocal_1_out_2 = NULL;
main_Append_1_in_3 = NULL;
main_Append_1_in_5 = NULL;
main_Append_1_out_1 = NULL;
macro Image(
id,
object,
where,
useVector,
to,
from,
width,
resolution,
aspect,
up,
viewAngle,
perspective,
options,
buttonState = 1,
buttonUpApprox = "none",
buttonDownApprox = "none",
buttonUpDensity = 1,
buttonDownDensity = 1,
renderMode = 0,
defaultCamera,
reset,
backgroundColor,
throttle,
RECenable = 0,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable = 0,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
interactionMode,
title,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
webOptions) -> (
object,
camera,
where)
{
ImageMessage(
id,
backgroundColor,
throttle,
RECenable,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
interactionMode,
title,
renderMode,
buttonUpApprox,
buttonDownApprox,
buttonUpDensity,
buttonDownDensity) [instance: 1, cache: 1];
autoCamera =
AutoCamera(
object,
"front",
object,
resolution,
aspect,
[0,1,0],
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
realCamera =
Camera(
to,
from,
width,
resolution,
aspect,
up,
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
coloredDefaultCamera =
UpdateCamera(defaultCamera,
background=backgroundColor) [instance: 1, cache: 1];
nullDefaultCamera =
Inquire(defaultCamera,
"is null + 1") [instance: 1, cache: 1];
resetCamera =
Switch(
nullDefaultCamera,
coloredDefaultCamera,
autoCamera) [instance: 1, cache: 1];
resetNull =
Inquire(
reset,
"is null + 1") [instance: 2, cache: 1];
reset =
Switch(
resetNull,
reset,
0) [instance: 2, cache: 1];
whichCamera =
Compute(
"($0 != 0 || $1 == 0) ? 1 : 2",
reset,
useVector) [instance: 1, cache: 1];
camera = Switch(
whichCamera,
resetCamera,
realCamera) [instance: 3, cache: 1];
AAobject =
AutoAxes(
object,
camera,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels) [instance: 1, cache: 1];
switchAAenable = Compute("$0+1",
AAenable) [instance: 2, cache: 1];
object = Switch(
switchAAenable,
object,
AAobject) [instance:4, cache: 1];
SWapproximation_options =
Switch(
buttonState,
buttonUpApprox,
buttonDownApprox) [instance: 5, cache: 1];
SWdensity_options =
Switch(
buttonState,
buttonUpDensity,
buttonDownDensity) [instance: 6, cache: 1];
HWapproximation_options =
Format(
"%s,%s",
buttonDownApprox,
buttonUpApprox) [instance: 1, cache: 1];
HWdensity_options =
Format(
"%d,%d",
buttonDownDensity,
buttonUpDensity) [instance: 2, cache: 1];
switchRenderMode = Compute(
"$0+1",
renderMode) [instance: 3, cache: 1];
approximation_options = Switch(
switchRenderMode,
SWapproximation_options,
HWapproximation_options) [instance: 7, cache: 1];
density_options = Switch(
switchRenderMode,
SWdensity_options,
HWdensity_options) [instance: 8, cache: 1];
renderModeString = Switch(
switchRenderMode,
"software",
"hardware")[instance: 9, cache: 1];
object_tag = Inquire(
object,
"object tag")[instance: 3, cache: 1];
annoted_object =
Options(
object,
"send boxes",
0,
"cache",
1,
"object tag",
object_tag,
"ddcamera",
whichCamera,
"rendering approximation",
approximation_options,
"render every",
density_options,
"button state",
buttonState,
"rendering mode",
renderModeString) [instance: 1, cache: 1];
RECresNull =
Inquire(
RECresolution,
"is null + 1") [instance: 4, cache: 1];
ImageResolution =
Inquire(
camera,
"camera resolution") [instance: 5, cache: 1];
RECresolution =
Switch(
RECresNull,
RECresolution,
ImageResolution) [instance: 10, cache: 1];
RECaspectNull =
Inquire(
RECaspect,
"is null + 1") [instance: 6, cache: 1];
ImageAspect =
Inquire(
camera,
"camera aspect") [instance: 7, cache: 1];
RECaspect =
Switch(
RECaspectNull,
RECaspect,
ImageAspect) [instance: 11, cache: 1];
switchRECenable = Compute(
"$0 == 0 ? 1 : (($2 == $3) && ($4 == $5)) ? ($1 == 1 ? 2 : 3) : 4",
RECenable,
switchRenderMode,
RECresolution,
ImageResolution,
RECaspect,
ImageAspect) [instance: 4, cache: 1];
NoRECobject, RECNoRerenderObject, RECNoRerHW, RECRerenderObject = Route(switchRECenable, annoted_object);
Display(
NoRECobject,
camera,
where,
throttle) [instance: 1, cache: 1];
image =
Render(
RECNoRerenderObject,
camera) [instance: 1, cache: 1];
Display(
image,
NULL,
where,
throttle) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 1, cache: 1];
rec_where = Display(
RECNoRerHW,
camera,
where,
throttle) [instance: 1, cache: 0];
rec_image = ReadImageWindow(
rec_where) [instance: 1, cache: 1];
WriteImage(
rec_image,
RECfile,
RECformat) [instance: 1, cache: 1];
RECupdateCamera =
UpdateCamera(
camera,
resolution=RECresolution,
aspect=RECaspect) [instance: 2, cache: 1];
Display(
RECRerenderObject,
camera,
where,
throttle) [instance: 1, cache: 1];
RECRerenderObject =
ScaleScreen(
RECRerenderObject,
NULL,
RECresolution,
camera) [instance: 1, cache: 1];
image =
Render(
RECRerenderObject,
RECupdateCamera) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 2, cache: 1];
}
main_Image_1_in_1 = "Image_1";
main_Image_1_in_3 = "X24,,";
main_Image_1_in_4 = 0;
main_Image_1_in_5 = NULL;
main_Image_1_in_6 = NULL;
main_Image_1_in_7 = NULL;
main_Image_1_in_8 = NULL;
main_Image_1_in_9 = NULL;
main_Image_1_in_10 = NULL;
main_Image_1_in_11 = NULL;
main_Image_1_in_12 = NULL;
main_Image_1_in_13 = NULL;
main_Image_1_in_14 = 1;
main_Image_1_in_15 = NULL;
main_Image_1_in_16 = NULL;
main_Image_1_in_17 = NULL;
main_Image_1_in_18 = NULL;
main_Image_1_in_19 = 0;
main_Image_1_in_20 = NULL;
main_Image_1_in_21 = NULL;
main_Image_1_in_22 = NULL;
main_Image_1_in_23 = NULL;
main_Image_1_in_25 = NULL;
main_Image_1_in_26 = NULL;
main_Image_1_in_27 = NULL;
main_Image_1_in_28 = NULL;
main_Image_1_in_29 = NULL;
main_Image_1_in_30 = NULL;
main_Image_1_in_31 = NULL;
main_Image_1_in_32 = NULL;
main_Image_1_in_33 = NULL;
main_Image_1_in_34 = NULL;
main_Image_1_in_35 = NULL;
main_Image_1_in_36 = NULL;
main_Image_1_in_37 = NULL;
main_Image_1_in_38 = NULL;
main_Image_1_in_39 = NULL;
main_Image_1_in_40 = NULL;
main_Image_1_in_41 = NULL;
main_Image_1_in_42 = NULL;
main_Image_1_in_43 = NULL;
main_Image_1_in_44 = NULL;
main_Image_1_in_45 = NULL;
main_Image_1_in_46 = NULL;
main_Image_1_in_47 = NULL;
main_Image_1_in_48 = NULL;
main_Image_1_in_49 = NULL;
main_SetLocal_1_in_3 = NULL;
Executive("product version 4 4 4");
$sync
main();
fpl/inst/deprecated/FPL2ptcsurf.m 000644 000765 000000 00000004733 12010454601 017442 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2004-2008 Carlo de Falco, Massimiliano Culpo
##
## This file is part of
##
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
##
## AUTHORS:
## Carlo de Falco
##
## Culpo Massimiliano
## Bergische Universitaet Wuppertal
## Fachbereich C - Mathematik und Naturwissenschaften
## Arbeitsgruppe fuer Angewandte MathematD-42119 Wuppertal Gaussstr. 20
## D-42119 Wuppertal, Germany
## -*- texinfo -*-
##
## @deftypefn {Function File} {} FPL2ptcsurf (@var{mesh1}, @
## @var{color1}, @var{data1} @ [@var{mesh2}, @var{color2},@var{data2}])
##
## Plots the scalar fields @var{data} over the triangulation
## @var{mesh} using opendx. Connections will be displayed as defined
## in @var{color}.
##
## @end deftypefn
function FPL2ptcsurf(varargin)
colorlist = "";
datalist = "";
for ii=1:3:nargin
dataname{ii} = mktemp("/tmp",".dx");
FPL2dxoutputdata(dataname{ii},varargin{ii}.p,varargin{ii}.t,varargin{ii+2},"var",0,1,1);
datalist = strcat (datalist, """", dataname{ii} ,"""");
colorlist= strcat (colorlist, """", varargin{ii+1} ,"""");
endfor
scriptname = mktemp("/tmp",".net");
ptcview = file_in_path(path,"FPL2ptcsurf.net");
system (["cp " ptcview " " scriptname]);
system (["sed -i \'s|""FILELIST""|" datalist "|g\' " scriptname]);
system (["sed -i \'s|""COLORLIST""|" colorlist "|g\' " scriptname]);
command = ["dx -noConfirmedQuit -program " scriptname " -execute -image >& /dev/null & "];
system(command);
endfunction
function filename = mktemp (direct,ext);
if (~exist(direct,"dir"))
error("Trying to save temporary file to non existing directory")
endif
done = false;
while ~done
filename = [direct,"/FPL.",num2str(floor(rand*1e7)),ext];
if ~exist(filename,"file")
done = true;
endif
endwhile
endfunction fpl/inst/deprecated/FPL2ptcsurf.net 000644 000765 000000 00000047237 12007306463 020012 0 ustar 00carlo wheel 000000 000000 //
// time: Fri Jan 4 17:10:29 2008
//
// version: 3.2.0 (format), 4.4.4 (DX)
//
//
// MODULE main
// workspace: width = 968, height = 946
// layout: snap = 1, width = 10, height = 10, align = CC
//
macro main(
) -> (
) {
//
// node CollectMultiGrid[5]: x = 45, y = 424, inputs = 4, label = CollectMultiGrid
//
main_CollectMultiGrid_5_out_1 =
CollectMultiGrid(
main_CollectMultiGrid_5_in_1,
main_CollectMultiGrid_5_in_2,
main_CollectMultiGrid_5_in_3,
main_CollectMultiGrid_5_in_4
) [instance: 5, cache: 1];
//
// node StringList[1]: x = 178, y = 34, inputs = 0, label = StringList
// output[1]: visible = 1, type = 16777248, value = { "FILELIST" }
//
//
// node ForEachMember[1]: x = 155, y = 124, inputs = 1, label = ForEachMember
//
main_ForEachMember_1_out_1,
main_ForEachMember_1_out_2,
main_ForEachMember_1_out_3 =
ForEachMember(
main_StringList_1_out_1
) [instance: 1, cache: 1];
//
// node Import[2]: x = 169, y = 224, inputs = 6, label = Import
//
main_Import_2_out_1 =
Import(
main_ForEachMember_1_out_1,
main_Import_2_in_2,
main_Import_2_in_3,
main_Import_2_in_4,
main_Import_2_in_5,
main_Import_2_in_6
) [instance: 2, cache: 1];
//
// node ShowConnections[4]: x = 139, y = 324, inputs = 1, label = ShowConnections
//
main_ShowConnections_4_out_1 =
ShowConnections(
main_Import_2_out_1
) [instance: 4, cache: 1];
//
// node StringList[2]: x = 368, y = 34, inputs = 0, label = StringList
// output[1]: visible = 1, type = 16777248, value = { "COLORLIST" }
//
//
// node ForEachMember[2]: x = 345, y = 124, inputs = 1, label = ForEachMember
//
main_ForEachMember_2_out_1,
main_ForEachMember_2_out_2,
main_ForEachMember_2_out_3 =
ForEachMember(
main_StringList_2_out_1
) [instance: 2, cache: 1];
//
// node Color[3]: x = 179, y = 404, inputs = 5, label = Color
// input[3]: defaulting = 0, visible = 1, type = 5, value = .3
//
main_Color_3_out_1 =
Color(
main_ShowConnections_4_out_1,
main_ForEachMember_2_out_1,
main_Color_3_in_3,
main_Color_3_in_4,
main_Color_3_in_5
) [instance: 3, cache: 1];
//
// node GetLocal[4]: x = 322, y = 404, inputs = 3, label = GetLocal
//
main_GetLocal_4_out_1,
main_GetLocal_4_out_2 =
GetLocal(
main_GetLocal_4_in_1,
main_GetLocal_4_in_2,
main_GetLocal_4_in_3
) [instance: 4, cache: 1];
//
// node Append[1]: x = 185, y = 504, inputs = 5, label = Append
//
main_Append_1_out_1 =
Append(
main_CollectMultiGrid_5_out_1,
main_Color_3_out_1,
main_Append_1_in_3,
main_GetLocal_4_out_1,
main_Append_1_in_5
) [instance: 1, cache: 1];
//
// node CollectMultiGrid[4]: x = 615, y = 454, inputs = 4, label = CollectMultiGrid
//
main_CollectMultiGrid_4_out_1 =
CollectMultiGrid(
main_CollectMultiGrid_4_in_1,
main_CollectMultiGrid_4_in_2,
main_CollectMultiGrid_4_in_3,
main_CollectMultiGrid_4_in_4
) [instance: 4, cache: 1];
//
// node GetLocal[5]: x = 872, y = 394, inputs = 3, label = GetLocal
//
main_GetLocal_5_out_1,
main_GetLocal_5_out_2 =
GetLocal(
main_GetLocal_5_in_1,
main_GetLocal_5_in_2,
main_GetLocal_5_in_3
) [instance: 5, cache: 1];
//
// node Append[2]: x = 765, y = 514, inputs = 5, label = Append
//
main_Append_2_out_1 =
Append(
main_CollectMultiGrid_4_out_1,
main_Import_2_out_1,
main_Append_2_in_3,
main_GetLocal_5_out_1,
main_Append_2_in_5
) [instance: 2, cache: 1];
//
// node AutoColor[2]: x = 736, y = 604, inputs = 10, label = AutoColor
// input[8]: visible = 1
//
main_AutoColor_2_out_1,
main_AutoColor_2_out_2 =
AutoColor(
main_Append_2_out_1,
main_AutoColor_2_in_2,
main_AutoColor_2_in_3,
main_AutoColor_2_in_4,
main_AutoColor_2_in_5,
main_AutoColor_2_in_6,
main_AutoColor_2_in_7,
main_AutoColor_2_in_8,
main_AutoColor_2_in_9,
main_AutoColor_2_in_10
) [instance: 2, cache: 1];
//
// node RubberSheet[1]: x = 176, y = 624, inputs = 4, label = RubberSheet
//
main_RubberSheet_1_out_1 =
RubberSheet(
main_Append_1_out_1,
main_RubberSheet_1_in_2,
main_RubberSheet_1_in_3,
main_RubberSheet_1_in_4
) [instance: 1, cache: 1];
//
// node Shade[1]: x = 599, y = 654, inputs = 8, label = Shade
// input[2]: defaulting = 0, visible = 1, type = 3, value = 1
// input[3]: defaulting = 0, visible = 1, type = 32, value = "smooth"
//
main_Shade_1_out_1 =
Shade(
main_AutoColor_2_out_1,
main_Shade_1_in_2,
main_Shade_1_in_3,
main_Shade_1_in_4,
main_Shade_1_in_5,
main_Shade_1_in_6,
main_Shade_1_in_7,
main_Shade_1_in_8
) [instance: 1, cache: 1];
//
// node RubberSheet[2]: x = 526, y = 734, inputs = 4, label = RubberSheet
//
main_RubberSheet_2_out_1 =
RubberSheet(
main_Shade_1_out_1,
main_RubberSheet_2_in_2,
main_RubberSheet_2_in_3,
main_RubberSheet_2_in_4
) [instance: 2, cache: 1];
//
// node ColorBar[1]: x = 755, y = 734, inputs = 16, label = ColorBar
// input[4]: defaulting = 0, visible = 1, type = 3, value = 1
//
main_ColorBar_1_out_1 =
ColorBar(
main_AutoColor_2_out_2,
main_ColorBar_1_in_2,
main_ColorBar_1_in_3,
main_ColorBar_1_in_4,
main_ColorBar_1_in_5,
main_ColorBar_1_in_6,
main_ColorBar_1_in_7,
main_ColorBar_1_in_8,
main_ColorBar_1_in_9,
main_ColorBar_1_in_10,
main_ColorBar_1_in_11,
main_ColorBar_1_in_12,
main_ColorBar_1_in_13,
main_ColorBar_1_in_14,
main_ColorBar_1_in_15,
main_ColorBar_1_in_16
) [instance: 1, cache: 1];
//
// node Collect[1]: x = 349, y = 774, inputs = 3, label = Collect
//
main_Collect_1_out_1 =
Collect(
main_RubberSheet_1_out_1,
main_RubberSheet_2_out_1,
main_ColorBar_1_out_1
) [instance: 1, cache: 1];
//
// node Image[5]: x = 339, y = 884, inputs = 49, label = Image
// input[1]: defaulting = 0, visible = 0, type = 32, value = "Image_5"
// input[4]: defaulting = 0, visible = 0, type = 1, value = 0
// input[14]: defaulting = 0, visible = 0, type = 1, value = 1
// input[19]: defaulting = 0, visible = 0, type = 3, value = 0
// depth: value = 24
// internal caching: 1
//
main_Image_5_out_1,
main_Image_5_out_2,
main_Image_5_out_3 =
Image(
main_Image_5_in_1,
main_Collect_1_out_1,
main_Image_5_in_3,
main_Image_5_in_4,
main_Image_5_in_5,
main_Image_5_in_6,
main_Image_5_in_7,
main_Image_5_in_8,
main_Image_5_in_9,
main_Image_5_in_10,
main_Image_5_in_11,
main_Image_5_in_12,
main_Image_5_in_13,
main_Image_5_in_14,
main_Image_5_in_15,
main_Image_5_in_16,
main_Image_5_in_17,
main_Image_5_in_18,
main_Image_5_in_19,
main_Image_5_in_20,
main_Image_5_in_21,
main_Image_5_in_22,
main_Image_5_in_23,
main_Image_5_in_24,
main_Image_5_in_25,
main_Image_5_in_26,
main_Image_5_in_27,
main_Image_5_in_28,
main_Image_5_in_29,
main_Image_5_in_30,
main_Image_5_in_31,
main_Image_5_in_32,
main_Image_5_in_33,
main_Image_5_in_34,
main_Image_5_in_35,
main_Image_5_in_36,
main_Image_5_in_37,
main_Image_5_in_38,
main_Image_5_in_39,
main_Image_5_in_40,
main_Image_5_in_41,
main_Image_5_in_42,
main_Image_5_in_43,
main_Image_5_in_44,
main_Image_5_in_45,
main_Image_5_in_46,
main_Image_5_in_47,
main_Image_5_in_48,
main_Image_5_in_49
) [instance: 5, cache: 1];
//
// node SetLocal[4]: x = 322, y = 514, inputs = 3, label = SetLocal
//
SetLocal(
main_Append_1_out_1,
main_GetLocal_4_out_2,
main_SetLocal_4_in_3
) [instance: 4, cache: 1];
//
// node SetLocal[5]: x = 902, y = 514, inputs = 3, label = SetLocal
//
SetLocal(
main_Append_2_out_1,
main_GetLocal_5_out_2,
main_SetLocal_5_in_3
) [instance: 5, cache: 1];
// network: end of macro body
CacheScene(main_Image_5_in_1, main_Image_5_out_1, main_Image_5_out_2);
}
main_CollectMultiGrid_5_in_1 = NULL;
main_CollectMultiGrid_5_in_2 = NULL;
main_CollectMultiGrid_5_in_3 = NULL;
main_CollectMultiGrid_5_in_4 = NULL;
main_CollectMultiGrid_5_out_1 = NULL;
main_StringList_1_out_1 = { "FILELIST" };
main_ForEachMember_1_out_1 = NULL;
main_Import_2_in_2 = NULL;
main_Import_2_in_3 = NULL;
main_Import_2_in_4 = NULL;
main_Import_2_in_5 = NULL;
main_Import_2_in_6 = NULL;
main_Import_2_out_1 = NULL;
main_ShowConnections_4_out_1 = NULL;
main_StringList_2_out_1 = { "COLORLIST" };
main_ForEachMember_2_out_1 = NULL;
main_Color_3_in_3 = .3;
main_Color_3_in_4 = NULL;
main_Color_3_in_5 = NULL;
main_Color_3_out_1 = NULL;
main_GetLocal_4_in_1 = NULL;
main_GetLocal_4_in_2 = NULL;
main_GetLocal_4_in_3 = NULL;
main_GetLocal_4_out_1 = NULL;
main_GetLocal_4_out_2 = NULL;
main_Append_1_in_3 = NULL;
main_Append_1_in_5 = NULL;
main_Append_1_out_1 = NULL;
main_CollectMultiGrid_4_in_1 = NULL;
main_CollectMultiGrid_4_in_2 = NULL;
main_CollectMultiGrid_4_in_3 = NULL;
main_CollectMultiGrid_4_in_4 = NULL;
main_CollectMultiGrid_4_out_1 = NULL;
main_GetLocal_5_in_1 = NULL;
main_GetLocal_5_in_2 = NULL;
main_GetLocal_5_in_3 = NULL;
main_GetLocal_5_out_1 = NULL;
main_GetLocal_5_out_2 = NULL;
main_Append_2_in_3 = NULL;
main_Append_2_in_5 = NULL;
main_Append_2_out_1 = NULL;
main_AutoColor_2_in_2 = NULL;
main_AutoColor_2_in_3 = NULL;
main_AutoColor_2_in_4 = NULL;
main_AutoColor_2_in_5 = NULL;
main_AutoColor_2_in_6 = NULL;
main_AutoColor_2_in_7 = NULL;
main_AutoColor_2_in_8 = NULL;
main_AutoColor_2_in_9 = NULL;
main_AutoColor_2_in_10 = NULL;
main_AutoColor_2_out_1 = NULL;
main_AutoColor_2_out_2 = NULL;
main_RubberSheet_1_in_2 = NULL;
main_RubberSheet_1_in_3 = NULL;
main_RubberSheet_1_in_4 = NULL;
main_RubberSheet_1_out_1 = NULL;
main_Shade_1_in_2 = 1;
main_Shade_1_in_3 = "smooth";
main_Shade_1_in_4 = NULL;
main_Shade_1_in_5 = NULL;
main_Shade_1_in_6 = NULL;
main_Shade_1_in_7 = NULL;
main_Shade_1_in_8 = NULL;
main_Shade_1_out_1 = NULL;
main_RubberSheet_2_in_2 = NULL;
main_RubberSheet_2_in_3 = NULL;
main_RubberSheet_2_in_4 = NULL;
main_RubberSheet_2_out_1 = NULL;
main_ColorBar_1_in_2 = NULL;
main_ColorBar_1_in_3 = NULL;
main_ColorBar_1_in_4 = 1;
main_ColorBar_1_in_5 = NULL;
main_ColorBar_1_in_6 = NULL;
main_ColorBar_1_in_7 = NULL;
main_ColorBar_1_in_8 = NULL;
main_ColorBar_1_in_9 = NULL;
main_ColorBar_1_in_10 = NULL;
main_ColorBar_1_in_11 = NULL;
main_ColorBar_1_in_12 = NULL;
main_ColorBar_1_in_13 = NULL;
main_ColorBar_1_in_14 = NULL;
main_ColorBar_1_in_15 = NULL;
main_ColorBar_1_in_16 = NULL;
main_ColorBar_1_out_1 = NULL;
main_Collect_1_out_1 = NULL;
macro Image(
id,
object,
where,
useVector,
to,
from,
width,
resolution,
aspect,
up,
viewAngle,
perspective,
options,
buttonState = 1,
buttonUpApprox = "none",
buttonDownApprox = "none",
buttonUpDensity = 1,
buttonDownDensity = 1,
renderMode = 0,
defaultCamera,
reset,
backgroundColor,
throttle,
RECenable = 0,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable = 0,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
interactionMode,
title,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
webOptions) -> (
object,
camera,
where)
{
ImageMessage(
id,
backgroundColor,
throttle,
RECenable,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
interactionMode,
title,
renderMode,
buttonUpApprox,
buttonDownApprox,
buttonUpDensity,
buttonDownDensity) [instance: 1, cache: 1];
autoCamera =
AutoCamera(
object,
"front",
object,
resolution,
aspect,
[0,1,0],
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
realCamera =
Camera(
to,
from,
width,
resolution,
aspect,
up,
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
coloredDefaultCamera =
UpdateCamera(defaultCamera,
background=backgroundColor) [instance: 1, cache: 1];
nullDefaultCamera =
Inquire(defaultCamera,
"is null + 1") [instance: 1, cache: 1];
resetCamera =
Switch(
nullDefaultCamera,
coloredDefaultCamera,
autoCamera) [instance: 1, cache: 1];
resetNull =
Inquire(
reset,
"is null + 1") [instance: 2, cache: 1];
reset =
Switch(
resetNull,
reset,
0) [instance: 2, cache: 1];
whichCamera =
Compute(
"($0 != 0 || $1 == 0) ? 1 : 2",
reset,
useVector) [instance: 1, cache: 1];
camera = Switch(
whichCamera,
resetCamera,
realCamera) [instance: 3, cache: 1];
AAobject =
AutoAxes(
object,
camera,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels) [instance: 1, cache: 1];
switchAAenable = Compute("$0+1",
AAenable) [instance: 2, cache: 1];
object = Switch(
switchAAenable,
object,
AAobject) [instance:4, cache: 1];
SWapproximation_options =
Switch(
buttonState,
buttonUpApprox,
buttonDownApprox) [instance: 5, cache: 1];
SWdensity_options =
Switch(
buttonState,
buttonUpDensity,
buttonDownDensity) [instance: 6, cache: 1];
HWapproximation_options =
Format(
"%s,%s",
buttonDownApprox,
buttonUpApprox) [instance: 1, cache: 1];
HWdensity_options =
Format(
"%d,%d",
buttonDownDensity,
buttonUpDensity) [instance: 2, cache: 1];
switchRenderMode = Compute(
"$0+1",
renderMode) [instance: 3, cache: 1];
approximation_options = Switch(
switchRenderMode,
SWapproximation_options,
HWapproximation_options) [instance: 7, cache: 1];
density_options = Switch(
switchRenderMode,
SWdensity_options,
HWdensity_options) [instance: 8, cache: 1];
renderModeString = Switch(
switchRenderMode,
"software",
"hardware")[instance: 9, cache: 1];
object_tag = Inquire(
object,
"object tag")[instance: 3, cache: 1];
annoted_object =
Options(
object,
"send boxes",
0,
"cache",
1,
"object tag",
object_tag,
"ddcamera",
whichCamera,
"rendering approximation",
approximation_options,
"render every",
density_options,
"button state",
buttonState,
"rendering mode",
renderModeString) [instance: 1, cache: 1];
RECresNull =
Inquire(
RECresolution,
"is null + 1") [instance: 4, cache: 1];
ImageResolution =
Inquire(
camera,
"camera resolution") [instance: 5, cache: 1];
RECresolution =
Switch(
RECresNull,
RECresolution,
ImageResolution) [instance: 10, cache: 1];
RECaspectNull =
Inquire(
RECaspect,
"is null + 1") [instance: 6, cache: 1];
ImageAspect =
Inquire(
camera,
"camera aspect") [instance: 7, cache: 1];
RECaspect =
Switch(
RECaspectNull,
RECaspect,
ImageAspect) [instance: 11, cache: 1];
switchRECenable = Compute(
"$0 == 0 ? 1 : (($2 == $3) && ($4 == $5)) ? ($1 == 1 ? 2 : 3) : 4",
RECenable,
switchRenderMode,
RECresolution,
ImageResolution,
RECaspect,
ImageAspect) [instance: 4, cache: 1];
NoRECobject, RECNoRerenderObject, RECNoRerHW, RECRerenderObject = Route(switchRECenable, annoted_object);
Display(
NoRECobject,
camera,
where,
throttle) [instance: 1, cache: 1];
image =
Render(
RECNoRerenderObject,
camera) [instance: 1, cache: 1];
Display(
image,
NULL,
where,
throttle) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 1, cache: 1];
rec_where = Display(
RECNoRerHW,
camera,
where,
throttle) [instance: 1, cache: 0];
rec_image = ReadImageWindow(
rec_where) [instance: 1, cache: 1];
WriteImage(
rec_image,
RECfile,
RECformat) [instance: 1, cache: 1];
RECupdateCamera =
UpdateCamera(
camera,
resolution=RECresolution,
aspect=RECaspect) [instance: 2, cache: 1];
Display(
RECRerenderObject,
camera,
where,
throttle) [instance: 1, cache: 1];
RECRerenderObject =
ScaleScreen(
RECRerenderObject,
NULL,
RECresolution,
camera) [instance: 1, cache: 1];
image =
Render(
RECRerenderObject,
RECupdateCamera) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 2, cache: 1];
}
main_Image_5_in_1 = "Image_5";
main_Image_5_in_3 = "X24,,";
main_Image_5_in_4 = 0;
main_Image_5_in_5 = NULL;
main_Image_5_in_6 = NULL;
main_Image_5_in_7 = NULL;
main_Image_5_in_8 = NULL;
main_Image_5_in_9 = NULL;
main_Image_5_in_10 = NULL;
main_Image_5_in_11 = NULL;
main_Image_5_in_12 = NULL;
main_Image_5_in_13 = NULL;
main_Image_5_in_14 = 1;
main_Image_5_in_15 = NULL;
main_Image_5_in_16 = NULL;
main_Image_5_in_17 = NULL;
main_Image_5_in_18 = NULL;
main_Image_5_in_19 = 0;
main_Image_5_in_20 = NULL;
main_Image_5_in_21 = NULL;
main_Image_5_in_22 = NULL;
main_Image_5_in_23 = NULL;
main_Image_5_in_25 = NULL;
main_Image_5_in_26 = NULL;
main_Image_5_in_27 = NULL;
main_Image_5_in_28 = NULL;
main_Image_5_in_29 = NULL;
main_Image_5_in_30 = NULL;
main_Image_5_in_31 = NULL;
main_Image_5_in_32 = NULL;
main_Image_5_in_33 = NULL;
main_Image_5_in_34 = NULL;
main_Image_5_in_35 = NULL;
main_Image_5_in_36 = NULL;
main_Image_5_in_37 = NULL;
main_Image_5_in_38 = NULL;
main_Image_5_in_39 = NULL;
main_Image_5_in_40 = NULL;
main_Image_5_in_41 = NULL;
main_Image_5_in_42 = NULL;
main_Image_5_in_43 = NULL;
main_Image_5_in_44 = NULL;
main_Image_5_in_45 = NULL;
main_Image_5_in_46 = NULL;
main_Image_5_in_47 = NULL;
main_Image_5_in_48 = NULL;
main_Image_5_in_49 = NULL;
main_SetLocal_4_in_3 = NULL;
main_SetLocal_5_in_3 = NULL;
Executive("product version 4 4 4");
$sync
main();
fpl/inst/deprecated/FPL2showmesh.net 000644 000765 000000 00000040600 12007306463 020144 0 ustar 00carlo wheel 000000 000000 //
// time: Wed Jun 27 18:36:54 2007
//
// version: 3.2.0 (format), 4.4.4 (DX)
//
//
// MODULE main
// workspace: width = 464, height = 625
// layout: snap = 0, width = 50, height = 50, align = NN
//
macro main(
) -> (
) {
//
// node Collect[1]: x = 409, y = 272, inputs = 2, label = Collect
//
main_Collect_1_out_1 =
Collect(
main_Collect_1_in_1,
main_Collect_1_in_2
) [instance: 1, cache: 1];
//
// node GetLocal[1]: x = 308, y = 381, inputs = 3, label = GetLocal
//
main_GetLocal_1_out_1,
main_GetLocal_1_out_2 =
GetLocal(
main_Collect_1_out_1,
main_GetLocal_1_in_2,
main_GetLocal_1_in_3
) [instance: 1, cache: 1];
//
// node StringList[1]: x = 42, y = 74, inputs = 0, label = StringList
// output[1]: visible = 1, type = 16777248, value = {__FILE__DX__ }
//
//
// node ForEachMember[1]: x = 28, y = 151, inputs = 1, label = ForEachMember
//
main_ForEachMember_1_out_1,
main_ForEachMember_1_out_2,
main_ForEachMember_1_out_3 =
ForEachMember(
main_StringList_1_out_1
) [instance: 1, cache: 1];
//
// node Import[1]: x = 40, y = 234, inputs = 6, label = Import
//
main_Import_1_out_1 =
Import(
main_ForEachMember_1_out_1,
main_Import_1_in_2,
main_Import_1_in_3,
main_Import_1_in_4,
main_Import_1_in_5,
main_Import_1_in_6
) [instance: 1, cache: 1];
//
// node StringList[2]: x = 215, y = 61, inputs = 0, label = StringList
// output[1]: visible = 1, type = 16777248, value = { __MESH__COLOR__ }
//
//
// node ForEachMember[2]: x = 198, y = 159, inputs = 1, label = ForEachMember
//
main_ForEachMember_2_out_1,
main_ForEachMember_2_out_2,
main_ForEachMember_2_out_3 =
ForEachMember(
main_StringList_2_out_1
) [instance: 2, cache: 1];
//
// node Color[1]: x = 179, y = 312, inputs = 5, label = Color
// input[2]: defaulting = 1, visible = 1, type = 32, value = "indianred"
//
main_Color_1_out_1 =
Color(
main_Import_1_out_1,
main_ForEachMember_2_out_1,
main_Color_1_in_3,
main_Color_1_in_4,
main_Color_1_in_5
) [instance: 1, cache: 1];
//
// node ShowConnections[1]: x = 31, y = 354, inputs = 1, label = ShowConnections
//
main_ShowConnections_1_out_1 =
ShowConnections(
main_Color_1_out_1
) [instance: 1, cache: 1];
//
// node Append[1]: x = 60, y = 453, inputs = 5, label = Append
//
main_Append_1_out_1 =
Append(
main_GetLocal_1_out_1,
main_ShowConnections_1_out_1,
main_Append_1_in_3,
main_Append_1_in_4,
main_Append_1_in_5
) [instance: 1, cache: 1];
//
// node Image[1]: x = 153, y = 563, inputs = 49, label = Image
// input[1]: defaulting = 0, visible = 0, type = 67108863, value = "Image_1"
// input[4]: defaulting = 0, visible = 0, type = 1, value = 1
// input[5]: defaulting = 0, visible = 0, type = 8, value = [7.5 7.5 0]
// input[6]: defaulting = 0, visible = 0, type = 8, value = [7.5 7.5 39.3199]
// input[7]: defaulting = 0, visible = 0, type = 5, value = 21.0715
// input[8]: defaulting = 0, visible = 0, type = 1, value = 804
// input[9]: defaulting = 0, visible = 0, type = 5, value = 0.610075
// input[10]: defaulting = 0, visible = 0, type = 8, value = [0 1 0]
// input[11]: defaulting = 1, visible = 0, type = 5, value = 30.0
// input[12]: defaulting = 0, visible = 0, type = 1, value = 0
// input[14]: defaulting = 0, visible = 0, type = 1, value = 1
// input[15]: defaulting = 1, visible = 0, type = 32, value = "none"
// input[16]: defaulting = 1, visible = 0, type = 32, value = "none"
// input[17]: defaulting = 0, visible = 0, type = 1, value = 1
// input[18]: defaulting = 0, visible = 0, type = 1, value = 1
// input[19]: defaulting = 0, visible = 0, type = 1, value = 1
// input[22]: defaulting = 0, visible = 0, type = 32, value = "snow"
// input[25]: defaulting = 0, visible = 0, type = 32, value = "/Users/carlo/Desktop/COMSONDEMO/CoMSON DP/grid.tif"
// input[26]: defaulting = 0, visible = 0, type = 32, value = "tiff"
// input[29]: defaulting = 0, visible = 0, type = 3, value = 1
// input[31]: defaulting = 0, visible = 0, type = 1, value = -15
// input[33]: defaulting = 0, visible = 0, type = 3, value = 0
// input[34]: defaulting = 0, visible = 0, type = 3, value = 0
// input[37]: defaulting = 0, visible = 0, type = 16777248, value = {"clear", "grey5", "saddlebrown", "saddlebrown"}
// input[38]: defaulting = 0, visible = 0, type = 16777248, value = {"background", "grid", "ticks", "labels"}
// input[39]: defaulting = 0, visible = 0, type = 5, value = 0.7
// input[40]: defaulting = 0, visible = 0, type = 32, value = "roman_s"
// input[41]: defaulting = 0, visible = 0, type = 32, value = "none"
// depth: value = 24
// window: position = (0.2477,0.1272), size = 0.6391x0.6838, screen = 0
// internal caching: 1
//
main_Image_1_out_1,
main_Image_1_out_2,
main_Image_1_out_3 =
Image(
main_Image_1_in_1,
main_Append_1_out_1,
main_Image_1_in_3,
main_Image_1_in_4,
main_Image_1_in_5,
main_Image_1_in_6,
main_Image_1_in_7,
main_Image_1_in_8,
main_Image_1_in_9,
main_Image_1_in_10,
main_Image_1_in_11,
main_Image_1_in_12,
main_Image_1_in_13,
main_Image_1_in_14,
main_Image_1_in_15,
main_Image_1_in_16,
main_Image_1_in_17,
main_Image_1_in_18,
main_Image_1_in_19,
main_Image_1_in_20,
main_Image_1_in_21,
main_Image_1_in_22,
main_Image_1_in_23,
main_Image_1_in_24,
main_Image_1_in_25,
main_Image_1_in_26,
main_Image_1_in_27,
main_Image_1_in_28,
main_Image_1_in_29,
main_Image_1_in_30,
main_Image_1_in_31,
main_Image_1_in_32,
main_Image_1_in_33,
main_Image_1_in_34,
main_Image_1_in_35,
main_Image_1_in_36,
main_Image_1_in_37,
main_Image_1_in_38,
main_Image_1_in_39,
main_Image_1_in_40,
main_Image_1_in_41,
main_Image_1_in_42,
main_Image_1_in_43,
main_Image_1_in_44,
main_Image_1_in_45,
main_Image_1_in_46,
main_Image_1_in_47,
main_Image_1_in_48,
main_Image_1_in_49
) [instance: 1, cache: 1];
//
// node SetLocal[1]: x = 316, y = 471, inputs = 3, label = SetLocal
//
SetLocal(
main_Append_1_out_1,
main_GetLocal_1_out_2,
main_SetLocal_1_in_3
) [instance: 1, cache: 1];
// network: end of macro body
CacheScene(main_Image_1_in_1, main_Image_1_out_1, main_Image_1_out_2);
}
main_Collect_1_in_1 = NULL;
main_Collect_1_in_2 = NULL;
main_Collect_1_out_1 = NULL;
main_GetLocal_1_in_2 = NULL;
main_GetLocal_1_in_3 = NULL;
main_GetLocal_1_out_1 = NULL;
main_GetLocal_1_out_2 = NULL;
main_StringList_1_out_1 = {__FILE__DX__};
main_ForEachMember_1_out_1 = NULL;
main_Import_1_in_2 = NULL;
main_Import_1_in_3 = NULL;
main_Import_1_in_4 = NULL;
main_Import_1_in_5 = NULL;
main_Import_1_in_6 = NULL;
main_Import_1_out_1 = NULL;
main_StringList_2_out_1 = {__MESH__COLOR__ };
main_ForEachMember_2_out_1 = NULL;
main_Color_1_in_3 = NULL;
main_Color_1_in_4 = NULL;
main_Color_1_in_5 = NULL;
main_Color_1_out_1 = NULL;
main_ShowConnections_1_out_1 = NULL;
main_Append_1_in_3 = NULL;
main_Append_1_in_4 = NULL;
main_Append_1_in_5 = NULL;
main_Append_1_out_1 = NULL;
macro Image(
id,
object,
where,
useVector,
to,
from,
width,
resolution,
aspect,
up,
viewAngle,
perspective,
options,
buttonState = 1,
buttonUpApprox = "none",
buttonDownApprox = "none",
buttonUpDensity = 1,
buttonDownDensity = 1,
renderMode = 0,
defaultCamera,
reset,
backgroundColor,
throttle,
RECenable = 0,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable = 0,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
interactionMode,
title,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
webOptions) -> (
object,
camera,
where)
{
ImageMessage(
id,
backgroundColor,
throttle,
RECenable,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
interactionMode,
title,
renderMode,
buttonUpApprox,
buttonDownApprox,
buttonUpDensity,
buttonDownDensity) [instance: 1, cache: 1];
autoCamera =
AutoCamera(
object,
"front",
object,
resolution,
aspect,
[0,1,0],
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
realCamera =
Camera(
to,
from,
width,
resolution,
aspect,
up,
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
coloredDefaultCamera =
UpdateCamera(defaultCamera,
background=backgroundColor) [instance: 1, cache: 1];
nullDefaultCamera =
Inquire(defaultCamera,
"is null + 1") [instance: 1, cache: 1];
resetCamera =
Switch(
nullDefaultCamera,
coloredDefaultCamera,
autoCamera) [instance: 1, cache: 1];
resetNull =
Inquire(
reset,
"is null + 1") [instance: 2, cache: 1];
reset =
Switch(
resetNull,
reset,
0) [instance: 2, cache: 1];
whichCamera =
Compute(
"($0 != 0 || $1 == 0) ? 1 : 2",
reset,
useVector) [instance: 1, cache: 1];
camera = Switch(
whichCamera,
resetCamera,
realCamera) [instance: 3, cache: 1];
AAobject =
AutoAxes(
object,
camera,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels) [instance: 1, cache: 1];
switchAAenable = Compute("$0+1",
AAenable) [instance: 2, cache: 1];
object = Switch(
switchAAenable,
object,
AAobject) [instance:4, cache: 1];
SWapproximation_options =
Switch(
buttonState,
buttonUpApprox,
buttonDownApprox) [instance: 5, cache: 1];
SWdensity_options =
Switch(
buttonState,
buttonUpDensity,
buttonDownDensity) [instance: 6, cache: 1];
HWapproximation_options =
Format(
"%s,%s",
buttonDownApprox,
buttonUpApprox) [instance: 1, cache: 1];
HWdensity_options =
Format(
"%d,%d",
buttonDownDensity,
buttonUpDensity) [instance: 2, cache: 1];
switchRenderMode = Compute(
"$0+1",
renderMode) [instance: 3, cache: 1];
approximation_options = Switch(
switchRenderMode,
SWapproximation_options,
HWapproximation_options) [instance: 7, cache: 1];
density_options = Switch(
switchRenderMode,
SWdensity_options,
HWdensity_options) [instance: 8, cache: 1];
renderModeString = Switch(
switchRenderMode,
"software",
"hardware")[instance: 9, cache: 1];
object_tag = Inquire(
object,
"object tag")[instance: 3, cache: 1];
annoted_object =
Options(
object,
"send boxes",
0,
"cache",
1,
"object tag",
object_tag,
"ddcamera",
whichCamera,
"rendering approximation",
approximation_options,
"render every",
density_options,
"button state",
buttonState,
"rendering mode",
renderModeString) [instance: 1, cache: 1];
RECresNull =
Inquire(
RECresolution,
"is null + 1") [instance: 4, cache: 1];
ImageResolution =
Inquire(
camera,
"camera resolution") [instance: 5, cache: 1];
RECresolution =
Switch(
RECresNull,
RECresolution,
ImageResolution) [instance: 10, cache: 1];
RECaspectNull =
Inquire(
RECaspect,
"is null + 1") [instance: 6, cache: 1];
ImageAspect =
Inquire(
camera,
"camera aspect") [instance: 7, cache: 1];
RECaspect =
Switch(
RECaspectNull,
RECaspect,
ImageAspect) [instance: 11, cache: 1];
switchRECenable = Compute(
"$0 == 0 ? 1 : (($2 == $3) && ($4 == $5)) ? ($1 == 1 ? 2 : 3) : 4",
RECenable,
switchRenderMode,
RECresolution,
ImageResolution,
RECaspect,
ImageAspect) [instance: 4, cache: 1];
NoRECobject, RECNoRerenderObject, RECNoRerHW, RECRerenderObject = Route(switchRECenable, annoted_object);
Display(
NoRECobject,
camera,
where,
throttle) [instance: 1, cache: 1];
image =
Render(
RECNoRerenderObject,
camera) [instance: 1, cache: 1];
Display(
image,
NULL,
where,
throttle) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 1, cache: 1];
rec_where = Display(
RECNoRerHW,
camera,
where,
throttle) [instance: 1, cache: 0];
rec_image = ReadImageWindow(
rec_where) [instance: 1, cache: 1];
WriteImage(
rec_image,
RECfile,
RECformat) [instance: 1, cache: 1];
RECupdateCamera =
UpdateCamera(
camera,
resolution=RECresolution,
aspect=RECaspect) [instance: 2, cache: 1];
Display(
RECRerenderObject,
camera,
where,
throttle) [instance: 1, cache: 1];
RECRerenderObject =
ScaleScreen(
RECRerenderObject,
NULL,
RECresolution,
camera) [instance: 1, cache: 1];
image =
Render(
RECRerenderObject,
RECupdateCamera) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 2, cache: 1];
}
main_Image_1_in_1 = "Image_1";
main_Image_1_in_3 = "X24,,";
main_Image_1_in_4 = 1;
main_Image_1_in_5 = [7.5 7.5 0];
main_Image_1_in_6 = [7.5 7.5 39.3199];
main_Image_1_in_7 = 21.0715;
main_Image_1_in_8 = 804;
main_Image_1_in_9 = 0.610075;
main_Image_1_in_10 = [0 1 0];
main_Image_1_in_11 = NULL;
main_Image_1_in_12 = 0;
main_Image_1_in_13 = NULL;
main_Image_1_in_14 = 1;
main_Image_1_in_15 = NULL;
main_Image_1_in_16 = NULL;
main_Image_1_in_17 = 1;
main_Image_1_in_18 = 1;
main_Image_1_in_19 = 1;
main_Image_1_in_20 = NULL;
main_Image_1_in_21 = NULL;
main_Image_1_in_22 = "snow";
main_Image_1_in_23 = NULL;
main_Image_1_in_25 = "/Users/carlo/Desktop/COMSONDEMO/CoMSON DP/grid.tif";
main_Image_1_in_26 = "tiff";
main_Image_1_in_27 = NULL;
main_Image_1_in_28 = NULL;
main_Image_1_in_29 = 1;
main_Image_1_in_30 = NULL;
main_Image_1_in_31 = -15;
main_Image_1_in_32 = NULL;
main_Image_1_in_33 = 0;
main_Image_1_in_34 = 0;
main_Image_1_in_35 = NULL;
main_Image_1_in_36 = NULL;
main_Image_1_in_37 = {"clear", "grey5", "saddlebrown", "saddlebrown"};
main_Image_1_in_38 = {"background", "grid", "ticks", "labels"};
main_Image_1_in_39 = 0.7;
main_Image_1_in_40 = "roman_s";
main_Image_1_in_41 = "none";
main_Image_1_in_42 = NULL;
main_Image_1_in_43 = NULL;
main_Image_1_in_44 = NULL;
main_Image_1_in_45 = NULL;
main_Image_1_in_46 = NULL;
main_Image_1_in_47 = NULL;
main_Image_1_in_48 = NULL;
main_Image_1_in_49 = NULL;
main_SetLocal_1_in_3 = NULL;
Executive("product version 4 4 4");
$sync
main();
fpl/inst/deprecated/FPL2trspdesurf.m 000644 000765 000000 00000004711 12010454601 020151 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2004-2008 Carlo de Falco, Massimiliano Culpo
##
## This file is part of
##
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
##
## AUTHORS:
## Carlo de Falco
##
## Culpo Massimiliano
## Bergische Universitaet Wuppertal
## Fachbereich C - Mathematik und Naturwissenschaften
## Arbeitsgruppe fuer Angewandte MathematD-42119 Wuppertal Gaussstr. 20
## D-42119 Wuppertal, Germany
## -*- texinfo -*-
## @deftypefn {Function File} {} FPL2trspdesurf (@var{mesh}, @
## @var{color}, @var{data})
##
## Plots the transient scalar field @var{u} defined on the triangulation
## @var{mesh} using opendx. Connections are rendered as defined by
## @var{color}
##
## Example:
## @example
##
## FPL2trspdesurf(mesh,"blue",data)
##
## @end example
## @seealso{FPL2pdesurf, FPL2ptcsurf, FPL2trsptcsurf}
## @end deftypefn
function FPL2trspdesurf(varargin)
seriesend = columns(varargin{3});
dataname = mktemp("/tmp",".dx");
colorname = varargin{2};
FPL2dxoutputtimeseries(dataname, varargin{1}.p, varargin{1}.t, \
varargin{3}, "dataseries", 0, 1, 1:seriesend);
scriptname = mktemp("/tmp",".net");
view = file_in_path(path,"FPL2trspdesurf.net");
system (["cp " view " " scriptname]);
system (["sed -i \'s|FILENAME|" dataname "|g\' " scriptname]);
system (["sed -i \'s|COLORNAME|" colorname "|g\' " scriptname]);
command = ["dx -noConfirmedQuit -program " scriptname " -execute -image >& /dev/null & "];
system(command);
endfunction
function filename = mktemp (direct,ext);
if (~exist(direct,"dir"))
error("Trying to save temporary file to non existing directory")
endif
done = false;
while ~done
filename = [direct,"/FPL.",num2str(floor(rand*1e7)),ext];
if ~exist(filename,"file")
done = true;
endif
endwhile
endfunction fpl/inst/deprecated/FPL2trspdesurf.net 000644 000765 000000 00000044765 12007306463 020530 0 ustar 00carlo wheel 000000 000000 //
// time: Sat Jan 5 19:47:19 2008
//
// version: 3.2.0 (format), 4.4.4 (DX)
//
//
// MODULE main
// workspace: width = 1161, height = 826
// layout: snap = 1, width = 10, height = 10, align = CC
//
macro main(
) -> (
) {
//
// node String[1]: x = 281, y = 24, inputs = 0, label = String
// output[1]: visible = 1, type = 32, value = "FILENAME"
//
//
// node Import[1]: x = 269, y = 114, inputs = 6, label = Import
//
main_Import_1_out_1 =
Import(
main_String_1_out_1,
main_Import_1_in_2,
main_Import_1_in_3,
main_Import_1_in_4,
main_Import_1_in_5,
main_Import_1_in_6
) [instance: 1, cache: 1];
//
// node Value[1]: x = 513, y = 104, inputs = 0, label = Value
// output[1]: visible = 1, type = 29, value = 0
//
//
// node Inquire[1]: x = 509, y = 24, inputs = 3, label = Inquire
// input[2]: defaulting = 0, visible = 1, type = 32, value = "member count"
//
main_Inquire_1_out_1 =
Inquire(
main_Import_1_out_1,
main_Inquire_1_in_2,
main_Inquire_1_in_3
) [instance: 1, cache: 1];
//
// node Value[2]: x = 643, y = 4, inputs = 0, label = Value
// output[1]: visible = 1, type = 29, value = 1
//
//
// node Compute[1]: x = 601, y = 94, inputs = 3, label = Compute
// input[1]: defaulting = 0, visible = 0, type = 32, value = "$0 - $1"
// expression: value = a - b
// name[2]: value = a
// name[3]: value = b
//
main_Compute_1_out_1 =
Compute(
main_Compute_1_in_1,
main_Inquire_1_out_1,
main_Value_2_out_1
) [instance: 1, cache: 1];
//
// node Sequencer[1]: x = 585, y = 184, inputs = 7, label = Sequencer
// input[1]: defaulting = 0, visible = 0, type = 32, value = "Sequencer_1"
// input[4]: defaulting = 1, visible = 1, type = 1, value = 0
// input[5]: defaulting = 1, visible = 1, type = 1, value = 95
// input[6]: defaulting = 1, visible = 0, type = 1, value = 1
// input[7]: defaulting = 0, visible = 0, type = 16777217, value = { 0 95 1 0 95 1 }
// vcr[1]: min = 0, max = 95, beg = 0, end = 95, cur = 38, inc = 1, loop = off, step = off, pal = off
// window: position = (0.0132,0.0833), size = 0.1750x0.0667
//
main_Sequencer_1_in_3 = @frame;
main_Sequencer_1_out_1[cache: 2] =
Sequencer(
main_Sequencer_1_in_1,
main_Sequencer_1_in_2,
main_Sequencer_1_in_3,
main_Value_1_out_1,
main_Compute_1_out_1,
main_Sequencer_1_in_6,
main_Sequencer_1_in_7
) [instance: 1, cache: 1];
//
// node Select[1]: x = 411, y = 214, inputs = 3, label = Select
//
main_Select_1_out_1 =
Select(
main_Import_1_out_1,
main_Sequencer_1_out_1,
main_Select_1_in_3
) [instance: 1, cache: 1];
//
// node RubberSheet[3]: x = 406, y = 364, inputs = 4, label = RubberSheet
//
main_RubberSheet_3_out_1 =
RubberSheet(
main_Select_1_out_1,
main_RubberSheet_3_in_2,
main_RubberSheet_3_in_3,
main_RubberSheet_3_in_4
) [instance: 3, cache: 1];
//
// node Statistics[4]: x = 185, y = 234, inputs = 1, label = Statistics
//
main_Statistics_4_out_1,
main_Statistics_4_out_2,
main_Statistics_4_out_3,
main_Statistics_4_out_4,
main_Statistics_4_out_5 =
Statistics(
main_Import_1_out_1
) [instance: 4, cache: 1];
//
// node AutoColor[1]: x = 336, y = 474, inputs = 10, label = AutoColor
// input[8]: visible = 1
//
main_AutoColor_1_out_1,
main_AutoColor_1_out_2 =
AutoColor(
main_RubberSheet_3_out_1,
main_AutoColor_1_in_2,
main_AutoColor_1_in_3,
main_AutoColor_1_in_4,
main_AutoColor_1_in_5,
main_AutoColor_1_in_6,
main_Statistics_4_out_4,
main_Statistics_4_out_5,
main_AutoColor_1_in_9,
main_AutoColor_1_in_10
) [instance: 1, cache: 1];
//
// node Shade[2]: x = 299, y = 574, inputs = 8, label = Shade
// input[3]: defaulting = 0, visible = 1, type = 32, value = "smooth"
//
main_Shade_2_out_1 =
Shade(
main_AutoColor_1_out_1,
main_Shade_2_in_2,
main_Shade_2_in_3,
main_Shade_2_in_4,
main_Shade_2_in_5,
main_Shade_2_in_6,
main_Shade_2_in_7,
main_Shade_2_in_8
) [instance: 2, cache: 1];
//
// node ColorBar[1]: x = 775, y = 574, inputs = 16, label = ColorBar
// input[4]: defaulting = 0, visible = 1, type = 3, value = 1
//
main_ColorBar_1_out_1 =
ColorBar(
main_AutoColor_1_out_2,
main_ColorBar_1_in_2,
main_ColorBar_1_in_3,
main_ColorBar_1_in_4,
main_ColorBar_1_in_5,
main_ColorBar_1_in_6,
main_ColorBar_1_in_7,
main_ColorBar_1_in_8,
main_ColorBar_1_in_9,
main_ColorBar_1_in_10,
main_ColorBar_1_in_11,
main_ColorBar_1_in_12,
main_ColorBar_1_in_13,
main_ColorBar_1_in_14,
main_ColorBar_1_in_15,
main_ColorBar_1_in_16
) [instance: 1, cache: 1];
//
// node ShowConnections[1]: x = 869, y = 474, inputs = 1, label = ShowConnections
//
main_ShowConnections_1_out_1 =
ShowConnections(
main_RubberSheet_3_out_1
) [instance: 1, cache: 1];
//
// node String[2]: x = 1091, y = 474, inputs = 0, label = String
// output[1]: visible = 1, type = 32, value = "COLORNAME"
//
//
// node Color[1]: x = 929, y = 574, inputs = 5, label = Color
// input[3]: defaulting = 0, visible = 1, type = 5, value = .3
//
main_Color_1_out_1 =
Color(
main_ShowConnections_1_out_1,
main_String_2_out_1,
main_Color_1_in_3,
main_Color_1_in_4,
main_Color_1_in_5
) [instance: 1, cache: 1];
//
// node Collect[1]: x = 799, y = 684, inputs = 3, label = Collect
//
main_Collect_1_out_1 =
Collect(
main_Shade_2_out_1,
main_ColorBar_1_out_1,
main_Color_1_out_1
) [instance: 1, cache: 1];
//
// node Image[1]: x = 1089, y = 764, inputs = 49, label = Image
// input[1]: defaulting = 0, visible = 0, type = 32, value = "Image_1"
// input[4]: defaulting = 0, visible = 0, type = 1, value = 0
// input[14]: defaulting = 0, visible = 0, type = 1, value = 1
// input[19]: defaulting = 0, visible = 0, type = 3, value = 0
// depth: value = 24
// internal caching: 1
//
main_Image_1_out_1,
main_Image_1_out_2,
main_Image_1_out_3 =
Image(
main_Image_1_in_1,
main_Collect_1_out_1,
main_Image_1_in_3,
main_Image_1_in_4,
main_Image_1_in_5,
main_Image_1_in_6,
main_Image_1_in_7,
main_Image_1_in_8,
main_Image_1_in_9,
main_Image_1_in_10,
main_Image_1_in_11,
main_Image_1_in_12,
main_Image_1_in_13,
main_Image_1_in_14,
main_Image_1_in_15,
main_Image_1_in_16,
main_Image_1_in_17,
main_Image_1_in_18,
main_Image_1_in_19,
main_Image_1_in_20,
main_Image_1_in_21,
main_Image_1_in_22,
main_Image_1_in_23,
main_Image_1_in_24,
main_Image_1_in_25,
main_Image_1_in_26,
main_Image_1_in_27,
main_Image_1_in_28,
main_Image_1_in_29,
main_Image_1_in_30,
main_Image_1_in_31,
main_Image_1_in_32,
main_Image_1_in_33,
main_Image_1_in_34,
main_Image_1_in_35,
main_Image_1_in_36,
main_Image_1_in_37,
main_Image_1_in_38,
main_Image_1_in_39,
main_Image_1_in_40,
main_Image_1_in_41,
main_Image_1_in_42,
main_Image_1_in_43,
main_Image_1_in_44,
main_Image_1_in_45,
main_Image_1_in_46,
main_Image_1_in_47,
main_Image_1_in_48,
main_Image_1_in_49
) [instance: 1, cache: 1];
// network: end of macro body
CacheScene(main_Image_1_in_1, main_Image_1_out_1, main_Image_1_out_2);
}
main_String_1_out_1 = "FILENAME";
main_Import_1_in_2 = NULL;
main_Import_1_in_3 = NULL;
main_Import_1_in_4 = NULL;
main_Import_1_in_5 = NULL;
main_Import_1_in_6 = NULL;
main_Import_1_out_1 = NULL;
main_Value_1_out_1 = 0;
main_Inquire_1_in_2 = "member count";
main_Inquire_1_in_3 = NULL;
main_Inquire_1_out_1 = NULL;
main_Value_2_out_1 = 1;
main_Compute_1_in_1 = "$0 - $1";
main_Compute_1_out_1 = NULL;
main_Sequencer_1_in_1 = "Sequencer_1";
main_Sequencer_1_in_2 = NULL;
main_Sequencer_1_in_3 = NULL;
main_Sequencer_1_in_6 = NULL;
main_Sequencer_1_in_7 = { 0 95 1 0 95 1 };
main_Sequencer_1_out_1 = NULL;
@startframe = 0;
@nextframe = @startframe;
@endframe = 95;
@deltaframe = 1;
main_Select_1_in_3 = NULL;
main_Select_1_out_1 = NULL;
main_RubberSheet_3_in_2 = NULL;
main_RubberSheet_3_in_3 = NULL;
main_RubberSheet_3_in_4 = NULL;
main_RubberSheet_3_out_1 = NULL;
main_Statistics_4_out_4 = NULL;
main_Statistics_4_out_5 = NULL;
main_AutoColor_1_in_2 = NULL;
main_AutoColor_1_in_3 = NULL;
main_AutoColor_1_in_4 = NULL;
main_AutoColor_1_in_5 = NULL;
main_AutoColor_1_in_6 = NULL;
main_AutoColor_1_in_9 = NULL;
main_AutoColor_1_in_10 = NULL;
main_AutoColor_1_out_1 = NULL;
main_AutoColor_1_out_2 = NULL;
main_Shade_2_in_2 = NULL;
main_Shade_2_in_3 = "smooth";
main_Shade_2_in_4 = NULL;
main_Shade_2_in_5 = NULL;
main_Shade_2_in_6 = NULL;
main_Shade_2_in_7 = NULL;
main_Shade_2_in_8 = NULL;
main_Shade_2_out_1 = NULL;
main_ColorBar_1_in_2 = NULL;
main_ColorBar_1_in_3 = NULL;
main_ColorBar_1_in_4 = 1;
main_ColorBar_1_in_5 = NULL;
main_ColorBar_1_in_6 = NULL;
main_ColorBar_1_in_7 = NULL;
main_ColorBar_1_in_8 = NULL;
main_ColorBar_1_in_9 = NULL;
main_ColorBar_1_in_10 = NULL;
main_ColorBar_1_in_11 = NULL;
main_ColorBar_1_in_12 = NULL;
main_ColorBar_1_in_13 = NULL;
main_ColorBar_1_in_14 = NULL;
main_ColorBar_1_in_15 = NULL;
main_ColorBar_1_in_16 = NULL;
main_ColorBar_1_out_1 = NULL;
main_ShowConnections_1_out_1 = NULL;
main_String_2_out_1 = "COLORNAME";
main_Color_1_in_3 = .3;
main_Color_1_in_4 = NULL;
main_Color_1_in_5 = NULL;
main_Color_1_out_1 = NULL;
main_Collect_1_out_1 = NULL;
macro Image(
id,
object,
where,
useVector,
to,
from,
width,
resolution,
aspect,
up,
viewAngle,
perspective,
options,
buttonState = 1,
buttonUpApprox = "none",
buttonDownApprox = "none",
buttonUpDensity = 1,
buttonDownDensity = 1,
renderMode = 0,
defaultCamera,
reset,
backgroundColor,
throttle,
RECenable = 0,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable = 0,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
interactionMode,
title,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
webOptions) -> (
object,
camera,
where)
{
ImageMessage(
id,
backgroundColor,
throttle,
RECenable,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
interactionMode,
title,
renderMode,
buttonUpApprox,
buttonDownApprox,
buttonUpDensity,
buttonDownDensity) [instance: 1, cache: 1];
autoCamera =
AutoCamera(
object,
"front",
object,
resolution,
aspect,
[0,1,0],
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
realCamera =
Camera(
to,
from,
width,
resolution,
aspect,
up,
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
coloredDefaultCamera =
UpdateCamera(defaultCamera,
background=backgroundColor) [instance: 1, cache: 1];
nullDefaultCamera =
Inquire(defaultCamera,
"is null + 1") [instance: 1, cache: 1];
resetCamera =
Switch(
nullDefaultCamera,
coloredDefaultCamera,
autoCamera) [instance: 1, cache: 1];
resetNull =
Inquire(
reset,
"is null + 1") [instance: 2, cache: 1];
reset =
Switch(
resetNull,
reset,
0) [instance: 2, cache: 1];
whichCamera =
Compute(
"($0 != 0 || $1 == 0) ? 1 : 2",
reset,
useVector) [instance: 1, cache: 1];
camera = Switch(
whichCamera,
resetCamera,
realCamera) [instance: 3, cache: 1];
AAobject =
AutoAxes(
object,
camera,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels) [instance: 1, cache: 1];
switchAAenable = Compute("$0+1",
AAenable) [instance: 2, cache: 1];
object = Switch(
switchAAenable,
object,
AAobject) [instance:4, cache: 1];
SWapproximation_options =
Switch(
buttonState,
buttonUpApprox,
buttonDownApprox) [instance: 5, cache: 1];
SWdensity_options =
Switch(
buttonState,
buttonUpDensity,
buttonDownDensity) [instance: 6, cache: 1];
HWapproximation_options =
Format(
"%s,%s",
buttonDownApprox,
buttonUpApprox) [instance: 1, cache: 1];
HWdensity_options =
Format(
"%d,%d",
buttonDownDensity,
buttonUpDensity) [instance: 2, cache: 1];
switchRenderMode = Compute(
"$0+1",
renderMode) [instance: 3, cache: 1];
approximation_options = Switch(
switchRenderMode,
SWapproximation_options,
HWapproximation_options) [instance: 7, cache: 1];
density_options = Switch(
switchRenderMode,
SWdensity_options,
HWdensity_options) [instance: 8, cache: 1];
renderModeString = Switch(
switchRenderMode,
"software",
"hardware")[instance: 9, cache: 1];
object_tag = Inquire(
object,
"object tag")[instance: 3, cache: 1];
annoted_object =
Options(
object,
"send boxes",
0,
"cache",
1,
"object tag",
object_tag,
"ddcamera",
whichCamera,
"rendering approximation",
approximation_options,
"render every",
density_options,
"button state",
buttonState,
"rendering mode",
renderModeString) [instance: 1, cache: 1];
RECresNull =
Inquire(
RECresolution,
"is null + 1") [instance: 4, cache: 1];
ImageResolution =
Inquire(
camera,
"camera resolution") [instance: 5, cache: 1];
RECresolution =
Switch(
RECresNull,
RECresolution,
ImageResolution) [instance: 10, cache: 1];
RECaspectNull =
Inquire(
RECaspect,
"is null + 1") [instance: 6, cache: 1];
ImageAspect =
Inquire(
camera,
"camera aspect") [instance: 7, cache: 1];
RECaspect =
Switch(
RECaspectNull,
RECaspect,
ImageAspect) [instance: 11, cache: 1];
switchRECenable = Compute(
"$0 == 0 ? 1 : (($2 == $3) && ($4 == $5)) ? ($1 == 1 ? 2 : 3) : 4",
RECenable,
switchRenderMode,
RECresolution,
ImageResolution,
RECaspect,
ImageAspect) [instance: 4, cache: 1];
NoRECobject, RECNoRerenderObject, RECNoRerHW, RECRerenderObject = Route(switchRECenable, annoted_object);
Display(
NoRECobject,
camera,
where,
throttle) [instance: 1, cache: 1];
image =
Render(
RECNoRerenderObject,
camera) [instance: 1, cache: 1];
Display(
image,
NULL,
where,
throttle) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 1, cache: 1];
rec_where = Display(
RECNoRerHW,
camera,
where,
throttle) [instance: 1, cache: 0];
rec_image = ReadImageWindow(
rec_where) [instance: 1, cache: 1];
WriteImage(
rec_image,
RECfile,
RECformat) [instance: 1, cache: 1];
RECupdateCamera =
UpdateCamera(
camera,
resolution=RECresolution,
aspect=RECaspect) [instance: 2, cache: 1];
Display(
RECRerenderObject,
camera,
where,
throttle) [instance: 1, cache: 1];
RECRerenderObject =
ScaleScreen(
RECRerenderObject,
NULL,
RECresolution,
camera) [instance: 1, cache: 1];
image =
Render(
RECRerenderObject,
RECupdateCamera) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 2, cache: 1];
}
main_Image_1_in_1 = "Image_1";
main_Image_1_in_3 = "X24,,";
main_Image_1_in_4 = 0;
main_Image_1_in_5 = NULL;
main_Image_1_in_6 = NULL;
main_Image_1_in_7 = NULL;
main_Image_1_in_8 = NULL;
main_Image_1_in_9 = NULL;
main_Image_1_in_10 = NULL;
main_Image_1_in_11 = NULL;
main_Image_1_in_12 = NULL;
main_Image_1_in_13 = NULL;
main_Image_1_in_14 = 1;
main_Image_1_in_15 = NULL;
main_Image_1_in_16 = NULL;
main_Image_1_in_17 = NULL;
main_Image_1_in_18 = NULL;
main_Image_1_in_19 = 0;
main_Image_1_in_20 = NULL;
main_Image_1_in_21 = NULL;
main_Image_1_in_22 = NULL;
main_Image_1_in_23 = NULL;
main_Image_1_in_25 = NULL;
main_Image_1_in_26 = NULL;
main_Image_1_in_27 = NULL;
main_Image_1_in_28 = NULL;
main_Image_1_in_29 = NULL;
main_Image_1_in_30 = NULL;
main_Image_1_in_31 = NULL;
main_Image_1_in_32 = NULL;
main_Image_1_in_33 = NULL;
main_Image_1_in_34 = NULL;
main_Image_1_in_35 = NULL;
main_Image_1_in_36 = NULL;
main_Image_1_in_37 = NULL;
main_Image_1_in_38 = NULL;
main_Image_1_in_39 = NULL;
main_Image_1_in_40 = NULL;
main_Image_1_in_41 = NULL;
main_Image_1_in_42 = NULL;
main_Image_1_in_43 = NULL;
main_Image_1_in_44 = NULL;
main_Image_1_in_45 = NULL;
main_Image_1_in_46 = NULL;
main_Image_1_in_47 = NULL;
main_Image_1_in_48 = NULL;
main_Image_1_in_49 = NULL;
Executive("product version 4 4 4");
$sync
sequence main();
play;
fpl/inst/deprecated/FPL2trsptcsurf.m 000644 000765 000000 00000005347 12010454601 020175 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2004-2008 Carlo de Falco, Massimiliano Culpo
##
## This file is part of
##
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
##
## AUTHORS:
## Carlo de Falco
##
## Culpo Massimiliano
## Bergische Universitaet Wuppertal
## Fachbereich C - Mathematik und Naturwissenschaften
## Arbeitsgruppe fuer Angewandte MathematD-42119 Wuppertal Gaussstr. 20
## D-42119 Wuppertal, Germany
## -*- texinfo -*-
## @deftypefn {Function File} {} FPL2trsptcsurf (@var{mesh1}, @
## @var{color1}, @var{data1}, [@var{mesh2}, @var{color2}, @var{data2}])
##
## Plots the transient scalar fields @var{data} defined on the triangulation
## @var{mesh} using opendx. Connections are rendered as defined by
## @var{color}
##
## Example:
## @example
##
## FPL2trspdesurf(mesh1,"blue",data1, mesh2,"red",data2)
##
## @end example
## @seealso{FPL2pdesurf, FPL2ptcsurf, FPL2trspdesurf}
## @end deftypefn
function FPL2trsptcsurf(varargin)
datalist = "";
colorlist = "";
for ii = 1:3:nargin
seriesend = columns(varargin{ii+2});
dataname = mktemp("/tmp",".dx");
colorname = varargin{ii+1};
FPL2dxoutputtimeseries(dataname, varargin{ii}.p, varargin{ii}.t, \
varargin{ii+2}, "dataseries", 0, 1, \
1:seriesend);
datalist = strcat(datalist, """", dataname ,"""");
colorlist = strcat(colorlist, """", colorname, """");
endfor
scriptname = mktemp("/tmp",".net");
view = file_in_path(path,"FPL2trsptcsurf.net");
system (["cp " view " " scriptname]);
system (["sed -i \'s|""FILELIST""|" datalist "|g\' " scriptname]);
system (["sed -i \'s|""COLORLIST""|" colorlist "|g\' " scriptname]);
command = ["dx -noConfirmedQuit -program " scriptname " -execute -image >& /dev/null & "];
system(command);
endfunction
function filename = mktemp (direct,ext);
if (~exist(direct,"dir"))
error("Trying to save temporary file to non existing directory")
endif
done = false;
while ~done
filename = [direct,"/FPL.",num2str(floor(rand*1e7)),ext];
if ~exist(filename,"file")
done = true;
endif
endwhile
endfunction fpl/inst/deprecated/FPL2trsptcsurf.net 000644 000765 000000 00000061337 12007306463 020540 0 ustar 00carlo wheel 000000 000000 //
// time: Sun Jan 6 17:08:01 2008
//
// version: 3.2.0 (format), 4.4.4 (DX)
//
//
// MODULE main
// workspace: width = 1098, height = 1006
// layout: snap = 1, width = 10, height = 10, align = CC
//
macro main(
) -> (
) {
//
// node CollectMultiGrid[1]: x = 425, y = 404, inputs = 4, label = CollectMultiGrid
// input[1]: defaulting = 0, visible = 1, type = 67108863, value = NULL
// input[3]: defaulting = 0, visible = 1, type = 67108863, value = NULL
//
main_CollectMultiGrid_1_out_1 =
CollectMultiGrid(
main_CollectMultiGrid_1_in_1,
main_CollectMultiGrid_1_in_2,
main_CollectMultiGrid_1_in_3,
main_CollectMultiGrid_1_in_4
) [instance: 1, cache: 1];
//
// node StringList[1]: x = 178, y = 24, inputs = 0, label = StringList
// output[1]: visible = 1, type = 16777248, value = { "FILELIST" }
//
//
// node ForEachMember[1]: x = 155, y = 124, inputs = 1, label = ForEachMember
//
main_ForEachMember_1_out_1,
main_ForEachMember_1_out_2,
main_ForEachMember_1_out_3 =
ForEachMember(
main_StringList_1_out_1
) [instance: 1, cache: 1];
//
// node Import[1]: x = 159, y = 224, inputs = 6, label = Import
//
main_Import_1_out_1 =
Import(
main_ForEachMember_1_out_1,
main_Import_1_in_2,
main_Import_1_in_3,
main_Import_1_in_4,
main_Import_1_in_5,
main_Import_1_in_6
) [instance: 1, cache: 1];
//
// node Value[1]: x = 993, y = 294, inputs = 0, label = Value
// output[1]: visible = 1, type = 29, value = 0
//
//
// node Inquire[1]: x = 879, y = 294, inputs = 3, label = Inquire
// input[2]: defaulting = 0, visible = 1, type = 32, value = "member count"
//
main_Inquire_1_out_1 =
Inquire(
main_Import_1_out_1,
main_Inquire_1_in_2,
main_Inquire_1_in_3
) [instance: 1, cache: 1];
//
// node Value[2]: x = 1053, y = 74, inputs = 0, label = Value
// output[1]: visible = 1, type = 29, value = 1
//
//
// node Compute[1]: x = 1021, y = 164, inputs = 3, label = Compute
// input[1]: defaulting = 0, visible = 0, type = 32, value = "$0 - $1"
// expression: value = a - b
// name[2]: value = a
// name[3]: value = b
//
main_Compute_1_out_1 =
Compute(
main_Compute_1_in_1,
main_Inquire_1_out_1,
main_Value_2_out_1
) [instance: 1, cache: 1];
//
// node Sequencer[1]: x = 995, y = 394, inputs = 7, label = Sequencer
// input[1]: defaulting = 0, visible = 0, type = 32, value = "Sequencer_1"
// input[4]: defaulting = 1, visible = 1, type = 1, value = 0
// input[5]: defaulting = 1, visible = 1, type = 1, value = 95
// input[6]: defaulting = 1, visible = 0, type = 1, value = 1
// input[7]: defaulting = 0, visible = 0, type = 16777217, value = { 0 95 1 0 95 1 }
// vcr[1]: min = 0, max = 95, beg = 0, end = 95, cur = 38, inc = 1, loop = off, step = off, pal = off
// window: position = (0.0132,0.0833), size = 0.1750x0.0667
//
main_Sequencer_1_in_3 = @frame;
main_Sequencer_1_out_1[cache: 2] =
Sequencer(
main_Sequencer_1_in_1,
main_Sequencer_1_in_2,
main_Sequencer_1_in_3,
main_Value_1_out_1,
main_Compute_1_out_1,
main_Sequencer_1_in_6,
main_Sequencer_1_in_7
) [instance: 1, cache: 1];
//
// node Select[1]: x = 851, y = 394, inputs = 3, label = Select
//
main_Select_1_out_1 =
Select(
main_Import_1_out_1,
main_Sequencer_1_out_1,
main_Select_1_in_3
) [instance: 1, cache: 1];
//
// node ShowConnections[1]: x = 449, y = 324, inputs = 1, label = ShowConnections
//
main_ShowConnections_1_out_1 =
ShowConnections(
main_Select_1_out_1
) [instance: 1, cache: 1];
//
// node StringList[2]: x = 628, y = 224, inputs = 0, label = StringList
// output[1]: visible = 1, type = 16777248, value = { "COLORLIST" }
//
//
// node ForEachMember[2]: x = 605, y = 324, inputs = 1, label = ForEachMember
//
main_ForEachMember_2_out_1,
main_ForEachMember_2_out_2,
main_ForEachMember_2_out_3 =
ForEachMember(
main_StringList_2_out_1
) [instance: 2, cache: 1];
//
// node Color[1]: x = 589, y = 404, inputs = 5, label = Color
// input[3]: defaulting = 0, visible = 1, type = 5, value = .3
//
main_Color_1_out_1 =
Color(
main_ShowConnections_1_out_1,
main_ForEachMember_2_out_1,
main_Color_1_in_3,
main_Color_1_in_4,
main_Color_1_in_5
) [instance: 1, cache: 1];
//
// node GetLocal[3]: x = 732, y = 394, inputs = 3, label = GetLocal
//
main_GetLocal_3_out_1,
main_GetLocal_3_out_2 =
GetLocal(
main_GetLocal_3_in_1,
main_GetLocal_3_in_2,
main_GetLocal_3_in_3
) [instance: 3, cache: 1];
//
// node Append[1]: x = 555, y = 484, inputs = 5, label = Append
//
main_Append_1_out_1 =
Append(
main_CollectMultiGrid_1_out_1,
main_Color_1_out_1,
main_Append_1_in_3,
main_GetLocal_3_out_1,
main_Append_1_in_5
) [instance: 1, cache: 1];
//
// node GetLocal[4]: x = 1012, y = 484, inputs = 3, label = GetLocal
//
main_GetLocal_4_out_1,
main_GetLocal_4_out_2 =
GetLocal(
main_GetLocal_4_in_1,
main_GetLocal_4_in_2,
main_GetLocal_4_in_3
) [instance: 4, cache: 1];
//
// node Append[2]: x = 835, y = 484, inputs = 5, label = Append
//
main_Append_2_out_1 =
Append(
main_CollectMultiGrid_1_out_1,
main_Select_1_out_1,
main_Append_2_in_3,
main_GetLocal_4_out_1,
main_Append_2_in_5
) [instance: 2, cache: 1];
//
// node RubberSheet[2]: x = 786, y = 644, inputs = 4, label = RubberSheet
// input[2]: defaulting = 1, visible = 1, type = 5, value = .1
//
main_RubberSheet_2_out_1 =
RubberSheet(
main_Append_2_out_1,
main_RubberSheet_2_in_2,
main_RubberSheet_2_in_3,
main_RubberSheet_2_in_4
) [instance: 2, cache: 1];
//
// node Shade[1]: x = 899, y = 684, inputs = 8, label = Shade
// input[2]: defaulting = 0, visible = 1, type = 3, value = 1
// input[3]: defaulting = 0, visible = 1, type = 32, value = "smooth"
//
main_Shade_1_out_1 =
Shade(
main_RubberSheet_2_out_1,
main_Shade_1_in_2,
main_Shade_1_in_3,
main_Shade_1_in_4,
main_Shade_1_in_5,
main_Shade_1_in_6,
main_Shade_1_in_7,
main_Shade_1_in_8
) [instance: 1, cache: 1];
//
// node Statistics[1]: x = 135, y = 324, inputs = 1, label = Statistics
//
main_Statistics_1_out_1,
main_Statistics_1_out_2,
main_Statistics_1_out_3,
main_Statistics_1_out_4,
main_Statistics_1_out_5 =
Statistics(
main_Import_1_out_1
) [instance: 1, cache: 1];
//
// node GetLocal[2]: x = 12, y = 324, inputs = 3, label = GetLocal
//
main_GetLocal_2_out_1,
main_GetLocal_2_out_2 =
GetLocal(
main_GetLocal_2_in_1,
main_GetLocal_2_in_2,
main_GetLocal_2_in_3
) [instance: 2, cache: 1];
//
// node List[2]: x = 111, y = 464, inputs = 2, label = List
//
main_List_2_out_1 =
List(
main_Statistics_1_out_4,
main_GetLocal_2_out_1
) [instance: 2, cache: 1];
//
// node Statistics[3]: x = 75, y = 594, inputs = 1, label = Statistics
//
main_Statistics_3_out_1,
main_Statistics_3_out_2,
main_Statistics_3_out_3,
main_Statistics_3_out_4,
main_Statistics_3_out_5 =
Statistics(
main_List_2_out_1
) [instance: 3, cache: 1];
//
// node GetLocal[1]: x = 302, y = 324, inputs = 3, label = GetLocal
//
main_GetLocal_1_out_1,
main_GetLocal_1_out_2 =
GetLocal(
main_GetLocal_1_in_1,
main_GetLocal_1_in_2,
main_GetLocal_1_in_3
) [instance: 1, cache: 1];
//
// node List[1]: x = 231, y = 464, inputs = 2, label = List
//
main_List_1_out_1 =
List(
main_Statistics_1_out_5,
main_GetLocal_1_out_1
) [instance: 1, cache: 1];
//
// node Statistics[2]: x = 235, y = 594, inputs = 1, label = Statistics
//
main_Statistics_2_out_1,
main_Statistics_2_out_2,
main_Statistics_2_out_3,
main_Statistics_2_out_4,
main_Statistics_2_out_5 =
Statistics(
main_List_1_out_1
) [instance: 2, cache: 1];
//
// node AutoColor[1]: x = 896, y = 804, inputs = 10, label = AutoColor
// input[2]: defaulting = 0, visible = 0, type = 5, value = 1.0
// input[8]: visible = 1
//
main_AutoColor_1_out_1,
main_AutoColor_1_out_2 =
AutoColor(
main_Shade_1_out_1,
main_AutoColor_1_in_2,
main_AutoColor_1_in_3,
main_AutoColor_1_in_4,
main_AutoColor_1_in_5,
main_AutoColor_1_in_6,
main_Statistics_3_out_4,
main_Statistics_2_out_5,
main_AutoColor_1_in_9,
main_AutoColor_1_in_10
) [instance: 1, cache: 1];
//
// node RubberSheet[4]: x = 606, y = 734, inputs = 4, label = RubberSheet
// input[2]: defaulting = 1, visible = 1, type = 5, value = .1
//
main_RubberSheet_4_out_1 =
RubberSheet(
main_Append_1_out_1,
main_RubberSheet_4_in_2,
main_RubberSheet_4_in_3,
main_RubberSheet_4_in_4
) [instance: 4, cache: 1];
//
// node ColorBar[1]: x = 835, y = 934, inputs = 16, label = ColorBar
// input[4]: defaulting = 0, visible = 1, type = 3, value = 1
//
main_ColorBar_1_out_1 =
ColorBar(
main_AutoColor_1_out_2,
main_ColorBar_1_in_2,
main_ColorBar_1_in_3,
main_ColorBar_1_in_4,
main_ColorBar_1_in_5,
main_ColorBar_1_in_6,
main_ColorBar_1_in_7,
main_ColorBar_1_in_8,
main_ColorBar_1_in_9,
main_ColorBar_1_in_10,
main_ColorBar_1_in_11,
main_ColorBar_1_in_12,
main_ColorBar_1_in_13,
main_ColorBar_1_in_14,
main_ColorBar_1_in_15,
main_ColorBar_1_in_16
) [instance: 1, cache: 1];
//
// node Collect[1]: x = 619, y = 844, inputs = 3, label = Collect
//
main_Collect_1_out_1 =
Collect(
main_RubberSheet_4_out_1,
main_AutoColor_1_out_1,
main_ColorBar_1_out_1
) [instance: 1, cache: 1];
//
// node Image[1]: x = 609, y = 944, inputs = 49, label = Image
// input[1]: defaulting = 0, visible = 0, type = 67108863, value = "Image_1"
// input[4]: defaulting = 0, visible = 0, type = 1, value = 0
// input[14]: defaulting = 0, visible = 0, type = 1, value = 1
// input[19]: defaulting = 0, visible = 0, type = 3, value = 0
// depth: value = 24
// internal caching: 1
//
main_Image_1_out_1,
main_Image_1_out_2,
main_Image_1_out_3 =
Image(
main_Image_1_in_1,
main_Collect_1_out_1,
main_Image_1_in_3,
main_Image_1_in_4,
main_Image_1_in_5,
main_Image_1_in_6,
main_Image_1_in_7,
main_Image_1_in_8,
main_Image_1_in_9,
main_Image_1_in_10,
main_Image_1_in_11,
main_Image_1_in_12,
main_Image_1_in_13,
main_Image_1_in_14,
main_Image_1_in_15,
main_Image_1_in_16,
main_Image_1_in_17,
main_Image_1_in_18,
main_Image_1_in_19,
main_Image_1_in_20,
main_Image_1_in_21,
main_Image_1_in_22,
main_Image_1_in_23,
main_Image_1_in_24,
main_Image_1_in_25,
main_Image_1_in_26,
main_Image_1_in_27,
main_Image_1_in_28,
main_Image_1_in_29,
main_Image_1_in_30,
main_Image_1_in_31,
main_Image_1_in_32,
main_Image_1_in_33,
main_Image_1_in_34,
main_Image_1_in_35,
main_Image_1_in_36,
main_Image_1_in_37,
main_Image_1_in_38,
main_Image_1_in_39,
main_Image_1_in_40,
main_Image_1_in_41,
main_Image_1_in_42,
main_Image_1_in_43,
main_Image_1_in_44,
main_Image_1_in_45,
main_Image_1_in_46,
main_Image_1_in_47,
main_Image_1_in_48,
main_Image_1_in_49
) [instance: 1, cache: 1];
//
// node SetLocal[1]: x = 332, y = 464, inputs = 3, label = SetLocal
//
SetLocal(
main_List_1_out_1,
main_GetLocal_1_out_2,
main_SetLocal_1_in_3
) [instance: 1, cache: 1];
//
// node SetLocal[2]: x = 12, y = 464, inputs = 3, label = SetLocal
//
SetLocal(
main_List_2_out_1,
main_GetLocal_2_out_2,
main_SetLocal_2_in_3
) [instance: 2, cache: 1];
//
// node SetLocal[3]: x = 732, y = 484, inputs = 3, label = SetLocal
//
SetLocal(
main_Append_1_out_1,
main_GetLocal_3_out_2,
main_SetLocal_3_in_3
) [instance: 3, cache: 1];
//
// node SetLocal[4]: x = 1012, y = 564, inputs = 3, label = SetLocal
//
SetLocal(
main_Append_2_out_1,
main_GetLocal_4_out_2,
main_SetLocal_4_in_3
) [instance: 4, cache: 1];
// network: end of macro body
CacheScene(main_Image_1_in_1, main_Image_1_out_1, main_Image_1_out_2);
}
main_CollectMultiGrid_1_in_1 = NULL;
main_CollectMultiGrid_1_in_2 = NULL;
main_CollectMultiGrid_1_in_3 = NULL;
main_CollectMultiGrid_1_in_4 = NULL;
main_CollectMultiGrid_1_out_1 = NULL;
main_StringList_1_out_1 = { "FILELIST" };
main_ForEachMember_1_out_1 = NULL;
main_Import_1_in_2 = NULL;
main_Import_1_in_3 = NULL;
main_Import_1_in_4 = NULL;
main_Import_1_in_5 = NULL;
main_Import_1_in_6 = NULL;
main_Import_1_out_1 = NULL;
main_Value_1_out_1 = 0;
main_Inquire_1_in_2 = "member count";
main_Inquire_1_in_3 = NULL;
main_Inquire_1_out_1 = NULL;
main_Value_2_out_1 = 1;
main_Compute_1_in_1 = "$0 - $1";
main_Compute_1_out_1 = NULL;
main_Sequencer_1_in_1 = "Sequencer_1";
main_Sequencer_1_in_2 = NULL;
main_Sequencer_1_in_3 = NULL;
main_Sequencer_1_in_6 = NULL;
main_Sequencer_1_in_7 = { 0 95 1 0 95 1 };
main_Sequencer_1_out_1 = NULL;
@startframe = 0;
@nextframe = @startframe;
@endframe = 95;
@deltaframe = 1;
main_Select_1_in_3 = NULL;
main_Select_1_out_1 = NULL;
main_ShowConnections_1_out_1 = NULL;
main_StringList_2_out_1 = { "COLORLIST" };
main_ForEachMember_2_out_1 = NULL;
main_Color_1_in_3 = .3;
main_Color_1_in_4 = NULL;
main_Color_1_in_5 = NULL;
main_Color_1_out_1 = NULL;
main_GetLocal_3_in_1 = NULL;
main_GetLocal_3_in_2 = NULL;
main_GetLocal_3_in_3 = NULL;
main_GetLocal_3_out_1 = NULL;
main_GetLocal_3_out_2 = NULL;
main_Append_1_in_3 = NULL;
main_Append_1_in_5 = NULL;
main_Append_1_out_1 = NULL;
main_GetLocal_4_in_1 = NULL;
main_GetLocal_4_in_2 = NULL;
main_GetLocal_4_in_3 = NULL;
main_GetLocal_4_out_1 = NULL;
main_GetLocal_4_out_2 = NULL;
main_Append_2_in_3 = NULL;
main_Append_2_in_5 = NULL;
main_Append_2_out_1 = NULL;
main_RubberSheet_2_in_2 = NULL;
main_RubberSheet_2_in_3 = NULL;
main_RubberSheet_2_in_4 = NULL;
main_RubberSheet_2_out_1 = NULL;
main_Shade_1_in_2 = 1;
main_Shade_1_in_3 = "smooth";
main_Shade_1_in_4 = NULL;
main_Shade_1_in_5 = NULL;
main_Shade_1_in_6 = NULL;
main_Shade_1_in_7 = NULL;
main_Shade_1_in_8 = NULL;
main_Shade_1_out_1 = NULL;
main_Statistics_1_out_4 = NULL;
main_Statistics_1_out_5 = NULL;
main_GetLocal_2_in_1 = NULL;
main_GetLocal_2_in_2 = NULL;
main_GetLocal_2_in_3 = NULL;
main_GetLocal_2_out_1 = NULL;
main_GetLocal_2_out_2 = NULL;
main_List_2_out_1 = NULL;
main_Statistics_3_out_4 = NULL;
main_GetLocal_1_in_1 = NULL;
main_GetLocal_1_in_2 = NULL;
main_GetLocal_1_in_3 = NULL;
main_GetLocal_1_out_1 = NULL;
main_GetLocal_1_out_2 = NULL;
main_List_1_out_1 = NULL;
main_Statistics_2_out_5 = NULL;
main_AutoColor_1_in_2 = 1.0;
main_AutoColor_1_in_3 = NULL;
main_AutoColor_1_in_4 = NULL;
main_AutoColor_1_in_5 = NULL;
main_AutoColor_1_in_6 = NULL;
main_AutoColor_1_in_9 = NULL;
main_AutoColor_1_in_10 = NULL;
main_AutoColor_1_out_1 = NULL;
main_AutoColor_1_out_2 = NULL;
main_RubberSheet_4_in_2 = NULL;
main_RubberSheet_4_in_3 = NULL;
main_RubberSheet_4_in_4 = NULL;
main_RubberSheet_4_out_1 = NULL;
main_ColorBar_1_in_2 = NULL;
main_ColorBar_1_in_3 = NULL;
main_ColorBar_1_in_4 = 1;
main_ColorBar_1_in_5 = NULL;
main_ColorBar_1_in_6 = NULL;
main_ColorBar_1_in_7 = NULL;
main_ColorBar_1_in_8 = NULL;
main_ColorBar_1_in_9 = NULL;
main_ColorBar_1_in_10 = NULL;
main_ColorBar_1_in_11 = NULL;
main_ColorBar_1_in_12 = NULL;
main_ColorBar_1_in_13 = NULL;
main_ColorBar_1_in_14 = NULL;
main_ColorBar_1_in_15 = NULL;
main_ColorBar_1_in_16 = NULL;
main_ColorBar_1_out_1 = NULL;
main_Collect_1_out_1 = NULL;
macro Image(
id,
object,
where,
useVector,
to,
from,
width,
resolution,
aspect,
up,
viewAngle,
perspective,
options,
buttonState = 1,
buttonUpApprox = "none",
buttonDownApprox = "none",
buttonUpDensity = 1,
buttonDownDensity = 1,
renderMode = 0,
defaultCamera,
reset,
backgroundColor,
throttle,
RECenable = 0,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable = 0,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
interactionMode,
title,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
webOptions) -> (
object,
camera,
where)
{
ImageMessage(
id,
backgroundColor,
throttle,
RECenable,
RECfile,
RECformat,
RECresolution,
RECaspect,
AAenable,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels,
interactionMode,
title,
renderMode,
buttonUpApprox,
buttonDownApprox,
buttonUpDensity,
buttonDownDensity) [instance: 1, cache: 1];
autoCamera =
AutoCamera(
object,
"front",
object,
resolution,
aspect,
[0,1,0],
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
realCamera =
Camera(
to,
from,
width,
resolution,
aspect,
up,
perspective,
viewAngle,
backgroundColor) [instance: 1, cache: 1];
coloredDefaultCamera =
UpdateCamera(defaultCamera,
background=backgroundColor) [instance: 1, cache: 1];
nullDefaultCamera =
Inquire(defaultCamera,
"is null + 1") [instance: 1, cache: 1];
resetCamera =
Switch(
nullDefaultCamera,
coloredDefaultCamera,
autoCamera) [instance: 1, cache: 1];
resetNull =
Inquire(
reset,
"is null + 1") [instance: 2, cache: 1];
reset =
Switch(
resetNull,
reset,
0) [instance: 2, cache: 1];
whichCamera =
Compute(
"($0 != 0 || $1 == 0) ? 1 : 2",
reset,
useVector) [instance: 1, cache: 1];
camera = Switch(
whichCamera,
resetCamera,
realCamera) [instance: 3, cache: 1];
AAobject =
AutoAxes(
object,
camera,
AAlabels,
AAticks,
AAcorners,
AAframe,
AAadjust,
AAcursor,
AAgrid,
AAcolors,
AAannotation,
AAlabelscale,
AAfont,
AAxTickLocs,
AAyTickLocs,
AAzTickLocs,
AAxTickLabels,
AAyTickLabels,
AAzTickLabels) [instance: 1, cache: 1];
switchAAenable = Compute("$0+1",
AAenable) [instance: 2, cache: 1];
object = Switch(
switchAAenable,
object,
AAobject) [instance:4, cache: 1];
SWapproximation_options =
Switch(
buttonState,
buttonUpApprox,
buttonDownApprox) [instance: 5, cache: 1];
SWdensity_options =
Switch(
buttonState,
buttonUpDensity,
buttonDownDensity) [instance: 6, cache: 1];
HWapproximation_options =
Format(
"%s,%s",
buttonDownApprox,
buttonUpApprox) [instance: 1, cache: 1];
HWdensity_options =
Format(
"%d,%d",
buttonDownDensity,
buttonUpDensity) [instance: 2, cache: 1];
switchRenderMode = Compute(
"$0+1",
renderMode) [instance: 3, cache: 1];
approximation_options = Switch(
switchRenderMode,
SWapproximation_options,
HWapproximation_options) [instance: 7, cache: 1];
density_options = Switch(
switchRenderMode,
SWdensity_options,
HWdensity_options) [instance: 8, cache: 1];
renderModeString = Switch(
switchRenderMode,
"software",
"hardware")[instance: 9, cache: 1];
object_tag = Inquire(
object,
"object tag")[instance: 3, cache: 1];
annoted_object =
Options(
object,
"send boxes",
0,
"cache",
1,
"object tag",
object_tag,
"ddcamera",
whichCamera,
"rendering approximation",
approximation_options,
"render every",
density_options,
"button state",
buttonState,
"rendering mode",
renderModeString) [instance: 1, cache: 1];
RECresNull =
Inquire(
RECresolution,
"is null + 1") [instance: 4, cache: 1];
ImageResolution =
Inquire(
camera,
"camera resolution") [instance: 5, cache: 1];
RECresolution =
Switch(
RECresNull,
RECresolution,
ImageResolution) [instance: 10, cache: 1];
RECaspectNull =
Inquire(
RECaspect,
"is null + 1") [instance: 6, cache: 1];
ImageAspect =
Inquire(
camera,
"camera aspect") [instance: 7, cache: 1];
RECaspect =
Switch(
RECaspectNull,
RECaspect,
ImageAspect) [instance: 11, cache: 1];
switchRECenable = Compute(
"$0 == 0 ? 1 : (($2 == $3) && ($4 == $5)) ? ($1 == 1 ? 2 : 3) : 4",
RECenable,
switchRenderMode,
RECresolution,
ImageResolution,
RECaspect,
ImageAspect) [instance: 4, cache: 1];
NoRECobject, RECNoRerenderObject, RECNoRerHW, RECRerenderObject = Route(switchRECenable, annoted_object);
Display(
NoRECobject,
camera,
where,
throttle) [instance: 1, cache: 1];
image =
Render(
RECNoRerenderObject,
camera) [instance: 1, cache: 1];
Display(
image,
NULL,
where,
throttle) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 1, cache: 1];
rec_where = Display(
RECNoRerHW,
camera,
where,
throttle) [instance: 1, cache: 0];
rec_image = ReadImageWindow(
rec_where) [instance: 1, cache: 1];
WriteImage(
rec_image,
RECfile,
RECformat) [instance: 1, cache: 1];
RECupdateCamera =
UpdateCamera(
camera,
resolution=RECresolution,
aspect=RECaspect) [instance: 2, cache: 1];
Display(
RECRerenderObject,
camera,
where,
throttle) [instance: 1, cache: 1];
RECRerenderObject =
ScaleScreen(
RECRerenderObject,
NULL,
RECresolution,
camera) [instance: 1, cache: 1];
image =
Render(
RECRerenderObject,
RECupdateCamera) [instance: 2, cache: 1];
WriteImage(
image,
RECfile,
RECformat) [instance: 2, cache: 1];
}
main_Image_1_in_1 = "Image_1";
main_Image_1_in_3 = "X24,,";
main_Image_1_in_4 = 0;
main_Image_1_in_5 = NULL;
main_Image_1_in_6 = NULL;
main_Image_1_in_7 = NULL;
main_Image_1_in_8 = NULL;
main_Image_1_in_9 = NULL;
main_Image_1_in_10 = NULL;
main_Image_1_in_11 = NULL;
main_Image_1_in_12 = NULL;
main_Image_1_in_13 = NULL;
main_Image_1_in_14 = 1;
main_Image_1_in_15 = NULL;
main_Image_1_in_16 = NULL;
main_Image_1_in_17 = NULL;
main_Image_1_in_18 = NULL;
main_Image_1_in_19 = 0;
main_Image_1_in_20 = NULL;
main_Image_1_in_21 = NULL;
main_Image_1_in_22 = NULL;
main_Image_1_in_23 = NULL;
main_Image_1_in_25 = NULL;
main_Image_1_in_26 = NULL;
main_Image_1_in_27 = NULL;
main_Image_1_in_28 = NULL;
main_Image_1_in_29 = NULL;
main_Image_1_in_30 = NULL;
main_Image_1_in_31 = NULL;
main_Image_1_in_32 = NULL;
main_Image_1_in_33 = NULL;
main_Image_1_in_34 = NULL;
main_Image_1_in_35 = NULL;
main_Image_1_in_36 = NULL;
main_Image_1_in_37 = NULL;
main_Image_1_in_38 = NULL;
main_Image_1_in_39 = NULL;
main_Image_1_in_40 = NULL;
main_Image_1_in_41 = NULL;
main_Image_1_in_42 = NULL;
main_Image_1_in_43 = NULL;
main_Image_1_in_44 = NULL;
main_Image_1_in_45 = NULL;
main_Image_1_in_46 = NULL;
main_Image_1_in_47 = NULL;
main_Image_1_in_48 = NULL;
main_Image_1_in_49 = NULL;
main_SetLocal_1_in_3 = NULL;
main_SetLocal_2_in_3 = NULL;
main_SetLocal_3_in_3 = NULL;
main_SetLocal_4_in_3 = NULL;
Executive("product version 4 4 4");
$sync
sequence main();
play;
fpl/inst/deprecated/FPL2vtkoutputdata.m 000644 000765 000000 00000012570 12010454601 020671 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2008 Carlo de Falco
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
## -*- texinfo -*-
## @deftypefn {Function File} {} FPL2vtkoutputdata ( @var{filename}, @var{p}, @var{t}, @var{nodedata}, @var{celldata}, @var{header}, @var{vtkver})
##
## Save data in VTK ASCII format.
##
## @itemize @minus
## @item @var{filename} = name of file to save into
## @item @var{p}, @var{t} = mesh node coordinates and connectivity
## @item @var{name} = name of a mesh variable
## @item @var{nodedata}/@var{celldata} = node/cell centered data
## fields (2xNfields cell array), @var{*data}@{:,1@} = variable names;
## @var{*data}@{:,2@} = variable data;
## @item @var{header} comment to add in the file header
## @item @var{vtkver} format version (default is 3.0)
## @end itemize
##
## @seealso{FPL2dxoutputdata}
## @end deftypefn
function FPL2vtkoutputdata (filename, p, t, nodedata, celldata, header, vtkver)
fid = fopen (filename, "w");
if ( fid )
## version ID
if (!exist("vtkver"))
vtkver = [3 0];
endif
fprintf (fid, "# vtk DataFile Version %d.%d\n", vtkver(1), vtkver(2));
## header
if (!exist("header"))
header = "";
elseif (length(header) > 255)
header (255:end) = [];
endif
fprintf (fid, "%s\n", header);
## File format: only ASCII supported for the moment
fprintf (fid, "ASCII\n");
## Mesh: only triangles suported
fprintf (fid, "DATASET UNSTRUCTURED_GRID\n");
Nnodes = columns(p);
fprintf (fid,"POINTS %d double\n", Nnodes);
fprintf (fid,"%g %g 0\n", p);
Nelem = columns(t);
T = zeros(4,Nelem);
T(1,:)= 3;
T(2:4,:) = t(1:3,:) -1;
fprintf (fid,"CELLS %d %d\n", Nelem, Nelem*4);
fprintf (fid,"%d %d %d %d\n", T);
fprintf (fid,"CELL_TYPES %d \n", Nelem);
fprintf (fid,"%d\n", 5*ones(Nelem,1));
## node data
if (exist("nodedata"))
nfields = rows(nodedata);
if nfields
fprintf (fid,"POINT_DATA %d\n", Nnodes);
for ifield = 1:nfields
V = nodedata {ifield, 2};
N = nodedata {ifield, 1};
if (isvector (V))
fprintf (fid,"SCALARS %s double\nLOOKUP_TABLE default\n", N);
fprintf (fid,"%g\n", V);
else
V(:,3) = 0;
fprintf (fid,"VECTORS %s double\nLOOKUP_TABLE default\n", N);
fprintf (fid,"%g %g %g\n", V);
endif
endfor
endif
endif
## cell data
if (exist("celldata"))
nfields = rows(celldata);
if nfields
fprintf (fid,"CELL_DATA %d\n", Nelem);
for ifield = 1:nfields
V = celldata {ifield, 2};
N = celldata {ifield, 1};
if (isvector (V))
fprintf (fid,"SCALARS %s double\nLOOKUP_TABLE default\n", N);
fprintf (fid,"%g\n", V);
else
V(:,3) = 0;
fprintf (fid,"VECTORS %s double\nLOOKUP_TABLE default\n", N);
fprintf (fid,"%g %g %g\n", V);
endif
endfor
endif
endif
## cleanup
fclose (fid);
else
error(["FPL2vtkoutputdata: could not open file " filename]);
endif
endfunction
%!test
%! msh.p =[ 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3
%! 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3];
%! msh.e =[1 5 9 13 14 15 4 8 12 1 2 3
%! 5 9 13 14 15 16 8 12 16 2 3 4
%! 0 0 0 0 0 0 0 0 0 0 0 0
%! 0 0 0 0 0 0 0 0 0 0 0 0
%! 1 1 1 2 2 2 3 3 3 4 4 4
%! 0 0 0 0 0 0 0 0 0 0 0 0
%! 1 1 1 1 1 1 1 1 1 1 1 1];
%! msh.t =[ 1 2 3 5 6 7 9 10 11 1 2 3 5 6 7 9 10 11
%! 5 6 7 9 10 11 13 14 15 6 7 8 10 11 12 14 15 16
%! 6 7 8 10 11 12 14 15 16 2 3 4 6 7 8 10 11 12
%! 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1];
%! testfile = "# vtk DataFile Version 3.0\n\nASCII\nDATASET UNSTRUCTURED_GRID\nPOINTS 16 double\n0 0 0\n0 1 0\n0 2 0\n0 3 0\n1 0 0\n1 1 0\n1 2 0\n1 3 0\n2 0 0\n2 1 0\n2 2 0\n2 3 0\n3 0 0\n3 1 0\n3 2 0\n3 3 0\nCELLS 18 72\n3 0 4 5\n3 1 5 6\n3 2 6 7\n3 4 8 9\n3 5 9 10\n3 6 10 11\n3 8 12 13\n3 9 13 14\n3 10 14 15\n3 0 5 1\n3 1 6 2\n3 2 7 3\n3 4 9 5\n3 5 10 6\n3 6 11 7\n3 8 13 9\n3 9 14 10\n3 10 15 11\nCELL_TYPES 18 \n5\n5\n5\n5\n5\n5\n5\n5\n5\n5\n5\n5\n5\n5\n5\n5\n5\n5\nPOINT_DATA 16\nSCALARS u double\nLOOKUP_TABLE default\n0\n0\n0\n0\n1\n1\n1\n1\n2\n2\n2\n2\n3\n3\n3\n3\n";
%! FPL2vtkoutputdata ("__FPL2vtkoutputdata__test__.vtk", msh.p, msh.t, {"u", msh.p(1,:).'});
%! fid = fopen("__FPL2vtkoutputdata__test__.vtk","r");
%! s = fread(fid);
%! fclose(fid);
%! assert (char(s'), testfile);
%! delete __FPL2vtkoutputdata__test__.vtk
fpl/inst/deprecated/FPL3dxoutputfield.m 000644 000765 000000 00000005616 12010454601 020656 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2004-2008 Carlo de Falco, Massimiliano Culpo
##
## This file is part of
##
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
##
## AUTHORS:
## Carlo de Falco
##
## Culpo Massimiliano
## Bergische Universitaet Wuppertal
## Fachbereich C - Mathematik und Naturwissenschaften
## Arbeitsgruppe fuer Angewandte MathematD-42119 Wuppertal Gaussstr. 20
## D-42119 Wuppertal, Germany
## -*- texinfo -*-
## @deftypefn {Function File} {} FPL3dxoutputfield( @var{filename}, @
## @var{meshfilename}, @var{dep}, @var{u}, @var{attr_name}, @var{attr_rank}, @
## @var{attr_shape}, @var{endfile} )
##
## Outputs data in DX form.
##
## Variable must be a scalar, vector or tensor of doubles
##
## @itemize @minus
## @item @var{filename} = name of file to save (type string)
## @item @var{meshfilename} = name of mesh file (type string)
## @item @var{dep} = "positions" for node data, "connections" for element data
## @item @var{field} = field data to be saved
## @item @var{attr_name} = name of the variable (type string)
## @item @var{attr_rank} = rank of variable data (0 for scalar, 1 for vector, etc.)
## @item @var{attr_shape} = number of components of variable data (assumed 1 for scalar)
## @end itemize
## @end deftypefn
function FPL3dxoutputfield(filename,meshfilename,dep,field,attr_name,attr_rank,attr_shape)
fid = fopen (filename,"w");
nnodes = size(field,1);
if ((attr_rank==0) && (min(size(field))==1))
fprintf(fid,"object ""%s.data""\nclass array type double rank 0 items %d data follows",attr_name,nnodes);
fprintf(fid,"\n %e",field);
else
fprintf(fid,"object ""%s.data""\nclass array type double rank %d shape %d items %d data follows",attr_name,attr_rank,attr_shape,nnodes);
for ii = 1:nnodes
fprintf(fid,"\n");
fprintf(fid," %e",field(ii,:));
endfor
endif
fprintf(fid,"\nattribute ""dep"" string ""%s""\n\n",dep);
fprintf(fid,"object ""%s"" class field\n",attr_name);
fprintf(fid,"component ""positions"" file %s ""pos""\n",meshfilename);
fprintf(fid,"component ""connections"" file %s ""con""\n",meshfilename);
fprintf(fid,"component ""data"" value ""%s.data""\n",attr_name);
fprintf(fid,"\nend\n");
fclose (fid);
endfunction
fpl/inst/deprecated/FPL3dxoutputmesh.m 000644 000765 000000 00000011077 12010454601 020525 0 ustar 00carlo wheel 000000 000000 ## Copyright (C) 2004-2008,2009 Carlo de Falco, Massimiliano Culpo
##
## This file is part of
##
## FPL - Fem PLotting package for octave
##
## FPL is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## FPL is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with FPL; If not, see .
##
##
## AUTHORS:
## Carlo de Falco
##
## Culpo Massimiliano
## Bergische Universitaet Wuppertal
## Fachbereich C - Mathematik und Naturwissenschaften
## Arbeitsgruppe fuer Angewandte MathematD-42119 Wuppertal Gaussstr. 20
## D-42119 Wuppertal, Germany
## -*- texinfo -*-
## @deftypefn {Function File} {} FPL3dxoutputmesh ( @var{filename}, @
## @var{mesh} )
##
## Outputs data in DX form.
##
## Variable must be a scalar, vector or tensor of doubles
##
## @itemize @minus
## @item @var{filename} = name of file to save (type string)
## @item @var{mesh} = PDE-tool like mesh
## @end itemize
## @end deftypefn
function FPL3dxoutputmesh(filename,mesh)
nodes = mesh.p';
elem = mesh.t(1:4,:)';
fid = fopen (filename,"w");
nnodes = columns(mesh.p);
nelem = columns(mesh.t);
fprintf(fid,"object ""pos""\nclass array type float rank 1 shape 3 items %d data follows",nnodes);
for ii = 1:nnodes
fprintf(fid,"\n");
fprintf(fid," %e",nodes(ii,:));
endfor
## In DX format nodes are numbered starting from zero,
## instead we want to number them starting from 1.
if (min(min(elem))==1)
elem = elem - 1;
elseif(min(min(elem))~=0)
error("WARNING: check tetrahedra structure");
end
fprintf(fid,"\n\nobject ""con""\nclass array type int rank 1 shape 4 items %d data follows",nelem);
for ii = 1:nelem
fprintf(fid,"\n");
fprintf(fid," %d",elem(ii,:));
endfor
fprintf(fid,"\nattribute ""element type"" string ""tetrahedra""\nattribute ""ref"" string ""positions""\n\n");
fprintf(fid,"object ""themesh"" class field\n");
fprintf(fid,"component ""positions"" value ""pos""\n");
fprintf(fid,"component ""connections"" value ""con""\n");
fprintf(fid,"\nend\n");
fclose (fid);
endfunction
%!test
%! msh.p =[ 0 0 1 1 0 0 1 1
%! 0 1 0 1 0 1 0 1
%! 0 0 0 0 1 1 1 1];
%! msh.e =[1 5 7 8 5 5 6 8 1 3 5 7
%! 2 6 3 3 7 3 2 6 3 2 6 6
%! 6 1 8 4 3 1 4 4 2 4 7 8
%! 0 0 0 0 0 0 0 0 0 0 0 0
%! 0 0 0 0 0 0 0 0 0 0 0 0
%! 0 0 0 0 0 0 0 0 0 0 0 0
%! 0 0 0 0 0 0 0 0 0 0 0 0
%! 0 0 0 0 0 0 0 0 0 0 0 0
%! 1 1 1 1 1 1 1 1 1 1 1 1
%! 1 1 2 2 3 3 4 4 5 5 6 6];
%! msh.t =[ 1 5 5 6 7 8
%! 3 6 6 3 3 3
%! 2 7 3 2 6 6
%! 6 3 1 4 8 4
%! 1 1 1 1 1 1];
%! testfile = "object ""pos""\nclass array type float rank 1 shape 3 items 8 data follows\n 0.000000e+00 0.000000e+00 0.000000e+00\n 0.000000e+00 1.000000e+00 0.000000e+00\n 1.000000e+00 0.000000e+00 0.000000e+00\n 1.000000e+00 1.000000e+00 0.000000e+00\n 0.000000e+00 0.000000e+00 1.000000e+00\n 0.000000e+00 1.000000e+00 1.000000e+00\n 1.000000e+00 0.000000e+00 1.000000e+00\n 1.000000e+00 1.000000e+00 1.000000e+00\n\nobject ""con""\nclass array type int rank 1 shape 4 items 6 data follows\n 0 2 1 5\n 4 5 6 2\n 4 5 2 0\n 5 2 1 3\n 6 2 5 7\n 7 2 5 3\nattribute ""element type"" string ""tetrahedra""\nattribute ""ref"" string ""positions""\n\nobject ""themesh"" class field\ncomponent ""positions"" value ""pos""\ncomponent ""connections"" value ""con""\n\nend\n";
%! FPL3dxoutputmesh ("__FPL3dxoutputmesh__test__.dx",msh);
%! fid = fopen("__FPL3dxoutputmesh__test__.dx","r");
%! s = fread(fid);
%! fclose(fid);
%! assert (char(s'), testfile);
%! delete __FPL3dxoutputmesh__test__.dx