Commit 07e67499 authored by Mark Hymers's avatar Mark Hymers

Load ifrit-3.0.0/ into packages/ifrit/branches/upstream/trunk.

parent a5cb2415
====================
All files except those mentioned in this file have their own copyright
notices.
All *.ui files, ifrit.rc file, images/ifrit.ico file, and images/*.png
files are under GNU General Public License appearing in the file
LICENSE.GPL included in the packaging of this software.
====================
This diff is collapsed.
THE Q PUBLIC LICENSE
version 1.0
Copyright (C) 1999-2000 Trolltech AS, Norway.
Everyone is permitted to copy and
distribute this license document.
The intent of this license is to establish freedom to share and change the
software regulated by this license under the open source model.
This license applies to any software containing a notice placed by the
copyright holder saying that it may be distributed under the terms of
the Q Public License version 1.0. Such software is herein referred to as
the Software. This license covers modification and distribution of the
Software, use of third-party application programs based on the Software,
and development of free software which uses the Software.
Granted Rights
1. You are granted the non-exclusive rights set forth in this license
provided you agree to and comply with any and all conditions in this
license. Whole or partial distribution of the Software, or software
items that link with the Software, in any form signifies acceptance of
this license.
2. You may copy and distribute the Software in unmodified form provided
that the entire package, including - but not restricted to - copyright,
trademark notices and disclaimers, as released by the initial developer
of the Software, is distributed.
3. You may make modifications to the Software and distribute your
modifications, in a form that is separate from the Software, such as
patches. The following restrictions apply to modifications:
a. Modifications must not alter or remove any copyright notices in
the Software.
b. When modifications to the Software are released under this
license, a non-exclusive royalty-free right is granted to the
initial developer of the Software to distribute your modification
in future versions of the Software provided such versions remain
available under these terms in addition to any other license(s) of
the initial developer.
4. You may distribute machine-executable forms of the Software or
machine-executable forms of modified versions of the Software, provided
that you meet these restrictions:
a. You must include this license document in the distribution.
b. You must ensure that all recipients of the machine-executable forms
are also able to receive the complete machine-readable source code
to the distributed Software, including all modifications, without
any charge beyond the costs of data transfer, and place prominent
notices in the distribution explaining this.
c. You must ensure that all modifications included in the
machine-executable forms are available under the terms of this
license.
5. You may use the original or modified versions of the Software to
compile, link and run application programs legally developed by you
or by others.
6. You may develop application programs, reusable components and other
software items that link with the original or modified versions of the
Software. These items, when distributed, are subject to the following
requirements:
a. You must ensure that all recipients of machine-executable forms of
these items are also able to receive and use the complete
machine-readable source code to the items without any charge
beyond the costs of data transfer.
b. You must explicitly license all recipients of your items to use
and re-distribute original and modified versions of the items in
both machine-executable and source code forms. The recipients must
be able to do so without any charges whatsoever, and they must be
able to re-distribute to anyone they choose.
c. If the items are not available to the general public, and the
initial developer of the Software requests a copy of the items,
then you must supply one.
Limitations of Liability
In no event shall the initial developers or copyright holders be liable
for any damages whatsoever, including - but not restricted to - lost
revenue or profits or other direct, indirect, special, incidental or
consequential damages, even if they have been advised of the possibility
of such damages, except to the extent invariable law, if any, provides
otherwise.
No Warranty
The Software and this license document are provided AS IS with NO WARRANTY
OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE.
Choice of Law
This license is governed by the Laws of Norway. Disputes shall be settled
by Oslo City Court.
Install Other Packages
Before you can compile IFrIT, you need to install other packages that
IFrIT uses:
* Required: Kitware VTK (Visualization Toolkit for 3D
visualizations, public domain). IFrIT has been ported to VTK
version 4.4 to VTK 5.0. Version 5 is still somewhat buggy, but
it adds capabilities to create movies directly and to use 3D
textures for volume rendering. Do not download later versions
(so-called Nightly releases), they might not compile or function
properly.
Installation Notes:
o VTK must be compiled with Hybrid and Parallel classes (set
both to ON when configuring VTK with cmake).
o I suggest you compile VTK with shared libraries (that is
not the default option in VTK). Compiling with static libraries
may require editing Makefiles manually (but, hopefully, will
not).
o MacOS: users may try to include X11 classes in the VTK
installations (VTK option VTK_USE_X) if they have problems with
the VTK installation. If you compile VTK with shared libraries,
make sure to add the VTK library directoriy ($VTKDIR/bin) to the
environment variable DYLD_LIBRARY_PATH prior to installing
VTK. Otherwise, you will get errors of libraries not being
found.
o Cygwin: make sure to set VTK_USE_X during VTK
installation, otherwise cmake will create a Windows VTK version.
* Optional: Trolltech Qt (a multi-platform GUI library, open
source). IFrIT has been ported to Qt versions from 3.0.4 to
4.1.4 (I recommend using Qt 3, version 4 does not add any new
capabilities that I use, and is somewhat slower than version 3).
Mac users should get a free Mac version of Qt, do not use the
X11 version.
Important: Qt is needed for GUI support. Without Qt, only the
command-line version of IFrIT will be available.
Installation Notes:
o Qt must be compiled with thread support (use option
-thread when configuring Qt prior to compiling).
o MacOS: If you compile Qt with shared libraries (default
option), make sure to add the Qt library directory ($QTDIR/lib)
to the environment variable DYLD_LIBRARY_PATH prior to
installing Qt. Otherwise, you will get errors of libraries not
being found.
o Cygwin: Good luck with compiling Qt under cygwin - it is
possible, but requires editing source files (search for helpful
tricks on IFrIT website). Keep in mind that neither Trolltech
nor I support Qt under cygwin. After IFrIT is ported to Qt 4.0,
there will be a Windows native free version of IFrIT.
Compile IFrIT
To compile IFrIT, follow the steps:
* Untar IFrIT source file, and place it in a temporary directory.
* Set the environment variables VTKDIR to point to the VTK root
directory. If you use Qt, the environment variable QTDIR should
also be defined (it is defined automatically, if Qt is installed
correctly), and Qt bin directory ($QTDIR/bin) should be in your
path.
* Switch to ifrit-NNN/build directory (where NNN is the version of
IFrIT).
* Use CMake to configure IFrIT - since you installed VTK, you
should have a working version of CMake too. The simplest way to
configure IFrIT is to run non-interactive CMake:
% cmake .
If you would like to use CMake options to disable some of the
components or need more control over the build process (if, for
example, some of the standard libraries are not in standard
places), you can run CMake interactively:
% cmake -i .
(in the command-line mode) or
% ccmake .
for the GUI mode (ccmake is called CMakeSetup.exe under
Windows). In most cases configuring in GUI mode reduces to
pressing "c" a few times, and then pressing "g". If CMake
complains about VTK changing compiler switches, accept VTK
choice. If completed successfully, CMake will create a Makefile
in the current directory.
* Compile IFrIT by executing
% make
(or gmake). It will take some time to compile. The executable is
called "ifrit" and is located in the main source directory (one
level above build). Move it into your personal bin
directory. The executable is self-containing, it does not need
any other files to run (but you can use external files to modify
IFrIT behavior).
Enjoy! Do not forget to glance through the User Guide!
\ No newline at end of file
/*=========================================================================
Program: Ionization FRont Interactive Tool (IFRIT)
Language: C++
Copyright (c) 2002-2003 Nick Gnedin
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither name of Nick Gnedin nor the names of any contributors may be used
to endorse or promote products derived from this software without specific
prior written permission.
* Modified source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#include <qglobal.h>
#ifdef _WIN32
#include <vtkProp.h>
#include <vtkPropCollection.h>
#include <vtkViewport.h>
#include <vtkCubeAxesActor2D.h>
#include <vtkAbstractPropPicker.h>
void vtkViewport::RemovePropW(vtkProp *p)
{
if (p)
{
p->ReleaseGraphicsResources(this->VTKWindow);
this->Props->RemoveItem(p);
}
}
void vtkCubeAxesActor2D::SetPropW(vtkProp *p)
{
//vtkCxxSetObjectMacro(vtkCubeAxesActor2D,Prop, vtkProp);
vtkSetObjectBodyMacro(Prop,vtkProp,p);
}
vtkProp* vtkAbstractPropPicker::GetPropW()
{
return this->GetProp();
}
#else
#if defined(VTKDLL) && VTK_MAJOR_VERSION==4 && VTK_MINOR_VERSION==2 && VTK_BUILD_VERSION<4
#include <vtkVolumeMapper.h>
#include <vtkImageData.h>
void vtkVolumeMapper::SetInput( vtkImageData *input )
{
this->vtkProcessObject::SetNthInput(0, input );
}
#endif
#endif
#if (QT_VERSION == 0x030200)
#include <qspinbox.h>
#include <qapplication.h>
#include <qlineedit.h>
bool QSpinBox::eventFilter( QObject* o, QEvent* ev )
{
if (o != vi)
return QWidget::eventFilter(o,ev);
if ( ev->type() == QEvent::KeyPress ) {
QKeyEvent* k = (QKeyEvent*)ev;
bool retval = FALSE; // workaround for MSVC++ optimization bug
if( (k->key() == Key_Tab) || (k->key() == Key_BackTab) ){
if ( k->state() & Qt::ControlButton )
return FALSE;
if ( edited )
interpretText();
qApp->sendEvent( this, ev );
retval = TRUE;
} if ( k->key() == Key_Up ) {
stepUp();
retval = TRUE;
} else if ( k->key() == Key_Down ) {
stepDown();
retval = TRUE;
} else if ( k->key() == Key_Enter || k->key() == Key_Return ) {
interpretText();
return FALSE;
}
if ( retval )
return retval;
} else if ( ev->type() == QEvent::FocusOut || ev->type() == QEvent::Leave || ev->type() == QEvent::Hide ) {
if ( edited ) {
interpretText();
}
return FALSE;
}
return FALSE;
}
#endif
#
# Copyright (c) 2002-2006 Nick Gnedin
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of the
# GNU General Public License version 2 as published by the Free Software
# Foundation and appearing in the file LICENSE.GPL included in the
# packaging of this file.
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.0)
SET(src ..)
SET(target ifrit)
PROJECT(${target})
SET(addOGL 0 CACHE BOOL "Add OpenGL manually")
SET(addX11 0 CACHE BOOL "Add X11 manualy")
MARK_AS_ADVANCED(addOGL addX11)
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
#
# ---------------------------------------------------------------------------
#
# Configuration
#
# ---------------------------------------------------------------------------
#
# Shells
#
OPTION(Shell:CL "Include command-line shell" ON)
OPTION(Shell:QT "Include Qt-based GUI shell" ON)
SET(nsh)
SET(gsh)
IF(Shell:CL)
SET(nsh ${nsh} cl)
ENDIF(Shell:CL)
IF(Shell:QT)