diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..5b6e7c6 --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 + + 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. + + + 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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) year 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. + + , 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. diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 0000000..f6cefe5 --- /dev/null +++ b/Doxyfile @@ -0,0 +1,283 @@ +# Doxyfile 1.5.1-KDevelop + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = lsim +PROJECT_NUMBER = 0.1 +OUTPUT_DIRECTORY = +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = German +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = YES +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = /home/peter/ +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 7 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = YES +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = YES +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = /mnt/sdb1/c++/lsim +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.C \ + *.CC \ + *.C++ \ + *.II \ + *.I++ \ + *.H \ + *.HH \ + *.H++ \ + *.CS \ + *.PHP \ + *.PHP3 \ + *.M \ + *.MM \ + *.PY \ + *.C \ + *.H \ + *.tlh \ + *.diff \ + *.patch \ + *.moc \ + *.xpm \ + *.dox +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = YES +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = lsim.tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/bin/.kdbgrc.lsim b/bin/.kdbgrc.lsim new file mode 100644 index 0000000..fed082f --- /dev/null +++ b/bin/.kdbgrc.lsim @@ -0,0 +1,12 @@ +[General] +DebuggerCmdStr= +DriverName=GDB +FileVersion=1 +OptionsSelected= +ProgramArgs= +TTYLevel=7 +WorkingDirectory= + +[Memory] +ColumnWidths=80,0 +NumExprs=0 diff --git a/code schnipsel b/code schnipsel new file mode 100644 index 0000000..57e4001 --- /dev/null +++ b/code schnipsel @@ -0,0 +1,55 @@ + if (reRects.rightRezizeItem == pressedRectItem) { + currRect.adjust(0,0,mouseDistanceX , 0); + } + else if (reRects.leftResizeItem == pressedRectItem) { + currHomoEfieldEditItem->setPos(currHomoEfieldEditItem->pos().x()+mouseDistanceX,currHomoEfieldEditItem->pos().y()); + currRect.adjust(0,0,-mouseDistanceX , 0); + } + else if (reRects.topResizeItem == pressedRectItem) { + currHomoEfieldEditItem->setPos(currHomoEfieldEditItem->pos().x(),currHomoEfieldEditItem->pos().y()+mouseDistanceY); + currRect.adjust(0,0,0, -mouseDistanceY ); + } + else if (reRects.bottomResizeItem == pressedRectItem) { + currRect.adjust(0,0,0, mouseDistanceY ); + } + else if (reRects.rightBottomResizeItem == pressedRectItem) { + currRect.adjust(0,0,0, mouseDistanceY ); + currRect.adjust(0,0,mouseDistanceX , 0); + } + else if (reRects.leftBottomResizeItem == pressedRectItem) { + currRect.adjust(0,0,0, mouseDistanceY ); + currHomoEfieldEditItem->setPos(currHomoEfieldEditItem->pos().x()+mouseDistanceX,currHomoEfieldEditItem->pos().y()); + currRect.adjust(0,0,-mouseDistanceX , 0); + } + else if (reRects.leftTopResizeItem == pressedRectItem) { + currHomoEfieldEditItem->setPos(currHomoEfieldEditItem->pos().x(),currHomoEfieldEditItem->pos().y()+mouseDistanceY); + currRect.adjust(0,0,0, -mouseDistanceY ); + currHomoEfieldEditItem->setPos(currHomoEfieldEditItem->pos().x()+mouseDistanceX,currHomoEfieldEditItem->pos().y()); + currRect.adjust(0,0,-mouseDistanceX , 0); + } + else if (reRects.rightTopResizeItem == pressedRectItem) { + currHomoEfieldEditItem->setPos(currHomoEfieldEditItem->pos().x(),currHomoEfieldEditItem->pos().y()+mouseDistanceY); + currRect.adjust(0,0,0, -mouseDistanceY ); + currRect.adjust(0,0,mouseDistanceX , 0); + } + + //gegen zu klein werden + if (currRect.width() <= HomoEFieldItem::MinimumWidth) { + if (mouseEvent->lastScenePos().x() < mouseEvent->scenePos().x()) { //gegen rumspringen + currHomoEfieldEditItem->setPos(currHomoEfieldEditItem->pos().x() + (currRect.width() - HomoEFieldItem::MinimumWidth) ,currHomoEfieldEditItem->pos().y()); + } + currRect.setWidth(HomoEFieldItem::MinimumWidth); + } + if (currRect.height() <= HomoEFieldItem::MinimumHeight) { + if (mouseEvent->lastScenePos().y() < mouseEvent->scenePos().y()) { //gegen rumspringen + currHomoEfieldEditItem->setPos(currHomoEfieldEditItem->pos().x(), currHomoEfieldEditItem->pos().y() + (currRect.height() - HomoEFieldItem::MinimumHeight)); + } + currRect.setHeight(HomoEFieldItem::MinimumHeight); + } + //aenderungen uebernehmen + if (currRect != currHomoEfieldEditItem->getRectF()) { + currHomoEfieldEditItem->setRectF(currRect); + } + //resize rechtecke mitverschieben + if(mouseEvent->scenePos() != mouseEvent->lastScenePos()) displayResizeRects(true); + \ No newline at end of file diff --git a/code schnipsel~ b/code schnipsel~ new file mode 100644 index 0000000..e69de29 diff --git a/lsim.kdevelop b/lsim.kdevelop new file mode 100644 index 0000000..40b7388 --- /dev/null +++ b/lsim.kdevelop @@ -0,0 +1,235 @@ + + + + Peter Dahlberg + pdahlberg@gmail.com + 0.1 + KDevTrollProject + C++ + + Qt + + + lsim + . + false + + + + + + + + + + + false + false + + + false + *.o,*.lo,CVS + + + + + true + 4 + 4 + ExternalDesigner + /usr/bin/qmake-qt4 + /usr/bin/designer-qt4 + /usr/lib/qt4 + + + + true + true + true + 250 + 300 + 250 + false + 0 + true + true + false + std=_GLIBCXX_STD;__gnu_cxx=std + true + true + true + false + false + true + true + false + .; + + + get + set + m_,_ + theValue + true + true + + + false + true + Vertical + + + Qt4 + + + + + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + KDE Libraries (Doxygen) + + + + + + + + /usr/bin/gdb + true + false + false + + + + false + + + false + true + 10 + + + + + + /mnt/sdb1/c++/lsim + + executable + + /mnt/sdb1/c++/lsim + false + false + false + false + false + + + + + + /mnt/sdb1/c++/lsim + + + + + + + src + + + true + false + 1 + false + + 0 + + + + 2 + false + true + false + true + true + + + + + + + + + + + + + + + + + + + Doxygen-Dokumentation + lsim.tag + + + + + lsim + lsim + Lsim + LSIM + Peter Dahlberg + /usr/bin/designer-qt4 + pdahlberg@gmail.com + GPL + COPYING + /usr/bin/qmake-qt4 + 0.1 + 2008 + /mnt/sdb1/c++/lsim + + + + .h + .cpp + + + + + /mnt/sdb1/c++/lsim/tags + + + diff --git a/lsim.kdevelop.pcs b/lsim.kdevelop.pcs new file mode 100644 index 0000000..ae390dc Binary files /dev/null and b/lsim.kdevelop.pcs differ diff --git a/lsim.kdevses b/lsim.kdevses new file mode 100644 index 0000000..34f034f --- /dev/null +++ b/lsim.kdevses @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lsim.pro b/lsim.pro new file mode 100644 index 0000000..3f6c313 --- /dev/null +++ b/lsim.pro @@ -0,0 +1,5 @@ +SUBDIRS += src +TEMPLATE = subdirs +CONFIG += warn_on \ + qt \ + thread diff --git a/lsim.tag b/lsim.tag new file mode 100644 index 0000000..667d78f --- /dev/null +++ b/lsim.tag @@ -0,0 +1,1436 @@ + + + + editcopy.xpm + /mnt/sdb1/c++/lsim/src/ + editcopy_8xpm + + static char * + editcopy + editcopy_8xpm.html + 471211cb286a77cc53f043408037d009 + [] + + + + editcut.xpm + /mnt/sdb1/c++/lsim/src/ + editcut_8xpm + + static char * + editcut + editcut_8xpm.html + 5c6dbb1908552e3c6ce9edc3ad0b1185 + [] + + + + editpaste.xpm + /mnt/sdb1/c++/lsim/src/ + editpaste_8xpm + + static char * + editpaste + editpaste_8xpm.html + 5bcfa6e8879a52d13089d8f26955d1df + [] + + + + expdoublespinbox.cpp + /mnt/sdb1/c++/lsim/src/ + expdoublespinbox_8cpp + expdoublespinbox.h + + + expdoublespinbox.h + /mnt/sdb1/c++/lsim/src/ + expdoublespinbox_8h + ExpDoubleSpinBox + + + fielditem.cpp + /mnt/sdb1/c++/lsim/src/ + fielditem_8cpp + fielditem.h + homoefielditem.h + + + fielditem.h + /mnt/sdb1/c++/lsim/src/ + fielditem_8h + FieldItem + + + filenew.xpm + /mnt/sdb1/c++/lsim/src/ + filenew_8xpm + + static char * + filenew + filenew_8xpm.html + 12be11f9078c2358841f610019b44f62 + [] + + + + fileopen.xpm + /mnt/sdb1/c++/lsim/src/ + fileopen_8xpm + + static char * + fileopen + fileopen_8xpm.html + 260076d78280bdab25890dd5febe8ba3 + [] + + + + filesave.xpm + /mnt/sdb1/c++/lsim/src/ + filesave_8xpm + + static char * + filesave + filesave_8xpm.html + 4c51cfe135473cf998f1ed91ef2bd5da + [] + + + + graphicsellipseitem.cpp + /mnt/sdb1/c++/lsim/src/ + graphicsellipseitem_8cpp + graphicsellipseitem.h + + + graphicsellipseitem.h + /mnt/sdb1/c++/lsim/src/ + graphicsellipseitem_8h + GraphicsEllipseItem + + + graphicsview.cpp + /mnt/sdb1/c++/lsim/src/ + graphicsview_8cpp + graphicsview.h + + + graphicsview.h + /mnt/sdb1/c++/lsim/src/ + graphicsview_8h + GraphicsView + + + homoefielditem.cpp + /mnt/sdb1/c++/lsim/src/ + homoefielditem_8cpp + homoefielditem.h + homoefieldwidget.h + + + homoefielditem.h + /mnt/sdb1/c++/lsim/src/ + homoefielditem_8h + fielditem.h + HomoEFieldItem + + + homoefieldwidget.cpp + /mnt/sdb1/c++/lsim/src/ + homoefieldwidget_8cpp + homoefieldwidget.h + homoefielditem.h + expdoublespinbox.h + + + homoefieldwidget.h + /mnt/sdb1/c++/lsim/src/ + homoefieldwidget_8h + homoefielditem.h + HomoEFieldWidget + + + lsim.cpp + /mnt/sdb1/c++/lsim/src/ + lsim_8cpp + lsim.h + simulscene.h + expdoublespinbox.h + homoefieldwidget.h + + + lsim.h + /mnt/sdb1/c++/lsim/src/ + lsim_8h + graphicsview.h + lsim + lsim::Actions + + + main.cpp + /mnt/sdb1/c++/lsim/src/ + main_8cpp + lsim.h + + int + main + main_8cpp.html + 0ddf1224851353fc92bfbff6f499fa97 + (int argc, char *argv[]) + + + + moc_fielditem.cpp + /mnt/sdb1/c++/lsim/src/ + moc__fielditem_8cpp + fielditem.h + + static QT_BEGIN_MOC_NAMESPACE const uint + qt_meta_data_FieldItem + moc__fielditem_8cpp.html + 26b1e4547ec3ea776a30c12afcff36eb + [] + + + static const char + qt_meta_stringdata_FieldItem + moc__fielditem_8cpp.html + 13e7f1f09ba218a44b406e86bf4117f1 + [] + + + + moc_graphicsview.cpp + /mnt/sdb1/c++/lsim/src/ + moc__graphicsview_8cpp + graphicsview.h + + static QT_BEGIN_MOC_NAMESPACE const uint + qt_meta_data_GraphicsView + moc__graphicsview_8cpp.html + 8aa354a9bc67795bc7b15894820de6f1 + [] + + + static const char + qt_meta_stringdata_GraphicsView + moc__graphicsview_8cpp.html + b55983dd2de1891662aaf1883cfc262b + [] + + + + moc_homoefielditem.cpp + /mnt/sdb1/c++/lsim/src/ + moc__homoefielditem_8cpp + homoefielditem.h + + static QT_BEGIN_MOC_NAMESPACE const uint + qt_meta_data_HomoEFieldItem + moc__homoefielditem_8cpp.html + 8e30e9d7a57045f9e8c7c5e51940a349 + [] + + + static const char + qt_meta_stringdata_HomoEFieldItem + moc__homoefielditem_8cpp.html + 1ca909384a8238a74dcd7b350b44d8ec + [] + + + + moc_homoefieldwidget.cpp + /mnt/sdb1/c++/lsim/src/ + moc__homoefieldwidget_8cpp + homoefieldwidget.h + + static QT_BEGIN_MOC_NAMESPACE const uint + qt_meta_data_HomoEFieldWidget + moc__homoefieldwidget_8cpp.html + 9fc9b93dace8dcda099e37f69b3755c5 + [] + + + static const char + qt_meta_stringdata_HomoEFieldWidget + moc__homoefieldwidget_8cpp.html + 19898f05e5e656ef3102ed636364a1c7 + [] + + + + moc_lsim.cpp + /mnt/sdb1/c++/lsim/src/ + moc__lsim_8cpp + lsim.h + + static QT_BEGIN_MOC_NAMESPACE const uint + qt_meta_data_lsim + moc__lsim_8cpp.html + d9e762f6950c45f8f98a37a397037ea4 + [] + + + static const char + qt_meta_stringdata_lsim + moc__lsim_8cpp.html + 08735390eb9d7ada728c27ead899ac59 + [] + + + + moc_simulscene.cpp + /mnt/sdb1/c++/lsim/src/ + moc__simulscene_8cpp + simulscene.h + + static QT_BEGIN_MOC_NAMESPACE const uint + qt_meta_data_SimulScene + moc__simulscene_8cpp.html + 20dd898844fbf9e5a669a5114cb42f18 + [] + + + static const char + qt_meta_stringdata_SimulScene + moc__simulscene_8cpp.html + ae2445d9db906aec5aac780a4ce4f398 + [] + + + + qrc_application.cpp + /mnt/sdb1/c++/lsim/src/ + qrc__application_8cpp + + QT_BEGIN_NAMESPACE bool + qRegisterResourceData + qrc__application_8cpp.html + bd8d83733ca9800d36d9bb41f512929e + (int, const unsigned char *, const unsigned char *, const unsigned char *) + + + bool + qUnregisterResourceData + qrc__application_8cpp.html + 54b96c9f44d004fc0ea13bb581f97a71 + (int, const unsigned char *, const unsigned char *, const unsigned char *) + + + QT_END_NAMESPACE int QT_MANGLE_NAMESPACE() + qInitResources_application + qrc__application_8cpp.html + 91ad53cc78cf0cde32571f407153835a + () + + + + Q_CONSTRUCTOR_FUNCTION + qrc__application_8cpp.html + 215f1d008c8beb41184804c8ebb8af21 + (QT_MANGLE_NAMESPACE(qInitResources_application)) int QT_MANGLE_NAMESPACE(qCleanupResources_application)() + + + static const unsigned char + qt_resource_data + qrc__application_8cpp.html + 67a985282ed24629b630f624b668842b + [] + + + static const unsigned char + qt_resource_name + qrc__application_8cpp.html + 7931167bf9d7e883e4194a60d031e431 + [] + + + static const unsigned char + qt_resource_struct + qrc__application_8cpp.html + 37a83d7da2ee18badcd100d79aac64d4 + [] + + + + simulscene.cpp + /mnt/sdb1/c++/lsim/src/ + simulscene_8cpp + simulscene.h + graphicsellipseitem.h + homoefielditem.h + + + simulscene.h + /mnt/sdb1/c++/lsim/src/ + simulscene_8h + SimulScene + SimulScene::resizeRects + + + ExpDoubleSpinBox + classExpDoubleSpinBox.html + + + ExpDoubleSpinBox + classExpDoubleSpinBox.html + d049a64027ef0bf4d0f9466ee48dce5e + () + + + + ~ExpDoubleSpinBox + classExpDoubleSpinBox.html + 8c834f765ddaea53a2e7f75f5c42e144 + () + + + virtual double + valueFromText + classExpDoubleSpinBox.html + 033c6751f53919c394489543f07aef50 + (const QString &text) const + + + virtual QString + textFromValue + classExpDoubleSpinBox.html + 1b8dea8193bb8264d6225ef3b0d4a01b + (double val) const + + + virtual QValidator::State + validate + classExpDoubleSpinBox.html + e4aa290d4b2d675faf8d3e65a5bd6ff2 + (QString &input, int &pos) const + + + virtual void + stepBy + classExpDoubleSpinBox.html + 288a3a2afd580c6d3999bf1786cf82f8 + (int steps) + + + void + setNegativeExp + classExpDoubleSpinBox.html + 62d37fd43ccb329ffbc25436ec1aaf06 + (int exponent) + + + const int + getNegativeExp + classExpDoubleSpinBox.html + debcff917cf4644fa0515f4678345db6 + () const + + + void + setPositiveExp + classExpDoubleSpinBox.html + 8bd6687baef2c8c803f48a48bd2c06b5 + (int exponent) + + + const int + getPositiveExp + classExpDoubleSpinBox.html + 72fd535bd8226c8d6957c61f8b540533 + () const + + + virtual QDoubleSpinBox::StepEnabled + stepEnabled + classExpDoubleSpinBox.html + 4d670d8829ce505d3fc7d0773af2842f + () const + + + int + negativeExp + classExpDoubleSpinBox.html + 920d81c5e3227570a5280dd76a28d21a + + + + int + positiveExp + classExpDoubleSpinBox.html + b5b74897fb840c451265e2aac1f2fbd4 + + + + + FieldItem + classFieldItem.html + + virtual void + handleSceneChange + classFieldItem.html + c6b6dd11c757adefadd90ec3fc96a4b3 + (const QList< QRectF > &region) + + + virtual void + setScenePosX + classFieldItem.html + 10cc69573c1cc861242ed97a9517647f + (double newXPos) + + + virtual void + setScenePosY + classFieldItem.html + efa3a42bf4df3063d6597ee017b3a135 + (double newYPos) + + + virtual void + setRotation + classFieldItem.html + bcdc7dd52b655d13caf540afe0a1ab5a + (int angle) + + + virtual void + setRectF + classFieldItem.html + cc9e836f44f08db5668a8c9e8075fea5 + (QRectF rect) + + + void + setRect + classFieldItem.html + 5891e5dfc3849716ee94434ecd875e68 + (QRectF rect) + + + virtual void + setRectFWidth + classFieldItem.html + 7a2a9230d8877b87808ee284dc9a3b6a + (double newWidth) + + + virtual void + setRectFHeight + classFieldItem.html + f1d2649f738b21f780c035f4ed017cde + (double newHeight) + + + void + ScenePosChanged + classFieldItem.html + 01bb0ad2a089d2b9b643199234cc2b61 + (QPointF newpos) + + + void + ScenePosXChanged + classFieldItem.html + 6c4f15ab1a3866f7a8dbeec5de9a77b7 + (double newX) + + + void + ScenePosYChanged + classFieldItem.html + 47e25d54a28445cbb096e3ff2a8276db + (double newY) + + + void + rotationChanged + classFieldItem.html + f77bcc1aa40b3b45771596d768aed62b + (int angle) + + + void + rotationChanged + classFieldItem.html + 3c77c39a53c3346f8ac44114d443b722 + () + + + void + heightChanged + classFieldItem.html + 942c7734aba138663416ba182617bdd6 + (double height) + + + void + widthChanged + classFieldItem.html + fb618fb21293eb2575d5df76a90cdb80 + (double width) + + + + FieldItem + classFieldItem.html + 08d7fedd836503665e39831b2eca5827 + () + + + virtual + ~FieldItem + classFieldItem.html + 995b2c2a0ed7dbe282ff4b4a75a96c2c + () + + + virtual QRectF + getRectF + classFieldItem.html + 5f86742d0efdbe1ca7a88033ed5c6730 + () const + + + QRectF + rect + classFieldItem.html + 73f6ea2cb8ae1a73c31e76f843e97bbf + () const + + + virtual QRectF + boundingRect + classFieldItem.html + 5729fbd2569fe97f781531e2f6a43059 + () const =0 + + + virtual void + paint + classFieldItem.html + baeed9d23222744dcc58ecc2926478cd + (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)=0 + + + virtual QWidget * + getDockWidget + classFieldItem.html + 6c45aa9a52b2dc4f916272e651fb8092 + () const =0 + + + static bool + isFieldItem + classFieldItem.html + 4642adc434298f0fc0c9f5e9e75666ed + (QGraphicsItem *item) + + + QPointF + myScenePos + classFieldItem.html + 2b3f1682fda6853412d6baf4a2d4758b + + + + int + myRotation + classFieldItem.html + 41adf579d728620c1becf68cc8f22077 + + + + QRectF + sizeRect + classFieldItem.html + c606d1d3b329826a200f9bb15715240d + + + + + GraphicsEllipseItem + classGraphicsEllipseItem.html + + void + calculateProbePath + classGraphicsEllipseItem.html + c96e624b90b7acabd1fd979c35abdc1e + (int steps) + + + + GraphicsEllipseItem + classGraphicsEllipseItem.html + a138c72fbdabc4a52940d164f956464e + () + + + + ~GraphicsEllipseItem + classGraphicsEllipseItem.html + 4bf7a078c964d2d7d616841c0e22805a + () + + + void + mousePressEvent + classGraphicsEllipseItem.html + 067a7d35d01f50fa95eb87782541266e + (QGraphicsSceneMouseEvent *event) + + + void + timerEvent + classGraphicsEllipseItem.html + 2e04dec51a601e3a83a7cdd924c58a75 + (QTimerEvent *event) + + + QList< QPointF > * + currProbePath + classGraphicsEllipseItem.html + fb54026b4fca39d646f6e4f46545b313 + + + + QList< double > * + speedListX + classGraphicsEllipseItem.html + 6d2f812e0ad9e4eba9ebb7fb72696c85 + + + + QList< double > * + speedListY + classGraphicsEllipseItem.html + 1f55285da882bada1df7a093d56193ed + + + + double + masse + classGraphicsEllipseItem.html + ef680fb6a88e6a0951886582a333f3fc + + + + + GraphicsView + classGraphicsView.html + + void + enableOGLViewport + classGraphicsView.html + 52e9ad075ffd434a77f5791f9a6b3a50 + () + + + void + disableOGLViewport + classGraphicsView.html + 4af6cad75be87d86297dae8fbcd0c620 + () + + + + GraphicsView + classGraphicsView.html + 1a185da1facb776224b4cc9bbbe0aab9 + () + + + + ~GraphicsView + classGraphicsView.html + 367eed0f7fa5ab7b3cbc956f0d89d6d6 + () + + + + HomoEFieldItem + classHomoEFieldItem.html + FieldItem + + Type + classHomoEFieldItem.html + d89d0d82fbd2689c40ae29528fa91393c06fd10fb3badd77a822f5601903df34 + + + + MinimumWidth + classHomoEFieldItem.html + 5f72ae86d8bfd602169fc1bef881b34fcba84afb53a55c8e2c0daf52eed72d25 + + + + MinimumHeight + classHomoEFieldItem.html + 3cc84ab5f5c6f443d425fb9581e9b16f60030e8b43da40d39fbad3b5f8ac59d1 + + + + + HomoEFieldItem + classHomoEFieldItem.html + 96fdd5660c20846efa55662f79cb85b1 + (QRectF sizeRect) + + + virtual + ~HomoEFieldItem + classHomoEFieldItem.html + 6cc6587033eb878e3678a7dee0608cbd + () + + + virtual QRectF + boundingRect + classHomoEFieldItem.html + f9a330feae7928dcd6618e3914181200 + () const + + + virtual void + paint + classHomoEFieldItem.html + f57e4444a36b3ba6e3d2bc22423754c3 + (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) + + + int + type + classHomoEFieldItem.html + 91bdd8e7c2fda3f482b2aac1a950a8b4 + () const + + + QWidget * + getDockWidget + classHomoEFieldItem.html + a8eb4f93cb1616669f03533c47ea145f + () const + + + virtual void + setFieldLineDistance + classHomoEFieldItem.html + 9e852d12ede674be0390d63144f43385 + (int pixel) + + + int + fieldLineDistance + classHomoEFieldItem.html + ed75192b0ebc4e4a4ba12c4afda6f195 + + + + qreal + outerPenWidth + classHomoEFieldItem.html + cfb50de7491e749ebe97d999a52c87f8 + + + + HomoEFieldWidget * + dockWidget + classHomoEFieldItem.html + 61ec658ae8e92cb5788193673e26e2c6 + + + + + HomoEFieldWidget + classHomoEFieldWidget.html + + + HomoEFieldWidget + classHomoEFieldWidget.html + 348aeaf4185a0e40ef700c14f7f59108 + (QWidget *parent, Qt::WindowFlags f, HomoEFieldItem *eField) + + + virtual + ~HomoEFieldWidget + classHomoEFieldWidget.html + 95645b43e623bf296268020ad29057a8 + () + + + void + createWidget + classHomoEFieldWidget.html + 91a95292548964b60495a4508740138c + () + + + HomoEFieldItem * + homoEField + classHomoEFieldWidget.html + d981917a07d4a1865b8de529fabe6e72 + + + + + lsim + classlsim.html + + + lsim + classlsim.html + d8916dbeeb2b2e52d6ebafaad29a9430 + () + + + + ~lsim + classlsim.html + c7ed11c62400d659f82db0a0bd5a35af + () + + + void + closeEvent + classlsim.html + bc7754937a01544b703ff00578128d6e + (QCloseEvent *event) + + + void + about + classlsim.html + f736ef5d5bd1c256d633b0ca0351eea4 + () + + + void + actModeSwitcher + classlsim.html + 11024901f919c3cfed0a6636bfafbbe1 + (QAction *action) + + + void + setSceneMode + classlsim.html + d9ced110785817d0058ff196bf89e9fd + (int mode) + + + void + updateDockFieldWidget + classlsim.html + b955c8a5093f2a8ff9eb30aed0c21c30 + () + + + void + createActions + classlsim.html + 47f8ca2605449ea0fd9c8e50140c2760 + () + + + void + createMenus + classlsim.html + 8f92a2001b30859a56668c2fe2313091 + () + + + void + createToolBars + classlsim.html + 5b9934d0c1fe68625c722088bcb7f46c + () + + + void + createStatusBar + classlsim.html + 4d06beb0639849a476dda2631920622a + () + + + void + createDocks + classlsim.html + 6b3f486aebc2377e823b8f3c59e6967b + () + + + void + createScene + classlsim.html + ea64591e3b29730ebb227370317f5565 + () + + + GraphicsView * + gview + classlsim.html + f4198663c3fa1d0c843684c772e4ecf8 + + + + QMenu * + fileMenu + classlsim.html + abecebe0c0c30b6892fb51bcd92bd72f + + + + QMenu * + editMenu + classlsim.html + 9d9e6babc113ea9b1dfb9a206b744f89 + + + + QMenu * + helpMenu + classlsim.html + c98e6aea43dc6a798803094d8c4f8930 + + + + QToolBar * + fileToolBar + classlsim.html + 18bd65b018d50615dc6ccf193e61c778 + + + + QToolBar * + editToolBar + classlsim.html + 15022ed5d2f9303674c94fa0684c38f8 + + + + Actions + acts + classlsim.html + 4297c2ff14ccdd77cf8effd6c221d464 + + + + QActionGroup * + modeChangeActGroup + classlsim.html + 9ab76164acbf8c9cfe766d295d84e5d9 + + + + QDockWidget * + fieldItemEditDock + classlsim.html + 89e420be0bf3e0024f670c672ec7fcac + + + + QDockWidget * + dock_2 + classlsim.html + 6d3765ed2ed2af79528c84b363c4351c + + + + SimulScene * + simulscene + classlsim.html + 04dd463751aac6c8e0b5f38ec8d32074 + + + lsim::Actions + + + lsim::Actions + structlsim_1_1Actions.html + + QAction * + aboutAct + structlsim_1_1Actions.html + 3cb57662d1e067357fc47a2c4f528d12 + + + + QAction * + exitAct + structlsim_1_1Actions.html + a0def3223ab1fbc81f8f072ef72f8117 + + + + QAction * + aboutQtAct + structlsim_1_1Actions.html + 636de7ef0fbd54cc2010da84d603af64 + + + + QAction * + oglEnable + structlsim_1_1Actions.html + cceca8c89c83b03a2552216276b49f3e + + + + QAction * + oglDisable + structlsim_1_1Actions.html + 6c81e95c70e50a089632805843ec40ab + + + + QAction * + timerStart + structlsim_1_1Actions.html + 9546761515a2022d7a29c570fd6fa1d6 + + + + QAction * + itemEditModeAct + structlsim_1_1Actions.html + d01ab46f0ec3c35e68c389be2b451850 + + + + QAction * + insertEFieldItemAct + structlsim_1_1Actions.html + 0fa3737ce6c6e20dfc83695d8201ad80 + + + + + SimulScene + classSimulScene.html + + SceneMode + classSimulScene.html + 9a5e7fd2816ae007a43df2587bcbb93c + + + + HomoEFieldItemInsert + classSimulScene.html + 9a5e7fd2816ae007a43df2587bcbb93c109280cb39bebad004cd4d8918b86caa + + + + FieldItemEdit + classSimulScene.html + 9a5e7fd2816ae007a43df2587bcbb93cbd43d167a779e8b894de1426d29673c7 + + + + ItemType + classSimulScene.html + 56543e4795ea4e636180b3e9936d357b + + + + ResizeRectItem + classSimulScene.html + 56543e4795ea4e636180b3e9936d357bd5c457c3b39cee7692076351a7dac86a + + + + void + setSceneMode + classSimulScene.html + e665a3e128d9367c9094493529a8027f + (SceneMode mode) + + + void + startTimer + classSimulScene.html + b3adfc8c3b2313c9c80414e0ac3ba6b2 + () + + + void + deleteSelectedFieldItems + classSimulScene.html + 2019e1423500ac17fed23b78f38edffa + () + + + void + setTimePerStep + classSimulScene.html + 860c2287ddf648775730857ff5df7227 + (double time) + + + void + startCalculation + classSimulScene.html + 5da9e20d3f402a4e7ab90dc1279ba894 + () + + + void + setSteps + classSimulScene.html + c4fa7c31f3b54b3652316c8a5ca11af5 + (int steps) + + + void + sceneModeChanged + classSimulScene.html + 48442d47492ae78984f1fadfe26fd0e5 + (int mode) + + + void + stepsChanged + classSimulScene.html + 0eb7ec8a07f04d4409415e6dd1d17c08 + (int steps) + + + void + timePerStepChanged + classSimulScene.html + b0f32d8ad757b9901a4b86b6e3f75e5a + (double timePerStep) + + + + SimulScene + classSimulScene.html + 8c0971b64130e5d77f6cc316922577eb + (QObject *parent=0) + + + qreal + getHighestZIndexVisible + classSimulScene.html + c6a71446effdacb37a5d29c6e329ebdd + () + + + + ~SimulScene + classSimulScene.html + 61a1d2732f21381bba814782575fa26b + () + + + double + getTimePerStep + classSimulScene.html + 67924bc0b015b4f15739d6648fdcc508 + () + + + int + getSteps + classSimulScene.html + d80e533696e4ef56ab02a194af502eee + () + + + double + getPowerXAt + classSimulScene.html + 01214a21cfac1d40199b56c9dda0e2d2 + (QPointF point) + + + double + getPowerYAt + classSimulScene.html + 0ed98fb4a8da5049481e9d4e220954e4 + (QPointF point) + + + void + mousePressEvent + classSimulScene.html + 77b153c5f92fe2f0adfba4e4d36bfe4f + (QGraphicsSceneMouseEvent *mouseEvent) + + + void + mouseMoveEvent + classSimulScene.html + 6ae208268b4a1e74bf204c9eed48bc1f + (QGraphicsSceneMouseEvent *mouseEvent) + + + void + mouseReleaseEvent + classSimulScene.html + c360e17dc99d50ca14a92c834ac7c3fd + (QGraphicsSceneMouseEvent *mouseEvent) + + + void + keyPressEvent + classSimulScene.html + f506b19b6fbb7c291af65edd70c44d37 + (QKeyEvent *keyEvent) + + + void + displayResizeRects + classSimulScene.html + d0171a8e76c10925bd0cc011193384e6 + (bool move=false) + + + void + moveResizeRects + classSimulScene.html + 85fae2e5c76642c1d25bbfa4a260eea7 + () + + + void + createResizeRects + classSimulScene.html + 6ed0db91bcbd8abcc3d02ed987195669 + () + + + void + calculateItemResize + classSimulScene.html + f8c0c0890a28ba471bd8a43a493d1665 + (QGraphicsSceneMouseEvent *mouseEvent, QGraphicsRectItem *pressedRectItem, QRectF &currRect, QPointF &newPos, qreal minWidth, qreal minHeight) + + + QTimeLine * + timer + classSimulScene.html + cc0c5530431faa20ed6334ff621b7f19 + + + + SceneMode + myMode + classSimulScene.html + af756f3b00045bf636033f9af6286628 + + + + double + timePerStep + classSimulScene.html + 842b44bd26144ad78366a906a5cf7f9f + + + + int + steps + classSimulScene.html + e315ef1c3adb6c3964b039a6479a351d + + + + HomoEFieldItem * + currHomoEfieldInsertItem + classSimulScene.html + 660a00d50296f4f08150803c5ea1421d + + + + HomoEFieldItem * + currHomoEfieldEditItem + classSimulScene.html + 44b79f0338746c6a3ff19a785921749d + + + + QGraphicsItem * + pressedResizeItem + classSimulScene.html + c49354a4bedc1d1c48a038aa956fcd5b + + + + GraphicsEllipseItem * + ellipse1 + classSimulScene.html + 0b90514f60d295d61d991c35381e5623 + + + + resizeRects + reRects + classSimulScene.html + 9e03c217dc3c5d14774ca1b8a407780e + + + SimulScene::resizeRects + + + SimulScene::resizeRects + structSimulScene_1_1resizeRects.html + + QGraphicsRectItem * + leftTopResizeItem + structSimulScene_1_1resizeRects.html + d53ccbc1b7bffcf32010433db4e2802c + + + + QGraphicsRectItem * + leftResizeItem + structSimulScene_1_1resizeRects.html + b3609720f2e729bd3634c5666e26e363 + + + + QGraphicsRectItem * + leftBottomResizeItem + structSimulScene_1_1resizeRects.html + 531de8d6b953ff818f930f4b1135e914 + + + + QGraphicsRectItem * + bottomResizeItem + structSimulScene_1_1resizeRects.html + b1f74bcdb2471b25770880d476eb61a7 + + + + QGraphicsRectItem * + rightBottomResizeItem + structSimulScene_1_1resizeRects.html + 58a98d49cd9280c2d998b41d12caddcd + + + + QGraphicsRectItem * + rightRezizeItem + structSimulScene_1_1resizeRects.html + 678d26b5a8df9271c18b6dcd5cc7714a + + + + QGraphicsRectItem * + rightTopResizeItem + structSimulScene_1_1resizeRects.html + 77f1a180007a735b1f2a2878756dc99b + + + + QGraphicsRectItem * + topResizeItem + structSimulScene_1_1resizeRects.html + b7435d9850da45a63b712e50508fe9c3 + + + + diff --git a/src/ReadMe b/src/ReadMe new file mode 100644 index 0000000..87d23f7 --- /dev/null +++ b/src/ReadMe @@ -0,0 +1,11 @@ +READ THIS IN ORDER TO COMPILE THE Qt4 TEMPLATE +---------------------------------------------- + +Before compiling, check the Qt Options, go to +Project->Project Options->C++ Support and open the Qt Options tab. + +Check that the Qt installation directory is correct for the Qt version you've chosen. + +------------------ +Andreas Pakulat +July 2006 diff --git a/src/application.qrc b/src/application.qrc new file mode 100644 index 0000000..67881c3 --- /dev/null +++ b/src/application.qrc @@ -0,0 +1,10 @@ + + + editcopy.xpm + editcut.xpm + filenew.xpm + fileopen.xpm + editpaste.xpm + filesave.xpm + + diff --git a/src/constants.h b/src/constants.h new file mode 100644 index 0000000..964c726 --- /dev/null +++ b/src/constants.h @@ -0,0 +1,21 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +const double PI = acos( -1.0 ); \ No newline at end of file diff --git a/src/editcopy.xpm b/src/editcopy.xpm new file mode 100644 index 0000000..8350ed0 --- /dev/null +++ b/src/editcopy.xpm @@ -0,0 +1,193 @@ +/* XPM */ +static char *editcopy[] = { +/* columns rows colors chars-per-pixel */ +"32 32 155 2", +" c black", +". c #191000", +"X c #221700", +"o c #2E2300", +"O c #452E00", +"+ c #433200", +"@ c #493000", +"# c #553800", +"$ c #5D4600", +"% c #6B5000", +"& c #724B00", +"* c #7D5E00", +"= c #6E694F", +"- c #7E795F", +"; c #865900", +": c #8A5C00", +"> c #8B6800", +", c #936200", +"< c #926D00", +"1 c #926B1A", +"2 c #967000", +"3 c #9B721D", +"4 c #9B7625", +"5 c #9E792A", +"6 c #A47C00", +"7 c #AA7D00", +"8 c #A1761A", +"9 c #A57816", +"0 c #A4791D", +"q c #AD8200", +"w c #B28500", +"e c #AE8530", +"r c #B99626", +"t c #97906D", +"y c #B18D48", +"u c #B49049", +"i c #B89542", +"p c #BA9C4D", +"a c #BD9E52", +"s c #BFA053", +"d c #B8AE78", +"f c #BEB47E", +"g c #C49300", +"h c #C89600", +"j c #C19D2C", +"k c #C1A43F", +"l c #C09E4E", +"z c #CFB457", +"x c #C9B159", +"c c #CAB573", +"v c #D4BF7C", +"b c #FFDF62", +"n c #FFE064", +"m c #FFE16D", +"M c #FFE372", +"N c #FFE479", +"B c #A19D8E", +"V c #ABA89A", +"C c #BEB580", +"Z c #BDB488", +"A c #B8B496", +"S c #AEADAA", +"D c #B3AFA1", +"F c #BCBBB6", +"G c #BFBFB9", +"H c #C0B680", +"J c #C4BA85", +"K c #C6BD8B", +"L c #CBB589", +"P c #C8BE88", +"I c #C3BC90", +"U c #CBC18C", +"Y c #CCC493", +"T c #D7CB8C", +"R c #DAC786", +"E c #D8C789", +"W c #DAC98B", +"Q c #D0C690", +"! c #D4CA94", +"~ c #D4CC9B", +"^ c #D8CE98", +"/ c #DCD29C", +"( c #C6C3B7", +") c #C8C6BE", +"_ c #D5C5A5", +"` c #DBC8A1", +"' c #DBD4A2", +"] c #DED9AE", +"[ c #D9D5B1", +"{ c #E0CC82", +"} c #E8D98B", +"| c #E8D991", +" . c #E1D7A1", +".. c #E5DBA5", +"X. c #E4DCAB", +"o. c #E8DDAA", +"O. c #E1DCB2", +"+. c #E1DCB8", +"@. c #FFE683", +"#. c #FFE78A", +"$. c #FFE885", +"%. c #FFE88D", +"&. c #FFE992", +"*. c #FFEC9D", +"=. c #FFF09F", +"-. c #ECE2AC", +";. c #E5E0B6", +":. c #E5E1B8", +">. c #EBE4B6", +",. c #EAE5BC", +"<. c #F0E5A8", +"1. c #FFEDA3", +"2. c #FFEDA9", +"3. c #F1E8B8", +"4. c #FFEFB1", +"5. c #FFF1A5", +"6. c #FFF2AD", +"7. c #FFF2B4", +"8. c #FFF2BC", +"9. c #CAC8C2", +"0. c #D6D4CB", +"q. c #DFDAC5", +"w. c #D4D2D0", +"e. c #E0D7C5", +"r. c #E4DAC3", +"t. c #E8DEC7", +"y. c #E0DFD3", +"u. c #E6E2C2", +"i. c #E8E1C5", +"p. c #EBE3CB", +"a. c #EEE9C2", +"s. c #E8E6DC", +"d. c #F3EDC3", +"f. c #F2EDCB", +"g. c #F7F2CD", +"h. c #FFF3C3", +"j. c #FFF4CA", +"k. c #FFF8C5", +"l. c #FFF8CD", +"z. c #FDF5D2", +"x. c #FFF7D8", +"c. c #FFF9D4", +"v. c #FFF9DC", +"b. c #E9E8E7", +"n. c #F3EFE3", +"m. c #F2F0E3", +"M. c #F4F2EA", +"N. c #FBF7E6", +"B. c #FEF9E3", +"V. c #FFFBEC", +"C. c #F4F4F3", +"Z. c #F8F7F6", +"A. c #FEFCF4", +"S. c #FEFEFC", +"D. c None", +/* pixels */ +"D.D.D.D.D.D.D.D.D.D.D.D.h g g g g g g g g g g w * D.D.D.D.D.", +"D.D.D.D.D.D.D.D.D.D.D.D.g z.z.g.g.g.g.g.g.z.g.R 2 D.D.D.D.D.", +"D.D.D.D.D.D.D.D.D.D.D.D.g z.d.3.3.3.3.3.3.>.f.g.z < D.D.D.D.", +"D.D.D.D.D., : ; , : : : 7 a i a R -.-.-.-.' m.u.g.j > D.D.D.", +"D.D.D.D., u y y L L L L ` t.t.e.e v -.-.-.Y b.S.+.d.q D.D.D.", +"D.D.D.D., S.S.S.S.S.S.S.S.Z.b.S.e.i W o.o.K w.S.A.u.q D.D.D.", +"D.D.D.D., S.S.S.A.S.S.S.S.M.w.S.S._ a E ..K 0.S.S.q.7 D.D.D.", +"D.D.D.D., S.A.V.A.A.A.V.A.n.9.S.S.C._ a ..Y t = - A 6 D.D.D.", +"D.D.D.D., A.A.V.A.V.V.V.A.n.9.S.S.S.Z.3 ' ' K Z A ] 7 D.D.D.", +"D.D.D.D., A.V.B.V.V.B.V.V.n.( F S S G 5 ' | / / X.f.q D.D.D.", +"D.D.D.D., A.V.x.B.x.V.B.N.B.e.D B V ) 3 / / ^ ^ ' a.q D.D.D.", +"D.D.D.D., V.N.N.B.B.B.v.v.N.z.p.i.p.n.8 ^ / ! Q ' a.q D.D.D.", +"D.D.D.D., B.B.x.v.x.z.j.j.x.z.z.c.B.B.0 ! ! ! ^ ' ,.q D.D.D.", +"D.D.D.D., B.h.h.z.z.x.x.z.z.z.h.j.x.v.0 ! Q Y ! ~ ,.q D.D.D.", +"D.D.D.D., v.c.k.x.h.j.j.j.z.8.h.k.j.v.0 U T U U ~ ,.q D.D.D.", +"D.D.D.D., v.k.z.h.h.h.j.8.j.h.h.j.k.v.0 U U U U Y ;.q D.D.D.", +"D.D.D.D., x.h.8.8.h.j.8.8.4.h.4.8.h.x.8 P H P P ~ ;.q D.D.D.", +"D.D.D.D., v.h.4.4.8.8.4.1.z.h.8.4.h.c.8 H J H J Y ;.q D.D.D.", +"D.D.D.D., c.2.z.j.4.*.1.1.8.2.2.*.2.l.8 J J H J U ] q D.D.D.", +"D.D.D.D., l.h.2.4.4.1.%.1.&.2.4.8.7.k.8 f d f H U ] q D.D.D.", +"D.D.D.D., z.8.#.1.4.1.*.1.1.1.*.N 4.l.8 f f C K ~ :.q D.D.D.", +"D.D.D.D., 8.&.4.#.%.4.&.@.#.%.%.&.2.l.8 K K Y ~ ] ,.6 D.D.D.", +"D.D.D.D., h.&.#.*.1.1.%.N N #.&.*.1.l.0 ' ] T x r 6 % D.D.D.", +"D.D.D.D., 4.4.%.*.#.b &.N M b M 2.1.k.9 k 7 > $ o D.D.D.", +"D.D.D.D., 7.&.N 5.&.N @.*.b N M N =.k., + D.D.D.", +"D.D.D.D., 6.N N M M &.#.N 2.$.%.8.6.<.& D.D.D.D.D.", +"D.D.D.D., 5.&.7.n $.m M 1.7.7.o.c 5 & @ D.D.D.D.D.D.D.D.D.", +"D.D.D.D., 7.*.m %.=.&.7.} p 1 % # X D.D.D.D.D.D.D.D.D.D.", +"D.D.D.D., 6.5.5.5.| a 1 & + . D.D.D.D.D.D.D.D.D.D.", +"D.D.D.D., 6.-.a 1 & O . D.D.D.D.D.D.D.D.D.D.D.D.", +"D.D.D.D.; : % O . D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.", +"D.D.D.D. D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D." +}; diff --git a/src/editcut.xpm b/src/editcut.xpm new file mode 100644 index 0000000..9a11893 --- /dev/null +++ b/src/editcut.xpm @@ -0,0 +1,252 @@ +/* XPM */ +static char *editcut[] = { +/* columns rows colors chars-per-pixel */ +"32 32 214 2", +" c #000000", +". c #0B0B0B", +"X c #181300", +"o c #1D190B", +"O c #131313", +"+ c #1B1B1B", +"@ c #211E11", +"# c #26231A", +"$ c #2A2513", +"% c #2E2912", +"& c #2E2A19", +"* c #372E0B", +"= c #302A12", +"- c #312C1B", +"; c #3A320F", +": c #3C3415", +"> c #3C351B", +", c #232323", +"< c #2B2922", +"1 c #2C2C2C", +"2 c #302E26", +"3 c #353120", +"4 c #3F3B2D", +"5 c #313131", +"6 c #3A3A3A", +"7 c #423814", +"8 c #493E17", +"9 c #413D2F", +"0 c #423F32", +"q c #4F4319", +"w c #5C4A00", +"e c #5F4F0D", +"r c #514410", +"t c #554813", +"y c #4E472C", +"u c #444136", +"i c #4A483F", +"p c #534B2B", +"a c #504B37", +"s c #514C3A", +"d c #654F04", +"f c #604F0B", +"g c #665200", +"h c #675509", +"j c #6B5405", +"k c #6C5807", +"l c #6C590B", +"z c #745B04", +"x c #715D0A", +"c c #7B5B02", +"v c #625B3B", +"b c #7E6815", +"n c #6C643E", +"m c #4D4B42", +"M c #494949", +"N c #504D43", +"B c #54534C", +"V c #515151", +"C c #5D5B54", +"Z c #656048", +"A c #736A44", +"S c #726C54", +"D c #77725B", +"F c #696968", +"G c gray50", +"H c #826203", +"J c #806609", +"K c #836907", +"L c #8D6A03", +"P c #9A6F00", +"I c #9B7005", +"U c #9E730E", +"Y c #9C7511", +"T c #85732C", +"R c #88783B", +"E c #AE7C00", +"W c #A87B13", +"Q c #847B53", +"! c #827D64", +"~ c #9C862E", +"^ c #A98A1F", +"/ c #B28D0A", +"( c #B88D00", +") c #B2821A", +"_ c #B18E1B", +"` c #B3941C", +"' c #A88E2C", +"] c #A28C36", +"[ c #AE9224", +"{ c #89815E", +"} c #87826D", +"| c #858174", +" . c #888370", +".. c #8E8A7D", +"X. c #928C71", +"o. c #A28E44", +"O. c #AA9F74", +"+. c #B9A456", +"@. c #BDA85B", +"#. c #B2A068", +"$. c #C28700", +"%. c #CC8E00", +"&. c #C29A00", +"*. c #C4962F", +"=. c #CCA100", +"-. c #D6A800", +";. c #D1AC1B", +":. c #DDB31A", +">. c #D2A922", +",. c #D4AE2B", +"<. c #DBA12E", +"1. c #DBA433", +"2. c #DDB428", +"3. c #D2B23B", +"4. c #E6A200", +"5. c #E8A509", +"6. c #EAAF00", +"7. c #EFAC1E", +"8. c #F5A100", +"9. c #FFAD02", +"0. c #FCAF0D", +"q. c #FCB005", +"w. c #FFB60C", +"e. c #FFBD00", +"r. c #FFBD16", +"t. c #E3B432", +"y. c #E8BF3C", +"u. c #F6BE2F", +"i. c #C6A949", +"p. c #D9A948", +"a. c #D8AB52", +"s. c #DBBA45", +"d. c #C5B162", +"f. c #ECB74D", +"g. c #EFB841", +"h. c #EFBE4A", +"j. c #EABA55", +"k. c #FDC006", +"l. c #FFC10B", +"z. c #FFC800", +"x. c #FFC90D", +"c. c #FAC113", +"v. c #FBC11C", +"b. c #FDC910", +"n. c #EDC233", +"m. c #F5C32D", +"M. c #FFC728", +"N. c #F4C537", +"B. c #F6C63A", +"V. c #F5CB36", +"C. c #FFD73D", +"Z. c #E9C659", +"A. c #EAC85A", +"S. c #FFDA4B", +"D. c #FFDD5D", +"F. c #E9CD6B", +"G. c #FFD560", +"H. c #FFE06C", +"J. c gray56", +"K. c #959595", +"L. c gray62", +"P. c #A6A18A", +"I. c #A8A69E", +"U. c #AEA895", +"Y. c #B3AC8F", +"T. c #B8AF8B", +"R. c #B4AD96", +"E. c #B8B199", +"W. c #A4A4A4", +"Q. c #AAAAAA", +"!. c #B0ADA3", +"~. c #BBB6A3", +"^. c #B1B1B1", +"/. c #B9B9B6", +"(. c #BBBBBA", +"). c #C5BC9D", +"_. c #C2BCA2", +"`. c #C1BEB5", +"'. c #D2C38E", +"]. c #DCC78C", +"[. c #C7C0A7", +"{. c #C7C2AE", +"}. c #C7C3B2", +"|. c #C5C2B8", +" X c #CAC6B6", +".X c #CBC9BE", +"XX c #D9D3BB", +"oX c #E6D08A", +"OX c #E7DEBD", +"+X c #ECDEB3", +"@X c #FFF0B9", +"#X c #C5C5C5", +"$X c #CECCC7", +"%X c #D0CEC5", +"&X c #D0CFC8", +"*X c #D2D1CB", +"=X c #DBD6C5", +"-X c #DBD7C9", +";X c #D3D3D1", +":X c #DBDBDB", +">X c #E5E1D6", +",X c #E5E3DA", +".9.U r . . , T B.*.x qX + , Q !.Q. . + 1 [ m.p.k . qXqXqXqX , u O.W.;X! + ", +"4 8.j.` p 5 y ;.u.a.d % qXqXqXqXqXqX O , A P._., ", +"1 x <.f.m.x.b.y.a.g ; qXqXqXqXqXqXqXqX + 0 v O ", +" - h c W W W W z : qXqXqXqXqXqXqXqXqXqX . . ", +" * e l l f X qXqXqXqXqXqXqXqXqXqXqXqXqX ", +"qX qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX qX", +"qXqXqX qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX", +"qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX", +"qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX" +}; diff --git a/src/editpaste.xpm b/src/editpaste.xpm new file mode 100644 index 0000000..c29ad36 --- /dev/null +++ b/src/editpaste.xpm @@ -0,0 +1,295 @@ +/* XPM */ +static char *editpaste[] = { +/* columns rows colors chars-per-pixel */ +"32 32 257 2", +" c black", +". c #0D0900", +"X c #191000", +"o c #221700", +"O c #2A1B00", +"+ c #332200", +"@ c #3E2900", +"# c #3A2804", +"$ c #4D3300", +"% c #4B3E15", +"& c #44391B", +"* c #543800", +"= c #5A3B00", +"- c #4D4015", +"; c #524E25", +": c #5A4F2C", +"> c #524E3D", +", c #58562F", +"< c #53503E", +"1 c #5E623B", +"2 c #634100", +"3 c #684500", +"4 c #6E4900", +"5 c #614F11", +"6 c #685416", +"7 c #734C00", +"8 c #784F00", +"9 c #755B00", +"0 c #7C5200", +"q c #7C5A00", +"w c #7B570F", +"e c #69562F", +"r c #786600", +"t c #7F6A00", +"y c #766300", +"u c #60613F", +"i c #7C6422", +"p c #545143", +"a c #54524B", +"s c gray32", +"d c #5D5D57", +"f c #616641", +"g c #67695D", +"h c #6B734D", +"j c #6C7553", +"k c #616261", +"l c #686A64", +"z c #6B7162", +"x c #727272", +"c c #003DFF", +"v c #0043FF", +"b c #004BFF", +"n c #0053FF", +"m c #015AFF", +"M c #0063FF", +"N c #046DFF", +"B c #0865FF", +"V c #0378FF", +"C c #1663FF", +"Z c #1576FF", +"A c #2678FF", +"S c #6F7B84", +"D c #77856D", +"F c #7B8B75", +"G c #0083FF", +"H c #0197FF", +"J c #0B92FF", +"K c #1385FF", +"L c #01A5FF", +"P c #0DB5FF", +"I c #3096FF", +"U c #2DADFF", +"Y c #2FBCFF", +"T c #22C6FF", +"R c #2AC5FF", +"E c #30D0FF", +"W c #38D5FF", +"Q c #4493F1", +"! c #5F83FF", +"~ c #5F8AFF", +"^ c #5290E4", +"/ c #5F92FF", +"( c #4CAAFE", +") c #40B8FF", +"_ c #779DCB", +"` c #6693E2", +"' c #6290FF", +"] c #649DFF", +"[ c #71A6E5", +"{ c #79A4FF", +"} c #7FB3FF", +"| c #68B8F3", +" . c #42DCFF", +".. c #47E0FF", +"X. c #58E9FF", +"o. c #64C0EB", +"O. c #6ADFEF", +"+. c #825600", +"@. c #845A00", +"#. c #8B5C00", +"$. c #905F00", +"%. c #8C6103", +"&. c #876807", +"*. c #8A6111", +"=. c #886E1B", +"-. c #887600", +";. c #8C7A00", +":. c #936200", +">. c #986800", +",. c #926C22", +"<. c #987A3F", +"1. c #A07200", +"2. c #A27511", +"3. c #A97D15", +"4. c #A77B14", +"5. c #998712", +"6. c #A68000", +"7. c #A78F00", +"8. c #AD8016", +"9. c #AC9600", +"0. c #BB8F00", +"q. c #A99B2A", +"w. c #B9A000", +"e. c #B3A63C", +"r. c #958D43", +"t. c #988F44", +"y. c #9A9346", +"u. c #9F9948", +"i. c #8B897C", +"p. c #958F6F", +"a. c #98937B", +"s. c #A68443", +"d. c #B08C41", +"f. c #AF9462", +"g. c #B39864", +"h. c #B2A850", +"j. c #BDB355", +"k. c #C3972F", +"l. c #C5A400", +"z. c #CCAC00", +"x. c #D7BB00", +"c. c #CCA030", +"v. c #CBB43E", +"b. c #E4AD0C", +"n. c #ECB600", +"m. c #EDB900", +"M. c #F2BB00", +"N. c #C1B84C", +"B. c #C1B757", +"V. c #C5BB58", +"C. c #C9BE5A", +"Z. c #C2A978", +"A. c #DFC000", +"S. c #FDCB00", +"D. c #F6C300", +"F. c #FFD100", +"G. c #FEDB00", +"H. c #FFDF0E", +"J. c #F5D500", +"K. c #FBCD39", +"L. c #FFE832", +"P. c #FFE432", +"I. c #CEC25C", +"U. c #D7C648", +"Y. c #DDC74B", +"T. c #D0C55E", +"R. c #D3C85F", +"E. c #D5C960", +"W. c #DDD264", +"Q. c #E0CA4C", +"!. c #E7D14E", +"~. c #EFDA51", +"^. c #F4D050", +"/. c #F9D452", +"(. c #FEDD53", +"). c #E2D765", +"_. c #E9DD69", +"`. c #E6DD68", +"'. c #FDDB6E", +"]. c #FFEE4F", +"[. c #FEE354", +"{. c #FEEA55", +"}. c #F7E153", +"|. c #FFF056", +" X c #ECE16A", +".X c #F1E56D", +"XX c #F7EA6F", +"oX c #F7EB70", +"OX c #F9EC70", +"+X c #FEF372", +"@X c #979486", +"#X c gray60", +"$X c #969596", +"%X c #8AA193", +"&X c #82A89B", +"*X c #8CAEA3", +"=X c #86A7A9", +"-X c #8BA2B1", +";X c #ACA580", +":X c #A5A291", +">X c #B3AF98", +",X c #B8B7AF", +".k.c.6 FXkXkXkXDXkXkXkXx i b.>.+ YXYXYXYXYXYXYXYXYXYX", +"YXYXYX:.'.K.=.hX1X1X1X1X1X1X1Xd &.0.%.* 7 #.#.:.$.#.2 YXYXYX", +"YXYXYX:./.M.%.$Xk k d s s s e w >.2.d.s.Z.9XrXlXxX0X7 YXYXYX", +"YXYXYX:.^.M.1.: % % - % 5 6 &.GXIXIXPXPXPXPXPXLXIXIXg.3 YXYX", +"YXYX#X:.^.m.v.y.r.r.r.r.h.h.2.IXPXPXKXKXPXKXHXxXUXIXIXf.4 YX", +"YXYX#X:.^.m.Y.I.B.j.j.j.V.I.4.PXKXJXKXJXKXKXmXjXFXIXIXUX+. YX", +"YXYX#X:.^.m.Y.E.I.j.j.j.I.R.8.PXKXSXJXJXJXSXnXeXDXIXIXUX<. YX", +"YXYXYX:./.M.!.W.R.I.T.R.E.W.8.UXJXJXSXSXSXSXnXeX:X@Xi.X@X@X,X4 ", +"YXYXYX:.(.S.}..X X X X X X X8.PXSXAXAXAXAXAXNXzXpXwXwXjX7 ", +"YXYXYX:.(.S.[.OXOXOXoXoXt.; O s a p p p p a.AXMXvXaXzXGX+. ", +"YXYXYX:.(.S.[.+X+X+XOX+X; 7X2X] / / ~ ! 2Xp MXNXNXNXSXKX+. YX", +"YXYXYX:.(.F.|.+X+X+X+X+Xy., _ A m b v c ! p MXMXgXMXAXKX+. YX", +"YXYXYX:.(.F.|.+X+X+X+X+X+Xj.& ^ B n b v ' < gXMXgXgXNXKX+. YX", +"YXYXYX:.(.F.U.W.+X+X+X+X).y.g Q N m n b ~ < gXgXgXgXAXJXq YX", +"YXYXYX:.[.l.j j y.I.j.r.1 =X( K N M m b ~ < gXgXgXgXNXKX+. YX", +"YXYXYX:.[.t 5X4X&XD F =X| U J G V Z A C / < fXgXgXgXMXHX+. YX", +"YXYXYX:.[.l.h 3XX...W T P L H K I [ S ` { < fXfXfXfXMXKX+. YX", +"YXYXYX:.[.G.e.1 *XO...E R Y Y | -Xd Z.k 6X> fXfXfXfXBXJX+. YX", +"YXYXYX:.[.G.{.`.u.1 F &X*X%Xz l a.uXfXp.> p.sXsXsXfXBXJX+. YX", +"YXYXYX:.{.G.|.+X+X XN.q.5.7.q cXvXsXsXsXsXsXsXsXsXsXBXKX+. YX", +"YXYXYX:.|.G.].|.L.H.G.G.G.A.1.JXvXsXsXsXsXsXsXsXfXdXCXPX+. YX", +"YXYXYX:.{.G.G.G.G.G.x.w.;.t :.HXdXsXsXsXsXsXdXvXBXZXLXtX= YX", +"YXYXYX:.{.G.J.x.9.;.r 9 q 0 #.KXvXsXaXsXvXBXCXHXiXg.*.= O YX", +"YXYXYX:.L.9.-.y 9 q 0 = + #.HXbXdXbXVXZXcX8X,.3 $ . YX", +"YXYXYX%.z.9 q 7 * o $.PXZXmXmX0Xs.0 $ X YX", +"YXYXYX8 0 = o :.IXpXg.*.= O YXYXYXYX", +"YXYXYX YXYX@.#.2 @ . YXYXYXYXYXYX", +"YXYXYX YXYXYXYXYX YXYXYXYXYXYXYXYXYX", +"YXYXYXYXYXYXYXYXYXYXYXYXYXYX YXYXYXYXYXYXYXYXYXYXYXYX" +}; diff --git a/src/expdoublespinbox.cpp b/src/expdoublespinbox.cpp new file mode 100644 index 0000000..d08fcd0 --- /dev/null +++ b/src/expdoublespinbox.cpp @@ -0,0 +1,99 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "expdoublespinbox.h" +#include +#include +#include +#include +#include +#include + +ExpDoubleSpinBox::ExpDoubleSpinBox() + : QDoubleSpinBox() { + setPositiveExp(4); + setNegativeExp(3); +} + + +ExpDoubleSpinBox::~ExpDoubleSpinBox() { +} + + +double ExpDoubleSpinBox::valueFromText ( const QString& text ) const { + return text.toDouble(); +} + +QString ExpDoubleSpinBox::textFromValue ( double val ) const { + //qDebug() << val; + if((val < pow(10,getPositiveExp()) && val > 1) || (val > -pow(10,getPositiveExp()) && val < -1) || val == 0) { + //return QDoubleSpinBox::textFromValue ( val ); + return QString("%L1").arg(val,0,'f',decimals()); + } + else if ( (val >= pow(10, -getNegativeExp()) && val <= 1 ) || (val <= -pow(10, -getNegativeExp()) && val >= -1 ) ){ + //return QDoubleSpinBox::textFromValue ( val ); + return QString("%L1").arg(val,0,'f',decimals()); + } + else { + return QString("%L1").arg(val,0,'e',decimals()); + } + //return QDoubleSpinBox::textFromValue ( val ); +} + +QValidator::State ExpDoubleSpinBox::validate ( QString & input, int & pos ) const { + QLocale loc; + QChar decpoint = loc.decimalPoint(); //Locale abhaengiger dezimaltrenner + QString regExpString =QString("[\\-,\\+]?\\d*\\%1?\\d+([e,E][\\-,\\+]\\d+)?").arg(decpoint); + QRegExp regExp(regExpString); + QValidator *validator = new QRegExpValidator(regExp, 0); + //qDebug() << validator->validate(input,pos); + return validator->validate(input,pos); +} + +QDoubleSpinBox::StepEnabled ExpDoubleSpinBox::stepEnabled () const { + QAbstractSpinBox::StepEnabled enabled = QDoubleSpinBox::stepEnabled(); + + if( + (value() > 0 && value() < pow(10, -getNegativeExp())) || + (value() < 0 && value() > -pow(10, -getNegativeExp())) + ) { //kein step bei negativen Zehnerpotenzen + enabled = QAbstractSpinBox::StepNone; + } + + return enabled; + +} +void ExpDoubleSpinBox::setNegativeExp (int exponent) { + if (negativeExp != exponent && exponent >= 0) negativeExp = exponent; +} +void ExpDoubleSpinBox::setPositiveExp (int exponent) { + if (positiveExp != exponent && exponent >= 0) positiveExp = exponent; +} +const int ExpDoubleSpinBox::getNegativeExp () const{ + return negativeExp; +} +const int ExpDoubleSpinBox::getPositiveExp () const{ + return positiveExp; +} + +void ExpDoubleSpinBox::stepBy ( int steps ) { + QDoubleSpinBox::stepBy(steps); +} + + diff --git a/src/expdoublespinbox.h b/src/expdoublespinbox.h new file mode 100644 index 0000000..f698b01 --- /dev/null +++ b/src/expdoublespinbox.h @@ -0,0 +1,60 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef EXPDOUBLESPINBOX_H +#define EXPDOUBLESPINBOX_H + +#include +#include + +//! DoubleSpinBox für Zehnerpotenzen +/** +Eine DoubleSpinBox, die mit Zehnerpotenzen umgehen kann + + @author Peter Dahlberg +*/ +class ExpDoubleSpinBox : public QDoubleSpinBox { + public: + ExpDoubleSpinBox(); + + ~ExpDoubleSpinBox(); + + virtual double valueFromText ( const QString& text ) const; + virtual QString textFromValue ( double val ) const; + virtual QValidator::State validate ( QString & input, int & pos ) const; + virtual void stepBy ( int steps ); + + ///welche kommastelle soll noch ohne exponentialdarstellungen dargestellt werden + void setNegativeExp (int exponent); + ///welche kommastelle soll noch ohne exponentialdarstellungen dargestellt werden + const int getNegativeExp () const; + ///ab welchem positiven exponenten soll exponentialdarstellung benutzt werden + void setPositiveExp (int exponent); + ///ab welchem positiven exponenten soll exponentialdarstellung benutzt werden + const int getPositiveExp () const; + + + protected: + virtual QDoubleSpinBox::StepEnabled stepEnabled () const; + private: + int negativeExp; + int positiveExp; +}; + +#endif diff --git a/src/fielditem.cpp b/src/fielditem.cpp new file mode 100644 index 0000000..0206ea7 --- /dev/null +++ b/src/fielditem.cpp @@ -0,0 +1,130 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "fielditem.h" +#include "homoefielditem.h" +#include + +FieldItem::FieldItem() + : QGraphicsItem() { + myRotation = 0; + myScenePos = QPointF(0,0); +} + + +FieldItem::~FieldItem() { +} + + + + +/*! + \fn FieldItem::isFieldItem(QGraphicsItem *item) + */ +bool FieldItem::isFieldItem(QGraphicsItem *item) { + QList fieldItemTypes; + // ---- Definiert die FieldItem typen + fieldItemTypes << HomoEFieldItem::Type; + // ---- + for (int i=0; itype() == fieldItemTypes.at(i)) { + return true; + } + } + return false; + //return item->type() == HomoEFieldItem::Type; +} + +void FieldItem::handleSceneChange(const QList & /*region*/) { + if (myScenePos != scenePos()) { + myScenePos = scenePos(); + emit ScenePosChanged(myScenePos); + emit ScenePosXChanged(myScenePos.x()); + emit ScenePosYChanged(myScenePos.y()); + } + +} + +void FieldItem::setScenePosX(double newXPos) { + moveBy(newXPos - scenePos().x(), 0); + //qDebug() << mapFromScene(0 , 0); +} +void FieldItem::setScenePosY(double newYPos) { + moveBy(0,newYPos - scenePos().y()); +} + +void FieldItem::setRotation(int angle) { + if (angle == myRotation) return; + setTransform(QTransform().translate(boundingRect().width()/2.0, boundingRect().height()/2.0).rotate(angle).translate(-boundingRect().width()/2.0, -boundingRect().height()/2.0)); + myRotation = angle; + emit rotationChanged(angle); + emit rotationChanged(); +} + +void FieldItem::setRectFHeight(double newHeight) { + QRectF currRect = getRectF(); + if (currRect.height() == newHeight) return; + currRect.setHeight(newHeight); + setRectF(currRect); +} + +void FieldItem::setRectFWidth(double newWidth) { + QRectF currRect = getRectF(); + if (currRect.width() == newWidth) return; + currRect.setWidth(newWidth); + setRectF(currRect); +} + +void FieldItem::setRectF(QRectF rect) { + if (rect == sizeRect) return; + double newHeight = rect.height(); + double newWidth = rect.width(); + double oldHeight = sizeRect.height(); + double oldWidth = sizeRect.width(); + + prepareGeometryChange(); + sizeRect = rect; + prepareGeometryChange(); + + //breite geandert + if (newWidth != oldWidth) emit widthChanged(newWidth); + //hoehe geandert + if (newHeight != oldHeight) emit heightChanged(newHeight); +} + +void FieldItem::setRect(QRectF rect) { + setRectF(rect); +} + +QRectF FieldItem::getRectF() const { + return sizeRect; +} + +QRectF FieldItem::rect() const { + return getRectF(); +} + + +/*! + \fn FieldItem::getRotation() + */ +int FieldItem::getRotation() +{ + return myRotation; +} diff --git a/src/fielditem.h b/src/fielditem.h new file mode 100644 index 0000000..260675c --- /dev/null +++ b/src/fielditem.h @@ -0,0 +1,107 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef FIELDITEM_H +#define FIELDITEM_H + +#include +#include + +//! Ein abstraktes Feld GraphicsItem +/** + @author Peter Dahlberg +*/ +class QPointF; +class FieldItem :public QObject, public QGraphicsItem { + Q_OBJECT + public: + FieldItem(); + + virtual ~FieldItem(); + + + //! gibt das Rechteck des Feldes zurück + virtual QRectF getRectF() const; + + //! alias für getRectF() + QRectF rect() const; + + virtual QRectF boundingRect() const = 0; + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) = 0; + virtual QWidget* getDockWidget() const = 0; + + //! Prüft, ob ein allgemeines Item ein FiledItem ist + /*! + Die Liste der Item Typen wird in der Funktion definiert + \param item Das zu pruefende Item + */ + static bool isFieldItem(QGraphicsItem *item); + int getRotation(); + + protected: + + QPointF myScenePos; + int myRotation; + QRectF sizeRect; + + + public slots: + virtual void handleSceneChange(const QList & region); + virtual void setScenePosX(double newXPos); + virtual void setScenePosY(double newYPos); + virtual void setRotation(int angle); + + public slots: + //! setzt das rechteck des Widgets + /*! + \param rect Das neue QRectF + */ + virtual void setRectF ( QRectF rect ); + + //! alias für setRectF() + /*! + \param rect Das neue QRectF + */ + void setRect ( QRectF rect ); + + //! Breite des Item Rechtecks setzen + /*! + \param newWidth Die neue Breite + */ + virtual void setRectFWidth ( double newWidth ); + + //! Höhe des Item Rechtecks setzen + /*! + \param newHeight Die neue Höhe + */ + virtual void setRectFHeight ( double newHeight ); + + signals: + void ScenePosChanged(QPointF newpos); + void ScenePosXChanged(double newX); + void ScenePosYChanged(double newY); + + void rotationChanged(int angle); + void rotationChanged(); + + void heightChanged ( double height ); + void widthChanged ( double width ); +}; + +#endif diff --git a/src/filenew.xpm b/src/filenew.xpm new file mode 100644 index 0000000..85efceb --- /dev/null +++ b/src/filenew.xpm @@ -0,0 +1,216 @@ +/* XPM */ +static char *filenew[] = { +/* columns rows colors chars-per-pixel */ +"32 32 178 2", +" c black", +". c #191000", +"X c #221700", +"o c #452E00", +"O c #4A3100", +"+ c #4E3400", +"@ c #553800", +"# c #604000", +"$ c #6A4600", +"% c #6D4800", +"& c #704A00", +"* c #724C00", +"= c #744C00", +"- c #764E00", +"; c #785000", +": c #805500", +"> c #815500", +", c #835700", +"< c #865900", +"1 c #875A00", +"2 c #8A5B00", +"3 c #8A5C00", +"4 c #8B5C00", +"5 c #8C5D00", +"6 c #8D5D00", +"7 c #8F5E00", +"8 c #805911", +"9 c #905F00", +"0 c #906000", +"q c #926000", +"w c #946200", +"e c #956300", +"r c #966400", +"t c #976400", +"y c #956913", +"u c #926C22", +"i c #9B7732", +"p c #B18D48", +"a c #B28E49", +"s c #B4904A", +"d c #BAA373", +"f c #A1A195", +"g c #ABAB9F", +"h c #ADADAB", +"j c #AFAFAB", +"k c #B3B3A6", +"l c #BCBCB8", +"z c #BFBFBC", +"x c #CBB489", +"c c #CBB58A", +"v c #CDB78B", +"b c #CAB891", +"n c #C9BB9E", +"m c #CEBEA2", +"M c #C6C6BC", +"N c #D9C8A8", +"B c #E8E1BA", +"V c #E8E1BB", +"C c #FEFFA1", +"Z c #FFFFA0", +"A c #FEFFA3", +"S c #FEFFA4", +"D c #FEFFA6", +"F c #FEFFA8", +"G c #FEFFA9", +"H c #FFFFA8", +"J c #FEFFAA", +"K c #FEFFAB", +"L c #FFFFAB", +"P c #FEFFAC", +"I c #FFFFAC", +"U c #FEFFAE", +"Y c #FEFFAF", +"T c #FEFFB0", +"R c #FEFFB1", +"E c #FFFFB0", +"W c #FEFFB4", +"Q c #FEFFB5", +"! c #FFFFB4", +"~ c #FEFFB8", +"^ c #FEFFB9", +"/ c #FFFFB8", +"( c #FFFFB9", +") c #FEFFBB", +"_ c #FFFFBA", +"` c #FEFFBD", +"' c #FFFFBD", +"] c #FEFFBE", +"[ c #FFFFBE", +"{ c #C8C8C1", +"} c #CACAC4", +"| c #CBCBC6", +" . c #DBD2C1", +".. c #DEDFCF", +"X. c #D4D4D1", +"o. c #E1D5C1", +"O. c #E3D9C3", +"+. c #E5DCCC", +"@. c #E8E8D3", +"#. c #ECECD7", +"$. c #F0EBDA", +"%. c #FEFFC2", +"&. c #FEFFC3", +"*. c #FFFFC2", +"=. c #FEFFC7", +"-. c #FFFFC7", +";. c #FEFFCB", +":. c #FEFFCC", +">. c #FFFFCC", +",. c #FEFFCE", +"<. c #FEFFD0", +"1. c #FEFFD1", +"2. c #FFFFD0", +"3. c #FFFFD1", +"4. c #FFFFD3", +"5. c #FEFFD5", +"6. c #FFFFD5", +"7. c #FEFFD6", +"8. c #FEFFD7", +"9. c #FFFFD6", +"0. c #FFFFD8", +"q. c #FEFFDA", +"w. c #FFFFDA", +"e. c #FFFFDB", +"r. c #FFFFDC", +"t. c #FEFFDE", +"y. c #FEFFDF", +"u. c #FFFFDE", +"i. c #FFFFDF", +"p. c #E9E9E7", +"a. c #F3F3E9", +"s. c #F3F3EB", +"d. c #F5F5E8", +"f. c #F8F8E3", +"g. c #FEFFE0", +"h. c LightYellow", +"j. c #FFFFE1", +"k. c #FEFFE3", +"l. c #FFFFE3", +"z. c #FDFEE7", +"x. c #FEFFE4", +"c. c #FEFFE5", +"v. c #FFFFE4", +"b. c #FBFBE9", +"n. c #FEFFE8", +"m. c #FFFFE8", +"M. c #FFFFE9", +"N. c #FFFFEA", +"B. c #FEFFEC", +"V. c #FEFFED", +"C. c #FFFFEC", +"Z. c #FFFFED", +"A. c #FEFFEF", +"S. c #F4F4F0", +"D. c #F4F4F3", +"F. c #F5F5F4", +"G. c #F8F8F6", +"H. c ivory", +"J. c #FFFFF1", +"K. c #FEFFF3", +"L. c #FFFFF3", +"P. c #FEFFF4", +"I. c #FFFFF4", +"U. c #FEFFF7", +"Y. c #FFFFF6", +"T. c #FFFFF7", +"R. c #FBFBFB", +"E. c #FFFFF8", +"W. c #FFFFF9", +"Q. c #FFFFFA", +"!. c #FFFFFB", +"~. c gray99", +"^. c #FEFFFD", +"/. c #FFFFFC", +"(. c #FFFFFD", +"). c #FFFFFE", +"_. c gray100", +"`. c None", +/* pixels */ +"`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.`.w 2 1 w 4 4 4 6 w 9 6 - `.`.`.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.r s p p c c c c N O.+.o.y # `.`.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.r ).).).).).).).).F.p.). .& o `.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w ).E.).E.).E.E.E.S.X.).R.n $ + `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w E.Y.Y.E.Y.E.E.E.a.| ).).D.m % `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w E.Y.Y.J.Y.J.Y.Y.a.| ).).).D.> `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w Y.J.J.J.J.J.J.J.a.M l h h { ; `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w Y.B.B.B.N.N.B.B.b...k f h } ; `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w J.N.N.N.N.N.N.N.l.f.#.@.#.a.> `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w J.l.l.l.l.l.l.l.l.l.l.l.l.J.> `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w J.r.l.l.r.l.r.l.r.l.r.l.r.J.1 `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w B.r.r.q.q.q.q.q.q.r.q.q.r.B.> `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w N.5.5.5.5.q.5.5.5.5.5.5.5.B., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w N.<.<.<.<.<.<.<.5.<.<.<.<.N., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w l.,.;.;.;.,.;.,.;.,.;.;.;.l., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w l.-.-.-.-.-.-.;.-.-.-.-.;.l.> `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w l.-.%.%.%.%.%.%.%.%.%.%.%.l., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w r.' ' ' ' ' ) ' ' ' ' ' ' r., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w r.) ) W ) ) ) ) ) ) W ) ) q., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w q.W W W W W W W W W W W W q., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w 5.Y Y W Y Y Y Y Y Y Y Y Y 5., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w 5.J J J Y J Y Y J Y J J Y q., `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w 5.J J D J J D J D J W ) ,.$.- `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w <.Z D D Z D J Y ' ,.B b i - O `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w <.Z Z Z Y ) <.B d u & @ X `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w ,.J ) ,.B d y & o . `.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.w Y.V d u & o . `.`.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`.1 4 & o . `.`.`.`.`.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`. `.`.`.`.`.`.`.`.`.`.`.`.`.`.", +"`.`.`.`.`.`.`.`. `.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`." +}; diff --git a/src/fileopen.xpm b/src/fileopen.xpm new file mode 100644 index 0000000..a6c33b6 --- /dev/null +++ b/src/fileopen.xpm @@ -0,0 +1,295 @@ +/* XPM */ +static char *fileopen[] = { +/* columns rows colors chars-per-pixel */ +"32 32 257 2", +" c black", +". c #0B0900", +"X c #130E00", +"o c #161100", +"O c #231A00", +"+ c #352600", +"@ c #3B311C", +"# c #433100", +"$ c #4F3B00", +"% c #4A3E16", +"& c #4A3D22", +"* c #4D421A", +"= c #54420D", +"- c #4E4529", +"; c #484338", +": c #484233", +"> c #5B4B24", +", c #624500", +"< c #674D00", +"1 c #6D4D00", +"2 c #6E4F17", +"3 c #6D5200", +"4 c #775500", +"5 c #745B0F", +"6 c #795200", +"7 c #7A5A00", +"8 c #715C18", +"9 c #764B0A", +"0 c #6C5423", +"q c #6D592E", +"w c #785E27", +"e c #735626", +"r c #665736", +"t c #7A631D", +"y c #7A672E", +"u c #776535", +"i c #5C5956", +"p c #78704F", +"a c #75726E", +"s c #8D4F00", +"d c #815700", +"f c #835A00", +"g c #8A5C00", +"h c #866400", +"j c #966100", +"k c #956F00", +"l c #9C6100", +"z c #9D7500", +"x c #856B2A", +"c c #8C752A", +"v c #8C723B", +"b c #977939", +"n c #A45D00", +"m c #A26100", +"M c #AA680D", +"N c #AB6700", +"B c #A07700", +"V c #A57B00", +"C c #AB7A00", +"Z c #AA7300", +"A c #AF721A", +"S c #B87E00", +"D c #B57B00", +"F c #B0731A", +"G c #B47C26", +"H c #B77E28", +"J c #897F59", +"K c #977C40", +"L c #927F58", +"P c #807A6C", +"I c #9C821D", +"U c #9F8A35", +"Y c #AC8000", +"T c #B28500", +"R c #B68800", +"E c #BB8B00", +"W c #A78337", +"Q c #A28B31", +"! c #AF9535", +"~ c #B58E3A", +"^ c #B88633", +"/ c #B49936", +"( c #BCA039", +") c #998445", +"_ c #978657", +"` c #8B8264", +"' c #8E8572", +"] c #978864", +"[ c #978C75", +"{ c #9F9072", +"} c #A38845", +"| c #A48952", +" . c #AA965C", +".. c #A89156", +"X. c #B5934D", +"o. c #B39D45", +"O. c #B49755", +"+. c #AB984A", +"@. c #AD9A65", +"#. c #A79778", +"$. c #A59874", +"%. c #A29B7A", +"&. c #A79775", +"*. c #BDA959", +"=. c #B3A46C", +"-. c #B1A07F", +";. c #B5A97A", +":. c #BEB37B", +">. c #C49200", +",. c #C89500", +"<. c #CC9800", +"1. c #C69812", +"2. c #D2A31C", +"3. c #C2A63E", +"4. c #D7AE37", +"5. c #C29840", +"6. c #C29B4E", +"7. c #C2A641", +"8. c #C6AA43", +"9. c #C8AC45", +"0. c #CBAF49", +"q. c #CAA746", +"w. c #C4A158", +"e. c #CAA65D", +"r. c #CEA857", +"t. c #CFA95A", +"y. c #C5AC50", +"u. c #CDB14B", +"i. c #CBB358", +"p. c #CAB152", +"a. c #D2AB59", +"s. c #D1B54D", +"d. c #D4B951", +"f. c #D6BC5B", +"g. c #DDB45E", +"h. c #D9BD56", +"j. c #D2B753", +"k. c #DAAB48", +"l. c #CEAE69", +"z. c #CCAD67", +"x. c #CCB662", +"c. c #CAB26B", +"v. c #C8B66B", +"b. c #CEB775", +"n. c #CEBE7F", +"m. c #D3AD66", +"M. c #D5BE64", +"N. c #D4BF6D", +"B. c #E4B34B", +"V. c #E0B75F", +"C. c #E1B85F", +"Z. c #E4BA61", +"A. c #E9BE63", +"S. c #DDC159", +"D. c #DAC269", +"F. c #D4C176", +"G. c #D8C67F", +"H. c #E1C55D", +"J. c #EFC05D", +"K. c #F1C15E", +"L. c #E0C264", +"P. c #E5C961", +"I. c #EDC164", +"U. c #E9CD65", +"Y. c #EFD36B", +"T. c #F2C564", +"R. c #F6C868", +"E. c #F8C760", +"W. c #FBCC6A", +"Q. c #FDCB63", +"!. c #F1D56D", +"~. c #FFD06C", +"^. c #F5D972", +"/. c #FED175", +"(. c #FADE77", +"). c #E4C87A", +"_. c #FEE27C", +"`. c #8F9192", +"'. c #9A9A96", +"]. c #A79F83", +"[. c #ADA583", +"{. c #A7A399", +"}. c #BBAC86", +"|. c #BDB088", +" X c #BBB298", +".X c #A7A8A6", +"XX c #ADAEB0", +"oX c #B5B6B4", +"OX c #BABCBC", +"+X c #C6B38E", +"@X c #D3BE80", +"#X c #D0BC95", +"$X c #C6BFA6", +"%X c #C5C29D", +"&X c #D2C283", +"*X c #DAC789", +"=X c #DBCA8B", +"-X c #D5C489", +";X c #DBCD94", +":X c #D6C699", +">X c #CFC8B1", +",X c #C8C6B7", +".L.ZXyXT.K.E.wX ..XKXKXR YXYX", +"YXYXYXYXYXYXYXYXYXYXYXYX V E 4.ZXsXW.K.I.Z.O.{.KXUXUXMXk YXYX", +"YXYXYXYXYXYX R E 7 YX< E 2.aXsX6XC.T.Z.w.[ xXUXUXUXUX2X3 YXYX", +"YXYXYXYX R >.).5X,.T ,.5XCX8XK.T.A.a.] OXUXUXUXUXUXUX2.O YXYX", +"YXYX Y E Z.ZXsX7XsX0XCXyXR.K.I.V._ .XUXUXUXUXUXLXKXJXV D N S 7 ", +" z E 4.fXsX/.K.~./.6X~.I.I.C...'.KXUXPXPXPXLXKXGXbXl.N m.SXm.D ", +" E 0XgX7XE.W.W.~.~.R.I.Z.w.' bXUXUXUXPXPXLXmXbX$X) ~ aXSXpXBXn ", +" <.CXT.Q.~.W.W.R.I.A.t._ hXUXUXUXUXPXLXGXnX,X .t XAXSXeX4Xl.Z ", +" <.sXB.W.W.W.T.A.g._ oXUXUXUXUXUXLXLXmXcX=.5 $.BXgXeX!.D.3Xm + ", +" <.sXB.R.R.A.V.| {.KXUXUXUXUXLXKXGXvX|.c u qXdXgX^.U.f.3XH f ", +" <.sXB.T.Z.m.[ nXUXUXUXUXPXKXHXbX,X) e X) y >XAXAX_.S.h.h.u.s.d.F.6.g YX", +" >.9X~ } u '.LXKXmXxX .5 [.IXAX_.!.S.h.h.d.8.s.D.n.j YXYX", +" >.:XW v & kXmXvX;.t ] BXAXrX!.U.u.S.9.u.3.7.i.;XM 1 YXYXYX", +" E #Xb u : nXcX_ u 1XSXgX^.U.H.S.d.8.s.d.u.b.-XG g YXYXYXYX", +" R +Xc r a zX[.= -XdX_.U.d.P.h.d.u.3.8.N.=Xw.l 1 YXYXYXYX", +" T }.x > `.oX> %.*.S.S.h.S.7.d.h.0.p.n.c.M d . YXYXYXYXYX", +" C ].w @ XXu p *.( h.S.s.u.u.u.p.N.*X^ g + YXYXYXYXYXYX", +" Z &.e ; ` * :.o.S.S.S.u.( 9.x.&XX.j , YXYXYXYXYXYX", +" B { 0 i % [.o.u.S.d.h.9.M.&Xz.M 6 YXYXYXYXYXYXYXYX", +" z { 0 - J *./ S.9.d.i.G.&XF g O YXYXYXYXYXYXYXYXYXYX", +" z $.2 w =.! s.d.p.N.;X^ l , YXYXYXYXYXYXYXYXYXYXYX", +" B &.9 ;.Q / j.x.@Xl.m 6 YXYXYXYXYXYXYXYXYXYXYXYXYX", +" h W @.+.I y.&Xb.F 7 O YXYXYXYXYXYXYXYXYXYXYXYXYXYXYX", +" $ s %XU F.=X^ j # YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX", +" g O. c #23224B", +", c #262353", +"< c #292655", +"1 c #2B2C54", +"2 c #2C2C5B", +"3 c #293746", +"4 c #2D304F", +"5 c #243243", +"6 c #2E315D", +"7 c #363647", +"8 c #303E4A", +"9 c #30325E", +"0 c #3C3C53", +"q c #2E2E60", +"w c #2F3160", +"e c #302E63", +"r c #313164", +"t c #363861", +"y c #353868", +"u c #384650", +"i c #284F6B", +"p c #2D547B", +"a c #3B486A", +"s c #36597D", +"d c #3D5D7C", +"f c #4C4C4C", +"g c #40405A", +"h c #414E56", +"j c #4B585E", +"k c #49545E", +"l c #555555", +"z c #4D4D6B", +"x c #434675", +"c c #4B5660", +"v c #4F5962", +"b c #41517E", +"n c #4B507D", +"m c #515C67", +"M c #505D6E", +"N c #5C5D7D", +"B c #546066", +"V c #54626D", +"C c #5B646D", +"Z c #55677A", +"A c #556B78", +"S c #5D6772", +"D c #6B6B6B", +"F c #646464", +"G c #616C73", +"H c #63707D", +"J c #6B7679", +"K c gray45", +"L c #00418E", +"P c #004494", +"I c #004894", +"U c #044F98", +"Y c #03509B", +"T c #0A5198", +"R c #13579C", +"E c #185DA1", +"W c #285888", +"Q c #2B6094", +"! c #396D9A", +"~ c #336A96", +"^ c #3D719B", +"/ c #226EB8", +"( c #326EA8", +") c #326BA3", +"_ c #3673AE", +"` c #3A76B4", +"' c #0B6FD1", +"] c #0F75D8", +"[ c #1479DA", +"{ c #1B7CDC", +"} c #466481", +"| c #42749C", +" . c #4A799E", +".. c #506A84", +"X. c #5F678D", +"o. c #576391", +"O. c #5A6592", +"+. c #5F6893", +"@. c #5B738B", +"#. c #507DA1", +"$. c #626283", +"%. c #636A94", +"&. c #656F98", +"*. c #657A8F", +"=. c #6B7299", +"-. c #717191", +";. c #797998", +":. c #687BA6", +">. c #2281DC", +",. c #3F81C0", +"<. c #3988D7", +"1. c #2785E1", +"2. c #2E8AE3", +"3. c #368FE5", +"4. c #3690E6", +"5. c #3D93E7", +"6. c #3D94E9", +"7. c #57839E", +"8. c #4787BC", +"9. c #5480A1", +"0. c #5B84A3", +"q. c #6E8496", +"w. c #6E8B9A", +"e. c #7D848E", +"r. c #728597", +"t. c #738598", +"y. c #768899", +"u. c #7B8B9B", +"i. c #6489A5", +"p. c #698EA7", +"a. c #6D8FA9", +"s. c #6E81AB", +"d. c #7683A6", +"f. c #768CB7", +"g. c #7395AD", +"h. c #7C96B0", +"j. c #4086CA", +"k. c #4986C3", +"l. c #4284C3", +"z. c #498ED2", +"x. c #4D95DB", +"c. c #548DC5", +"v. c #5D92C8", +"b. c #5593C9", +"n. c #5097DE", +"m. c #5198DE", +"M. c #4296E7", +"N. c #4895E2", +"B. c #4B99E5", +"V. c #4A9CEB", +"C. c #4599EB", +"Z. c #529DE6", +"A. c #589EE2", +"S. c #54A1EB", +"D. c #5AA1E6", +"F. c #5AA5EB", +"G. c #5EA8EF", +"H. c #53A3F1", +"J. c #5EAAF2", +"K. c #6699CB", +"L. c #799BC8", +"P. c #7EA6C9", +"I. c #60A2E5", +"U. c #65A7E8", +"Y. c #6BABE9", +"T. c #68ADF2", +"R. c #67B0F5", +"E. c #6DB3F6", +"W. c #70ADEA", +"Q. c #75B0E9", +"!. c #7CB5EB", +"~. c #73B9F8", +"^. c #7BBDFB", +"/. c #7CBAF6", +"(. c gray55", +"). c #828899", +"_. c #84949E", +"`. c #918E8A", +"'. c #949494", +"]. c #8F8FA9", +"[. c #8997A5", +"{. c #8A9AA9", +"}. c #9A9BAF", +"|. c #9399A9", +" X c #9FAAB5", +".X c #A29E9B", +"XX c #A7A7A7", +"oX c #ABABAB", +"OX c #A3A3B4", +"+X c #A8A8B7", +"@X c #A3ABB3", +"#X c #B4B5B5", +"$X c #B0B0BC", +"%X c #B7B9BC", +"&X c #BBB7B3", +"*X c #BBBBBB", +"=X c #82B1DB", +"-X c #81B7EC", +";X c #88BBED", +":X c #86BAED", +">X c #AEBBC8", +",X c #A6BDCD", +".U i 9 YXYX", +"YXYXYXo.2X] L C UXDXcXzXkXkXkXjXjXdXdX%X%X&X%X*XN.' ~ 6 YXYX", +"YXYXYXo.1X] P k hXoXXXXXoXoX#X#X*X%X&X%X%XdXkXxXx.[ ~ 6 YXYX", +"YXYXYXO.3X[ I m FXkXjXjXkXkXkXkXkXkXzXzXzXcXZXSXx.{ ! 6 YXYX", +"YXYXYXo.3X{ I S UXvXxXzXkXkXkXkXkXjXdX*X%X#X&X%XZ.1.^ 9 YXYX", +"YXYXYXO.4X>.U j jX#X#X#X%XdXdXkXzXkXzXzXcXvXDXJXA.1.| 6 YXYX", +"YXYXYXO.6X>.T V PXZXZXZXAXSXDXDXFXHXDXHXHXHXHXSXI.2.| 9 YXYX", +"YXYXYXO.6X2.T G UXLXDXDXAXZXZXAXZXvXcXzXkXkXkXgXY.3. .6 YXYX", +"YXYXYXO.9X4.R m zXdXdXkXzXvXAXDXHXLXPXPXIXUXUXUXQ.6. .9 YXYX", +"YXYXYXO.9X5.R H UXIXUXUXUXUXUXUXUXUXUXUXIXKXJXBX-XC.#.9 YXYX", +"YXYXYXO.eXM./ h.UXUXIXKXBXNXnXuXyXwX5X:X!.Y.Y.Y.D.H.9.6 YXYX", +"YXYXYX+.rXB.<.x.Q.;X-XQ.Y.U.U.D.Z.Z.B.B.C.V.V.B.B.T.0.9 YXYX", +"YXYXYX+.tXB.N.B.B.B.B.C.V.V.H.H.H.D.N.z.8._ ( <.D.R.0.9 YXYX", +"YXYXYX+.tXS.Z.F.D.m.z.l.` ) Q W p s } @.r.[. X>XG.E.0.9 YXYX", +"YXYXYX+.pXU.m.) p d ..*.u.|.+X @ o YXYXYXYXYXYXYXYXYXYXYXYX", +"YXYXYX YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX", +"YXYXYX YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX" +}; diff --git a/src/graphicsellipseitem.cpp b/src/graphicsellipseitem.cpp new file mode 100644 index 0000000..cfd1be3 --- /dev/null +++ b/src/graphicsellipseitem.cpp @@ -0,0 +1,131 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "graphicsellipseitem.h" +#include +#include +#include +#include +#include "simulscene.h" +#include "probechargewidget.h" + +GraphicsEllipseItem::GraphicsEllipseItem() { + setFlag(ItemIsMovable); + setFlag(ItemIsSelectable); + setFlag(ItemIsFocusable); + //setCacheMode(QGraphicsItem::DeviceCoordinateCache); + //startTimer(100); + setMasse(9.10938188e-31); + setCharge(-1.6e-19); + myProbeChargeWidget = new ProbeChargeWidget(0,0,this); + currProbePath = new QList; + speedListX = new QList; + speedListY = new QList; + +} +void GraphicsEllipseItem::timerEvent ( QTimerEvent * event ) { + static double vx; + vx++; + //moveBy(vx/20.0,vx/20.0*vx/20.0); +} + +GraphicsEllipseItem::~GraphicsEllipseItem() { +} + +void GraphicsEllipseItem::mousePressEvent ( QGraphicsSceneMouseEvent *event ) { + //QGraphicsEllipseItem::mousePressEvent(event); +} + + + +/*! + \fn GraphicsEllipseItem::calculateProbePath() + */ +void GraphicsEllipseItem::calculateProbePath(QPointF startPoint, double startSpeedX , double startSpeedY) { + SimulScene* myScene = dynamic_cast(scene()); + //wenn noch zu keiner scene gehoerend abbruch + if (myScene == 0) return; + //parameter der scene in lokale variablen uebernehmen + double timePerStep = myScene->getTimePerStep(); + int steps = myScene->getSteps(); + double meterPerPx = myScene->getMeterPerPx(); + + //listen leeren + currProbePath->clear(); + speedListX->clear(); + speedListY->clear(); + //startwerte in die listen setzen + currProbePath->append(startPoint); + speedListX->append(startSpeedX); + speedListY->append(startSpeedY); + + + for(int i = 1; i< steps;++i) { + double powerX = myScene->getPowerAt(currProbePath->at(i-1), charge, 'x'); + double powerY = myScene->getPowerAt(currProbePath->at(i-1), charge, 'y'); + double deltaDistXconst = speedListX->at(i-1) * (timePerStep/1000.0); + double deltaDistYconst = speedListY->at(i-1) * (timePerStep/1000.0); + double deltaDistXaccel = 0.5 * (powerX/getMasse()) * (timePerStep/1000.0) * (timePerStep/1000.0); + double deltaDistYaccel = 0.5 * (powerY/getMasse()) * (timePerStep/1000.0) * (timePerStep/1000.0); + double deltaDistX = (deltaDistXconst + deltaDistXaccel); + double deltaDistY = (deltaDistYconst + deltaDistYaccel); + + currProbePath->append(QPointF(currProbePath->at(i-1).x() + deltaDistX/meterPerPx,currProbePath->at(i-1).y() + deltaDistY/meterPerPx)); + speedListX->append(speedListX->at(i-1) + (powerX/getMasse()) * (timePerStep/1000.0)); + speedListY->append(speedListY->at(i-1) + (powerY/getMasse()) * (timePerStep/1000.0)); + + } + + + qDebug()<< "Probe Path: " <<*currProbePath; + qDebug()<< "speed x: "<<*speedListX; + qDebug()<< "speed y: "<<*speedListY; + qDebug()<at(12); + qDebug()<at(12); + qDebug()<<"power x: "<< (double)myScene->getPowerAt(QPointF(0,0), charge, 'x'); + qDebug()<<"power y: " << (double)myScene->getPowerAt(QPointF(0,0), charge, 'y'); + +} + + +long double GraphicsEllipseItem::getMasse() const { + return masse; +} + + +void GraphicsEllipseItem::setMasse ( const long double& theValue ) { + if (masse == theValue) return; + masse = theValue; +} + + +long double GraphicsEllipseItem::getCharge() const { + return charge; +} + + +void GraphicsEllipseItem::setCharge ( const long double& theValue ) { + if (charge == theValue) return; + charge = theValue; +} + +QWidget * GraphicsEllipseItem::getDockWidget() const +{ + return myProbeChargeWidget; +} diff --git a/src/graphicsellipseitem.h b/src/graphicsellipseitem.h new file mode 100644 index 0000000..1772023 --- /dev/null +++ b/src/graphicsellipseitem.h @@ -0,0 +1,76 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef GRAPHICSELLIPSEITEM_H +#define GRAPHICSELLIPSEITEM_H + +#include +class ProbeChargeWidget; + +/** + @author Peter Dahlberg +*/ +class GraphicsEllipseItem : public QObject , public QGraphicsEllipseItem { + public: + GraphicsEllipseItem(); + QWidget* getDockWidget() const; + + ~GraphicsEllipseItem(); + + + + protected: + void mousePressEvent ( QGraphicsSceneMouseEvent *event ); + void timerEvent ( QTimerEvent * event ); + + private: + QList *currProbePath; + ///Liste Der Geschwindigkeitsanteile in x-richtung + QList *speedListX; + ///Liste Der Geschwindigkeitsanteile in y-richtung + QList *speedListY; + ///Masse der Probeladung in kg + double masse; + ///Ladung der Probleadung in As + double charge; + ///Zugeordnetes Probe Charge Widget + ProbeChargeWidget* myProbeChargeWidget; + + + public slots: + //! Berechnet die Bewegung der Probeladung + /*! + \param steps Anzahl der auszufürenden Schriite + */ + void calculateProbePath (QPointF startPoint = QPointF(0,0), double startSpeedX = 0, double startSpeedY = 0); + + void setMasse ( const long double& theValue ); + + + long double getMasse() const; + + void setCharge ( const long double& theValue ); + + + long double getCharge() const; + + +}; + +#endif diff --git a/src/graphicsview.cpp b/src/graphicsview.cpp new file mode 100644 index 0000000..c3fc91f --- /dev/null +++ b/src/graphicsview.cpp @@ -0,0 +1,49 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "graphicsview.h" +#include +#include + + +GraphicsView::GraphicsView(): QGraphicsView() { + setMinimumSize(900,700); + //setDragMode(QGraphicsView::RubberBandDrag); + + + + //scale(2.5,2.5); + + + +} + +void GraphicsView::enableOGLViewport() { + setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); +} + +void GraphicsView::disableOGLViewport() { + setViewport(new QWidget(parentWidget())); +} + + +GraphicsView::~GraphicsView() { +} + + diff --git a/src/graphicsview.h b/src/graphicsview.h new file mode 100644 index 0000000..405ecc9 --- /dev/null +++ b/src/graphicsview.h @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef GRAPHICSVIEW_H +#define GRAPHICSVIEW_H + +#include + +class HomoEFieldItem; +class QTimeLine; +/** + @author Peter Dahlberg +*/ +class GraphicsView : public QGraphicsView { + Q_OBJECT + public: + GraphicsView(); + + ~GraphicsView(); + + public slots: + void enableOGLViewport(); + void disableOGLViewport(); + private: + + +}; + +#endif diff --git a/src/homoefielditem.cpp b/src/homoefielditem.cpp new file mode 100644 index 0000000..a6f525b --- /dev/null +++ b/src/homoefielditem.cpp @@ -0,0 +1,124 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "homoefielditem.h" +#include "homoefieldwidget.h" +#include +#include +#include +#include + +HomoEFieldItem::HomoEFieldItem(QRectF sizeRect) + : FieldItem() { + setRectF(sizeRect); + dockWidget = new HomoEFieldWidget(0,0,this); + setFieldPower(2.8e+3); + setFieldLineDistance(10); + setFlag(ItemIsMovable); + setFlag(ItemIsSelectable); + setFlag(ItemIsFocusable); + outerPenWidth = 2; + //rotateslot(66); + + + + + + +} + +void HomoEFieldItem::setFieldLineDistance(int pixel) { + fieldLineDistance = pixel; +} + +QRectF HomoEFieldItem::boundingRect() const { + return QRectF(sizeRect.x() - outerPenWidth, sizeRect.y() - outerPenWidth, + sizeRect.width() + outerPenWidth, sizeRect.height() + outerPenWidth); +} + +void HomoEFieldItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + Qt::GlobalColor linecolor = Qt::blue; + painter->setPen(linecolor); + if (isSelected()) painter->setBrush(Qt::Dense6Pattern); //selection deutlich machen + painter->drawRect(sizeRect); + + for (int i = 1; i <= floor(sizeRect.width()/(qreal)fieldLineDistance); ++i) { + const int top_bottom_space = 10; + const int arrow_height = 8; //pfeilhoehe + const int arrow_width_half = 3; //Halbe pfeilbreite + + if ((i*fieldLineDistance)+arrow_width_half >= sizeRect.width() -2) break; //rechts ueberstehen verhindern + if (sizeRect.height() < top_bottom_space + arrow_height) break;//nur zeichnen, wenn sizeRect hoch genug + + //Feldlinien zeichnen + painter->drawLine( + sizeRect.x() + (i*fieldLineDistance) , + sizeRect.y() +top_bottom_space , + sizeRect.x() + (i*fieldLineDistance) , + sizeRect.y() + sizeRect.height() - top_bottom_space + ); + + + //Pfeile Zeichnen + QPointF arrows[3] = { + QPointF(sizeRect.x()+(i*fieldLineDistance), sizeRect.y()+sizeRect.height()-top_bottom_space), + QPointF(sizeRect.x()+(i*fieldLineDistance)-arrow_width_half,sizeRect.y()+sizeRect.height()-top_bottom_space-arrow_height), + QPointF(sizeRect.x()+(i*fieldLineDistance)+arrow_width_half,sizeRect.y()+sizeRect.height()-top_bottom_space-arrow_height), + }; + painter->setBrush(linecolor); + painter->drawPolygon(arrows,3); + painter->setBrush(Qt::NoBrush); + + //qDebug() << pos(); + } +} + + +int HomoEFieldItem::type() const { + return Type; +} + + +HomoEFieldItem::~HomoEFieldItem() { +} + + + + +/*! + \fn HomoEFieldItem::getDockWidget() + */ +QWidget * HomoEFieldItem::getDockWidget() const +{ + return dockWidget; +} + + + + +double HomoEFieldItem::getFieldPower() const { + return fieldPower; +} + + +void HomoEFieldItem::setFieldPower (double fieldPower ) { + //if (this->fieldPower == fieldPower) return; + this->fieldPower = fieldPower; + emit fieldPowerChanged(fieldPower); +} diff --git a/src/homoefielditem.h b/src/homoefielditem.h new file mode 100644 index 0000000..c9dbd66 --- /dev/null +++ b/src/homoefielditem.h @@ -0,0 +1,74 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef HOMOEFIELDITEM_H +#define HOMOEFIELDITEM_H + +#include + + +/** + @author Peter Dahlberg +*/ +class QPainter; +class HomoEFieldWidget; +class QWidget; +class HomoEFieldItem : public FieldItem { + Q_OBJECT + public: + enum {Type = UserType + 1}; + enum {MinimumWidth = 20}; + enum {MinimumHeight = 30}; + HomoEFieldItem ( QRectF sizeRect ); + + virtual ~HomoEFieldItem(); + + virtual QRectF boundingRect() const; + virtual void paint ( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget ); + int type() const; + ///pointer auf das zugehoerige einstellungs Widget + QWidget* getDockWidget() const; + + //! setzt fieldLineDistance + /*! + \param pixel der Abstand + */ + virtual void setFieldLineDistance(int pixel); + + double getFieldPower() const; + + public slots: + void setFieldPower (double fieldPower ); + signals: + void fieldPowerChanged(double fieldPower); + + private: + //! Abstand der Feldlinien in der Zeichnung + int fieldLineDistance; + + qreal outerPenWidth; + + HomoEFieldWidget* dockWidget; + + ///Die Feldstärke E in V/m + double fieldPower; + +}; + +#endif diff --git a/src/homoefieldwidget.cpp b/src/homoefieldwidget.cpp new file mode 100644 index 0000000..dfd62e5 --- /dev/null +++ b/src/homoefieldwidget.cpp @@ -0,0 +1,141 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "homoefieldwidget.h" +#include "homoefielditem.h" +#include "expdoublespinbox.h" +#include +#include +#include +#include +#include + +HomoEFieldWidget::HomoEFieldWidget ( QWidget* parent, Qt::WindowFlags f, HomoEFieldItem* eField ) : QWidget ( parent, f ) { + homoEField = eField; + createWidget(); +} + + +HomoEFieldWidget::~HomoEFieldWidget() { +} + + + + +/*! + \fn HomoEFieldWidget::createWidget() + */ +void HomoEFieldWidget::createWidget() +{ + QDial *rotationDial = new QDial; + rotationDial->setRange(0,359); + rotationDial->setNotchesVisible(true); + rotationDial->setWrapping(true); + + + QDoubleSpinBox *heightBox = new QDoubleSpinBox; + heightBox->setRange(HomoEFieldItem::MinimumHeight, 5000); + connect(homoEField ,SIGNAL(heightChanged(double)), heightBox, SLOT(setValue(double)) ); + connect(heightBox, SIGNAL(valueChanged(double)),homoEField ,SLOT(setRectFHeight(double)) ); + + QDoubleSpinBox *widthBox = new QDoubleSpinBox; + widthBox->setRange(HomoEFieldItem::MinimumWidth, 5000); + connect(homoEField ,SIGNAL(widthChanged(double)),widthBox, SLOT(setValue(double)) ); + connect(widthBox, SIGNAL(valueChanged(double)),homoEField ,SLOT(setRectFWidth(double)) ); + + QLabel* xLabel = new QLabel(tr("x:")); + QLabel* yLabel = new QLabel(tr("y:")); + QLabel* widthLabel = new QLabel(tr("Breite(l):")); + QLabel* heightLabel = new QLabel(tr("H\366he(d):")); + QLabel* rotationLabel = new QLabel(tr("Rotation:")); + + QDoubleSpinBox *posXBox = new QDoubleSpinBox; + posXBox->setRange(-5000, 5000); + connect(homoEField ,SIGNAL(ScenePosXChanged(double)),posXBox, SLOT(setValue(double)) ); + connect(posXBox, SIGNAL(valueChanged(double)),homoEField ,SLOT(setScenePosX(double)) ); + + QDoubleSpinBox *posYBox = new QDoubleSpinBox; + posYBox->setRange(-5000, 5000); + connect(homoEField ,SIGNAL(ScenePosYChanged(double)),posYBox, SLOT(setValue(double)) ); + connect(posYBox, SIGNAL(valueChanged(double)),homoEField ,SLOT(setScenePosY(double)) ); + + QSpinBox* rotationBox = new QSpinBox; + rotationBox->setRange(0,359); + rotationBox->setSuffix("\260"); + rotationBox->setWrapping(true); + connect(rotationDial, SIGNAL(valueChanged(int)),rotationBox ,SIGNAL(valueChanged(int)) ); + connect(rotationDial, SIGNAL(valueChanged(int)),rotationBox,SLOT(setValue(int)) ); + connect(rotationBox, SIGNAL(valueChanged(int)),homoEField ,SLOT(setRotation(int)) ); + connect(rotationBox, SIGNAL(valueChanged(int)),rotationDial ,SLOT(setValue(int)) ); + + + QGridLayout* geomGridLayout = new QGridLayout; + //geomGridLayout->setSizeConstraint(QLayout::SetFixedSize); + + geomGridLayout->addWidget(heightBox,4,1); + geomGridLayout->addWidget(rotationBox,0,1); + geomGridLayout->addWidget(posYBox,2,1); + geomGridLayout->addWidget(posXBox,1,1); + geomGridLayout->addWidget(xLabel,1,0,Qt::AlignRight); + geomGridLayout->addWidget(yLabel,2,0,Qt::AlignRight); + geomGridLayout->addWidget(heightLabel,4,0,Qt::AlignRight); + geomGridLayout->addWidget(widthLabel,3,0,Qt::AlignRight); + geomGridLayout->addWidget(rotationLabel,0,0,Qt::AlignRight); + geomGridLayout->addWidget(widthBox,3,1); + //geomGridLayout->addWidget(rotationDial, 1,0,2,2); + + QGroupBox* geometryBox = new QGroupBox(tr("Geometrie")); + geometryBox->setLayout(geomGridLayout); + + + QLabel* fieldPowerLabel = new QLabel(tr("Feldst\344rke:")); + QLabel* voltageLabel = new QLabel(tr("Spannung:")); + + ExpDoubleSpinBox* fieldPowerBox = new ExpDoubleSpinBox; + fieldPowerBox->setRange(-1e+200,1e+200); + connect(homoEField ,SIGNAL(fieldPowerChanged(double)),fieldPowerBox, SLOT(setValue(double)) ); + connect(fieldPowerBox, SIGNAL(valueChanged(double)),homoEField ,SLOT(setFieldPower(double)) ); + + ExpDoubleSpinBox* voltageBox = new ExpDoubleSpinBox; + voltageBox->setRange(-1e+200,1e+200); + + QGridLayout* constGridLayout = new QGridLayout; + //constGridLayout->setSizeConstraint(QLayout::SetFixedSize); + constGridLayout->addWidget(fieldPowerBox,0,1); + constGridLayout->addWidget(voltageBox,1,1); + constGridLayout->addWidget(fieldPowerLabel,0,0,Qt::AlignRight); + constGridLayout->addWidget(voltageLabel,1,0,Qt::AlignRight); + + QGroupBox* fieldConstantsBox = new QGroupBox(tr("Feldkonstanten")); + fieldConstantsBox->setLayout(constGridLayout); + + + QVBoxLayout * mainLayout = new QVBoxLayout(this); + mainLayout -> addWidget(geometryBox); + mainLayout -> addWidget(fieldConstantsBox); + mainLayout -> addStretch(); + + QWidget::setTabOrder (rotationBox, posXBox); + QWidget::setTabOrder (posXBox, posYBox); + QWidget::setTabOrder (posYBox, widthBox); + QWidget::setTabOrder (widthBox, heightBox); + + this -> setLayout(mainLayout); +} diff --git a/src/homoefieldwidget.h b/src/homoefieldwidget.h new file mode 100644 index 0000000..d4b63bc --- /dev/null +++ b/src/homoefieldwidget.h @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef HOMOEFIELDWIDGET_H +#define HOMOEFIELDWIDGET_H + +#include +#include "homoefielditem.h" + + +//! Dock Widget fuer die Eigenschaften von HomoEFieldItem +/** + auf diesem Widget befinden sich Steuerelemente, mit denen man + die Eigenschaften von einem HomoEFieldItem manipulieren kann. + + @author Peter Dahlberg +*/ +class HomoEFieldWidget : public QWidget { + Q_OBJECT + public: + //! Erzeugt ein neues HomoEFieldWidget + /*! + \param parent Parent Widget, see Qt Documentaion + \param f Window Flags, see Qt Documentaion + \param eField HomoEFieldItem, zu dem das HomoEFieldWidget zugeordnet werden soll + */ + HomoEFieldWidget ( QWidget* parent, Qt::WindowFlags f, HomoEFieldItem* eField ); + + virtual ~HomoEFieldWidget(); + + private: + //!enthält einen Zeiger auf das zugeordnete HomoEFieldItem + HomoEFieldItem* homoEField; + //! Erstellt die Steuerelemente + /*! + Wird von Konstruktor aufgerufen, um die Steuerelemente zu erzeugen + */ + void createWidget(); +}; + +#endif diff --git a/src/lsim.cpp b/src/lsim.cpp new file mode 100644 index 0000000..c58bcd1 --- /dev/null +++ b/src/lsim.cpp @@ -0,0 +1,256 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#include +#include "lsim.h" +#include "simulscene.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include "expdoublespinbox.h" +#include "homoefieldwidget.h" + + +lsim::lsim() { + gview = new GraphicsView(); + setCentralWidget (gview); + + createScene(); + createActions(); + simulscene->setSceneMode(SimulScene::FieldItemEdit); + createMenus(); + createToolBars(); + createStatusBar(); + createDocks(); +} + +void lsim::closeEvent (QCloseEvent *event) { + //event->ignore(); +} + + + +void lsim::about() { + QMessageBox::about (this, tr ("\334ber lsim"), + tr ("Ein Proramm, dass noch fast gar nix kann usw...")); +} + + + +void lsim::createActions() { + acts.aboutAct = new QAction (tr ("&About"), this); + acts.aboutAct->setStatusTip (tr ("Show the application's About box")); + connect (acts.aboutAct, SIGNAL (triggered()), this, SLOT (about())); + + acts.aboutQtAct = new QAction (tr ("\334ber &Qt"), this); + acts.aboutQtAct->setStatusTip (tr ("Show the Qt library's About box")); + connect (acts.aboutQtAct, SIGNAL (triggered()), qApp, SLOT (aboutQt())); + + acts.oglEnable = new QAction (tr ("Opengl ein"), this); + acts.oglEnable->setStatusTip (tr ("OGL ein")); + connect (acts.oglEnable, SIGNAL (triggered()), gview, SLOT (enableOGLViewport())); + + acts.oglDisable = new QAction (tr ("Opengl aus"), this); + acts.oglDisable->setStatusTip (tr ("OGL aus")); + connect (acts.oglDisable, SIGNAL (triggered()), gview, SLOT (disableOGLViewport())); + + acts.timerStart = new QAction (tr ("Timer Start"), this); + acts.timerStart->setStatusTip (tr ("Timer starten")); + connect (acts.timerStart, SIGNAL (triggered()), simulscene, SLOT (startTimer())); + + acts.exitAct = new QAction (tr ("Beenden"), this); + acts.exitAct->setStatusTip (tr ("Die Anwendung beenden")); + connect (acts.exitAct, SIGNAL (triggered()), qApp, SLOT (quit())); + + //Edit, insert, Modechange + + acts.itemEditModeAct = new QAction (tr ("Edit"), this); + acts.itemEditModeAct->setStatusTip (tr ("Editiermode")); + acts.itemEditModeAct->setCheckable(true); + acts.itemEditModeAct->setData(QVariant(SimulScene::FieldItemEdit)); + + acts.insertEFieldItemAct = new QAction (tr ("E-Feld"), this); + acts.insertEFieldItemAct->setStatusTip (tr ("E-Feld Einfuegen")); + acts.insertEFieldItemAct->setCheckable(true); + acts.insertEFieldItemAct->setData(QVariant(SimulScene::HomoEFieldItemInsert)); + + modeChangeActGroup = new QActionGroup(this); + modeChangeActGroup->addAction(acts.itemEditModeAct); + modeChangeActGroup->addAction(acts.insertEFieldItemAct); + connect (modeChangeActGroup, SIGNAL (triggered(QAction*)), this, SLOT (actModeSwitcher(QAction*))); + connect (simulscene, SIGNAL(sceneModeChanged(int)) , this, SLOT(setSceneMode(int))); + +} + +void lsim::createMenus() { + fileMenu = menuBar()->addMenu("Datei"); + fileMenu->addAction(acts.oglEnable); + fileMenu->addAction(acts.oglDisable); + fileMenu->addSeparator(); + fileMenu->addAction(acts.exitAct); + menuBar()->addMenu("Bearbeiten"); + menuBar()->addMenu("Ansicht"); + menuBar()->addMenu("Einstellungen"); + + + helpMenu = menuBar()->addMenu (tr ("&Help")); + helpMenu->addAction (acts.aboutAct); + helpMenu->addAction (acts.aboutQtAct); + +} + +void lsim::createToolBars() { + fileToolBar = addToolBar (tr ("File")); + fileToolBar->addAction(acts.oglEnable); + fileToolBar->addAction(acts.oglDisable); + + editToolBar = addToolBar (tr ("Edit")); + editToolBar->addAction(acts.timerStart); + editToolBar->addSeparator(); + editToolBar->addAction(acts.itemEditModeAct); + editToolBar->addAction(acts.insertEFieldItemAct); +} + +void lsim::createStatusBar() { + statusBar()->showMessage (tr ("Ready")); +} + +void lsim::createScene() { + simulscene = new SimulScene(); + gview->setScene(simulscene); +} + +void lsim::createDocks() { + QPushButton *button1 = new QPushButton("Loeschen"); + QPushButton *button2 = new QPushButton("calculate"); + ExpDoubleSpinBox *box = new ExpDoubleSpinBox; + box->setRange(-pow(10,33), pow(10,33)); + box->setDecimals(4); + //box->setSuffix(" V"); + + QSlider *slider1 = new QSlider(); + slider1->setMinimum(0); + slider1->setMaximum(360); + + connect (button1, SIGNAL(clicked()) , simulscene, SLOT(deleteSelectedFieldItems())); + connect (button2, SIGNAL(clicked()) , simulscene, SLOT(startCalculation())); + + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(button1); + layout->addWidget(button2); + layout->addWidget(slider1); + layout->addWidget(box); + QWidget *widget2 = new QWidget; + widget2->setLayout(layout); + + //HomoEFieldWidget *eFieldOpt = new HomoEFieldWidget(0,0,qgraphicsitem_cast(simulscene->items().first())); + //HomoEFieldItem *homoitem = new HomoEFieldItem(QRectF(44,44,99,99)); + + fieldItemEditDock = new QDockWidget(tr("Feldeinstellungen"), this); + fieldItemEditDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea); + fieldItemEditDock->setWidget(new QWidget); + addDockWidget(Qt::LeftDockWidgetArea, fieldItemEditDock); + connect (simulscene, SIGNAL(selectionChanged ()) , this, SLOT(updateDockFieldWidget())); + updateDockFieldWidget(); + + dock_2 = new QDockWidget(tr("Ein Testdock 2"), this); + dock_2->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea); + dock_2->setWidget((widget2)); + addDockWidget(Qt::LeftDockWidgetArea, dock_2); + + + probeItemDock = new QDockWidget(tr("Probleladung"), this); + probeItemDock->setWidget(simulscene->getProbeDockWidget()); + addDockWidget(Qt::LeftDockWidgetArea, probeItemDock); + + + + tabifyDockWidget(dock_2,fieldItemEditDock); + tabifyDockWidget(fieldItemEditDock, probeItemDock); + setDockOptions(QMainWindow::VerticalTabs); + +} + +void lsim::actModeSwitcher(QAction *action) { + if (action->data().toInt() == SimulScene::FieldItemEdit) simulscene->setSceneMode(SimulScene::FieldItemEdit); + if (action->data().toInt() == SimulScene::HomoEFieldItemInsert) simulscene->setSceneMode(SimulScene::HomoEFieldItemInsert); +} + +void lsim::setSceneMode(int mode) { + for (int i=0;i < modeChangeActGroup->actions().count();++i){ + if(modeChangeActGroup->actions().at(i)->data().toInt() == mode) { + modeChangeActGroup->actions().at(i)->setChecked(true); + } + else { + modeChangeActGroup->actions().at(i)->setChecked(false); + } + } +/* +//Problem mit resizeRects, warum auch immer :( + //je nach sceneMode den cursor eintellen + switch (mode) { + case SimulScene::HomoEFieldItemInsert: + gview->setCursor(Qt::CrossCursor); + break; + default: + gview->unsetCursor(); + + } +*/ +} + +lsim::~lsim() { + +} + + + +/*! + \fn lsim::updateDockFieldWidget() + */ +void lsim::updateDockFieldWidget() { + QStringListModel *model = new QStringListModel(); + QStringList list; + list << "a" << "b" << "c"; + model->setStringList(list); + QListView * lview = new QListView; + lview->setModel(model); + + QLabel* currLabel = new QLabel(tr("Bitte ein Feld ausw\344hlen")); + currLabel->setWordWrap(true); + currLabel->setAlignment(Qt::AlignCenter); + QWidget *currDockWidget =currLabel; + if(simulscene->selectedItems().count() == 1) { + QGraphicsItem *currItem = simulscene->selectedItems().first(); + if (FieldItem::isFieldItem(currItem)) { + FieldItem *currFieldItem = qgraphicsitem_cast(currItem); + currDockWidget = currFieldItem->getDockWidget(); + } + } + + fieldItemEditDock->setWidget(currDockWidget); +} diff --git a/src/lsim.h b/src/lsim.h new file mode 100644 index 0000000..86ee8ad --- /dev/null +++ b/src/lsim.h @@ -0,0 +1,99 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#ifndef LSIM_H +#define LSIM_H + +#include +#include +#include + +//Hauptfenster + +/** + @author Peter Dahlberg +*/ + +class QAction; +class QMenu; +class QTextEdit; +class QDockWidget; +class SimulScene; +class QActionGroup; + +class lsim: public QMainWindow { + Q_OBJECT + + public: + lsim(); + ~lsim(); + + protected: + void closeEvent (QCloseEvent *event); + + private slots: + void about(); + void actModeSwitcher(QAction *action); + void setSceneMode(int mode); + void updateDockFieldWidget(); + + private: + void createActions(); + void createMenus(); + void createToolBars(); + void createStatusBar(); + void createDocks(); + void createScene(); + + GraphicsView *gview; + + QMenu *fileMenu; + QMenu *editMenu; + QMenu *helpMenu; + + QToolBar *fileToolBar; + QToolBar *editToolBar; + + struct Actions { + QAction *aboutAct; + QAction *exitAct; + QAction *aboutQtAct; + QAction *oglEnable; + QAction *oglDisable; + QAction *timerStart; + + QAction *itemEditModeAct; + QAction *insertEFieldItemAct; + }; + Actions acts; + + QActionGroup *modeChangeActGroup; + + + + QDockWidget *fieldItemEditDock; + QDockWidget *probeItemDock; + QDockWidget *dock_2; + + SimulScene *simulscene; +}; + +#endif diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..daf985d --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,33 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#include +#include "lsim.h" + +int main(int argc, char *argv[]) +{ + Q_INIT_RESOURCE(application); + QApplication app(argc, argv); + lsim * mw = new lsim(); + mw->show(); + return app.exec(); +} + diff --git a/src/probechargewidget.cpp b/src/probechargewidget.cpp new file mode 100644 index 0000000..ba936c1 --- /dev/null +++ b/src/probechargewidget.cpp @@ -0,0 +1,126 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "probechargewidget.h" +#include "graphicsellipseitem.h" +#include "expdoublespinbox.h" +#include +#include +#include +#include +#include + +ProbeChargeWidget::ProbeChargeWidget ( QWidget* parent, Qt::WindowFlags f, GraphicsEllipseItem* ellipse ) : QWidget (parent, f ) { + createWidget(); +} + + +ProbeChargeWidget::~ProbeChargeWidget() { +} + + +void ProbeChargeWidget::createWidget() +{ + QDial *rotationDial = new QDial; + rotationDial->setRange(0,359); + rotationDial->setNotchesVisible(true); + rotationDial->setWrapping(true); + + + QDoubleSpinBox *heightBox = new QDoubleSpinBox; + + + + QDoubleSpinBox *widthBox = new QDoubleSpinBox; + + + + QLabel* xLabel = new QLabel(tr("x:")); + QLabel* yLabel = new QLabel(tr("y:")); + QLabel* widthLabel = new QLabel(tr("Breite(l):")); + QLabel* heightLabel = new QLabel(tr("H\366he(d):")); + QLabel* rotationLabel = new QLabel(tr("Rotation:")); + + QDoubleSpinBox *posXBox = new QDoubleSpinBox; + posXBox->setRange(-5000, 5000); + + + QDoubleSpinBox *posYBox = new QDoubleSpinBox; + posYBox->setRange(-5000, 5000); + + + QSpinBox* rotationBox = new QSpinBox; + rotationBox->setRange(0,359); + rotationBox->setSuffix("\260"); + rotationBox->setWrapping(true); + + + + QGridLayout* geomGridLayout = new QGridLayout; + //geomGridLayout->setSizeConstraint(QLayout::SetFixedSize); + + geomGridLayout->addWidget(heightBox,4,1); + geomGridLayout->addWidget(rotationBox,0,1); + geomGridLayout->addWidget(posYBox,2,1); + geomGridLayout->addWidget(posXBox,1,1); + geomGridLayout->addWidget(xLabel,1,0,Qt::AlignRight); + geomGridLayout->addWidget(yLabel,2,0,Qt::AlignRight); + geomGridLayout->addWidget(heightLabel,4,0,Qt::AlignRight); + geomGridLayout->addWidget(widthLabel,3,0,Qt::AlignRight); + geomGridLayout->addWidget(rotationLabel,0,0,Qt::AlignRight); + geomGridLayout->addWidget(widthBox,3,1); + //geomGridLayout->addWidget(rotationDial, 1,0,2,2); + + QGroupBox* geometryBox = new QGroupBox(tr("Geometrie")); + geometryBox->setLayout(geomGridLayout); + + + QLabel* fieldPowerLabel = new QLabel(tr("Feldst\344rke:")); + QLabel* voltageLabel = new QLabel(tr("Spannung:")); + + ExpDoubleSpinBox* fieldPowerBox = new ExpDoubleSpinBox; + fieldPowerBox->setRange(-1e+200,1e+200); + + + ExpDoubleSpinBox* voltageBox = new ExpDoubleSpinBox; + voltageBox->setRange(-1e+200,1e+200); + + QGridLayout* constGridLayout = new QGridLayout; + //constGridLayout->setSizeConstraint(QLayout::SetFixedSize); + constGridLayout->addWidget(fieldPowerBox,0,1); + constGridLayout->addWidget(voltageBox,1,1); + constGridLayout->addWidget(fieldPowerLabel,0,0,Qt::AlignRight); + constGridLayout->addWidget(voltageLabel,1,0,Qt::AlignRight); + + QGroupBox* fieldConstantsBox = new QGroupBox(tr("Feldkonstanten")); + fieldConstantsBox->setLayout(constGridLayout); + + + QVBoxLayout * mainLayout = new QVBoxLayout(this); + mainLayout -> addWidget(geometryBox); + mainLayout -> addWidget(fieldConstantsBox); + mainLayout -> addStretch(); + + QWidget::setTabOrder (rotationBox, posXBox); + QWidget::setTabOrder (posXBox, posYBox); + QWidget::setTabOrder (posYBox, widthBox); + QWidget::setTabOrder (widthBox, heightBox); + + this -> setLayout(mainLayout); +} diff --git a/src/probechargewidget.h b/src/probechargewidget.h new file mode 100644 index 0000000..3710b5a --- /dev/null +++ b/src/probechargewidget.h @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef PROBECHARGEWIDGET_H +#define PROBECHARGEWIDGET_H + +#include +class GraphicsEllipseItem; +//! Dock Widget fuer die Eigenschaften von HomoEFieldItem +/** + auf diesem Widget befinden sich Steuerelemente, mit denen man + die Eigenschaften von einem GraphicsEllipseItem (Probeladungen) manipulieren kann. + + @author Peter Dahlberg +*/ +class ProbeChargeWidget : public QWidget { + Q_OBJECT + public: + //! Erzeugt ein neues ProbeChargeWidget + /*! + \param parent Parent Widget, see Qt Documentaion + \param f Window Flags, see Qt Documentaion + \param eField HomoEFieldItem, zu dem das HomoEFieldWidget zugeordnet werden soll + */ + ProbeChargeWidget ( QWidget* parent, Qt::WindowFlags f, GraphicsEllipseItem* ellipse ); + + virtual ~ProbeChargeWidget(); + private: + //!enthält einen Zeiger auf das zugeordnete GraphicsEllipseItem + GraphicsEllipseItem* ellipseItem; + //! Erstellt die Steuerelemente + /*! + Wird von Konstruktor aufgerufen, um die Steuerelemente zu erzeugen + */ + void createWidget(); + +}; + +#endif diff --git a/src/simulscene.cpp b/src/simulscene.cpp new file mode 100644 index 0000000..3a6d692 --- /dev/null +++ b/src/simulscene.cpp @@ -0,0 +1,561 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "constants.h" +#include "simulscene.h" +#include +#include +#include +#include +#include "graphicsellipseitem.h" +#include "homoefielditem.h" +#include +#include +#include +#include +#include +#include +#include + + + +SimulScene::SimulScene ( QObject* parent ) : QGraphicsScene ( parent ) { + //variablen initialisieren + setTimePerStep(0.00001); + setSteps(200); + //setMeterPerPx(1/1000.0); + setMeterPerPx(1); + currHomoEfieldInsertItem = 0; + currHomoEfieldEditItem = 0; + createResizeRects(); + + addLine(0,-298,0,298,QPen(Qt::green, 1, Qt::SolidLine) )->setCacheMode(QGraphicsItem::DeviceCoordinateCache); + addLine(-398,0,398,0,QPen(Qt::green, 1, Qt::SolidLine) )->setCacheMode(QGraphicsItem::DeviceCoordinateCache); + + for (int i = -39; i< 39; ++i) { + if(i!=0) { + QGraphicsLineItem *line = addLine(i*10,-298,i*10,298,QPen(Qt::lightGray, 1, Qt::DotLine) ); + line ->setCacheMode(QGraphicsItem::DeviceCoordinateCache); + line->setZValue(-1); + } + } + for (int i = -29; i< 29; ++i) { + if(i!=0) { + QGraphicsLineItem *line = addLine(-398,i*10,398,i*10,QPen(Qt::lightGray, 1, Qt::DotLine) ); + line ->setCacheMode(QGraphicsItem::DeviceCoordinateCache); + line->setZValue(-1); + } + } + + ellipse1 = new GraphicsEllipseItem(); + ellipse1->setRect(-2,-2,5,5); + ellipse1->setPen(Qt::NoPen); + ellipse1->setBrush(Qt::red); + ellipse1->setZValue(1); + //ellipse1->scale(4,4); + ellipse1->setAcceptDrops(true); + + + addItem(ellipse1); + + timer = new QTimeLine( (200e-3/8.0e+6) *1000 * 2e+8); + //qDebug()<< (200e-3/8.0e+6) *1000 * 2e+8; + timer->setFrameRange(0,100); + timer->setUpdateInterval(25); + timer->setCurveShape(QTimeLine::LinearCurve); + //timer->toggleDirection(); + QGraphicsItemAnimation *ani = new QGraphicsItemAnimation(); + ani->setItem(ellipse1); + ani->setTimeLine(timer); + + qreal E = 40/(2e-2); + qreal q = -1.6022e-19; + qreal m = 9.1094e-31; + qreal vx = 8.0e+6; + qreal ax=0; + qreal ay=q*E/m; + + for (int i=0; i<=200; ++i) { + qreal x=i; + ani->setPosAt(i/200.0, QPointF(x , 0.5 * ay * pow(( (x/1000) /vx),2) *1000 )); + //ani->setPosAt((t+360)/720.0, QPointF((t), 80*abs(t/180.0*3.14) )); + //qDebug()<start(); +} + +void SimulScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) { + switch(myMode) { + case HomoEFieldItemInsert: + if (mouseEvent->button() != Qt::LeftButton) break; //benutze nur linke maustaste + currHomoEfieldInsertItem = new HomoEFieldItem(QRectF(mouseEvent->scenePos(),mouseEvent->scenePos())); + addItem(currHomoEfieldInsertItem); + QApplication::setOverrideCursor(QCursor(Qt::SizeFDiagCursor)); + break; + default: + if (itemAt(mouseEvent->scenePos())->data(0) == ResizeRectItem && mouseEvent->button()==Qt::LeftButton) { + pressedResizeItem = itemAt(mouseEvent->scenePos()); + if (selectedItems().first()->type() == HomoEFieldItem::Type) { + currHomoEfieldEditItem = qgraphicsitem_cast(selectedItems().first()); + QApplication::setOverrideCursor(pressedResizeItem->cursor()); + } + + } + else { + QGraphicsScene::mousePressEvent(mouseEvent); + } + } + + +} + +void SimulScene::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent) { + if (currHomoEfieldInsertItem != 0) { + if (myMode == HomoEFieldItemInsert) { + QPointF point(currHomoEfieldInsertItem->getRectF().x(), currHomoEfieldInsertItem->getRectF().y()); + update(currHomoEfieldInsertItem->getRectF()); + if(point.x() <= mouseEvent->scenePos().x() && point.y() <= mouseEvent->scenePos().y()) { + QRectF rect(point,mouseEvent->scenePos()); + currHomoEfieldInsertItem->setRectF(rect); + //update(QRectF(point,mouseEvent->lastScenePos())); + + } + + } + } + else if (currHomoEfieldEditItem != 0 ) { + + QGraphicsRectItem *pressedRectItem = qgraphicsitem_cast(pressedResizeItem); + QRectF currRect = currHomoEfieldEditItem->getRectF(); + QPointF newPos = currHomoEfieldEditItem->pos(); + + calculateItemResize(mouseEvent,pressedRectItem,currRect,newPos,HomoEFieldItem::MinimumWidth,HomoEFieldItem::MinimumHeight); + + //aenderungen uebernehmen + currHomoEfieldEditItem->setPos(newPos); + if (currRect != currHomoEfieldEditItem->getRectF()) { + currHomoEfieldEditItem->setRectF(currRect); + } + //resize rechtecke mitverschieben --> macht jetzt schon das Widget + //if(mouseEvent->scenePos() != mouseEvent->lastScenePos()) displayResizeRects(true); + + } + else { + QGraphicsScene::mouseMoveEvent(mouseEvent); + if (mouseEvent->buttons() == Qt::LeftButton) + if(mouseEvent->scenePos() != mouseEvent->lastScenePos()) + displayResizeRects(true); + } +} + +void SimulScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) { + if (currHomoEfieldInsertItem != 0 && myMode == HomoEFieldItemInsert) { + if (currHomoEfieldInsertItem->getRectF().width() < HomoEFieldItem::MinimumWidth || currHomoEfieldInsertItem->getRectF().height() setVisible(false); //ausblenden, damit sich nix verschiebt + QRectF rect (currHomoEfieldInsertItem->getRectF()); + QPointF posPoint(rect.x(),rect.y()); + rect.setWidth(rect.width() - rect.x()); + rect.setHeight(rect.height() - rect.y()); + rect.setX(0); + rect.setY(0); + currHomoEfieldInsertItem->setRectF(rect); + currHomoEfieldInsertItem->setPos(posPoint); + currHomoEfieldInsertItem->setVisible(true); //und wieder einblenden + + + setSceneMode(FieldItemEdit); + //das neue item auswaehlen + clearSelection(); + currHomoEfieldInsertItem->setSelected(true); + + //die resize items aus und einblenden bei rotation + connect( currHomoEfieldInsertItem, SIGNAL(rotationChanged()), this, SLOT(displayResizeRects())); + //bei groesenanderung und verschieben resizerects mitverschieben + connect( currHomoEfieldInsertItem, SIGNAL(heightChanged(double)), this, SLOT(moveResizeRects())); + connect( currHomoEfieldInsertItem, SIGNAL(widthChanged(double)), this, SLOT(moveResizeRects())); + connect( currHomoEfieldInsertItem, SIGNAL(ScenePosChanged(QPointF)), this, SLOT(moveResizeRects())); + //item ueber sceneChange informieren + connect(this,SIGNAL(changed(QList)),currHomoEfieldInsertItem,SLOT(handleSceneChange(QList))); + } + update(); //moegliche darstellungsprobleme beseitigen + QApplication::restoreOverrideCursor(); + } + else if (currHomoEfieldEditItem != 0) { + update(); + QApplication::restoreOverrideCursor(); + + } + pressedResizeItem = 0; + currHomoEfieldInsertItem = 0; + currHomoEfieldEditItem = 0; + + QGraphicsScene::mouseReleaseEvent(mouseEvent); +} + +void SimulScene::keyPressEvent (QKeyEvent *keyevent) { + if(keyevent->key() == Qt::Key_Delete) { + deleteSelectedFieldItems(); + } +} + +void SimulScene::setSceneMode(SceneMode mode) { + if(myMode==mode) return; + myMode = mode; + emit sceneModeChanged(mode); +} + +void SimulScene::createResizeRects() { + const QRectF resizeRectSize(0,0,7,7); + + reRects.leftTopResizeItem = new QGraphicsRectItem(resizeRectSize); + reRects.leftTopResizeItem->setCursor(Qt::SizeFDiagCursor); + reRects.leftTopResizeItem->setBrush(Qt::black); + reRects.leftTopResizeItem->setVisible(false); + reRects.leftTopResizeItem->setData(0, QVariant(ResizeRectItem)); //typ des items setzen + + reRects.leftResizeItem = new QGraphicsRectItem(resizeRectSize); + reRects.leftResizeItem->setCursor(Qt::SizeHorCursor); + reRects.leftResizeItem->setBrush(Qt::black); + reRects.leftResizeItem->setVisible(false); + reRects.leftResizeItem->setData(0, QVariant(ResizeRectItem)); + + reRects.leftBottomResizeItem = new QGraphicsRectItem(resizeRectSize); + reRects.leftBottomResizeItem->setCursor(Qt::SizeBDiagCursor); + reRects.leftBottomResizeItem->setBrush(Qt::black); + reRects.leftBottomResizeItem->setVisible(false); + reRects.leftBottomResizeItem->setData(0, QVariant(ResizeRectItem)); + + reRects.bottomResizeItem = new QGraphicsRectItem(resizeRectSize); + reRects.bottomResizeItem->setCursor(Qt::SizeVerCursor); + reRects.bottomResizeItem->setBrush(Qt::black); + reRects.bottomResizeItem->setVisible(false); + reRects.bottomResizeItem->setData(0, QVariant(ResizeRectItem)); + + reRects.rightBottomResizeItem = new QGraphicsRectItem(resizeRectSize); + reRects.rightBottomResizeItem->setCursor(Qt::SizeFDiagCursor); + reRects.rightBottomResizeItem->setBrush(Qt::black); + reRects.rightBottomResizeItem->setVisible(false); + reRects.rightBottomResizeItem->setData(0, QVariant(ResizeRectItem)); + + reRects.rightRezizeItem = new QGraphicsRectItem(resizeRectSize); + reRects.rightRezizeItem->setCursor(Qt::SizeHorCursor); + reRects.rightRezizeItem->setBrush(Qt::black); + reRects.rightRezizeItem->setVisible(false); + reRects.rightRezizeItem->setData(0, QVariant(ResizeRectItem)); + + reRects.rightTopResizeItem = new QGraphicsRectItem(resizeRectSize); + reRects.rightTopResizeItem->setCursor(Qt::SizeBDiagCursor); + reRects.rightTopResizeItem->setBrush(Qt::black); + reRects.rightTopResizeItem->setVisible(false); + reRects.rightTopResizeItem->setData(0, QVariant(ResizeRectItem)); + + reRects.topResizeItem = new QGraphicsRectItem(resizeRectSize); + reRects.topResizeItem->setCursor(Qt::SizeVerCursor); + reRects.topResizeItem->setBrush(Qt::black); + reRects.topResizeItem->setVisible(false); + reRects.topResizeItem->setData(0, QVariant(ResizeRectItem)); + + addItem(reRects.leftTopResizeItem); + addItem(reRects.leftResizeItem); + addItem(reRects.leftBottomResizeItem); + addItem(reRects.bottomResizeItem); + addItem(reRects.rightBottomResizeItem); + addItem(reRects.rightRezizeItem); + addItem(reRects.rightTopResizeItem); + addItem(reRects.topResizeItem); + + + connect( this, SIGNAL(selectionChanged()), this, SLOT(displayResizeRects()) ); +} + +void SimulScene::displayResizeRects(bool move) { + if ( + selectedItems().count() == 1 && + FieldItem::isFieldItem(selectedItems().first()) && + !selectedItems().first()->transform().isTranslating() //bei rotation nicht anzeigen + ) { + + const qreal oSPACE = 3; //Aussenabstand + + //position des ausgewaehlten items + QPointF seletedPos = selectedItems().first()->pos(); + qreal selPosX = seletedPos.x(); + qreal selPosY = seletedPos.y(); + + + + //an die richtige stelle schieben + reRects.leftTopResizeItem->setPos(selPosX - reRects.leftTopResizeItem->rect().width()- oSPACE, + selPosY - reRects.leftTopResizeItem->rect().height() - oSPACE); + + reRects.leftResizeItem->setPos(selPosX - reRects.leftResizeItem->rect().width()- oSPACE, + selPosY + + selectedItems().first()->boundingRect().height() / 2.0 - + reRects.leftResizeItem->rect().height() /2.0); + reRects.leftBottomResizeItem->setPos(selPosX - reRects.leftBottomResizeItem->rect().width()- oSPACE, + selPosY + selectedItems().first()->boundingRect().height() + oSPACE); + + reRects.bottomResizeItem->setPos(selPosX + + selectedItems().first()->boundingRect().width() / 2.0 - + reRects.bottomResizeItem->rect().width() /2.0, + selPosY + selectedItems().first()->boundingRect().height() + oSPACE); + reRects.rightBottomResizeItem->setPos(selPosX + selectedItems().first()->boundingRect().width() + oSPACE, + selPosY + selectedItems().first()->boundingRect().height() + oSPACE); + reRects.rightRezizeItem->setPos(selPosX + selectedItems().first()->boundingRect().width() + oSPACE, + selPosY + + selectedItems().first()->boundingRect().height() / 2.0 - + reRects.rightRezizeItem->rect().height() /2.0); + reRects.rightTopResizeItem->setPos(selPosX + selectedItems().first()->boundingRect().width() + oSPACE, + selPosY - reRects.rightTopResizeItem->rect().height() - oSPACE); + reRects.topResizeItem->setPos(selPosX + + selectedItems().first()->boundingRect().width() / 2.0 - + reRects.topResizeItem->rect().width() /2.0, + selPosY - reRects.leftTopResizeItem->rect().height() - oSPACE); + + + if (!move) { //im verschiebemodus kann man von diesen dingen ausgehen + //nach oben bringen + qreal newZValue = getHighestZIndexVisible() + 0.000001; + reRects.leftTopResizeItem->setZValue(newZValue); + reRects.leftResizeItem->setZValue(newZValue); + reRects.leftBottomResizeItem->setZValue(newZValue); + reRects.bottomResizeItem->setZValue(newZValue); + reRects.rightBottomResizeItem->setZValue(newZValue); + reRects.rightRezizeItem->setZValue(newZValue); + reRects.rightTopResizeItem->setZValue(newZValue); + reRects.topResizeItem->setZValue(newZValue); + + //sichtbar machen + reRects.leftTopResizeItem->setVisible(true); + reRects.leftResizeItem->setVisible(true); + reRects.leftBottomResizeItem->setVisible(true); + reRects.bottomResizeItem->setVisible(true); + reRects.rightBottomResizeItem->setVisible(true); + reRects.rightRezizeItem->setVisible(true); + reRects.rightTopResizeItem->setVisible(true); + reRects.topResizeItem->setVisible(true); + } + } + else if(!move && reRects.leftTopResizeItem->isVisible()) { + //unsichtbar machen + reRects.leftTopResizeItem->setVisible(false); + reRects.leftResizeItem->setVisible(false); + reRects.leftBottomResizeItem->setVisible(false); + reRects.bottomResizeItem->setVisible(false); + reRects.rightBottomResizeItem->setVisible(false); + reRects.rightRezizeItem->setVisible(false); + reRects.rightTopResizeItem->setVisible(false); + reRects.topResizeItem->setVisible(false); + } +} + +void SimulScene::moveResizeRects() { + displayResizeRects(true); +} + +qreal SimulScene::getHighestZIndexVisible() { + bool highestZValueSet = false; + qreal highestZValue = 0; + for (int i = 0; i < items().count() ; ++i ) { + if (items().at(i)->isVisible()) { + if (!highestZValueSet) { + highestZValue = items().at(i)->zValue(); + highestZValueSet = true; + } + else if (highestZValue < items().at(i)->zValue()) { + highestZValue = items().at(i)->zValue(); + } + } + } + return highestZValue; +} + +void SimulScene::deleteSelectedFieldItems() { + QList currSelectedItems = selectedItems(); + for (int i = 0; i < currSelectedItems.count() ; ++i ) { + if (FieldItem::isFieldItem(currSelectedItems.at(i))) { + delete currSelectedItems.at(i); + } + } +} + + +void SimulScene::calculateItemResize( + QGraphicsSceneMouseEvent *mouseEvent, + QGraphicsRectItem *pressedRectItem, + QRectF &currRect, + QPointF &newPos, + qreal minWidth, + qreal minHeight +) { + + qreal mouseDistanceX = mouseEvent->scenePos().x() - mouseEvent->lastScenePos().x(); + qreal mouseDistanceY = mouseEvent->scenePos().y() - mouseEvent->lastScenePos().y(); + + if (reRects.rightRezizeItem == pressedRectItem) { + currRect.adjust(0,0,mouseDistanceX , 0); + } + else if (reRects.leftResizeItem == pressedRectItem) { + newPos = QPointF(newPos.x()+mouseDistanceX,newPos.y()); + currRect.adjust(0,0,-mouseDistanceX , 0); + } + else if (reRects.topResizeItem == pressedRectItem) { + newPos = QPointF(newPos.x(),newPos.y()+mouseDistanceY); + currRect.adjust(0,0,0, -mouseDistanceY ); + } + else if (reRects.bottomResizeItem == pressedRectItem) { + currRect.adjust(0,0,0, mouseDistanceY ); + } + else if (reRects.rightBottomResizeItem == pressedRectItem) { + currRect.adjust(0,0,0, mouseDistanceY ); + currRect.adjust(0,0,mouseDistanceX , 0); + } + else if (reRects.leftBottomResizeItem == pressedRectItem) { + currRect.adjust(0,0,0, mouseDistanceY ); + newPos = QPointF(newPos.x()+mouseDistanceX,newPos.y()); + currRect.adjust(0,0,-mouseDistanceX , 0); + } + else if (reRects.leftTopResizeItem == pressedRectItem) { + newPos = QPointF(newPos.x(),newPos.y()+mouseDistanceY); + currRect.adjust(0,0,0, -mouseDistanceY ); + newPos = QPointF(newPos.x()+mouseDistanceX,newPos.y()); + currRect.adjust(0,0,-mouseDistanceX , 0); + } + else if (reRects.rightTopResizeItem == pressedRectItem) { + newPos = QPointF(newPos.x(),newPos.y()+mouseDistanceY); + currRect.adjust(0,0,0, -mouseDistanceY ); + currRect.adjust(0,0,mouseDistanceX , 0); + } + + //gegen zu klein werden + if (currRect.width() <= minWidth) { + if (mouseEvent->lastScenePos().x() < mouseEvent->scenePos().x()) { //gegen rumspringen + newPos = QPointF(newPos.x() + (currRect.width() - minWidth) ,newPos.y()); + } + currRect.setWidth(minWidth); + } + if (currRect.height() <= minHeight) { + if (mouseEvent->lastScenePos().y() < mouseEvent->scenePos().y()) { //gegen rumspringen + newPos = QPointF(newPos.x(), newPos.y() + (currRect.height() - minHeight)); + } + currRect.setHeight(minHeight); + } + +} + + +SimulScene::~SimulScene() { +} + + + + + +/*! + \fn SimulScene::getTimePerStep() + */ +double SimulScene::getTimePerStep() { + return timePerStep; +} + + +/*! + \fn SimulScene::setTimePerStep(int time) + */ +void SimulScene::setTimePerStep(double time) { + if (time == timePerStep) return; + timePerStep = time; + emit timePerStepChanged(time); +} + + +/*! + \fn SimulScene::startCalculation() + */ +void SimulScene::startCalculation() { + ellipse1->calculateProbePath(); +} + + +/*! + \fn SimulScene::getSteps() + */ +int SimulScene::getSteps() { + return steps; +} + + +/*! + \fn SimulScene::setSteps() + */ +void SimulScene::setSteps(int steps) { + if (this->steps == steps) return; + this->steps = steps; + emit stepsChanged(steps); + +} + +long double SimulScene::getPowerAt(QPointF point, long double charge, char xy) { + long double dPower = 0; + for(int i = 0; i < items(point).size(); ++i) { + //HomoEFieldItems Abarbeiten + if (qgraphicsitem_cast (items(point).at(i)) != 0) { + HomoEFieldItem* myHomoEfieldItem = qgraphicsitem_cast (items(point).at(i)); + double power = (myHomoEfieldItem->getFieldPower() * charge); + double degAngle = myHomoEfieldItem->getRotation(); + double radAngle = degAngle/180.0l*PI; + + if(xy == 'x') { + if (degAngle != 180.0) dPower += power * -sin(radAngle); + } + if(xy == 'y') { + if (degAngle != 90.0 && degAngle != 270.0) dPower += power * cos(radAngle); + } + } + } + + return dPower; + +} + +double SimulScene::getMeterPerPx() const { + return meterPerPx; +} + + +void SimulScene::setMeterPerPx ( double theValue ) { + if (theValue == meterPerPx) return; + meterPerPx = theValue; +} + + +/*! + \fn SimulScene::getProbeDockWidget() const + */ +QWidget* SimulScene::getProbeDockWidget() const { + return ellipse1->getDockWidget(); +} diff --git a/src/simulscene.h b/src/simulscene.h new file mode 100644 index 0000000..506ee20 --- /dev/null +++ b/src/simulscene.h @@ -0,0 +1,125 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef SIMULSCENE_H +#define SIMULSCENE_H + +#include + +class QTimeLine; +class HomoEFieldItem; +class QGraphicsRectItem; +class QGraphicsItemGroup; +class GraphicsEllipseItem; + +/** + @author Peter Dahlberg +*/ +class SimulScene : public QGraphicsScene { + Q_OBJECT + public: + enum SceneMode {HomoEFieldItemInsert, FieldItemEdit }; + enum ItemType {ResizeRectItem}; + SimulScene ( QObject* parent = 0); + qreal getHighestZIndexVisible(); //hoechsten z-index der sichtbaren items ausgeben + + ~SimulScene(); + double getTimePerStep(); + int getSteps(); + + //! gibt die Wirkende Kraft zurück (in Newton) + /*! + \param point der Punkt der abgeprüft werden soll + \param charge Die Ladung, auf die die Kraft ausgeübt wird + \param xy x oder y-Richtung + */ + long double getPowerAt(QPointF point, long double charge, char xy); + QWidget* getProbeDockWidget() const; + + public slots: + void setSceneMode(SceneMode mode); + void startTimer(); + void deleteSelectedFieldItems(); + void setTimePerStep(double time); + ///starte die Berechnung der teilchenbahn(en) + void startCalculation(); + void setSteps(int steps); + + void setMeterPerPx ( double theValue ); + + + double getMeterPerPx() const; + + private slots: + void displayResizeRects(bool move = false); + ///does the same as displayResizeRects(true) + void moveResizeRects(); + signals: + void sceneModeChanged(int mode); + void stepsChanged(int steps); + void timePerStepChanged(double timePerStep); + private: + QTimeLine *timer; + + SceneMode myMode; + + ///Zeit pro Step in ms + double timePerStep; + ///anzahl der Steps + int steps; + ///ein Pixel entspricht so viel meter + double meterPerPx; + HomoEFieldItem *currHomoEfieldInsertItem; //Aktuell erstelltes Item + HomoEFieldItem *currHomoEfieldEditItem; + QGraphicsItem *pressedResizeItem; + + GraphicsEllipseItem *ellipse1; + + + //rechtecke zur groesenaenderung + struct resizeRects { + QGraphicsRectItem *leftTopResizeItem; + QGraphicsRectItem *leftResizeItem; + QGraphicsRectItem *leftBottomResizeItem; + QGraphicsRectItem *bottomResizeItem; + QGraphicsRectItem *rightBottomResizeItem; + QGraphicsRectItem *rightRezizeItem; + QGraphicsRectItem *rightTopResizeItem; + QGraphicsRectItem *topResizeItem; + }; + resizeRects reRects; + void createResizeRects(); + + void calculateItemResize( + QGraphicsSceneMouseEvent *mouseEvent, + QGraphicsRectItem *pressedRectItem, + QRectF &currRect, + QPointF &newPos, + qreal minWidth, + qreal minHeight + ); + + protected: + void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent); + void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent); + void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent); + void keyPressEvent ( QKeyEvent * keyEvent ); +}; + +#endif diff --git a/src/src.pro b/src/src.pro new file mode 100644 index 0000000..b056f91 --- /dev/null +++ b/src/src.pro @@ -0,0 +1,32 @@ +SOURCES += lsim.cpp \ + main.cpp \ + graphicsview.cpp \ + graphicsellipseitem.cpp \ + fielditem.cpp \ + homoefielditem.cpp \ + simulscene.cpp \ + expdoublespinbox.cpp \ + homoefieldwidget.cpp \ + probechargewidget.cpp +HEADERS += lsim.h \ + graphicsview.h \ + graphicsellipseitem.h \ + fielditem.h \ + homoefielditem.h \ + simulscene.h \ + expdoublespinbox.h \ + lsim_interface.h \ + homoefieldwidget.h \ + constants.h \ + probechargewidget.h +TEMPLATE = app +CONFIG += warn_on \ + thread \ + qt \ + debug +TARGET = ../bin/lsim +RESOURCES = application.qrc +QT += opengl + +CONFIG -= release + diff --git a/templates/cpp b/templates/cpp new file mode 100644 index 0000000..c696552 --- /dev/null +++ b/templates/cpp @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ diff --git a/templates/h b/templates/h new file mode 100644 index 0000000..c696552 --- /dev/null +++ b/templates/h @@ -0,0 +1,19 @@ +/*************************************************************************** + * Copyright (C) 2008 by Peter Dahlberg * + * pdahlberg@gmail.com * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/