Back to FE Tools Home
VTK Programs:
How do
I run the normals program?
C++ Programs on Windows:
How do I compile changes to the code?
What’s
the difference between VSC++ and VS.Net?
What
files are important to save?
How
do I compile changes to the Thickness program?
C++ Programs on Unix:
How do
I unpack/pack a .tar file?
How
do I compile changes to the code?
What
files are important to save?
C++ Programs on Linux:
How
do I unpack/pack a .tar file?
How
do I compile changes to the code?
What
files are important to save?
1-
You need to have VTK and Tcl installed and working. For additional information visit the VTK Home Page (download) and the Tcl Developer Site .
2-
You need to change the paths in the code to point to your files
to process. You can use any text editor to make and save
your changes:
PathToConvert “path to folder containing
.surf file”
inFileName “name of .surf file”
outFile “name of ouput .vtk
file” (this will go in PathToConvert)
The other
variables should be set with the given file structure already:
VTK_NORMALS_FILES “normalsFiles/”
This is the
location of the required files colors.tck, vtkInt.tcl, and vtkImageInclude.tcl.
3-
Now open /normals/normals.tcl with vtk.
On Windows:
Open with vtk.exe (should be located at something
like C:\Program Files\vtk42\bin\vtk.exe).
You can do this via command line too (see the Windows section on how do I run a
program).
On Unix:
Open with vtk program (should be located at
something like /vtk42/bin/vtk). You can
use an alias for repeated execution (see the Unix
section for instructions on how do I run
a program)
4-
Once the picture of the surface is showing, the program has
finished
and you can close the program by closing all windows. Go to the PathToConvert
folder to find the outFile it created.
1- Set the Path variable
to the FEtools\bin folder: Right
click on My Computer->Properties.
Choose the Advanced tab then the Environment Variables button. Select the Path Variable (either in User or
System) then the Edit button. Append a ; followed by the path to the FEtools\bin folder. OK, OK, OK.
2- Open a command prompt,
change to the directory containing your files and type the program name: Open Start->All
Programs->Accessories->Command Prompt.
Use cd to change directories and dir to list
the directory contents. Type the
executable file name at the prompt.
3- Read and follow usage
instructions: The Usage lists the command name followed
by all required input arguments in [].
To use the options, type the tag(s) with
arguments after the required arguments.
Ex:
>>surfToOff filename.surf –o outfilename.off -print
- Using Microsoft Visual C++ (6.0)
Making Changes:
Open the program file (FEtools/name/name.cpp) in VSC++. Make and save changes as desired. Or make and save changes in your favorite
text editor.
Compiling:
Open the program file (FEtools/name/name.cpp) in VSC++.
Choose Build->Build from the menu.
Look for status of build in the Build window below. If prompted, choose Yes to use default
project workspace. Close VSC++ after
building. Go to the program folder
(FEtools/name/) and open the subfolder Debug or Release (depending on the mode
you were in when you built). Move the
.exe file to the FEtools/bin folder for future command line execution.
- Using Microsoft Visual Studio .Net (2003)
Making Changes:
Open the program solution (FEtools/name/name.sln) in VS.Net.
In the Solution Explorer window
(View->Solution Explorer) double click on the main file (name->Source
Files->name.cpp).
Make and save changes as desired.
Compiling:
With the program solution open, choose
Build->Build Solution from the menu.
Look for status of build in the Output window. Close VS.Net after building. Go to the program folder (FEtools/name/) and
open the subfolder Debug or Release (depending on the mode you were in when you
built). There you will find the solution
executable (name.exe). Move the .exe
file to the FEtools/bin folder for future command line execution.
-
In VSC++, the code looks exactly as it does for a Unix
compiler. It can compile and build an
executable file without other linking information.
-
In VS.Net, the code needs to be part of a project solution in order to be
compiled and run. Thus, the stdfx.h and stdfx.cpp files are used
to define the entry points for the code execution by some magical means known
only to the software composers. What
this means in reality is that you need to add an #include stdfx.h
to the top of every .cpp file. The other necessary file components of the
solution are included in the folder download above and described in what files are important to save.
1-
All of the FEtools/bin files (.exe’s).
2-
For each program folder (FEtools/name) the following (all other
folders and files are created upon compiling and can be deleted without
damaging the program):
VSC++
name.cpp
VS.Net
name.cpp
name.sln
name.vcproj
stdafx.cpp
stdafx.h (some programs have additional .ccp
and .h files that should be saved)
3-
Thickness program folder. The .obj and .sbr files are necessary
because they contain the info needed to use the ANN libraries.
VS.Net
newthickness.cpp
Thickness.sln
Thickness.vcproj
Debug/*.obj (There should be 12
Object Files)
Debug/*.sbr
(There should be 12 Source Browser Intermediate Files)
ann_0.2/ (all
files)
VSC++
(include
previous VS.Net stuff)
newthickness.dsp
Thickness.dsp
Thickness.dsw
-
For VSC++:
Making Changes:
Open FEtools/Thickness/Thickness.dsw
in VSC++> In the Workspace window
(View->Workspace) choose the FileView tab,
navigate to Thickness files->Source Files->newthickness.cpp, then double
click on the main file (newthickness.cpp).
Make and save changes as desired.
Compiling:
Choose Build->Build Thickness.exe from the
menu. Continue on according to the
normal instructions.
Note on ann_2.0 files:
Some of the headers in FEtools/Thickness/ann_2.0/include/ANN
were changed from the original ANN software specifically to work with C++.
- For VS.Net:
Making Changes:
Open the program solution (FEtools/Thickness/Thickness.sln) in VS.Net.
In the Solution Explorer window (View->Solution
Explorer) navigate to Thickness->Source Files->newThickness.cpp
then double click on the main file (newThickness.cpp). Make and save changes as desired.
Compiling:
Before you can compile any changes, you must include
the ANN programs. Choose
Tools->Options then the Projects folder->VC++ Directories then on the
right choose Show Directories For: Includes files.
Add a new directory that points to
FEtools/Thickness/ann_2.0/include. This
allows the compiler to find the ANN programs.
Now you’re set to make changes and compile according to the normal
instructions.
Note on ann_2.0 files:
Some of the headers in
FEtools/Thickness/ann_2.0/include/ANN were changed from the original ANN
software specifically for VS.Net to work.
The <iomanip.h> include in ANNx.h was changed to <iomanip>. Several instances of <iostream.h>
where changed to <iostream> and the line using
namespace std; was added after. These changes are necessary due to the
out-of-date references to the standard libraries. If you run into further errors of not being
able to find one of these headers, try changing it accordingly.
1-
To untar use the following command:
tar xvf
FEtools.tar
2-
To tarup use the following command:
tar cvf
nameout.tar FEtools/
1-
You can set up an alias for any program you use frequently: Change to your home directory. Use your favorite text editor to open your
.aliases file (Ex: emacs .aliases). At the end of the existing list, add the
following:
The alias command
The alias name you want to use for the program (you
can use the same name as the actual program)
The path to the program (FEtools/bin_Unix/name)
Ex: alias name /home/FEtools/bin_Unix/name
2-
Source the aliases file: In your
home directory run the source command.
>>source .aliases
3-
Change to the directory containing your files to process and
type the alias name for the program at the prompt.
4-
Read and follow usage instructions: The Usage lists the command name followed by all
required input arguments in []. To use
the options, type the tag(s) with arguments after the
required arguments.
Ex: >>surfToOff filename.surf
–o outfilename.off –print
1-
Use any C++ compiler: (On the SGI machines, the command is CC). Change to the FEtools/ directory. This is a good place to run the compiler from
because then you have access to both the program file folder and the bin_Unix folder and you won’t have to move the compiled
program later.
2-
Type the following in order:
Compiler command
Language tag (if listed in Documentation under CC tags)
Program
file name
Output
tag and output file name (use the bin_Unix/ folder)
Other
tags (if listed in Documentation under CC tags)
Example: CC –LANG:std
modulus/modulus.cpp –o bin_Unix/modulus -lm
1-
All
of the FEtools/bin_Unix files (compiled programs).
2-
For
each program folder (FEtools/name) the name.cpp file
and any other .h or .cpp files.
3- All other folders and
files are created upon compiling and can be deleted without damaging any
programs.
1-
To untar use the following command:
tar xvf
FEtools.tar
2-
To tarup use the following command:
tar cvf
nameout.tar FEtools/
1-
You can set up an alias for any program you use frequently: Change to your home directory. Use your favorite text editor to open your
.aliases file (Ex: emacs .aliases). At the end of the existing list, add the
following:
The alias command
The alias name you want to use for the program (you
can use the same name as the actual program)
The path to the program (FEtools/bin_Linux/name)
Ex: alias name /home/FEtools/bin_Linux/name
2-
Source the aliases file: In your
home directory run the source command.
>>source .aliases
3-
Change to the directory containing your files to process and
type the alias name for the program at the prompt.
4-
Read and follow usage instructions: The Usage lists the command name followed by
all required input arguments in []. To
use the options, type the tag(s) with arguments after
the required arguments.
Ex: >>surfToOff filename.surf
–o outfilename.off –print
1-
Use any C++ compiler: (On the SCI machines, the command is g++). Change to the FEtools/ directory. This is a good place to run the compiler from
because then you have access to both the program file folder and the bin_Linux folder and you won’t have to move the compiled
program later.
2-
Type the following in order:
Compiler command
Program
file name
Output
tag and output file name (use the bin_Linux/ folder)
Example:
g++ modulus/modulus.cpp –o bin_Linux/modulus
1-
All
of the FEtools/bin_Linux files (compiled programs).
2-
For
each program folder (FEtools/name) the name.cpp file
and any other .h or .cpp files.
3- All other folders and files are created upon
compiling and can be deleted without damaging any programs.
Created by Janna Balling j.balling@utah.edu |
|
For |