--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#if !defined(__ATOMIC_VERSION_H__)
+#define __ATOMIC_VERSION_H__
+
+/*
+ ATOMIC_VERSION is (major << 16) + (minor << 8) + patch.
+*/
+
+#define ATOMIC_VERSION_STR "@VERSION@"
+#define ATOMIC_VERSION @XVERSION@
+
+#endif // __ATOMIC_VERSION_H__
--- /dev/null
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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.
+\f
+ 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.)
+\f
+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.
+\f
+ 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.
+\f
+ 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
+\f
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
--- /dev/null
+This is the version 0.3.0 of ATOMIC (sample no-corba-engine) SALOME module
--- /dev/null
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 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.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+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 and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, 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 library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete 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 distribute a copy of this License along with the
+Library.
+
+ 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.
+\f
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, 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) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+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 Library, 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 Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+\f
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you 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.
+
+ If distribution of 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 satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be 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.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library 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.
+
+ 9. 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 Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+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 with
+this License.
+\f
+ 11. 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 Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library 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 Library.
+
+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.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library 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.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser 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 Library
+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 Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+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
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "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
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. 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 LIBRARY 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
+LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+\f
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; 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.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
--- /dev/null
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
+ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
+ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
+
+SUBDIRS = adm_local resources src bin
+
+DISTCLEANFILES = a.out aclocal.m4 configure local-install.sh
+
+salomeinclude_DATA = ATOMIC_version.h
+
+EXTRA_DIST += \
+ build_configure \
+ clean_configure
+
+dist-hook:
+ rm -rf `find $(distdir) -name CVS`
--- /dev/null
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+SUBDIRS = unix
--- /dev/null
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+SUBDIRS = config_files
--- /dev/null
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+dist_admlocalm4_DATA = check_ATOMIC.m4
--- /dev/null
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+AC_DEFUN([CHECK_ATOMIC],[
+
+AC_CHECKING(for ATOMIC)
+
+ATOMIC_ok=no
+
+AC_ARG_WITH(atomic,
+ [ --with-atomic=DIR root directory path of ATOMIC module installation ],
+ ATOMIC_DIR="$withval",ATOMIC_DIR="")
+
+if test "x$ATOMIC_DIR" == "x" ; then
+ # no --with-atomic-dir option used
+ if test "x$ATOMIC_ROOT_DIR" != "x" ; then
+ # ATOMIC_ROOT_DIR environment variable defined
+ ATOMIC_DIR=$ATOMIC_ROOT_DIR
+ fi
+fi
+
+if test -f ${ATOMIC_DIR}/lib/salome/libATOMIC.so ; then
+ ATOMIC_ok=yes
+ AC_MSG_RESULT(Using ATOMIC module distribution in ${ATOMIC_DIR})
+
+ if test "x$ATOMIC_ROOT_DIR" == "x" ; then
+ ATOMIC_ROOT_DIR=${ATOMIC_DIR}
+ fi
+
+ ATOMIC_LDFLAGS=-L${ATOMIC_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
+ ATOMIC_CXXFLAGS=-I${ATOMIC_DIR}/include/salome
+else
+ AC_MSG_WARN("Cannot find valid ATOMIC module installation)
+fi
+
+AC_MSG_RESULT(for ATOMIC: $ATOMIC_ok)
+
+AC_SUBST(ATOMIC_ROOT_DIR)
+AC_SUBST(ATOMIC_LDFLAGS)
+AC_SUBST(ATOMIC_CXXFLAGS)
+
+])dnl
+
--- /dev/null
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+# ============================================================
+# The following is to avoid PACKAGE_... env variable
+# redefinition compilation warnings
+# ============================================================
+AM_CXXFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h
+AM_CPPFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h
+
+# ============================================================
+# This file defines the common definitions used in several
+# Makefile. This file must be included, if needed, by the file
+# Makefile.am.
+# ============================================================
+# Standard directory for installation
+#
+salomeincludedir = $(includedir)/salome
+libdir = $(prefix)/lib@LIB_LOCATION_SUFFIX@/salome
+bindir = $(prefix)/bin/salome
+salomescriptdir = $(bindir)
+salomepythondir = $(pythondir)/salome
+salomepyexecdir = $(pyexecdir)/salome
+
+# Directory for installing resource files
+salomeresdir = $(prefix)/share/salome/resources/@MODULE_NAME@
+
+# Directories for installing admin files
+admlocaldir = $(prefix)/adm_local
+admlocalunixdir = $(admlocaldir)/unix
+admlocalm4dir = $(admlocaldir)/unix/config_files
+
+# Shared modules installation directory
+sharedpkgpythondir = $(salomepythondir)/shared_modules
+
+# Documentation directory
+docdir = $(datadir)/doc/salome
+
+# common rules
+
+# meta object implementation files generation (moc)
+%_moc.cxx: %.h
+ $(MOC) $< -o $@
+
+# translation (*.qm) files generation (lrelease)
+%.qm: resources/%.ts
+ $(LRELEASE) $< -qm $@
+
+# resource files generation (qrcc)
+qrc_%.cxx: %.qrc
+ $(QRCC) $< -o $@ -name $(*F)
+
+# qt forms files generation (uic)
+ui_%.h: %.ui
+ $(UIC) -o $@ $<
+
+# extra distributed files
+EXTRA_DIST = $(MOC_FILES:%_moc.cxx=%.h) $(QRC_FILES:qrc_%.cxx=%.qrc) \
+ $(UIC_FILES:ui_%.h=%.ui) $(nodist_salomeres_DATA:%.qm=resources/%.ts)
+
+# customize clean operation
+mostlyclean-local:
+ rm -f @builddir@/*_moc.cxx
+ rm -f @builddir@/*.qm
+ rm -f @builddir@/ui_*.h
+ rm -f @builddir@/qrc_*.cxx
+
+# tests
+tests: unittest
+
+unittest: $(UNIT_TEST_PROG)
+ @if test "x$(UNIT_TEST_PROG)" != "x"; then \
+ $(UNIT_TEST_PROG); \
+ fi;
--- /dev/null
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+# non-distributed files
+nodist_salomescript_DATA = VERSION
+
+# distributed files
+dist_salomescript_SCRIPTS =
--- /dev/null
+THIS IS SAMPLE LIGHT (NO-CORBA-ENGINE) MODULE : ATOMIC : VERSION: @VERSION@
--- /dev/null
+#!/bin/bash
+
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+ORIG_DIR=`pwd`
+CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
+
+# ____________________________________________________________________
+# Test if the KERNEL_ROOT_DIR is set correctly
+
+if test ! -d "${KERNEL_ROOT_DIR}"; then
+ echo "failed : KERNEL_ROOT_DIR variable is not correct !"
+ exit
+fi
+
+# ____________________________________________________________________
+# Test if the GUI_ROOT_DIR is set correctly
+
+if test ! -d "${GUI_ROOT_DIR}"; then
+ echo "failed : GUI_ROOT_DIR variable is not correct !"
+ exit
+fi
+
+cd ${CONF_DIR}
+ABS_CONF_DIR=`pwd`
+
+# ____________________________________________________________________
+# aclocal creates the aclocal.m4 file from the standard macro and the
+# custom macro embedded in the directory adm_local/unix/config_files
+# and KERNEL config_files directory.
+# output:
+# aclocal.m4
+# autom4te.cache (directory)
+echo "======================================================= aclocal"
+
+aclocal -I adm_local/unix/config_files \
+ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
+ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files || exit 1
+
+# ____________________________________________________________________
+# libtoolize creates some configuration files (ltmain.sh,
+# config.guess and config.sub). It only depends on the libtool
+# version. The files are created in the directory specified with the
+# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
+# output:
+# adm_local/unix/config_files/config.guess
+# adm_local/unix/config_files/config.sub
+# adm_local/unix/config_files/ltmain.sh
+echo "==================================================== libtoolize"
+
+libtoolize --force --copy --automake || exit 1
+
+# ____________________________________________________________________
+# autoconf creates the configure script from the file configure.ac (or
+# configure.in if configure.ac doesn't exist)
+# output:
+# configure
+echo "====================================================== autoconf"
+
+autoconf
+
+# ____________________________________________________________________
+# automake creates some scripts used in building process
+# (install-sh, missing, ...). It only depends on the automake
+# version. The files are created in the directory specified with the
+# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
+# creates the Makefile.in files from the Makefile.am files.
+# output:
+# adm_local/unix/config_files/compile
+# adm_local/unix/config_files/depcomp
+# adm_local/unix/config_files/install-sh
+# adm_local/unix/config_files/missing
+# adm_local/unix/config_files/py-compile
+# Makefile.in (from Makefile.am)
+echo "====================================================== automake"
+
+automake --copy --gnu --add-missing
--- /dev/null
+#!/bin/bash
+
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+rm -rf autom4te.cache aclocal.m4 configure make_config
+find . -name "*~" -print -exec rm {} \;
+find . -name "*.pyc" -print -exec rm {} \;
+
+find adm_local -name Makefile.in | xargs rm -f
+find bin -name Makefile.in | xargs rm -f
+find resources -name Makefile.in | xargs rm -f
+find src -name Makefile.in | xargs rm -f
+rm -f Makefile.in
--- /dev/null
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+AC_INIT([Salome5 Project ATOMIC module], [0.3.0], [webmaster.salome@opencascade.com], [SalomeATOMIC])
+AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+AM_INIT_AUTOMAKE([-Wno-portability])
+
+XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
+AC_SUBST(XVERSION)
+
+# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
+MODULE_NAME=atomic
+AC_SUBST(MODULE_NAME)
+
+dnl
+dnl Initialize source and build root directories
+dnl
+
+ROOT_BUILDDIR=`pwd`
+ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
+cd $ROOT_SRCDIR
+ROOT_SRCDIR=`pwd`
+cd $ROOT_BUILDDIR
+
+AC_SUBST(ROOT_SRCDIR)
+AC_SUBST(ROOT_BUILDDIR)
+
+echo
+echo Source root directory : $ROOT_SRCDIR
+echo Build root directory : $ROOT_BUILDDIR
+echo
+echo
+
+AC_CHECK_PROG(SHELL,sh)
+AC_SUBST(SHELL)
+
+if test -z "$AR"; then
+ AC_CHECK_PROGS(AR,ar xar,:,$PATH)
+fi
+AC_SUBST(AR)
+
+dnl Export the AR macro so that it will be placed in the libtool file
+dnl correctly.
+export AR
+
+echo
+echo ---------------------------------------------
+echo testing make
+echo ---------------------------------------------
+echo
+
+AC_PROG_MAKE_SET
+AC_PROG_INSTALL
+AC_LOCAL_INSTALL
+dnl
+dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
+
+AC_ENABLE_DEBUG(yes)
+AC_DISABLE_PRODUCTION
+
+echo ---------------------------------------------
+echo testing libtool
+echo ---------------------------------------------
+
+dnl first, we set static to no!
+dnl if we want it, use --enable-static
+AC_ENABLE_STATIC(no)
+
+AC_LIBTOOL_DLOPEN
+AC_PROG_LIBTOOL
+
+echo
+echo ---------------------------------------------
+echo testing C/C++
+echo ---------------------------------------------
+echo
+
+cc_ok=no
+dnl inutil car libtool
+dnl AC_PROG_CC
+AC_PROG_CXX
+AC_CXX_WARNINGS
+AC_CXX_TEMPLATE_OPTIONS
+AC_DEPEND_FLAG
+# AC_CC_WARNINGS([ansi])
+cc_ok=yes
+
+dnl Library libdl :
+AC_CHECK_LIB(dl,dlopen)
+
+dnl add library libm :
+AC_CHECK_LIB(m,ceil)
+
+dnl Library librt : for alpha/osf
+AC_CHECK_LIB(rt,nanosleep)
+
+dnl
+dnl Check if we use std iostream by default or if we must add
+dnl a compiler directive for that
+dnl
+
+AC_CXX_USE_STD_IOSTREAM
+
+dnl
+dnl Well we use sstream which is not in gcc pre-2.95.3
+dnl We must test if it exists. If not, add it in include !
+dnl
+
+AC_CXX_HAVE_SSTREAM
+
+dnl
+dnl ---------------------------------------------
+dnl testing linker
+dnl ---------------------------------------------
+dnl
+
+AC_LINKER_OPTIONS
+
+dnl
+dnl ---------------------------------------------
+dnl testing WITHIHM
+dnl ---------------------------------------------
+dnl
+
+CHECK_WITHIHM
+
+echo
+echo ---------------------------------------------
+echo testing LEX \& YACC
+echo ---------------------------------------------
+echo
+
+lex_yacc_ok=no
+AC_PROG_YACC
+AC_PROG_LEX
+lex_yacc_ok=yes
+
+echo
+echo ---------------------------------------------
+echo testing python
+echo ---------------------------------------------
+echo
+
+CHECK_PYTHON
+
+AM_PATH_PYTHON(2.3)
+
+echo
+echo ---------------------------------------------
+echo testing threads
+echo ---------------------------------------------
+echo
+
+ENABLE_PTHREADS
+
+echo
+echo ---------------------------------------------
+echo testing openGL
+echo ---------------------------------------------
+echo
+
+CHECK_OPENGL
+
+echo
+echo ---------------------------------------------
+echo testing QT
+echo ---------------------------------------------
+echo
+
+CHECK_QT
+
+echo
+echo ---------------------------------------------
+echo testing VTK
+echo ---------------------------------------------
+echo
+
+CHECK_VTK
+
+echo
+echo ---------------------------------------------
+echo testing MPI
+echo ---------------------------------------------
+echo
+
+CHECK_MPI
+
+echo
+echo ---------------------------------------------
+echo testing HDF5
+echo ---------------------------------------------
+echo
+
+CHECK_HDF5
+
+echo
+echo ---------------------------------------------
+echo Testing OpenCascade
+echo ---------------------------------------------
+echo
+
+CHECK_CAS
+
+echo
+echo ---------------------------------------------
+echo Testing html generators
+echo ---------------------------------------------
+echo
+
+CHECK_HTML_GENERATORS
+
+echo
+echo ---------------------------------------------
+echo Testing Kernel
+echo ---------------------------------------------
+echo
+
+CHECK_KERNEL
+
+echo
+echo ---------------------------------------------
+echo Testing GUI
+echo ---------------------------------------------
+echo
+
+CHECK_SALOME_GUI
+
+echo
+echo ---------------------------------------------
+echo Summary
+echo ---------------------------------------------
+echo
+
+echo Configure
+variables="cc_ok lex_yacc_ok python_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok occ_ok doxygen_ok graphviz_ok Kernel_ok SalomeGUI_ok"
+
+for var in $variables
+do
+ printf " %10s : " `echo \$var | sed -e "s,_ok,,"`
+ eval echo \$$var
+done
+
+dnl We don't need to say when we re entering directories if we re using
+dnl GNU make because make does it for us.
+if test "X$GMAKE" = "Xyes"; then
+ AC_SUBST(SETX) SETX=":"
+else
+ AC_SUBST(SETX) SETX="set -x"
+fi
+
+AC_OUTPUT_COMMANDS([ \
+ chmod +x ./bin/* \
+])
+
+echo
+echo ---------------------------------------------
+echo generating Makefiles and configure files
+echo ---------------------------------------------
+echo
+
+# This list is initiated using autoscan and must be updated manually
+# when adding a new file <filename>.in to manage. When you execute
+# autoscan, the Makefile list is generated in the output file configure.scan.
+# This could be helpfull to update de configuration.
+AC_OUTPUT([ \
+ adm_local/Makefile \
+ adm_local/unix/Makefile \
+ adm_local/unix/config_files/Makefile \
+ bin/VERSION \
+ bin/Makefile \
+ resources/Makefile \
+ src/Makefile \
+ src/ATOMICGUI/Makefile \
+ ATOMIC_version.h \
+ Makefile \
+])
--- /dev/null
+<!DOCTYPE document>
+<document>
+ <section name="launch" >
+ <parameter name="modules" value="ATOMIC" />
+ </section>
+ <section name="ATOMIC" >
+ <parameter name="name" value="Atomic" />
+ <parameter name="icon" value="ATOMIC.png" />
+ </section>
+ <section name="resources" >
+ <parameter name="ATOMIC" value="${ATOMIC_ROOT_DIR}/share/salome/resources/atomic" />
+ </section>
+</document>
--- /dev/null
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+dist_salomeres_DATA = \
+ ATOMIC.png \
+ atom.png \
+ atom_conf.png \
+ atom_remove.png \
+ atom_rename.png \
+ LightApp.xml \
+ SalomeApp.xml \
+ sample.xml
--- /dev/null
+<!DOCTYPE document>
+<document>
+ <section name="launch" >
+ <parameter name="modules" value="ATOMIC" />
+ </section>
+ <section name="ATOMIC" >
+ <parameter name="name" value="Atomic" />
+ <parameter name="icon" value="ATOMIC.png" />
+ </section>
+ <section name="resources" >
+ <parameter name="ATOMIC" value="${ATOMIC_ROOT_DIR}/share/salome/resources/atomic" />
+ </section>
+</document>
--- /dev/null
+<!DOCTYPE Atomic>
+<document>
+ <molecule name="H2O" >
+ <atom x="0" y="0" z="0" name="H1" />
+ <atom x="0" y="0" z="0" name="H2" />
+ <atom x="0" y="0" z="0" name="O" />
+ </molecule>
+ <molecule name="C2H5OH" >
+ <atom x="0" y="0" z="0" name="C1" />
+ <atom x="0" y="0" z="0" name="C2" />
+ <atom x="0" y="0" z="0" name="H1" />
+ <atom x="0" y="0" z="0" name="H2" />
+ <atom x="0" y="0" z="0" name="H3" />
+ <atom x="0" y="0" z="0" name="H4" />
+ <atom x="0" y="0" z="0" name="H5" />
+ <atom x="0" y="0" z="0" name="O" />
+ <atom x="0" y="0" z="0" name="H" />
+ </molecule>
+</document>
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+using namespace std;
+
+#include "ATOMICGUI.h"
+
+#include "ATOMICGUI_DataModel.h"
+#include "ATOMICGUI_DataObject.h"
+#include "ATOMICGUI_Selection.h"
+#include "ATOMICGUI_CreateMolOp.h"
+#include "ATOMICGUI_AddAtomOp.h"
+#include "ATOMICGUI_ImportExportOp.h"
+#include "ATOMICGUI_RenameOp.h"
+#include "ATOMICGUI_DeleteOp.h"
+
+#include <LightApp_Application.h>
+#include <LightApp_DataOwner.h>
+#include <LightApp_SelectionMgr.h>
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_Desktop.h>
+
+#include <qaction.h>
+
+/*! Constructor */
+ATOMICGUI::ATOMICGUI()
+: LightApp_Module( "ATOMICGUI" )
+{
+}
+
+/*! Initialization funciton. Called only once on first activation of GUI module. */
+void ATOMICGUI::initialize ( CAM_Application* app )
+{
+ LightApp_Module::initialize( app );// call parent's implementation
+
+ SUIT_Desktop* parent = application()->desktop();
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
+ // create actions
+ createAction( agCreateMol, tr( "TOP_CREATE_MOL" ), resMgr->loadPixmap( "ATOMIC", tr( "ICON_MOLECULE" ) ),
+ tr( "MEN_CREATE_MOL" ), tr( "STB_CREATE_MOL" ), 0, parent, false, this, SLOT( onOperation() ) );
+ createAction( agAddAtom, tr( "TOP_ADD_ATOM" ), resMgr->loadPixmap( "ATOMIC", tr( "ICON_ATOM" ) ),
+ tr( "MEN_ADD_ATOM" ), tr( "STB_ADD_ATOM" ), 0, parent, false, this, SLOT( onOperation() ) );
+ createAction( agRename, tr( "TOP_RENAME" ), resMgr->loadPixmap( "ATOMIC", tr( "ICON_RENAME" ) ),
+ tr( "MEN_RENAME" ), tr( "STB_RENAME" ), 0, parent, false, this, SLOT( onOperation() ) );
+ createAction( agDelete, tr( "TOP_DELETE_OBJ" ), resMgr->loadPixmap( "ATOMIC", tr( "ICON_REMOVE" ) ),
+ tr( "MEN_DELETE_OBJ" ), tr( "STB_DELETE_OBJ" ), 0, parent, false, this, SLOT( onOperation() ) );
+ createAction( agImportXML, tr( "TOP_IMPORT_XML" ), QIcon(), tr( "MEN_IMPORT_XML" ),
+ tr( "STB_IMPORT_XML" ), 0, parent, false, this, SLOT( onOperation() ) );
+ createAction( agExportXML, tr( "TOP_EXPORT_XML" ), QIcon(), tr( "MEN_EXPORT_XML" ),
+ tr( "STB_EXPORT_XML" ), 0, parent, false, this, SLOT( onOperation() ) );
+
+ // init popup menus
+ int aFileMnu = createMenu( tr( "MEN_FILE" ), -1, -1 );
+ createMenu( separator(), aFileMnu, -1, 10 );
+ createMenu( agImportXML, aFileMnu, 10 );
+ createMenu( agExportXML, aFileMnu, 10 );
+ createMenu( separator(), aFileMnu, -1, 10 );
+
+ int aEditMnu = createMenu( tr( "MEN_EDIT" ), -1, -1 );
+ createMenu( separator(), aEditMnu, -1, 10 );
+ createMenu( agRename, aEditMnu, 10 );
+ createMenu( agDelete, aEditMnu, 10 );
+ createMenu( separator(), aEditMnu, -1, 10 );
+
+ int aAtomicMnu = createMenu( tr( "MEN_ATOMIC" ), -1, -1, 50 );
+ createMenu( agCreateMol, aAtomicMnu, 10 );
+ createMenu( separator(), aAtomicMnu, -1, 10 );
+ createMenu( agAddAtom, aAtomicMnu, 10 );
+
+ // create toolbar
+ int tbId = createTool( tr( "MEN_ATOMIC" ) );
+ createTool( agCreateMol, tbId );
+ createTool( agAddAtom, tbId );
+ createTool( separator(), tbId );
+ createTool( agRename, tbId );
+ createTool( separator(), tbId );
+ createTool( agDelete, tbId );
+
+ // popup for object browser
+ int parentId = -1;
+ popupMgr()->insert ( separator(), parentId, 0 );
+ popupMgr()->insert ( action( agCreateMol ), parentId, 0 );
+ popupMgr()->insert ( action( agAddAtom ), parentId, 0 );
+ popupMgr()->insert ( separator(), parentId, 0 );
+ popupMgr()->insert ( action( agRename ), parentId, 0 );
+ popupMgr()->insert ( action( agDelete ), parentId, 0 );
+ popupMgr()->insert ( separator(), parentId, 0 );
+
+ QString rule = "client='ObjectBrowser' and selcount=1 and type='Molecule'";
+ popupMgr()->setRule( action( agAddAtom ), rule );
+
+ rule = "client='ObjectBrowser' and selcount=1 and type='Root'";
+ popupMgr()->setRule( action( agCreateMol ),rule );
+
+ rule = "($type in {'Molecule' 'Atom'}) and client='ObjectBrowser' and selcount=1";
+ popupMgr()->setRule( action( agRename ), rule );
+
+ rule = "($type in {'Molecule' 'Atom'}) and client='ObjectBrowser' and selcount>0";
+ popupMgr()->setRule( action( agDelete ), rule );
+}
+
+/*! Returns default icon of a component. */
+QString ATOMICGUI::iconName() const
+{
+ return QObject::tr( "ICON_ATOMIC" );
+}
+
+/*! Returns list of windows required for this GUI module. */
+void ATOMICGUI::windows ( QMap<int, int>& aMap ) const
+{
+ aMap.insert( LightApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
+}
+
+/*! Returns list of entities of selected objects. */
+void ATOMICGUI::selected( QStringList& entries, const bool multiple )
+{
+ LightApp_SelectionMgr* mgr = getApp()->selectionMgr();
+ if( !mgr )
+ return;
+
+ SUIT_DataOwnerPtrList anOwnersList;
+ mgr->selected( anOwnersList );
+
+ for ( int i = 0; i < anOwnersList.size(); i++ )
+ {
+ const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( anOwnersList[ i ].get() );
+ QStringList es = owner->entry().split( "_" );
+ if ( es.count() > 1 && es[ 0 ] == "ATOMICGUI" && es[ 1 ] != "root" )
+ {
+ entries.append( owner->entry() );
+ if( !multiple )
+ break;
+ }
+ }
+}
+
+/*! Instantiation of a custom Data Model. */
+CAM_DataModel* ATOMICGUI::createDataModel()
+{
+ return new ATOMICGUI_DataModel( this );
+}
+
+/*! Instantiation of a custom Selection object - manager of parameters for popup construction. */
+LightApp_Selection* ATOMICGUI::createSelection() const
+{
+ return new ATOMICGUI_Selection();
+}
+
+/*! Activation function. Called on every activation of a GUI module. */
+bool ATOMICGUI::activateModule ( SUIT_Study* study )
+{
+ bool isDone = LightApp_Module::activateModule( study );
+ if ( !isDone ) return false;
+
+ setMenuShown( true );
+ setToolShown( true );
+
+ return isDone;
+}
+
+/*! Deactivation function. Called on every deactivation of a GUI module. */
+bool ATOMICGUI::deactivateModule ( SUIT_Study* study )
+{
+ setMenuShown( false );
+ setToolShown( false );
+
+ return LightApp_Module::deactivateModule( study );
+}
+
+/*! slot connected to all functions of the component (create molecule, add atom, etc.) */
+void ATOMICGUI::onOperation()
+{
+ if( sender() && sender()->inherits( "QAction" ) )
+ {
+ int id = actionId( ( QAction* )sender() );
+ startOperation( id );
+ }
+}
+
+/*! Instantiation of a custom Operation object - component's action manager. */
+LightApp_Operation* ATOMICGUI::createOperation( const int id ) const
+{
+ switch( id )
+ {
+ case agImportXML:
+ return new ATOMICGUI_ImportExportOp( true );
+
+ case agExportXML:
+ return new ATOMICGUI_ImportExportOp( false );
+
+ case agCreateMol:
+ return new ATOMICGUI_CreateMolOp();
+
+ case agAddAtom:
+ return new ATOMICGUI_AddAtomOp();
+
+ case agRename:
+ return new ATOMICGUI_RenameOp();
+
+ case agDelete:
+ return new ATOMICGUI_DeleteOp();
+
+ default:
+ return 0;
+ }
+}
+
+#if defined(WNT)
+#define ATOMICGUI_EXPORT __declspec(dllexport)
+#else // WNT
+#define ATOMICGUI_EXPORT
+#endif // WNT
+
+/*! GUI module instantiation function */
+extern "C" {
+ ATOMICGUI_EXPORT CAM_Module* createModule() {
+ return new ATOMICGUI();
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#if !defined(ATOMICGUI_H)
+#define ATOMICGUI_H
+
+#include <LightApp_Module.h>
+
+/*!
+ * Class : ATOMICGUI
+ * Description : GUI module class for ATOMIC component
+ */
+class ATOMICGUI: public LightApp_Module
+{
+ Q_OBJECT
+ enum { agCreateMol,
+ agAddAtom,
+ agRename,
+ agDelete,
+ agImportXML,
+ agExportXML };
+
+public:
+ ATOMICGUI();
+
+ virtual void initialize ( CAM_Application* );
+ virtual QString iconName () const;
+
+ virtual void windows ( QMap<int, int>& ) const;
+
+ void selected( QStringList&, const bool );
+
+protected:
+ virtual CAM_DataModel* createDataModel();
+ virtual LightApp_Selection* createSelection() const;
+ virtual LightApp_Operation* createOperation( const int ) const;
+
+public slots:
+ virtual bool activateModule ( SUIT_Study* );
+ virtual bool deactivateModule ( SUIT_Study* );
+
+private slots:
+ void onOperation();
+};
+
+#endif // ATOMICGUI_H
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#include <ATOMICGUI_AddAtomDlg.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qlabel.h>
+#include <QtxDoubleSpinBox.h>
+
+#define DBL_MAX 1000.0
+
+/*! Constructor */
+ATOMICGUI_AddAtomDlg::ATOMICGUI_AddAtomDlg( QWidget* parent )
+: LightApp_Dialog( parent, 0, false, true, OK | Apply | Close )
+{
+ setWindowTitle( tr( "CAPTION" ) );
+
+ QGridLayout* main = new QGridLayout( mainFrame() );
+
+ QLabel* xn = new QLabel( tr( "ATOMIC_ATOM" ) + ":", mainFrame() );
+ myName = new QLineEdit( mainFrame() );
+
+ QLabel* xl = new QLabel( "X:", mainFrame() );
+ myX = new QtxDoubleSpinBox( -DBL_MAX, DBL_MAX, 1, mainFrame() );
+ myX->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ QLabel* yl = new QLabel( "Y:", mainFrame() );
+ myY = new QtxDoubleSpinBox( -DBL_MAX, DBL_MAX, 1, mainFrame() );
+ myY->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ QLabel* zl = new QLabel( "Z:", mainFrame() );
+ myZ = new QtxDoubleSpinBox( -DBL_MAX, DBL_MAX, 1, mainFrame() );
+ myZ->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+
+ main->addWidget( xn, 0, 0 );
+ main->addWidget( myName, 0, 1 );
+ main->addWidget( xl, 1, 0 );
+ main->addWidget( myX, 1, 1 );
+ main->addWidget( yl, 2, 0 );
+ main->addWidget( myY, 2, 1 );
+ main->addWidget( zl, 3, 0 );
+ main->addWidget( myZ, 3, 1 );
+
+ setButtonPosition( Right, Close );
+
+ myX->setValue( 0 );
+ myY->setValue( 0 );
+ myZ->setValue( 0 );
+}
+
+/*! Destructor */
+ATOMICGUI_AddAtomDlg::~ATOMICGUI_AddAtomDlg()
+{
+}
+
+/*! Validates data. */
+bool ATOMICGUI_AddAtomDlg::acceptData( const QStringList& selected ) const
+{
+ // check selection
+ if( selected.count()!=1 )
+ return false;
+
+ // check entered data
+ return !myName->text().toLatin1().trimmed().isEmpty();
+}
+
+/*! Returns values of dialog widgets. */
+void ATOMICGUI_AddAtomDlg::data( QString& name, double& x, double& y, double& z ) const
+{
+ name = myName->text().toLatin1().trimmed();
+ x = myX->value();
+ y = myY->value();
+ z = myZ->value();
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#if !defined(ATOMICGUI_ATOMDLG_H)
+#define ATOMICGUI_ATOMDLG_H
+
+#include <LightApp_Dialog.h>
+
+class QtxDoubleSpinBox;
+class QLineEdit;
+
+/*!
+ * Class : ATOMICGUI_AddAtomDlg
+ * Description : Dialog for Atom creation
+ */
+class ATOMICGUI_AddAtomDlg : public LightApp_Dialog
+{
+ Q_OBJECT
+
+public:
+ ATOMICGUI_AddAtomDlg( QWidget* );
+ virtual ~ATOMICGUI_AddAtomDlg();
+
+ void data( QString&, double&, double&, double& ) const;
+ bool acceptData( const QStringList& ) const;
+
+private:
+ QLineEdit* myName;
+ QtxDoubleSpinBox* myX;
+ QtxDoubleSpinBox* myY;
+ QtxDoubleSpinBox* myZ;
+};
+
+#endif // ATOMICGUI_ATOMDLG_H
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#include <ATOMICGUI_AddAtomOp.h>
+#include <ATOMICGUI_AddAtomDlg.h>
+#include <ATOMICGUI_DataModel.h>
+#include <ATOMICGUI.h>
+
+#include <LightApp_Module.h>
+#include <LightApp_Application.h>
+#include <SUIT_Desktop.h>
+
+/*! Constructor */
+ATOMICGUI_AddAtomOp::ATOMICGUI_AddAtomOp()
+ : ATOMICGUI_Operation(),
+ myDlg( 0 )
+{
+}
+
+/*! Destructor */
+ATOMICGUI_AddAtomOp::~ATOMICGUI_AddAtomOp()
+{
+ if ( myDlg )
+ delete myDlg;
+}
+
+/*! Returns Operation dialog */
+LightApp_Dialog* ATOMICGUI_AddAtomOp::dlg() const
+{
+ if ( !myDlg )
+ const_cast<ATOMICGUI_AddAtomOp*>( this )->myDlg = new ATOMICGUI_AddAtomDlg( module()->getApp()->desktop() );
+
+ return myDlg;
+}
+
+/*! slot, called when user presses Apply button of the dialog */
+void ATOMICGUI_AddAtomOp::onApply()
+{
+ QStringList entries;
+ atomModule()->selected( entries, false );
+ ATOMICGUI_AddAtomDlg* d = dynamic_cast<ATOMICGUI_AddAtomDlg*>( dlg() );
+ if( dataModel() && d && d->acceptData( entries ) )
+ {
+ QString name;
+ double x, y, z;
+ d->data( name, x, y, z );
+ dataModel()->addAtom( entries.first(), name, x, y, z );
+ module()->getApp()->updateObjectBrowser();
+ }
+}
+
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#ifndef ATOMICGUI_ADD_ATOM_OP_H
+#define ATOMICGUI_ADD_ATOM_OP_H
+
+#include <ATOMICGUI_Operation.h>
+
+class ATOMICGUI_AddAtomDlg;
+
+/*!
+ * Class : ATOMICGUI_AddAtomOp
+ * Description : Operation class for Atom creation
+ * Uses ATOMICGUI_AddAtomDlg class
+ */
+class ATOMICGUI_AddAtomOp : public ATOMICGUI_Operation
+{
+ Q_OBJECT
+
+public:
+ ATOMICGUI_AddAtomOp();
+ virtual ~ATOMICGUI_AddAtomOp();
+
+ virtual LightApp_Dialog* dlg() const;
+
+protected slots:
+ virtual void onApply();
+
+private:
+ ATOMICGUI_AddAtomDlg* myDlg;
+};
+
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#include <ATOMICGUI_CreateMolOp.h>
+#include <ATOMICGUI_DataModel.h>
+
+/*! Constructor */
+ATOMICGUI_CreateMolOp::ATOMICGUI_CreateMolOp()
+: ATOMICGUI_Operation()
+{
+}
+
+/*! Destructor */
+ATOMICGUI_CreateMolOp::~ATOMICGUI_CreateMolOp()
+{
+}
+
+/*! Operation itself. */
+void ATOMICGUI_CreateMolOp::startOperation()
+{
+ if( dataModel() && dataModel()->createMolecule() )
+ commit();
+ else
+ abort();
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#ifndef ATOMICGUI_CREATECONF_OP_H
+#define ATOMICGUI_CREATECONF_OP_H
+
+#include <ATOMICGUI_Operation.h>
+
+/*!
+ * Class : ATOMICGUI_AddAtomOp
+ * Description : Operation class for Molecule creation
+ */
+class ATOMICGUI_CreateMolOp : public ATOMICGUI_Operation
+{
+ Q_OBJECT
+
+public:
+ ATOMICGUI_CreateMolOp();
+ virtual ~ATOMICGUI_CreateMolOp();
+
+protected:
+ virtual void startOperation();
+};
+
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#include "ATOMICGUI_Data.h"
+#include <qobject.h>
+
+int ATOMICGUI_AtomicMolecule::myMaxId = 0;
+int ATOMICGUI_AtomicMolecule::Atom::myMaxId = 0;
+
+/*! Constructor of Atom */
+ATOMICGUI_AtomicMolecule::Atom::Atom()
+ : myName( QString::null ), myX( 0. ), myY( 0. ), myZ( 0. )
+{
+ myId = ++myMaxId;
+}
+
+/*! Constructor of Atom */
+ATOMICGUI_AtomicMolecule::Atom::Atom( const QString& name,
+ const double x,
+ const double y,
+ const double z )
+ : myName( name ), myX( x ), myY( y ), myZ( z )
+{
+ myId = ++myMaxId;
+}
+
+/*! Constructor of Molecule */
+ATOMICGUI_AtomicMolecule::ATOMICGUI_AtomicMolecule( const QString& name )
+{
+ myId = ++myMaxId;
+ myName = name.isEmpty() ? QObject::tr( "ATOMICGUI_NONAME" ) : name;
+}
+
+/*! Destructor of Molecule */
+ATOMICGUI_AtomicMolecule::~ATOMICGUI_AtomicMolecule()
+{
+}
+
+/*! Adds an atom to the molecule */
+void ATOMICGUI_AtomicMolecule::addAtom( const QString& atom,
+ const double x,
+ const double y,
+ const double z )
+{
+ myAtoms.append( Atom( atom, x, y, z ) );
+}
+
+/*! Removes an atom from molecule by index */
+void ATOMICGUI_AtomicMolecule::deleteAtom( const int index )
+{
+ if ( index >= 0 and index < myAtoms.count() )
+ myAtoms.removeAt( index );
+}
+
+/*! Gets an atom id by index */
+int ATOMICGUI_AtomicMolecule::atomId( const int index ) const
+{
+ if ( index >= 0 and index < myAtoms.count() )
+ return myAtoms[ index ].id();
+ return 0;
+}
+
+/*! Gets an atom name by index */
+QString ATOMICGUI_AtomicMolecule::atomName( const int index ) const
+{
+ QString n;
+ if ( index >= 0 and index < myAtoms.count() )
+ n = myAtoms[ index ].name();
+ return n;
+}
+
+/*! Gets an atom x coordinate by index */
+double ATOMICGUI_AtomicMolecule::atomX( const int index ) const
+{
+ if ( index >= 0 and index < myAtoms.count() )
+ return myAtoms[ index ].x();
+ return 0;
+}
+
+/*! Gets an atom y coordinate by index */
+double ATOMICGUI_AtomicMolecule::atomY( const int index ) const
+{
+ if ( index >= 0 and index < myAtoms.count() )
+ return myAtoms[ index ].y();
+ return 0;
+}
+
+/*! Gets an atom z coordinate by index */
+double ATOMICGUI_AtomicMolecule::atomZ( const int index ) const
+{
+ if ( index >= 0 and index < myAtoms.count() )
+ return myAtoms[ index ].z();
+ return 0;
+}
+
+/*! Sets a name to the molecule or atom */
+void ATOMICGUI_AtomicMolecule::setName( const QString& name, const int index )
+{
+ if ( index < 0 )
+ myName = name;
+ else if ( index >= 0 and index < myAtoms.count() )
+ myAtoms[ index ].myName = name;
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#if !defined(ATOMICGUI_DATA_H)
+#define ATOMICGUI_DATA_H
+
+#include <qlist.h>
+#include <qstring.h>
+
+/*!
+ * Class : ATOMICGUI_AtomicMolecule, ATOMICGUI_AtomicMolecule::Atom
+ * Description : Core classes for data of ATOMIC component
+ */
+class ATOMICGUI_AtomicMolecule
+{
+private:
+
+ class Atom
+ {
+ public:
+ Atom();
+ Atom( const QString& name, const double x, const double y, const double z );
+ QString name() const { return myName; }
+ double x() const { return myX; }
+ double y() const { return myY; }
+ double z() const { return myZ; }
+
+ int id () const { return myId; }
+
+ private:
+ QString myName;
+ double myX;
+ double myY;
+ double myZ;
+ int myId;
+ static int myMaxId;
+
+ friend class ATOMICGUI_AtomicMolecule;
+ };
+
+public:
+ ATOMICGUI_AtomicMolecule( const QString& name = QString::null );
+ virtual ~ATOMICGUI_AtomicMolecule();
+
+ void addAtom( const QString& atom, const double x, const double y, const double z );
+ void deleteAtom( const int index );
+
+ int id () const { return myId; }
+ QString name () const { return myName; }
+ int count () const { return myAtoms.count(); }
+
+ int atomId ( const int index ) const;
+ QString atomName ( const int index ) const;
+ double atomX ( const int index ) const;
+ double atomY ( const int index ) const;
+ double atomZ ( const int index ) const;
+
+ void setName( const QString& name, const int index = -1 );
+
+private:
+ QString myName;
+ QList<Atom> myAtoms;
+ int myId;
+ static int myMaxId;
+};
+
+#endif // ATOMICGUI_DATA_H
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#include "ATOMICGUI_DataModel.h"
+#include "ATOMICGUI_DataObject.h"
+
+#include <LightApp_Study.h>
+#include <SUIT_Tools.h>
+#include <SUIT_DataObjectIterator.h>
+#include <CAM_Module.h>
+#include <CAM_Application.h>
+
+#include <CAM_Module.h>
+#include <CAM_Application.h>
+
+#include <qstring.h>
+#include <qfile.h>
+#ifndef QT_NO_DOM
+#include <qdom.h>
+#endif
+
+#include <vector>
+#include <string>
+
+const QString doc_name = "Atomic";
+const QString doc_tag = "document";
+const QString molecule_tag = "molecule";
+const QString atom_tag = "atom";
+const QString name_attr = "name";
+const QString x_attr = "x";
+const QString y_attr = "y";
+const QString z_attr = "z";
+
+/*! Constructor */
+ATOMICGUI_DataModel::ATOMICGUI_DataModel( CAM_Module* module )
+ : LightApp_DataModel( module ),
+ myStudyURL( "" )
+{
+}
+
+/*! Destructor */
+ATOMICGUI_DataModel::~ATOMICGUI_DataModel()
+{
+}
+
+/*! Open Data Model. Build data structure from the given list of files. */
+bool ATOMICGUI_DataModel::open( const QString& URL, CAM_Study* study, QStringList listOfFiles )
+{
+ LightApp_Study* aDoc = dynamic_cast<LightApp_Study*>( study );
+ if ( !aDoc )
+ return false;
+
+ LightApp_DataModel::open( URL, aDoc, listOfFiles );
+
+ // The first list item contains path to a temporary
+ // directory, where the persistent files was placed
+ if ( listOfFiles.count() > 0 ) {
+ QString aTmpDir ( listOfFiles[0] );
+
+ // This module operates with a single persistent file
+ if ( listOfFiles.size() == 2 ) {
+ myStudyURL = URL;
+ QString aFullPath = SUIT_Tools::addSlash( aTmpDir ) + listOfFiles[1];
+ return importFile( aFullPath, aDoc );
+ }
+ }
+
+ return false;
+}
+
+/*! Save Data Model. Export data structure to temprorary files and return the list of files. */
+bool ATOMICGUI_DataModel::save( QStringList& listOfFiles )
+{
+ bool isMultiFile = false; // TODO: decide, how to access this parameter
+
+ LightApp_DataModel::save( listOfFiles );
+
+ LightApp_Study* study = dynamic_cast<LightApp_Study*>( module()->application()->activeStudy() );
+
+ QString aTmpDir(study->GetTmpDir( myStudyURL.toLatin1(), isMultiFile ).c_str());
+
+ QString aFileName = SUIT_Tools::file( myStudyURL, false ) + "_ATOMICGUI.xml";
+ QString aFullPath = aTmpDir + aFileName;
+ bool ok = exportFile( aFullPath );
+
+ listOfFiles.append( aTmpDir );
+ listOfFiles.append( aFileName );
+
+ printf( " \n saved to %s\n ", aFullPath.toLatin1().data() );
+
+ return ok;
+}
+
+/*! Save Data Model under given name. Export data structure to temprorary files and return the list of files. */
+bool ATOMICGUI_DataModel::saveAs ( const QString& URL, CAM_Study* study, QStringList& listOfFiles )
+{
+ myStudyURL = URL;
+ return save( listOfFiles );
+}
+
+/*! Called on Study closure */
+bool ATOMICGUI_DataModel::close()
+{
+ myStudyURL = "";
+ myMolecules.clear();
+ return LightApp_DataModel::close();
+}
+
+/*! Called on Study creation */
+bool ATOMICGUI_DataModel::create( CAM_Study* study )
+{
+ return true;
+}
+
+/*! Default implementation, always returns false so as not to mask study's isModified() */
+bool ATOMICGUI_DataModel::isModified() const
+{
+ return false;
+}
+
+/*! Default implementation, always returns true so as not to mask study's isSaved() */
+bool ATOMICGUI_DataModel::isSaved() const
+{
+ return true;
+}
+
+/*! Called on update of the structure of Data Objects */
+void ATOMICGUI_DataModel::build()
+{
+ ATOMICGUI_ModuleObject* modelRoot = dynamic_cast<ATOMICGUI_ModuleObject*>( root() );
+ if( !modelRoot ) { // root is not set yet
+ modelRoot = new ATOMICGUI_ModuleObject( this, 0 );
+ setRoot( modelRoot );
+ }
+
+ // create 'molecule' objects under model root object and 'atom' objects under 'molecule'-s
+ for ( int i = 0; i < myMolecules.count(); i++ ) {
+ ATOMICGUI_DataObject* molObj = new ATOMICGUI_DataObject ( modelRoot, &myMolecules[i] );
+ for ( int j = 0; j < myMolecules[ i ].count(); j++ ) {
+ /*ATOMICGUI_DataObject* atomObj = */new ATOMICGUI_DataObject ( molObj, &myMolecules[i], j );
+ }
+ }
+
+ root()->dump();
+}
+
+/*! Loads data from the XML file. */
+bool ATOMICGUI_DataModel::importFile( const QString& fileName, CAM_Study* study )
+{
+ bool res = false;
+
+#ifndef QT_NO_DOM
+
+ QFile file( fileName );
+ if ( !file.open( QIODevice::ReadOnly ) )
+ return false;
+
+ QDomDocument doc;
+
+ res = doc.setContent( &file );
+ file.close();
+
+ if ( !res )
+ return false;
+
+ QDomElement root = doc.documentElement();
+ if ( root.isNull() || root.tagName() != doc_tag )
+ return false;
+
+ QDomNode molNode = root.firstChild();
+ while ( res && !molNode.isNull() ) {
+ res = molNode.isElement();
+ if ( res ) {
+ QDomElement molElem = molNode.toElement();
+ if ( molElem.tagName() == molecule_tag && molElem.hasAttribute( name_attr ) ) {
+ ATOMICGUI_AtomicMolecule aMol( molElem.attribute( name_attr ) );
+ QDomNode atomNode = molNode.firstChild();
+ while ( res && !atomNode.isNull() ) {
+ res = atomNode.isElement();
+ if ( res ) {
+ QDomElement atomElem = atomNode.toElement();
+ if ( atomElem.tagName() == atom_tag &&
+ atomElem.hasAttribute( name_attr ) &&
+ atomElem.hasAttribute( x_attr ) &&
+ atomElem.hasAttribute( y_attr ) &&
+ atomElem.hasAttribute( z_attr ) ) {
+ aMol.addAtom( atomElem.attribute( name_attr ),
+ atomElem.attribute( x_attr ).toDouble(),
+ atomElem.attribute( y_attr ).toDouble(),
+ atomElem.attribute( z_attr ).toDouble() );
+ }
+ else
+ res = false;
+ }
+ else
+ res = atomNode.isComment();
+
+ atomNode = atomNode.nextSibling();
+ }
+ myMolecules.append( aMol );
+ }
+ else
+ res = false;
+ }
+ else
+ res = molNode.isComment();
+
+ molNode = molNode.nextSibling();
+ }
+
+#endif
+
+ return res;
+}
+
+/*! Saves data to the XML file */
+bool ATOMICGUI_DataModel::exportFile( const QString& fileName )
+{
+ bool res = false;
+
+#ifndef QT_NO_DOM
+
+ QFile file( fileName );
+ if ( !file.open( QIODevice::WriteOnly ) )
+ return false;
+
+ QDomDocument doc( doc_name );
+ QDomElement root = doc.createElement( doc_tag );
+ doc.appendChild( root );
+
+ for ( int i = 0; i < myMolecules.count(); i++ ) {
+ QDomElement molecule = doc.createElement( molecule_tag );
+ molecule.setAttribute( name_attr, myMolecules[ i ].name() );
+ root.appendChild( molecule );
+ for ( int j = 0; j < myMolecules[ i ].count(); j++ ) {
+ QDomElement atom = doc.createElement( atom_tag );
+ atom.setAttribute( name_attr, myMolecules[ i ].atomName( j ) );
+ atom.setAttribute( x_attr, myMolecules[ i ].atomX( j ) );
+ atom.setAttribute( y_attr, myMolecules[ i ].atomY( j ) );
+ atom.setAttribute( z_attr, myMolecules[ i ].atomZ( j ) );
+ molecule.appendChild( atom );
+ }
+ }
+
+ QString docStr = doc.toString();
+ res = file.write( docStr.toLatin1(), docStr.length() ) == (int)docStr.length();
+ file.close();
+
+#endif
+
+ return res;
+}
+
+/*! Adds a new molecule to the data structure */
+bool ATOMICGUI_DataModel::createMolecule ()
+{
+ ATOMICGUI_AtomicMolecule mol;
+
+ // temporary code to add a few atoms to a molecule..
+ mol.addAtom( "atom_1", 0, 0, 0 );
+ mol.addAtom( "atom_2", 0, 0, 0 );
+ mol.addAtom( "atom_3", 0, 0, 0 );
+ // end of temporary code
+
+ myMolecules.append( mol );
+
+ update();
+
+ return true;
+}
+
+/*! Adds a new atom to the given molecule */
+bool ATOMICGUI_DataModel::addAtom( const QString& entry, const QString& atom,
+ const double x, const double y, const double z )
+{
+ ATOMICGUI_DataObject* obj = findMolecule( entry );
+ if ( obj && obj->isMolecule() ) {
+ obj->molecule()->addAtom( atom, x, y, z );
+ }
+ return true;
+}
+
+/*! Rename the given (by entry) object */
+bool ATOMICGUI_DataModel::renameObj( const QString& entry, const QString& name )
+{
+ ATOMICGUI_DataObject* obj = findObject( entry );
+ if ( obj ) {
+ if ( obj->isMolecule() || obj->isAtom() ) {
+ obj->molecule()->setName( name, obj->atomIndex() );
+ return true;
+ }
+ }
+ return false;
+}
+
+/*! Delete the given objects (list of entries) */
+bool ATOMICGUI_DataModel::deleteObjs( const QStringList& entries )
+{
+ QMap<QString, ATOMICGUI_DataObject*> cmap;
+ // first find all molecules
+ for ( int i = 0; i < entries.count(); i++ ) {
+ ATOMICGUI_DataObject* o = findObject( entries[i] );
+ if ( o && o->isMolecule() )
+ cmap[ entries[i] ] = o;
+ }
+ // then find all atoms
+ typedef QList<int> IntList;
+ QMap<ATOMICGUI_DataObject*, IntList> amap;
+ for ( int i = 0; i < entries.count(); i++ ) {
+ ATOMICGUI_DataObject* o = findObject( entries[i] );
+ if ( o && o->isAtom() ) {
+ ATOMICGUI_DataObject* c = dynamic_cast<ATOMICGUI_DataObject*>( o->parent() );
+ if ( !c || cmap.find( c->entry() ) == cmap.end() )
+ amap[ c ].append( o->atomIndex() );
+ }
+ }
+ // now perform deleting
+ int removed = 0;
+ QMap<QString, ATOMICGUI_DataObject*>::Iterator it;
+ for ( it = cmap.begin(); it != cmap.end(); ++it ) {
+ for ( int i = 0; i < myMolecules.count(); i++ ) {
+ if ( &myMolecules[ i ] == it.value()->molecule() ) {
+ myMolecules.removeAt( i );
+ removed++;
+ break;
+ }
+ }
+ }
+ QMap<ATOMICGUI_DataObject*, IntList>::Iterator it1;
+ for ( it1 = amap.begin(); it1 != amap.end(); ++it1 ) {
+ IntList indices = it1.value();
+ qSort( indices );
+ for ( int i = indices.count() - 1; i >= 0; i-- ) {
+ it1.key()->molecule()->deleteAtom( indices[i] );
+ removed++;
+ }
+ }
+ return removed;
+}
+
+/*! Returns the Data Object by entry */
+ATOMICGUI_DataObject* ATOMICGUI_DataModel::findObject( const QString& entry )
+{
+ for ( SUIT_DataObjectIterator it( root(), SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it ) {
+ ATOMICGUI_DataObject* obj = dynamic_cast<ATOMICGUI_DataObject*>( it.current() );
+ if ( obj && obj->entry() == entry )
+ return obj;
+ }
+ return 0;
+}
+
+/*! Returns the Data Object by entry. If object is an Atom, its parent Molecule is returned. */
+ATOMICGUI_DataObject* ATOMICGUI_DataModel::findMolecule( const QString& entry )
+{
+ for ( SUIT_DataObjectIterator it( root(), SUIT_DataObjectIterator::DepthLeft ); it.current(); ++it ) {
+ ATOMICGUI_DataObject* obj = dynamic_cast<ATOMICGUI_DataObject*>( it.current() );
+ if ( obj && obj->entry() == entry ) {
+ if ( obj->isMolecule() )
+ return obj;
+ else if ( obj->isAtom() )
+ return dynamic_cast<ATOMICGUI_DataObject*>( obj->parent() );
+ else
+ return 0;
+ }
+ }
+ return 0;
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#if !defined(ATOMICGUI_DATAMODEL_H)
+#define ATOMICGUI_DATAMODEL_H
+
+#include "ATOMICGUI_Data.h"
+#include <LightApp_DataModel.h>
+#include <qlist.h>
+
+class CAM_Module;
+class LightApp_Study;
+class LightApp_DataObject;
+class ATOMICGUI_DataObject;
+
+/*!
+ * Class : ATOMICGUI_DataModel
+ * Description : Data Model of ATOMIC component
+ */
+class ATOMICGUI_DataModel : public LightApp_DataModel
+{
+ Q_OBJECT
+
+public:
+ ATOMICGUI_DataModel ( CAM_Module* );
+ virtual ~ATOMICGUI_DataModel();
+
+ virtual bool open ( const QString&, CAM_Study*, QStringList );
+ virtual bool save ( QStringList& );
+ virtual bool saveAs ( const QString&, CAM_Study*, QStringList& );
+ virtual bool close ();
+ virtual bool create ( CAM_Study* );
+
+ virtual bool isModified () const;
+ virtual bool isSaved () const;
+
+ bool importFile ( const QString&, CAM_Study* = 0 );
+ bool exportFile ( const QString& = QString::null );
+ bool createMolecule ();
+ bool addAtom ( const QString&, const QString&,
+ const double, const double, const double );
+ bool renameObj ( const QString&, const QString& );
+ bool deleteObjs ( const QStringList& );
+
+ ATOMICGUI_DataObject* findObject ( const QString& );
+ ATOMICGUI_DataObject* findMolecule ( const QString& );
+
+protected:
+ virtual void build();
+
+private:
+ QString myStudyURL;
+ QList<ATOMICGUI_AtomicMolecule> myMolecules;
+};
+
+#endif // ATOMICGUI_DATAMODEL_H
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#include "ATOMICGUI_DataObject.h"
+#include "ATOMICGUI_Data.h"
+
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <CAM_DataModel.h>
+#include <CAM_Module.h>
+
+/*! Constructor */
+ATOMICGUI_DataObject::ATOMICGUI_DataObject( SUIT_DataObject* parent,
+ ATOMICGUI_AtomicMolecule* mol,
+ int idx )
+ : LightApp_DataObject( parent ),
+ CAM_DataObject( parent),
+ myMolecule( mol ),
+ myIndex( idx )
+{
+}
+
+/*! Destructor */
+ATOMICGUI_DataObject::~ATOMICGUI_DataObject()
+{
+}
+
+/*! Returns unique object ID */
+QString ATOMICGUI_DataObject::entry() const
+{
+ QString id = "root";
+ if ( myMolecule )
+ id = QString::number( myMolecule->id() );
+ if ( myIndex >= 0 )
+ id += QString( "_%1" ).arg( QString::number( myMolecule->atomId( myIndex ) ) );
+ return QString( "ATOMICGUI_%1" ).arg( id );
+}
+
+/*! Returns a name of the Data Object. */
+QString ATOMICGUI_DataObject::name() const
+{
+ QString n;
+ if ( myMolecule )
+ n = myIndex < 0 ? myMolecule->name()
+ : myMolecule->atomName( myIndex );
+ return n;
+}
+
+/*! Returns an icon of the Data Object. */
+QPixmap ATOMICGUI_DataObject::icon(const int column) const
+{
+ static QPixmap pxmole = SUIT_Session::session()->resourceMgr()->loadPixmap( "ATOMIC", QObject::tr( "ICON_MOLECULE" ), false );
+ static QPixmap pxatom = SUIT_Session::session()->resourceMgr()->loadPixmap( "ATOMIC", QObject::tr( "ICON_ATOM" ), false );
+ static QPixmap nullpx;
+ return column == NameId ? ( myIndex < 0 ? pxmole : pxatom ) : nullpx;
+}
+
+/*! Returns a tooltip for the object (to be displayed in the Object Browser). */
+QString ATOMICGUI_DataObject::toolTip(const int) const
+{
+ QString tt;
+ if ( myMolecule )
+ tt = myIndex < 0 ? QString( QObject::tr( "ATOMIC_MOLECULE" ) + ": %1" ).arg( myMolecule->name() )
+ : QString( QObject::tr( "ATOMIC_ATOM" ) + ": %1: %2,%3,%4" ).
+ arg( myMolecule->atomName( myIndex ) ).
+ arg( myMolecule->atomX( myIndex ) ).
+ arg( myMolecule->atomY( myIndex ) ).
+ arg( myMolecule->atomZ( myIndex ) );
+ return tt;
+}
+
+/*! Returns true if the Data Object corresponds to a Molecule. */
+bool ATOMICGUI_DataObject::isMolecule() const
+{
+ return myMolecule && myIndex < 0;
+}
+
+/*! Returns true if the Data Object corresponds to an Atom. */
+bool ATOMICGUI_DataObject::isAtom() const
+{
+ return myMolecule && myIndex >= 0;
+}
+
+/*! Constructor */
+ATOMICGUI_ModuleObject::ATOMICGUI_ModuleObject( CAM_DataModel* dm, SUIT_DataObject* parent )
+: ATOMICGUI_DataObject( parent ),
+ LightApp_ModuleObject( dm, parent ),
+ CAM_DataObject( parent )
+{
+}
+
+/*! Returns a name of the root object. */
+QString ATOMICGUI_ModuleObject::name() const
+{
+ return CAM_ModuleObject::name();
+}
+
+/*! Returns an icon of the root object. */
+QPixmap ATOMICGUI_ModuleObject::icon(const int column) const
+{
+ QPixmap px;
+ if ( column == NameId && dataModel() ) {
+ QString anIconName = dataModel()->module()->iconName();
+ if ( !anIconName.isEmpty() )
+ px = SUIT_Session::session()->resourceMgr()->loadPixmap( "ATOMIC", anIconName, false );
+ }
+ return px;
+}
+
+/*! Returns a tooltip of the root object. */
+QString ATOMICGUI_ModuleObject::toolTip(const int) const
+{
+ return QObject::tr( "ATOMIC_ROOT_TOOLTIP" );
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#if !defined(ATOMICGUI_DATAOBJECT_H)
+#define ATOMICGUI_DATAOBJECT_H
+
+#include <LightApp_DataObject.h>
+
+#include <qstring.h>
+
+class ATOMICGUI_AtomicMolecule;
+
+/*!
+ * Class : ATOMICGUI_DataObject
+ * Description : Data Object for data of ATOMIC component
+ * Using the same Data Object for Atoms and Molecules
+ * If it is an Atom then myIndex field is >= 0
+ * For Molecule myIndex equals to -1.
+ */
+class ATOMICGUI_DataObject : public virtual LightApp_DataObject
+{
+public:
+ ATOMICGUI_DataObject ( SUIT_DataObject*, ATOMICGUI_AtomicMolecule* = 0, int = -1 );
+ virtual ~ATOMICGUI_DataObject();
+
+ virtual QString entry() const;
+
+ QString name() const;
+ QPixmap icon(const int = NameId) const;
+ QString toolTip(const int = NameId) const;
+
+ ATOMICGUI_AtomicMolecule* molecule() const { return myMolecule; }
+ int atomIndex() const { return myIndex; }
+
+ bool isMolecule() const;
+ bool isAtom() const;
+
+private:
+ ATOMICGUI_AtomicMolecule* myMolecule;
+ int myIndex;
+};
+
+class ATOMICGUI_ModuleObject : public ATOMICGUI_DataObject,
+ public LightApp_ModuleObject
+{
+public:
+ ATOMICGUI_ModuleObject ( CAM_DataModel*, SUIT_DataObject* = 0 );
+
+ virtual QString name() const;
+ QPixmap icon(const int = NameId) const;
+ QString toolTip(const int = NameId) const;
+};
+
+#endif // ATOMICGUI_DATAOBJECT_H
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#include <ATOMICGUI_DeleteOp.h>
+#include <ATOMICGUI_DataModel.h>
+#include <ATOMICGUI.h>
+
+/*! Constructor */
+ATOMICGUI_DeleteOp::ATOMICGUI_DeleteOp()
+: ATOMICGUI_Operation()
+{
+}
+
+/*! Destructor */
+ATOMICGUI_DeleteOp::~ATOMICGUI_DeleteOp()
+{
+}
+
+/*! Operation itself. Removes the selected objects. */
+void ATOMICGUI_DeleteOp::startOperation()
+{
+ if( !dataModel() )
+ {
+ abort();
+ return;
+ }
+
+ QStringList entries;
+ atomModule()->selected( entries, true );
+ if( dataModel()->deleteObjs( entries ) )
+ commit();
+ else
+ abort();
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#ifndef ATOMICGUI_DELETEOP_OP_H
+#define ATOMICGUI_DELETEOP_OP_H
+
+#include <ATOMICGUI_Operation.h>
+
+/*!
+ * Class : ATOMICGUI_DeleteOp
+ * Description : Operation for objects removal in ATOMIC component
+ */
+class ATOMICGUI_DeleteOp : public ATOMICGUI_Operation
+{
+ Q_OBJECT
+
+public:
+ ATOMICGUI_DeleteOp();
+ virtual ~ATOMICGUI_DeleteOp();
+
+protected:
+ virtual void startOperation();
+};
+
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#include <ATOMICGUI_ImportExportOp.h>
+#include <ATOMICGUI_DataModel.h>
+
+#include <LightApp_Module.h>
+#include <LightApp_Application.h>
+
+#include <SUIT_MessageBox.h>
+#include <SUIT_Desktop.h>
+
+/*! Constructor */
+ATOMICGUI_ImportExportOp::ATOMICGUI_ImportExportOp( const bool import )
+: ATOMICGUI_Operation(),
+ myIsImport( import )
+{
+}
+
+/*! Destructor */
+ATOMICGUI_ImportExportOp::~ATOMICGUI_ImportExportOp()
+{
+}
+
+/*! Operation itself. Imports or exports the data structure
+ * calling the corresponing methods of Data Model. */
+void ATOMICGUI_ImportExportOp::startOperation()
+{
+ ATOMICGUI_DataModel* dm = dataModel();
+ if ( !dm )
+ {
+ abort();
+ return;
+ }
+
+ QStringList filtersList;
+ filtersList.append( tr( "XML_FILES" ) );
+
+ // Select a file to be imported
+ QString aFileName = module()->getApp()->getFileName( myIsImport, QString::null,
+ filtersList.join( ";;" ),
+ tr( myIsImport ? "ATOMICGUI_IMPORT_XML" : "ATOMICGUI_EXPORT_XML" ), 0 );
+
+ if( !aFileName.isEmpty() )
+ {
+ if( ( myIsImport && dm->importFile( aFileName ) ) ||
+ ( !myIsImport && dm->exportFile( aFileName ) ) )
+ {
+ commit();
+ return;
+ }
+ else
+ SUIT_MessageBox::warning( application()->desktop(),
+ tr( "WRN_WARNING" ),
+ tr( myIsImport ? "WRN_IMPORT_FAILED" : "WRN_EXPORT_FAILED" ),
+ tr( "BUT_OK" ) );
+ }
+ abort();
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#ifndef ATOMICGUI_IMPORTEXPORT_OP_H
+#define ATOMICGUI_IMPORTEXPORT_OP_H
+
+#include <ATOMICGUI_Operation.h>
+
+/*!
+ * Class : ATOMICGUI_ImportExportOp
+ * Description : Operation for Import and Export of data structure to/from
+ * an external file in XML format in ATOMIC component
+ */
+class ATOMICGUI_ImportExportOp : public ATOMICGUI_Operation
+{
+ Q_OBJECT
+
+public:
+ ATOMICGUI_ImportExportOp( const bool isImport );
+ virtual ~ATOMICGUI_ImportExportOp();
+
+protected:
+ virtual void startOperation();
+
+private:
+ bool myIsImport;
+};
+
+
+#endif
+
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#include <ATOMICGUI_Operation.h>
+#include <ATOMICGUI_DataModel.h>
+#include <ATOMICGUI.h>
+
+#include <LightApp_Application.h>
+#include <LightApp_Dialog.h>
+
+/*! Constructor */
+ATOMICGUI_Operation::ATOMICGUI_Operation()
+: LightApp_Operation()
+{
+}
+
+/*! Destructor */
+ATOMICGUI_Operation::~ATOMICGUI_Operation()
+{
+}
+
+/*! Called when Operation is started. */
+void ATOMICGUI_Operation::startOperation()
+{
+ if( dlg() )
+ {
+ disconnect( dlg(), SIGNAL( dlgOk() ), this, SLOT( onOk() ) );
+ disconnect( dlg(), SIGNAL( dlgApply() ), this, SLOT( onApply() ) );
+ disconnect( dlg(), SIGNAL( dlgClose() ), this, SLOT( onClose() ) );
+
+ connect( dlg(), SIGNAL( dlgOk() ), this, SLOT( onOk() ) );
+ connect( dlg(), SIGNAL( dlgApply() ), this, SLOT( onApply() ) );
+ connect( dlg(), SIGNAL( dlgClose() ), this, SLOT( onClose() ) );
+
+ dlg()->show();
+ }
+}
+
+/*! Called when Operation is aborted. */
+void ATOMICGUI_Operation::abortOperation()
+{
+ finish();
+}
+
+/*! Called when Operation is committed (normally ended). */
+void ATOMICGUI_Operation::commitOperation()
+{
+ finish();
+}
+
+/*! Called when Operation is done. Finalization steps. */
+void ATOMICGUI_Operation::finish()
+{
+ if( dlg() )
+ dlg()->hide();
+
+ module()->getApp()->updateObjectBrowser();
+}
+
+/*! Returns a Data Model. */
+ATOMICGUI_DataModel* ATOMICGUI_Operation::dataModel() const
+{
+ return dynamic_cast<ATOMICGUI_DataModel*>( module()->dataModel() );
+}
+
+/*! Returns ATOMICGUI class instance. */
+ATOMICGUI* ATOMICGUI_Operation::atomModule() const
+{
+ return dynamic_cast<ATOMICGUI*>( module() );
+}
+
+/*! slot. Called when user presses OK button of the dialog (if it was set). */
+void ATOMICGUI_Operation::onOk()
+{
+ onApply();
+ commit();
+}
+
+/*! slot. Called when user presses Apply button of the dialog (if it was set). */
+void ATOMICGUI_Operation::onApply()
+{
+}
+
+/*! slot. Called when user presses Close button of the dialog (if it was set). */
+void ATOMICGUI_Operation::onClose()
+{
+ commit();
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#ifndef ATOMICGUI_OPERATION_H
+#define ATOMICGUI_OPERATION_H
+
+#include <LightApp_Operation.h>
+
+class ATOMICGUI_DataModel;
+class ATOMICGUI;
+
+/*!
+ * Class : ATOMICGUI_AddAtomDlg
+ * Description : Base Operation class for ATOMIC component
+ */
+class ATOMICGUI_Operation : public LightApp_Operation
+{
+ Q_OBJECT
+
+public:
+ ATOMICGUI_Operation();
+ virtual ~ATOMICGUI_Operation();
+
+protected:
+ virtual void startOperation();
+ virtual void abortOperation();
+ virtual void commitOperation();
+ virtual void finish();
+
+ ATOMICGUI_DataModel* dataModel() const;
+ ATOMICGUI* atomModule() const;
+
+protected slots:
+ virtual void onOk();
+ virtual void onApply();
+ virtual void onClose();
+};
+
+
+#endif
+
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#include <ATOMICGUI_RenameOp.h>
+#include <ATOMICGUI_DataModel.h>
+#include <ATOMICGUI_DataObject.h>
+#include <ATOMICGUI.h>
+
+#include <LightApp_Application.h>
+#include <SUIT_Desktop.h>
+
+#include <qinputdialog.h>
+
+/*! Constructor */
+ATOMICGUI_RenameOp::ATOMICGUI_RenameOp()
+: ATOMICGUI_Operation()
+{
+}
+
+/*! Destructor */
+ATOMICGUI_RenameOp::~ATOMICGUI_RenameOp()
+{
+}
+
+/*! Operation itself. Renames the selected object. */
+void ATOMICGUI_RenameOp::startOperation()
+{
+ ATOMICGUI_DataModel* dm = dataModel();
+ QStringList entries;
+ atomModule()->selected( entries, false );
+
+ if( entries.isEmpty() || !dm )
+ {
+ abort();
+ return;
+ }
+
+ ATOMICGUI_DataObject* obj = dm->findObject( entries.first() );
+ if ( obj && ( obj->isMolecule() || obj->isAtom() ) )
+ {
+ bool bOk;
+ QString name = QInputDialog::getText( module()->getApp()->desktop(),
+ tr( "ATOMICGUI_RENAME_OBJECT" ),
+ tr( "ATOMICGUI_NEW_NAME"),
+ QLineEdit::Normal,
+ obj->name(),
+ &bOk);
+ if( bOk && !name.toLatin1().trimmed().isEmpty() && dm->renameObj( entries.first(), name ) )
+ commit();
+ else
+ abort();
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#ifndef ATOMICGUI_RENAME_OP_H
+#define ATOMICGUI_RENAME_OP_H
+
+#include <ATOMICGUI_Operation.h>
+
+/*!
+ * Class : ATOMICGUI_DeleteOp
+ * Description : Operation for objects rename in ATOMIC component
+ */
+class ATOMICGUI_RenameOp : public ATOMICGUI_Operation
+{
+ Q_OBJECT
+
+public:
+ ATOMICGUI_RenameOp();
+ virtual ~ATOMICGUI_RenameOp();
+
+protected:
+ virtual void startOperation();
+};
+
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#include "ATOMICGUI_Selection.h"
+#include "LightApp_DataOwner.h"
+
+#include <LightApp_SelectionMgr.h>
+#include <qstringlist.h>
+
+/*! Constructor */
+ATOMICGUI_Selection::ATOMICGUI_Selection ()
+: LightApp_Selection()
+{
+}
+
+/*! Destructor */
+ATOMICGUI_Selection::~ATOMICGUI_Selection()
+{
+}
+
+/*! Initialization of Selection */
+void ATOMICGUI_Selection::init( const QString& client, LightApp_SelectionMgr* mgr )
+{
+ if ( mgr ) {
+ SUIT_DataOwnerPtrList sel;
+ mgr->selected( sel);
+ SUIT_DataOwnerPtrList::const_iterator anIt = sel.begin(),
+ aLast = sel.end();
+ for ( ; anIt != aLast; anIt++ ) {
+ QString type = "Unknown";
+ SUIT_DataOwner* owner = (SUIT_DataOwner*)( (*anIt).get() );
+ LightApp_DataOwner* sowner = dynamic_cast<LightApp_DataOwner*>( owner );
+ QStringList es = sowner->entry().split( "_" );
+ if ( es.count() > 0 && es[ 0 ] == "ATOMICGUI" ) {
+ if ( es.count() > 1 ) {
+ if( es[ 1 ] == "root" )
+ type = "Root";
+ else
+ type = "Molecule";
+ if ( es.count() > 2 )
+ type = "Atom";
+ }
+ }
+ myTypes.append( type );
+ }
+ }
+ LightApp_Selection::init( client, mgr );
+}
+
+/*! Returns number of objects of supported types. */
+int ATOMICGUI_Selection::count() const
+{
+ return myTypes.count();
+}
+
+/*! Returns selection parameter value. */
+QVariant ATOMICGUI_Selection::parameter( const int ind, const QString& p ) const
+{
+ if ( p == "type" )
+ return myTypes[ ind ];
+ return LightApp_Selection::parameter( ind, p );
+}
--- /dev/null
+// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+#if !defined(ATOMICGUI_SELECTION_H)
+#define ATOMICGUI_SELECTION_H
+
+#include <QtxPopupMgr.h>
+#include <LightApp_Selection.h>
+
+class LightApp_SelectionMgr;
+
+/*!
+ * Class : ATOMICGUI_Selection
+ * Description : Selection class for ATOMIC component.
+ * Computation of object parameters for popup manager.
+ */
+class ATOMICGUI_Selection : public LightApp_Selection
+{
+public:
+ ATOMICGUI_Selection ();
+ virtual ~ATOMICGUI_Selection ();
+
+ virtual void init( const QString&, LightApp_SelectionMgr* );
+ virtual int count () const;
+ virtual QVariant parameter ( const int, const QString& ) const;
+
+private:
+ QStringList myTypes;
+};
+
+#endif // ATOMICGUI_SELECTION_H
--- /dev/null
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+# Library target
+lib_LTLIBRARIES = libATOMIC.la
+
+# Library sources
+dist_libATOMIC_la_SOURCES = \
+ ATOMICGUI.h \
+ ATOMICGUI.cxx \
+ ATOMICGUI_Data.h \
+ ATOMICGUI_Data.cxx \
+ ATOMICGUI_DataObject.h \
+ ATOMICGUI_DataObject.cxx \
+ ATOMICGUI_DataModel.h \
+ ATOMICGUI_DataModel.cxx \
+ ATOMICGUI_AddAtomDlg.h \
+ ATOMICGUI_AddAtomDlg.cxx \
+ ATOMICGUI_Selection.h \
+ ATOMICGUI_Selection.cxx \
+ ATOMICGUI_Operation.h \
+ ATOMICGUI_Operation.cxx \
+ ATOMICGUI_AddAtomOp.h \
+ ATOMICGUI_AddAtomOp.cxx \
+ ATOMICGUI_CreateMolOp.h \
+ ATOMICGUI_CreateMolOp.cxx \
+ ATOMICGUI_RenameOp.h \
+ ATOMICGUI_RenameOp.cxx \
+ ATOMICGUI_DeleteOp.h \
+ ATOMICGUI_DeleteOp.cxx \
+ ATOMICGUI_ImportExportOp.h \
+ ATOMICGUI_ImportExportOp.cxx
+
+# MOC pre-processing
+MOC_FILES = \
+ ATOMICGUI_moc.cxx \
+ ATOMICGUI_DataModel_moc.cxx \
+ ATOMICGUI_AddAtomDlg_moc.cxx \
+ ATOMICGUI_Operation_moc.cxx \
+ ATOMICGUI_CreateMolOp_moc.cxx \
+ ATOMICGUI_DeleteOp_moc.cxx \
+ ATOMICGUI_RenameOp_moc.cxx \
+ ATOMICGUI_ImportExportOp_moc.cxx \
+ ATOMICGUI_AddAtomOp_moc.cxx
+
+nodist_libATOMIC_la_SOURCES = $(MOC_FILES)
+
+# additionnal compilation flags
+libATOMIC_la_CPPFLAGS = \
+ $(QT_INCLUDES) \
+ $(VTK_INCLUDES) \
+ $(CAS_CPPFLAGS) \
+ $(PYTHON_INCLUDES) \
+ $(GUI_CXXFLAGS)
+
+# additionnal linkage flags
+libATOMIC_la_LDFLAGS = \
+ $(GUI_LDFLAGS) \
+ -lLightApp
+
+# resources files
+nodist_salomeres_DATA = \
+ ATOMIC_images.qm \
+ ATOMIC_msg_en.qm
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="1.1">
+ <context>
+ <name>@default</name>
+ <message>
+ <source>ICON_ATOM</source>
+ <translation>atom.png</translation>
+ </message>
+ <message>
+ <source>ICON_ATOMIC</source>
+ <translation>ATOMIC.png</translation>
+ </message>
+ <message>
+ <source>ICON_MOLECULE</source>
+ <translation>atom_conf.png</translation>
+ </message>
+ </context>
+ <context>
+ <name>ATOMICGUI</name>
+ <message>
+ <source>ICON_REMOVE</source>
+ <translation>atom_remove.png</translation>
+ </message>
+ <message>
+ <source>ICON_RENAME</source>
+ <translation>atom_rename.png</translation>
+ </message>
+ </context>
+</TS>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="1.1">
+ <context>
+ <name>@default</name>
+ <message>
+ <source>ATOMICGUI_EXPORT_XML</source>
+ <translation>Export XML File</translation>
+ </message>
+ <message>
+ <source>ATOMICGUI_IMPORT_XML</source>
+ <translation>Import XML File</translation>
+ </message>
+ <message>
+ <source>ATOMICGUI_NEW_NAME</source>
+ <translation>New name:</translation>
+ </message>
+ <message>
+ <source>ATOMICGUI_NONAME</source>
+ <translation>Noname</translation>
+ </message>
+ <message>
+ <source>ATOMICGUI_RENAME_OBJECT</source>
+ <translation>Rename object</translation>
+ </message>
+ <message>
+ <source>ATOMIC_ATOM</source>
+ <translation>Atom</translation>
+ </message>
+ <message>
+ <source>ATOMIC_MOLECULE</source>
+ <translation>Molecule</translation>
+ </message>
+ <message>
+ <source>ATOMIC_ROOT_TOOLTIP</source>
+ <translation>Atomic module root object</translation>
+ </message>
+ <message>
+ <source>BUT_OK</source>
+ <translation>&OK</translation>
+ </message>
+ <message>
+ <source>MEN_FILE</source>
+ <translation>File</translation>
+ </message>
+ <message>
+ <source>WRN_EXPORT_FAILED</source>
+ <translation>Can't export XML file</translation>
+ </message>
+ <message>
+ <source>WRN_IMPORT_FAILED</source>
+ <translation>Can't import XML file</translation>
+ </message>
+ <message>
+ <source>WRN_WARNING</source>
+ <translation>Warning!</translation>
+ </message>
+ <message>
+ <source>XML_FILES</source>
+ <translation>XML Files ( *.xml )</translation>
+ </message>
+ </context>
+ <context>
+ <name>ATOMICGUI</name>
+ <message>
+ <source>MEN_ADD_ATOM</source>
+ <translation>Add atom</translation>
+ </message>
+ <message>
+ <source>MEN_ATOMIC</source>
+ <translation>Atomic</translation>
+ </message>
+ <message>
+ <source>MEN_CREATE_MOL</source>
+ <translation>Create molecule</translation>
+ </message>
+ <message>
+ <source>MEN_DELETE_OBJ</source>
+ <translation>Delete</translation>
+ </message>
+ <message>
+ <source>MEN_EDIT</source>
+ <translation>Edit</translation>
+ </message>
+ <message>
+ <source>MEN_EXPORT_XML</source>
+ <translation>Export...</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT_XML</source>
+ <translation>Import...</translation>
+ </message>
+ <message>
+ <source>MEN_RENAME</source>
+ <translation>Rename</translation>
+ </message>
+ <message>
+ <source>STB_ADD_ATOM</source>
+ <translation>Add an atom to the selected atomic configuration</translation>
+ </message>
+ <message>
+ <source>STB_CREATE_MOL</source>
+ <translation>Create new molecule</translation>
+ </message>
+ <message>
+ <source>STB_DELETE_OBJ</source>
+ <translation>Delete selected objects</translation>
+ </message>
+ <message>
+ <source>STB_EXPORT_XML</source>
+ <translation>Export atomic data to XML file</translation>
+ </message>
+ <message>
+ <source>STB_IMPORT_XML</source>
+ <translation>Import atomic data from XML file</translation>
+ </message>
+ <message>
+ <source>STB_RENAME</source>
+ <translation>Rename selected atom or atomic configuration</translation>
+ </message>
+ <message>
+ <source>TOP_ADD_ATOM</source>
+ <translation>Add atom</translation>
+ </message>
+ <message>
+ <source>TOP_CREATE_MOL</source>
+ <translation>Create molecule</translation>
+ </message>
+ <message>
+ <source>TOP_DELETE_OBJ</source>
+ <translation>Delete</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORT_XML</source>
+ <translation>Export to XML</translation>
+ </message>
+ <message>
+ <source>TOP_IMPORT_XML</source>
+ <translation>Import from XML</translation>
+ </message>
+ <message>
+ <source>TOP_RENAME</source>
+ <translation>Rename</translation>
+ </message>
+ </context>
+ <context>
+ <name>ATOMICGUI_AddAtomDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Add atom</translation>
+ </message>
+ </context>
+</TS>
--- /dev/null
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+SUBDIRS = ATOMICGUI