pkg://ifsdaem-1.1-1.src.rpm:94968/ifsdaem.tgz
info downloads
./ifsdaem-1.1/COPYING 100664 764 144 43076 6506244217 12571 0 ustar timo users GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) 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
this service 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 make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. 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.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the 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 a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE 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.
END OF TERMS AND CONDITIONS
Appendix: 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
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision 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, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This 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 Library General
Public License instead of this License.
./ifsdaem-1.1/Makefile 100664 0 0 2646 6637205731 12662 0 ustar root root INCDIR = /usr/lib/qt/include
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LFLAGS = -L/usr/X11/lib/qt/lib -lqt -lm
CC = gcc
MOC = /usr/X11/lib/qt/bin/moc
LSTATIC = /usr/X11/lib/libqt.a -lm -lX11
####### Files
SOURCES = run.cpp parse.cpp farben.cpp ifs_drawer.cpp ifs_utils.cpp \
ifs_file_editor.cpp ifs_win.cpp
OBJECTS = run.o parse.o farben.o ifs_drawer.o ifs_utils.o ifs_win.o \
ifs_file_editor.o
OBJ_THERE= ./edit_win/ifs.o ./edit_win/abbildung.o ./edit_win/koordsys.o \
./edit_win/qiandsc.o ./edit_win/edit_win.o
OBJMETA = mfile_win.o
OBJM_THERE=./edit_win/mqiandsc.o ./edit_win/medit_win.o
TARGET = ifsdaem
####### Implicit rules
.SUFFIXES: .cpp
.cpp.o:
$(CC) -c $(CFLAGS) -I$(INCDIR) $<
####### Build rules
all: linux_shared
linux_shared: $(OBJECTS) $(OBJMETA)
cd edit_win; make
$(CC) $(OBJECTS) $(OBJMETA) $(OBJ_THERE) $(OBJM_THERE) -o $(TARGET) $(LFLAGS)
linux_static: $(OBJECTS) $(OBJMETA)
cd edit_win; make
$(CC) $(OBJECTS) $(OBJMETA) $(OBJ_THERE) $(OBJM_THERE) -o $(TARGET) $(LSTATIC)
archiv:
tar -c -z -f ifsdaem.tgz *
archiv_1:
zip -9 -r ifsdaem.zip . -i \*
files_1:
find . -name "*" > FILES
files:
ls -l * > FILES
depend:
@makedepend -I$(INCDIR) $(SOURCES) 2> /dev/null
clean:
rm -f *.o *.bak *.e *.ESV *.tgz
cd edit_win; make clean
####### Meta classes
mfile_win.cpp: file_win.h
$(MOC) -o $@ $<
# DO NOT DELETE THIS LINE -- make depend depends on it.
./ifsdaem-1.1/README 100664 0 0 1724 6704440604 12071 0 ustar root root ------------------ IFS-Daemon Version 1.1 --------------------------
A program to create easily IFS.
<Copyright (C) 1998 Timo Hartmann >
<email: hudson.hartmann@t-online.de>
LINUX-Version for X-Windows
Requires QT-TOOLKIT
Building ifsdaem in 3 easy steps:
1.) Adjust the makefile
INCDIR for QT,moc,...
2.) type make
3.) Copy ifsdaem in /usr/bin (or where you want it to be)
--------------------------------------------------------------------
This 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 2 of the License,
or (at your opinion) 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.
./ifsdaem-1.1/edit_win/ 40775 764 144 0 6704443453 13214 5 ustar timo users ./ifsdaem-1.1/edit_win/abbildung.cpp 100664 764 144 7524 6533503556 15755 0 ustar timo users /* <Copyright (C) 1998 Timo Hartmann >
This 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 2 of the License,
or (at your opinion) 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.,
675 Mass Ave, Cambridge, MA 02139, USA.
See "COPYING" and "README" for more details. */
#include "abbildung.hpp"
void abbildung::verkette(abbildung& n1,abbildung& n2)
{
if(&n1==this)
{
abbildung tmp1;
tmp1.set(n1);
if(&n2==this)
{
abbildung tmp2;
tmp2.set(n2);
verkette(tmp1,tmp2);
return;
}
verkette(tmp1,n2);
return;
}
if(&n2==this)
{
abbildung tmp2;
tmp2.set(n2);
verkette(n1,tmp2);
return;
}
a= n1.a * n2.a + n1.c * n2.b ;
c= n1.a * n2.c + n1.c * n2.d ;
b= n1.b * n2.a + n1.d * n2.b ;
d= n1.b * n2.c + n1.d * n2.d ;
e= n1.e * n2.a + n1.f * n2.b + n2.e ;
f= n1.e * n2.c + n1.f * n2.d + n2.f ;
}
int abbildung::umkehr(abbildung& n)
{
double det;
det= n.det();
if(fabs(det)<1e-15) return FALSE;
a= n.d / det;
b=- n.b / det;
c=- n.c / det;
d= n.a / det;
e= ( n.f * n.b - n.e * n.d) / det;
f=- ( n.f * n.a - n.e * n.c) / det;
return TRUE;
}
int abbildung::fixpunkt(double& d1,double& d2)
{
double nenner;
nenner=(1-d)*(1-a)-c*b;
if(fabs(nenner)<1e-12)
{
d1=0;
d2=0;
return FALSE;
}
d1=(1-d)*e+f*b;
d2=(1-a)*f+e*c;
d1=d1/nenner;
d2=d2/nenner;
return TRUE;
}
double abbildung::det()
{
return(a*d-b*c);
}
void abbildung::write()
{
printf("%.3g %.3g %.3g %.3g",a,b,c,d);
printf(" , %.3g %.3g\n",e,f);
}
void abbildung::set(abbildung& n)
{
a=n.a;
b=n.b;
c=n.c;
d=n.d;
e=n.e;
f=n.f;
}
void abbildung::null()
{
a=0;
b=0;
c=0;
d=0;
e=0;
f=0;
}
void abbildung::get_trans(double x1,double x2)
{
get_ident();
e=x1;
f=x2;
}
void abbildung::get_rot(double d1)
{
a=cos(d1);
b=-sin(d1);
c=-b;
d=a;
e=0;
f=0;
}
void abbildung::get_spiegx()
{
null();
a=-1;
d=1;
}
void abbildung::get_spiegy()
{
null();
a=1;
d=-1;
}
void abbildung::get_ident()
{
null();
a=1;
d=1;
}
void abbildung::get_scale(double d1,double d2)
{
null();
a=d1;
d=d2;
}
void abbildung::get_scher(double d1,double d2)
{
get_ident();
b=d1;
c=d2;
}
void abbildung::do_it(double &xs,double &ys,double x,double y)
{
xs=a*x+b*y+e;
ys=c*x+d*y+f;
}
//-------------
void abb_alternativ::get_from_abb(abbildung& t)
{
double x2,a,d,b,c,si_,co_;
e=t.e;
f=t.f;
a=t.a;
b=t.b;
c=t.c;
d=t.d;
x2=a*a+c*c;
x=sqrt(x2);
if(fabs(x)<1e-9)
{
x=0;
s=0;
y=sqrt(b*b+d*d);
if(fabs(y)<1e-9)
{
y=0;
rot=0;
return;
}
si_=-b/y;
co_=d/y;
}else
{
s=(b*a+d*c)/x2;
y=(d*a-b*c)/x;
co_=a/x;
si_=c/x;
}
rot=asin(si_);
if(co_<0)
rot=_PI-rot;
}
void abb_alternativ::put_in_abb(abbildung &t)
{
double si_,co_;
si_=sin(rot);
co_=cos(rot);
t.a=x*co_;
t.b=-si_*y+s*x*co_;
t.c=x*si_;
t.d=s*x*si_+y*co_;
t.e=e;
t.f=f;
}
void abb_alternativ::write()
{
printf("s %.4g , x %.4g , y %.4g , rot %.4g, e %.4g , f %.4g \n",s,x,y,rot*_180dPI,e,f);
}
// -------------------- Zum Testen ----------------
/*
main()
{
abb_alternativ t1;
abbildung t2,t3;
t1.s=6;
t1.x=0.9;
t1.y=-0.8;
t1.rot=-6*_PId180;
t1.e=0;
t1.f=0;
t1.put_in_abb(t2);
t2.write();
t1.get_from_abb(t2);
t1.write();
}*/
./ifsdaem-1.1/edit_win/abbildung.hpp 100664 764 144 3433 6533503252 15746 0 ustar timo users /* <Copyright (C) 1998 Timo Hartmann >
This 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 2 of the License,
or (at your opinion) 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.,
675 Mass Ave, Cambridge, MA 02139, USA.
See "COPYING" and "README" for more details. */
#ifndef _abbcpp0
#define _abbcpp0
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "../standart.h"
// xs=a*x+b*y+e
// ys=c*x+d*y+f
class abbildung
{
public :
double a,b,c,d,e,f;
void verkette(abbildung& n1,abbildung& n2);
int umkehr(abbildung& n);
void write();
double det();
void set(abbildung& n);
void null();
void get_trans(double x1,double x2);
void get_rot(double d1);
void get_spiegx();
void get_spiegy();
void get_ident();
void get_scale(double d1,double d2);
void get_scher(double d1,double d2);
int fixpunkt(double& d1,double& d2);
void do_it(double &xs,double &ys,double x,double y);
};
// erst scheren,dann skalen,dann rotieren,dann verschieben
// (1 0) * (x 0) * ( cos sin) = (a b)
// (s 1) (0 y) ( -sin cos ) (c d)
// Das ist die eigentliche Form:
// (x y) * (a c) + (e f) =(xs ys)
// (b d)
class abb_alternativ
{
public :
double rot,s,x,y,e,f;
void get_from_abb(abbildung& t);
void put_in_abb(abbildung& t);
void write();
};
#endif
./ifsdaem-1.1/edit_win/Makefile 100664 0 0 2064 6637205745 14463 0 ustar root root INCDIR = /usr/lib/qt/include
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
LFLAGS = -L/usr/X11/lib/qt/lib -lqt -lm
CC = gcc
MOC = /usr/X11/lib/qt/bin/moc
SHELL = /bin/sh
####### Files
HEADERS = qiandsc.h edit_win.h
SOURCES = qiandsc.cpp edit_win.cpp abbildung.cpp ifs.cpp koordsys.cpp
OBJECTS = qiandsc.o edit_win.o abbildung.o ifs.o koordsys.o
SRCMETA = mqiandsc.cpp medit_win.cpp
OBJMETA = mqiandsc.o medit_win.o
####### Implicit rules
.SUFFIXES: .cpp
.cpp.o:
$(CC) -c $(CFLAGS) -I$(INCDIR) $<
####### Build rules
all: objss
objss: $(OBJECTS) $(OBJMETA)
# zum testen des IFS-Editors
test: $(OBJECTS) $(OBJMETA) run.o
$(CC) $(OBJECTS) $(OBJMETA) run.o -o test_edit $(LFLAGS)
depend:
@makedepend -I$(INCDIR) $(SOURCES) 2> /dev/null
showfiles:
@echo $(HEADERS) $(SOURCES) Makefile
clean:
rm -f *.o *.bak *.e *.ESV
####### Meta classes
mqiandsc.cpp: qiandsc.h
$(MOC) -o $@ $<
medit_win.cpp: edit_win.h
$(MOC) -o $@ $<
# DO NOT DELETE THIS LINE -- make depend depends on it.
./ifsdaem-1.1/edit_win/edit_win.cpp 100664 764 144 31125 6534776601 15646 0 ustar timo users /* <Copyright (C) 1998 Timo Hartmann >
This 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 2 of the License,
or (at your opinion) 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.,
675 Mass Ave, Cambridge, MA 02139, USA.
See "COPYING" and "README" for more details. */
#include "edit_win.h"
draw_area_class::draw_area_class(QWidget *parent,const char *name):QWidget(parent,name)
{
adult=(edit_win*) parent;
}
void draw_area_class::paintEvent(QPaintEvent *)
{
adult->draw_all();
}
void draw_area_class::mousePressEvent(QMouseEvent* p)
{
adult->_mousePressEvent(p);
}
void draw_area_class::mouseReleaseEvent(QMouseEvent *p)
{
adult->_mouseReleaseEvent(p);
}
void draw_area_class::mouseMoveEvent(QMouseEvent *p)
{
adult->_mouseMoveEvent(p);
}
edit_win::edit_win(QWidget *parent,const char *name) : QWidget(parent,name)
{
setCaption("IFS-Daemon : Editor");
// Die Einstellungen
rot_i=new qinpscr("Rot.:",40,this);CHECK_PTR(rot_i);
transx_i=new qinpscr("Tr. x:",40,this);CHECK_PTR(transx_i);
transy_i=new qinpscr("Tr. y:",40,this);CHECK_PTR(transy_i);
schx_i=new qinpscr("Sch.x:",40,this);CHECK_PTR(schx_i);
scx_i=new qinpscr("Sc. x:",40,this);CHECK_PTR(scx_i);
scy_i=new qinpscr("Sc. y:",40,this);CHECK_PTR(scy_i);
// Buttons
clear_b=new QPushButton("clear",this,"t1");CHECK_PTR(clear_b);
clear_b->resize(40,20);
add_b=new QPushButton("add",this,"t1");CHECK_PTR(add_b);
add_b->resize(40,20);
ifs_b=new QPushButton("test",this,"t1");CHECK_PTR(ifs_b);
ifs_b->resize(40,20);
emit_b=new QPushButton("emit",this,"t1");CHECK_PTR(emit_b);
emit_b->resize(40,20);
// Liste fr abbildungen
auswahl=new QListBox(this,"t1");CHECK_PTR(auswahl);
auswahl->resize(80,80);
// Das Malfenster
draw_area=new draw_area_class(this);CHECK_PTR(draw_area);
draw_area->move(0,0);
draw_area->setBackgroundColor(black);
// Einrichten
ix1=100;
iy1=100;
transx_i->set_dx(ix1/100);
transy_i->set_dx(ix1/100); // nicht iy1/2, damit das gleichmaessig erscheint
scx_i->set_dx(0.05);
scy_i->set_dx(0.05);
schx_i->set_dx(0.05);
liste_abb=new abb_alt_handler();CHECK_PTR(liste_abb);
actual_abb=0;
mouse_was=-1;
is_ifs=0;
arrange();
// Ereignisse
connect(rot_i,SIGNAL(ready()),this,SLOT(change_val()));
connect(schx_i,SIGNAL(ready()),this,SLOT(change_val()));
connect(scx_i,SIGNAL(ready()),this,SLOT(change_val()));
connect(scy_i,SIGNAL(ready()),this,SLOT(change_val()));
connect(transx_i,SIGNAL(ready()),this,SLOT(change_val()));
connect(transy_i,SIGNAL(ready()),this,SLOT(change_val()));
connect(clear_b,SIGNAL(clicked()),this,SLOT(clear_abb()));
connect(ifs_b,SIGNAL(released()),this,SLOT(test_ifs()));
connect(add_b,SIGNAL(clicked()),this,SLOT(add_abb()));
connect(emit_b,SIGNAL(clicked()),this,SLOT(do_emit()));
connect(auswahl,SIGNAL(selected(int)),this,SLOT(new_selected(int)));
}
void edit_win::arrange()
{
int beginofblock=width()-40-80;
draw_area->resize(beginofblock,height());
rot_i->move(beginofblock,0);
transx_i->move(beginofblock,20);
transy_i->move(beginofblock,40);
transy_i->move(beginofblock,40);
schx_i->move(beginofblock,60);
scx_i->move(beginofblock,80);
scy_i->move(beginofblock,100);
add_b->move(beginofblock+5,130);
ifs_b->move(beginofblock+5,150);
emit_b->move(beginofblock+5+40+5,130);
clear_b->move(beginofblock+5+40+5,150);
auswahl->move(beginofblock+10,195);
init_koord();
}
void edit_win::clear_abb()
{
sleep();
liste_abb=new abb_alt_handler();CHECK_PTR(liste_abb);
auswahl->clear();
auswahl->repaint();
draw_all();
}
void edit_win::edit_ifs(my_ifs *toedit)
{
sleep();
liste_abb=new abb_alt_handler();CHECK_PTR(liste_abb);
auswahl->clear();
double x=0,y=0;
abbildung zw1,zw2,zw3,zw4;
if(toedit->x1==toedit->x2) toedit->init_ifs(x,y,TRUE);
zw1.null();
zw1.e=-(toedit->x1+toedit->x2)/2;
zw1.f=-(toedit->y1+toedit->y2)/2;
zw1.a=ix1/fabs(toedit->x1-toedit->x2);
zw1.d=iy1/fabs(toedit->y1-toedit->y2);
if(zw1.a>zw1.d) {zw1.a=zw1.d;} else zw1.d=zw1.a;
zw1.e*=zw1.a;
zw1.f*=zw1.a;
zw2.umkehr(zw1);
abb_alternativ *t;
for(int i=0;i<toedit->count;i++)
{
t=new abb_alternativ();
CHECK_PTR(t);
zw3=*toedit->daten[i];
zw4.verkette(zw2,zw3);
zw3.verkette(zw4,zw1);
t->get_from_abb(zw3);
actual_abb=liste_abb->count;
liste_abb->add(t);
init_i(actual_abb);
QString s;
s.sprintf("No %d",actual_abb);
auswahl->insertItem(s);
auswahl->setCurrentItem(actual_abb);
}
}
void edit_win::init_koord()
{
double scx,scy;
scx=draw_area->width();
scx=scx/ix1;
scy=draw_area->height();
scy=scy/iy1;
if(scy<scx) scx=scy;
scx*=0.95;
ifs_fenster.set_all(0,0,draw_area->width()/2,draw_area->height()/2,scx,-scx);
init_kontaktp(actual_abb);
}
void edit_win::draw_koord()
{
QPainter p;
p.begin(draw_area);
p.setPen(white);
draw_line(ix1/2,iy1/2,-ix1/2,iy1/2,&p);
draw_line(-ix1/2,iy1/2,-ix1/2,-iy1/2,&p);
draw_line(-ix1/2,-iy1/2,ix1/2,-iy1/2,&p);
draw_line(ix1/2,-iy1/2,ix1/2,iy1/2,&p);
p.end();
}
void edit_win::draw_all()
{
draw_area->erase();
draw_koord();
if(liste_abb->count<=0) return;
QPainter p;
p.begin(draw_area);
p.setPen(blue);
for(int i=0;i<liste_abb->count;i++)
if(i!=actual_abb) draw_abb(i,&p);
p.setPen(red);
draw_abb(actual_abb,&p);
p.setPen(green);
draw_kontaktp(&p);
p.end();
}
void edit_win::draw_abb(unsigned int i,QPainter *p)
{
abbildung test;
liste_abb->daten[i]->put_in_abb(test);
double x1,y1,x2,y2;
test.do_it(x1,y1,ix1/2,iy1/2);
test.do_it(x2,y2,-ix1/2,iy1/2);
draw_line(x1,y1,x2,y2,p);
test.do_it(x1,y1,-ix1/2,-iy1/2);
draw_line(x1,y1,x2,y2,p);
test.do_it(x2,y2,ix1/2,-iy1/2);
draw_line(x1,y1,x2,y2,p);
test.do_it(x1,y1,ix1/2,iy1/2);
draw_line(x1,y1,x2,y2,p);
}
void edit_win::draw_kontaktp(QPainter *p)
{
p->drawLine(kontaktp[0][0],kontaktp[0][1],kontaktp[1][0],kontaktp[1][1]);
p->drawLine(kontaktp[1][0],kontaktp[1][1],kontaktp[2][0],kontaktp[2][1]);
for(int i=0;i<3;i++)
p->drawEllipse(kontaktp[i][0]-(_RADIUS_C>>1),
kontaktp[i][1]-(_RADIUS_C>>1),_RADIUS_C,_RADIUS_C);
}
void edit_win::init_kontaktp(unsigned int i)
{
if(i>=(unsigned)liste_abb->count) return;
abbildung test;
liste_abb->daten[i]->put_in_abb(test);
double x,y,x1,y1;
x1=-ix1/2+ix1*0.3;
y1=-iy1/2+iy1*0.3;
test.do_it(x,y,x1,y1);
ifs_fenster.abb(x,y,x1,y1);
kontaktp[0][0]=(int) x1;
kontaktp[0][1]=(int) y1;
x1=-ix1/2+ix1*0.3;
y1=-iy1/2+iy1*0.5;
test.do_it(x,y,x1,y1);
ifs_fenster.abb(x,y,x1,y1);
kontaktp[1][0]=(int) x1;
kontaktp[1][1]=(int) y1;
x1=-ix1/2+ix1*0.9;
y1=-iy1/2+iy1*0.5;
test.do_it(x,y,x1,y1);
ifs_fenster.abb(x,y,x1,y1);
kontaktp[2][0]=(int) x1;
kontaktp[2][1]=(int) y1;
}
void edit_win::draw_line(double x1,double y1,double x2,double y2,QPainter *p)
{
double xs,ys;
int zw1x,zw1y,zw2x,zw2y;
ifs_fenster.abb(x1,y1,xs,ys);
zw1x=(int)xs;
zw1y=(int)ys;
ifs_fenster.abb(x2,y2,xs,ys);
zw2x=(int)xs;
zw2y=(int)ys;
p->drawLine(zw1x,zw1y,zw2x,zw2y);
}
void edit_win::draw_point(double x,double y,QPainter *p)
{
double xs,ys;
int zw1x,zw1y;
ifs_fenster.abb(x,y,xs,ys);
zw1x=(int)xs;
zw1y=(int)ys;
p->drawPoint(zw1x,zw1y);
}
edit_win::~edit_win()
{
sleep();
}
void edit_win::sleep()
{
delete liste_abb;
liste_abb=NULL;
actual_abb=0;
}
void edit_win::change_val()
{
if(liste_abb->count==0) return;
abb_alternativ *t=liste_abb->daten[actual_abb];
t->rot=rot_i->get_wert()*_PId180;
t->x=scx_i->get_wert();
t->y=scy_i->get_wert();
t->s=schx_i->get_wert();
t->e=transx_i->get_wert();
t->f=transy_i->get_wert();
liste_abb->change(actual_abb);
init_kontaktp(actual_abb);
draw_all();
}
void edit_win::init_i(unsigned int i)
{
if(i>=(unsigned)liste_abb->count) return;
abb_alternativ *t=liste_abb->daten[actual_abb];
rot_i->set_wert(t->rot*_180dPI);
scx_i->set_wert(t->x);
scy_i->set_wert(t->y);
schx_i->set_wert(t->s);
transx_i->set_wert(t->e);
transy_i->set_wert(t->f);
init_kontaktp(actual_abb);
draw_all();
}
void edit_win::add_abb()
{
abb_alternativ *t;
t=new abb_alternativ();
CHECK_PTR(t);
t->x=0.5;
t->y=0.5;
t->rot=0;
t->e=0;
t->f=0;
t->s=0;
actual_abb=liste_abb->count;
liste_abb->add(t);
init_i(actual_abb);
QString s;
s.sprintf("No %d",actual_abb);
auswahl->insertItem(s);
auswahl->setCurrentItem(actual_abb);
}
void edit_win::new_selected(int i)
{
actual_abb=i;
init_i(i);
}
void edit_win::resizeEvent(QResizeEvent*)
{
arrange();
}
void edit_win::_mousePressEvent(QMouseEvent* p)
{
if(liste_abb->count<=0) return;
if(p->button()!=1) return;
int i;
for(i=0;i<3;i++)
if(sqr(p->x()-kontaktp[i][0])+sqr(p->y()-kontaktp[i][1])
<=sqr(_RADIUS_C)) break;
if(i==3) return;
mouse_was=i;
mouse_abb=*liste_abb->daten[actual_abb];
for(i=0;i<3;i++)
{
oldp[i][0]=kontaktp[i][0];
oldp[i][1]=kontaktp[i][1];
}
}
void edit_win::_mouseReleaseEvent(QMouseEvent *)
{
mouse_was=-1;
}
void edit_win::_mouseMoveEvent(QMouseEvent *p)
{
if(mouse_was==-1) return;
abb_alternativ *t;
t=liste_abb->daten[actual_abb];
if(mouse_was==0)
{
#if 0
double h2,h1,d1,d2,dx1,dx2,dy1,dy2;
dx1=oldp[0][0]-oldp[1][0];
dy1=oldp[0][1]-oldp[1][1];
dx2=p->x()-oldp[1][0];
dy2=p->y()-oldp[1][1];
dx1=dx1/ifs_fenster.scalex;
dy1=dy1/ifs_fenster.scaley;
dx2=dx2/ifs_fenster.scalex;
dy2=dy2/ifs_fenster.scaley;
d1=sqrt(dx1*dx1+dy1*dy1);
d2=sqrt(dx2*dx2+dy2*dy2);
if(fabs(d1)<1e-9) return;
t->y=mouse_abb.y*d2/d1;
////////////////////////////
dx1=oldp[2][0]-oldp[1][0];
dy1=oldp[2][1]-oldp[1][1];
dx1=dx1/ifs_fenster.scalex;
dy1=dy1/ifs_fenster.scaley;
d1=sqrt(dx1*dx1+dy1*dy1);
h1=(dx1*dx2+dy1*dy2)/d1;
dx2=oldp[0][0]-oldp[1][0];
dy2=oldp[0][1]-oldp[1][1];
dx2=dx2/ifs_fenster.scalex;
dy2=dy2/ifs_fenster.scaley;
d2=sqrt(dx2*dx2+dy2*dy2);
h2=(dx1*dx2+dy1*dy2)/d1;
t->y=mouse_abb.y*h2/h1;
init_i(actual_abb);
liste_abb->change(actual_abb);
#endif
}
if(mouse_was==1)
{
double dx,dy;
dx=p->x()-oldp[1][0];
dy=p->y()-oldp[1][1];
dx=dx/ifs_fenster.scalex;
dy=dy/ifs_fenster.scaley;
t->e=mouse_abb.e+dx;
t->f=mouse_abb.f+dy;
init_i(actual_abb);
liste_abb->change(actual_abb);
}
if(mouse_was==2)
{
double dx1,dy1,dx2,dy2,l1,l2,alpha1,alpha2;
dx1=p->x()-oldp[1][0];
dy1=p->y()-oldp[1][1];
dx2=oldp[2][0]-oldp[1][0];
dy2=oldp[2][1]-oldp[1][1];
dx1=dx1/ifs_fenster.scalex;
dy1=dy1/ifs_fenster.scaley;
dx2=dx2/ifs_fenster.scalex;
dy2=dy2/ifs_fenster.scaley;
l1=sqr(dx1)+sqr(dy1);
l2=sqr(dx2)+sqr(dy2);
if(fabs(l1)<1e-12) return;
if(fabs(l2)<1e-12) return;
l1=sqrt(l1);
l2=sqrt(l2);
alpha1=acos(dx1/l1);
if(dy1<0) alpha1=2*_PI-alpha1;
alpha2=acos(dx2/l2);
if(dy2<0) alpha2=2*_PI-alpha2;
alpha1=alpha1-alpha2;
t->rot=mouse_abb.rot+alpha1;
l1=l1/l2;
t->x=mouse_abb.x*l1;
t->y=mouse_abb.y*l1;
init_i(actual_abb);
liste_abb->change(actual_abb);
}
}
void edit_win::test_ifs()
{
if(is_ifs==0)
{
is_ifs=1;
timer_id=startTimer(1);
} else
{
is_ifs=0;
killTimer(timer_id);
}
}
void edit_win::timerEvent(QTimerEvent*)
{
do_test_ifs();
}
void edit_win::do_test_ifs()
{
if(liste_abb->count==0) return;
if(liste_abb->ifs->is_ready==FALSE)
{
liste_abb->ifs->init_startp();
liste_abb->ifs->daten[0]->fixpunkt(xr,yr);
}
QPainter p;
p.begin(draw_area);
p.setPen(yellow);
for(int i=0;i<100;i++)
{
liste_abb->ifs->render(xr,yr,xr,yr);
draw_point(xr,yr,&p);
}
p.end();
}
void edit_win::do_emit()
{
emit ifs_ready();
}
my_ifs* edit_win::get_ifs()
{
if(liste_abb->count==0) return NULL;
my_ifs *ifs=new my_ifs();CHECK_PTR(ifs);
for(int i=0;i<liste_abb->count;i++)
{
abbildung *test=new abbildung();CHECK_PTR(test);
liste_abb->daten[i]->put_in_abb(*test);
ifs->add(test,0);
}
ifs->init_startp();
ifs->x1=-ix1/2;
ifs->x2=-iy1/2;
ifs->y1=ix1/2;
ifs->y2=iy1/2;
return ifs;
}
./ifsdaem-1.1/edit_win/ifs.cpp 100664 0 0 10140 6637206104 14310 0 ustar root root /* <Copyright (C) 1998 Timo Hartmann >
This 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 2 of the License,
or (at your opinion) 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.,
675 Mass Ave, Cambridge, MA 02139, USA.
See "COPYING" and "README" for more details. */
#include "ifs.hpp"
abb_alt_handler::abb_alt_handler()
{
count=0;
daten=NULL;;
ifs=new my_ifs();CHECK_PTR(ifs);
}
abb_alt_handler::~abb_alt_handler()
{
if(ifs!=NULL) delete ifs;
ifs=NULL;count=0;
if(daten==NULL) return;
for(int i=0;i<count;i++)
if(daten[i]!=NULL) delete daten[i];
free(daten);
daten=NULL;
}
void abb_alt_handler::add(abb_alternativ *p)
{
count++;
daten=(abb_alternativ**)realloc(daten,count*sizeof(abb_alternativ*));
CHECK_PTR(daten);
daten[count-1]=p;
abbildung *t1=new abbildung();
p->put_in_abb(*t1);
ifs->add(t1,10);
}
void abb_alt_handler::change(unsigned int i)
{
if(i>=(unsigned)count) return;
daten[i]->put_in_abb(*ifs->daten[i]);
ifs->is_ready=FALSE;
}
//****************
my_ifs::my_ifs()
{
daten=NULL;
p=NULL;
startp=NULL;
count=0;
x1=x2=y1=y2=0;
is_ready=FALSE;
}
my_ifs::~my_ifs()
{
for(int i=0;i<count;i++)
delete daten[i];
if(daten!=NULL) free(daten);
if(p!=NULL) free(p);
if(startp!=NULL) free(startp);
count=0;is_ready=FALSE;
}
void my_ifs::add(abbildung *res,double p1)
{
count++;
daten=(abbildung**)realloc(daten,count*sizeof(abbildung*));CHECK_PTR(daten);
p=(double*)realloc(p,count*sizeof(double));CHECK_PTR(p);
startp=(double*) realloc(startp,count*sizeof(double));CHECK_PTR(startp);
daten[count-1]=res;
p[count-1]=p1;
is_ready=FALSE;
}
void my_ifs::init_p()
{
double d;
for(int i=0;i<count;i++)
{
p[i]=fabs(daten[i]->det());
}
for(int j=0;j<2;j++)
{
d=0;
for(int i=0;i<count;i++)
if(p[i]<1e-6) p[i]=0.01;
for(int i=0;i<count;i++)
d+=p[i];
for(int i=0;i<count;i++)
p[i]=p[i]/d;
}
}
void my_ifs::check_p()
{
for(int i=0;i<count;i++)
if(p[i]<0)
{
init_p();return;
}
double d=0;
for(int i=0;i<count;i++)
d+=p[i];
if(fabs(d-1)>1e-4)
{
init_p();return;
}
}
void my_ifs::init_startp()
{
double d=0;
check_p();
for(int i=0;i<count;i++)
{
d+=p[i];
startp[i]=d; // eher endp
}
}
int my_ifs::check_ifs()
{
if(count==0) return FALSE;
for(int i=0;i<count;i++)
{
if(fabs(daten[i]->a)>=1) return FALSE;
if(fabs(daten[i]->b)>=1) return FALSE;
if(fabs(daten[i]->c)>=1) return FALSE;
if(fabs(daten[i]->d)>=1) return FALSE;
if(fabs(daten[i]->det())>=1) return FALSE;
}
return TRUE;
}
int my_ifs::init_ifs(double& x,double& y,int test)
{
if(check_ifs()==FALSE) return FALSE;
init_startp();
daten[0]->fixpunkt(x,y);
is_ready=TRUE;
if(test) get_grenzen(x,y);
return TRUE;
}
void my_ifs::get_grenzen(double x,double y)
{
x1=1e7;
x2=-1e7;
y1=1e7;
y2=-1e7;
for(int i=0;i<2000;i++)
{
if(x<x1) x1=x;
if(x>x2) x2=x;
if(y<y1) y1=y;
if(y>y2) y2=y;
render(x,y,x,y);
}
double mx=(x1+x2)/2,my=(y1+y2)/2;
x1=mx+(x1-mx)*1.1;
x2=mx+(x2-mx)*1.1;
y1=my+(y1-my)*1.1;
y2=my+(y2-my)*1.1;
}
void my_ifs::render(double& xs,double& ys,double x,double y)
{
unsigned int i=(unsigned)random_();
if(i<(unsigned)count) {daten[i]->do_it(xs,ys,x,y);} else{xs=0,ys=0;}
}
void my_ifs::render(double& xs,double& ys,double x,double y,unsigned int i)
{
if(i<(unsigned)count) {daten[i]->do_it(xs,ys,x,y);} else{xs=0,ys=0;}
}
int my_ifs::random_()
{
double p=((double)random())/RAND_MAX;
for(int i=0;i<count;i++)
if(p<startp[i]) return i;
return count-1; // im Zweifelsfall
}
./ifsdaem-1.1/edit_win/ifs.hpp 100664 764 144 3275 6511675577 14624 0 ustar timo users /* <Copyright (C) 1998 Timo Hartmann >
This 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 2 of the License,
or (at your opinion) 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.,
675 Mass Ave, Cambridge, MA 02139, USA.
See "COPYING" and "README" for more details. */
#ifndef _ifs_hpp
#define _ifs_hpp
#include "abbildung.hpp"
typedef double my_point[2];
#define cp_my_point(a,b) {(a)[0]=(b)[0];(a)[1]=(b)[1];}
class my_ifs;
class abb_alt_handler
{
public:
abb_alternativ **daten;
int count;
my_ifs *ifs;
abb_alt_handler();
~abb_alt_handler();
void add(abb_alternativ *p);
void change(unsigned int i);
};
class my_ifs
{
public :
abbildung **daten;
double *p;
double *startp;
double x1,y1,x2,y2;
int count,is_ready;
my_ifs();
~my_ifs();
void add(abbildung *res,double p1);
void init_p(); // Intern
void check_p(); // Intern
void init_startp(); // Intern
int check_ifs(); // intern
void render(double& xs,double& ys,double x,double y);
void render(double& xs,double& ys,double x,double y,unsigned int i);
int random_();
int init_ifs(double& x,double& y,int test); //Das aufrufen
void get_grenzen(double x,double y);
};
#endif
./ifsdaem-1.1/edit_win/edit_win.h 100664 764 144 5517 6534771507 15301 0 ustar timo users /* <Copyright (C) 1998 Timo Hartmann >
This 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 2 of the License,
or (at your opinion) 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.,
675 Mass Ave, Cambridge, MA 02139, USA.
See "COPYING" and "README" for more details. */
#ifndef _edit_win_h
#define _edit_win_h
#include <qlistbox.h>
#include <qpainter.h>
#include "qiandsc.h"
#include "ifs.hpp"
#include "koordsys.hpp"
#define _RADIUS_C 5
class draw_area_class;
class edit_win : public QWidget
{
Q_OBJECT
public slots :
void change_val();
void add_abb();
void new_selected(int i);
void test_ifs();
void do_emit();
void clear_abb();
signals:
void ifs_ready();
protected :
void resizeEvent(QResizeEvent*);
void timerEvent(QTimerEvent*);
public :
qinpscr *rot_i,*transx_i,*transy_i,*schx_i,*scx_i,*scy_i; // Scrolleisten
QPushButton *clear_b,*add_b,*ifs_b,*emit_b; // Buttons
draw_area_class *draw_area; // Das Fenster
QListBox *auswahl; // Die Liste
double ix1,iy1; // Das IFS-Fenster, Zentrum : (0,0) ; Groesse : (ix1,ix2)
int kontaktp[3][2]; // Die Mauspunkte
int oldp[3][2]; // Fuer Maus
koordsys ifs_fenster; // das Koordinatensystem
abb_alt_handler *liste_abb; // die Abbildungen
abb_alternativ mouse_abb; // Fuer Maus
int actual_abb; // Wo sind wir?
int mouse_was; // fuer Maus
int is_ifs; // fuer testen
int timer_id; // fuer testen
double xr,yr; // fuer testen
edit_win(QWidget *parent,const char *name=0);
~edit_win();
void arrange();
void init_koord();
void draw_line(double x1,double y1,double x2,double y2,QPainter *p);
void draw_point(double x,double y,QPainter *p);
void draw_koord();
void init_i(unsigned int i);
void draw_all();
void draw_abb(unsigned int i,QPainter *p);
void draw_kontaktp(QPainter *p);
void init_kontaktp(unsigned int i);
void do_test_ifs();
void edit_ifs(my_ifs *toedit);
void sleep();
void _mousePressEvent(QMouseEvent* p);
void _mouseReleaseEvent(QMouseEvent *p);
void _mouseMoveEvent(QMouseEvent *p);
my_ifs * get_ifs();
};
class draw_area_class : public QWidget
{
protected:
void paintEvent(QPaintEvent *);
void mousePressEvent(QMouseEvent* p);
void mouseReleaseEvent(QMouseEvent *p);
void mouseMoveEvent(QMouseEvent *p);
public :
edit_win *adult;
draw_area_class(QWidget *parent,const char *name=0);
};
#endif
./ifsdaem-1.1/edit_win/qiandsc.h 100664 764 144 3062 6511675624 15110 0 ustar timo users /* <Copyright (C) 1998 Timo Hartmann >
This 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 2 of the License,
or (at your opinion) 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.,
675 Mass Ave, Cambridge, MA 02139, USA.
See "COPYING" and "README" for more details. */
#ifndef _qtand_
#define _qtand_
#include <qapp.h>
#include <qwidget.h>
#include <qpushbt.h>
#include <qlined.h>
#include <qlabel.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
class qinputandscroll : public QWidget
{
Q_OBJECT
protected :
void resizeEvent(QResizeEvent *);
public slots :
void input_ev();
void scrollr_ev();
void scrolll_ev();
signals :
void ready();
public :
double wert,dx;
QPushButton *schl,*schr;
QLineEdit *input;
qinputandscroll(QWidget *parent,const char *name=0);
void set_wert(double d);
void set_dx(double d);
double get_wert(){return wert;}
virtual void arrange();
};
class qinpscr : public qinputandscroll
{
public :
QLabel *namel;
int laenge;
qinpscr(char *s,int i,QWidget *parent);
void arrange();
};
#endif
./ifsdaem-1.1/edit_win/qiandsc.cpp 100664 764 144 5425 6511675546 15453 0 ustar timo users /* <Copyright (C) 1998 Timo Hartmann >
This 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 2 of the License,
or (at your opinion) 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.,
675 Mass Ave, Cambridge, MA 02139, USA.
See "COPYING" and "README" for more details. */
#include "qiandsc.h"
qinputandscroll::qinputandscroll(QWidget *parent,const char *name):QWidget(parent,name)
{
resize(80,20);
schl=new QPushButton("<",this,"t1");CHECK_PTR(schl);
schl->setGeometry(0,0,20,20);
schr=new QPushButton(">",this,"t1");CHECK_PTR(schr);
schr->setGeometry(80-20,0,20,20);
input=new QLineEdit(this,"t1");CHECK_PTR(input);
input->setGeometry(20,0,80-40,20);
input->setMaxLength(15);
input->setText("0");
connect(schl,SIGNAL(clicked()),this,SLOT(scrolll_ev()));
connect(schr,SIGNAL(clicked()),this,SLOT(scrollr_ev()));
connect(input,SIGNAL(returnPressed()),this,SLOT(input_ev()));
wert=0;dx=1;
}
void qinputandscroll::arrange()
{
input->resize(width()-2*schl->width(),height());
schr->move(width()-schr->width(),0);
}
void qinputandscroll::set_wert(double d)
{
char buf[20];
sprintf(buf,"%.6g",d);
input->setText(buf);
wert=d;
}
void qinputandscroll::set_dx(double d)
{
dx=d;
}
void qinputandscroll::scrolll_ev()
{
wert-=dx;
set_wert(wert);
emit ready();
}
void qinputandscroll::scrollr_ev()
{
wert+=dx;
set_wert(wert);
emit ready();
}
void qinputandscroll::input_ev()
{
char *c,*zw;
c=(char *)input->text();
double d=strtod(c,&zw);
if( ((long)(zw-c))!=(long)strlen(c))
{
set_wert(wert);
} else wert=d;
emit ready();
}
void qinputandscroll::resizeEvent(QResizeEvent *)
{
arrange();
}
//***********************************
qinpscr::qinpscr(char *s,int i,QWidget *parent) : qinputandscroll(parent)
{
setMinimumSize(120,20);
namel= new QLabel(this,"t1");CHECK_PTR(namel);
namel->setText(s);
namel->setGeometry(0,0,i,20);
laenge=i;
arrange();
}
void qinpscr::arrange()
{
schl->move(laenge,0);
input->move(laenge+schl->width(),0);
input->resize(width()-2*schl->width()-laenge,height());
schr->move(width()-schr->width(),0);
}
/*
main(int argc,char **argv)
{
QApplication a(argc,argv);
qinputandscroll test(NULL);
test.setGeometry(10,10,80,20);
a.setMainWidget(&test);
test.show();
return a.exec();
}
*/
./ifsdaem-1.1/edit_win/koordsys.cpp 100664 764 144 2631 6511675535 15700 0 ustar timo users /* <Copyright (C) 1998 Timo Hartmann >
This 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 2 of the License,
or (at your opinion) 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.,
675 Mass Ave, Cambridge, MA 02139, USA.
See "COPYING" and "README" for more details. */
#include "koordsys.hpp"
koordsys::koordsys()
{
scalex=1;
scaley=1;
centx=0;
centy=0;
}
void koordsys::set_scale(double x,double y)
{
scalex=x;
scaley=y;
}
void koordsys::set_cent(double x,double y)
{
centx=x;
centy=y;
}
void koordsys::set_all(double oldx,double oldy,double nx,double ny,double scx,double scy)
{
scalex=scx;
scaley=scy;
centx=nx-oldx*scalex;
centy=ny-oldy*scaley;
}
void koordsys::abb(double x,double y,double& x1,double& y1)
{
x1=x*scalex;
y1=y*scaley;
x1+=centx;
y1+=centy;
}
void koordsys::inv(double x,double y,double& x1,double& y1)
{
x1=x-centx;
y1=y-centy;
x1=x1/scalex;
y1=y1/scaley;
}
./ifsdaem-1.1/edit_win/koordsys.hpp 100664 764 144 2306 6511675605 15702 0 ustar timo users /* <Copyright (C) 1998 Timo Hartmann >
This 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 2 of the License,
or (at your opinion) 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.,
675 Mass Ave, Cambridge, MA 02139, USA.
See "COPYING" and "README" for more details. */
#ifndef _K_O_S_
#define _K_O_S_
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
class koordsys
{
public :
double scalex,scaley,centx,centy;
koordsys();
void set_scale(double x,double y);
void set_cent(double x,double y);
void set_all(double oldx,double oldy,double nx,double ny,double scx,double scy);
void abb(double x,double y,double& x1,double& y1);
void inv(double x,double y,double& x1,double& y1);
};
#endif
./ifsdaem-1.1/edit_win/mqiandsc.cpp 100664 764 144 3576 6511676002 15621 0 ustar timo users /****************************************************************************
** qinputandscroll meta object code from reading C++ file 'qiandsc.h'
**
** Created: Sun Apr 5 14:41:38 1998
** by: The Qt Meta Object Compiler ($Revision: 2.14 $)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#if !defined(Q_MOC_OUTPUT_REVISION)
#define Q_MOC_OUTPUT_REVISION 2
#elif Q_MOC_OUTPUT_REVISION != 2
#error Moc format conflict - please regenerate all moc files
#endif
#include <qmetaobj.h>
#include "qiandsc.h"
const char *qinputandscroll::className() const
{
return "qinputandscroll";
}
QMetaObject *qinputandscroll::metaObj = 0;
void qinputandscroll::initMetaObject()
{
if ( metaObj )
return;
if ( strcmp(QWidget::className(), "QWidget") != 0 )
badSuperclassWarning("qinputandscroll","QWidget");
if ( !QWidget::metaObject() )
QWidget::initMetaObject();
typedef void(qinputandscroll::*m1_t0)();
typedef void(qinputandscroll::*m1_t1)();
typedef void(qinputandscroll::*m1_t2)();
m1_t0 v1_0 = &qinputandscroll::input_ev;
m1_t1 v1_1 = &qinputandscroll::scrollr_ev;
m1_t2 v1_2 = &qinputandscroll::scrolll_ev;
QMetaData *slot_tbl = new QMetaData[3];
slot_tbl[0].name = "input_ev()";
slot_tbl[1].name = "scrollr_ev()";
slot_tbl[2].name = "scrolll_ev()";
slot_tbl[0].ptr = *((QMember*)&v1_0);
slot_tbl[1].ptr = *((QMember*)&v1_1);
slot_tbl[2].ptr = *((QMember*)&v1_2);
typedef void(qinputandscroll::*m2_t0)();
m2_t0 v2_0 = &qinputandscroll::ready;
QMetaData *signal_tbl = new QMetaData[1];
signal_tbl[0].name = "ready()";
signal_tbl[0].ptr = *((QMember*)&v2_0);
metaObj = new QMetaObject( "qinputandscroll", "QWidget",
slot_tbl, 3,
signal_tbl, 1 );
}
// SIGNAL ready
void qinputandscroll::ready()
{
activate_signal( "ready()" );
}
./ifsdaem-1.1/edit_win/main.prj 100644 764 144 431 6533502117 14717 0 ustar timo users #
# xwpe - project-file: main.prj
# createted by xwpe version Version 1.4.2
#
CMP= gcc
CMPFLAGS= -g -I/usr/X11/lib/qt/include
LDFLAGS=
EXENAME= a.out
CMPSWTCH= gnu
CMPMESSAGE= '${?*:warning:}\"${FILE}\", line ${LINE}:* at or near * \"${COLUMN=AFTER}\"'
FILES=
install:
./ifsdaem-1.1/edit_win/medit_win.cpp 100664 764 144 4375 6534774154 16013 0 ustar timo users /****************************************************************************
** edit_win meta object code from reading C++ file 'edit_win.h'
**
** Created: Tue Jun 2 15:04:44 1998
** by: The Qt Meta Object Compiler ($Revision: 2.14 $)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#if !defined(Q_MOC_OUTPUT_REVISION)
#define Q_MOC_OUTPUT_REVISION 2
#elif Q_MOC_OUTPUT_REVISION != 2
#error Moc format conflict - please regenerate all moc files
#endif
#include <qmetaobj.h>
#include "edit_win.h"
const char *edit_win::className() const
{
return "edit_win";
}
QMetaObject *edit_win::metaObj = 0;
void edit_win::initMetaObject()
{
if ( metaObj )
return;
if ( strcmp(QWidget::className(), "QWidget") != 0 )
badSuperclassWarning("edit_win","QWidget");
if ( !QWidget::metaObject() )
QWidget::initMetaObject();
typedef void(edit_win::*m1_t0)();
typedef void(edit_win::*m1_t1)();
typedef void(edit_win::*m1_t2)(int);
typedef void(edit_win::*m1_t3)();
typedef void(edit_win::*m1_t4)();
typedef void(edit_win::*m1_t5)();
m1_t0 v1_0 = &edit_win::change_val;
m1_t1 v1_1 = &edit_win::add_abb;
m1_t2 v1_2 = &edit_win::new_selected;
m1_t3 v1_3 = &edit_win::test_ifs;
m1_t4 v1_4 = &edit_win::do_emit;
m1_t5 v1_5 = &edit_win::clear_abb;
QMetaData *slot_tbl = new QMetaData[6];
slot_tbl[0].name = "change_val()";
slot_tbl[1].name = "add_abb()";
slot_tbl[2].name = "new_selected(int)";
slot_tbl[3].name = "test_ifs()";
slot_tbl[4].name = "do_emit()";
slot_tbl[5].name = "clear_abb()";
slot_tbl[0].ptr = *((QMember*)&v1_0);
slot_tbl[1].ptr = *((QMember*)&v1_1);
slot_tbl[2].ptr = *((QMember*)&v1_2);
slot_tbl[3].ptr = *((QMember*)&v1_3);
slot_tbl[4].ptr = *((QMember*)&v1_4);
slot_tbl[5].ptr = *((QMember*)&v1_5);
typedef void(edit_win::*m2_t0)();
m2_t0 v2_0 = &edit_win::ifs_ready;
QMetaData *signal_tbl = new QMetaData[1];
signal_tbl[0].name = "ifs_ready()";
signal_tbl[0].ptr = *((QMember*)&v2_0);
metaObj = new QMetaObject( "edit_win", "QWidget",
slot_tbl, 6,
signal_tbl, 1 );
}
// SIGNAL ifs_ready
void edit_win::ifs_ready()
{
activate_signal( "ifs_ready()" );
}
./ifsdaem-1.1/edit_win/run.cpp 100664 764 144 2056 6511675557 14634 0 ustar timo users /* <Copyright (C) 1998 Timo Hartmann >
This 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 2 of the License,
or (at your opinion) 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.,
675 Mass Ave, Cambridge, MA 02139, USA.
See "COPYING" and "README" for more details. */
#include "edit_win.h"
#include <qapp.h>
main(int argc,char **argv)
{
QApplication a(argc,argv);
edit_win test(NULL);
test.setGeometry(10,10,300,300);
QObject::connect(&a,SIGNAL(lastWindowClosed()),&a,SLOT(quit()));
a.setMainWidget(&test);
test.show();
return a.exec();
}
./ifsdaem-1.1/edit_win/edit_win.prj 100664 764 144 1156 6511457332 15630 0 ustar timo users #
# xwpe - project-file: edit_win.prj
# createted by xwpe version Version 1.4.2
#
CMP= gcc
CMPFLAGS= -g
LDFLAGS=
EXENAME= test_edit
CMPSWTCH= gnu
CMPMESSAGE= '${?*:warning:}\"${FILE}\", line ${LINE}:* at or near * \"${COLUMN=AFTER}\"'
FILES= /usr/programm/ifsdaem/edit_win/abbildung.cpp \
/usr/programm/ifsdaem/edit_win/edit_win.cpp /usr/programm/ifsdaem/edit_win/ifs.cpp \
/usr/programm/ifsdaem/edit_win/koordsys.cpp /usr/programm/ifsdaem/edit_win/medit_win.cpp \
/usr/programm/ifsdaem/edit_win/mqiandsc.cpp /usr/programm/ifsdaem/edit_win/qiandsc.cpp \
/usr/programm/ifsdaem/edit_win/run.cpp
install:
./ifsdaem-1.1/edit_win/edit_win1.h 100644 0 0 414 6637731352 15030 0 ustar root root #include <qlistbox.h>
#include <qpainter.h>
#include "qiandsc.h"
#include "ifs.hpp"
#include "koordsys.hpp"
class tool_bar_class
{
qinpscr *rotate_i,*transx_i,*scher_i,*scalex_i,*scaley_i;
QListBox *die_abbildungen;
QPushButton *clear_b,*add_b,*ifs_b,*emit_b;
./ifsdaem-1.1/example.gif 100644 764 144 43351 6512351661 13651 0 ustar timo users GIF87a % 23456678 9
::;
<=>>?@ABBCDEFFGHIJJ K!!L""M##N$$N%%O&&P''Q((R))R**S++T,,U--V..V//W00X11Y22Z33[44[55\66]77^88_99_::`;;a<<b==c>>c??d@@eAAfBBgCCgDDhEEiFFjGGkHHkIIlJJmKKnLLoMMoNNpOOqPPrQQsRRsSStTTuUUvVVwWWwXXxYYyZZz[[{\\{]]|^^}__~``aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~µöķŸŹƺǻȼɽɾʿ, % H*\ȰÇ#JHŋ3jȱǏ CIɓ(Hɲ@\<i̛"K$X ώD (":b))b`ӫ
Hr`bx˓&"ª=CK
c]
aZT2SVb-A@0 Ma1*/ hqsQ A
pB/|0]t@$HʈD3
V5k)C
%; @oȚdˁDL@C8Y ʎ.(LP@%\3AP'_J0L Бȡ/@a