misc.docu 8.5 KB
Newer Older
Jan Möbius's avatar
Jan Möbius committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
//-----------------------------------------------------------------------------


/** \page naming_conventions Naming Conventions

The following naming conventions are used for the OpenMesh code:

<b>Files:</b>
  \li \c MyClass.cc for C++-Implementation of class \c MyClass
  \li \c MyClass.hh for C++-Header of class \c MyClass

<b>Classes:</b>
  \li Class names start with a capital letter: \c MyClass
  \li Class templates end with \c T: \c MyClassTemplateT

<b>Variables:</b>
  \li One leading underscore for parameters in function-calls: \c _var
  \li One trailing underscore for member-variables: \c var_
  \li Two trailing underscores for static member-variables: \c var__

<b>Functions:</b>
  \li Words are separated by underscores: \c my_function()
		 
<b>Accessing members:</b>
  \li To get the member \c xxx_ use <tt> const& xxx() const </tt>
  \li To set the member \c xxx_ use <tt> void set_xxx(arg)  </tt>
  
**/


//-----------------------------------------------------------------------------


/** \page compiling Compiling OpenMesh

\section compilers Tested compilers

38
%OpenMesh has been successfully tested for the following operating
Jan Möbius's avatar
Jan Möbius committed
39 40 41 42 43 44 45 46 47
systems / compilers:

<table>

<tr><td> Linux </td><td>
gcc 4.0.x<br>
gcc 4.1.x<br>
gcc 4.2.x<br>
gcc 4.3.x<br>
Jan Möbius's avatar
Jan Möbius committed
48
gcc 4.4.x<br>
Jan Möbius's avatar
Jan Möbius committed
49 50 51 52 53 54
</td></tr>

<tr><td> Windows </td><td> 
Microsoft Visual Studio 2008<br>
</td></tr>

55
<tr><td> MacOS X <br>(Panther, Tiger and Leopard)</td><td> 
Jan Möbius's avatar
Jan Möbius committed
56
gcc 4.0 <br>
57
gcc 4.2 <br>
Jan Möbius's avatar
Jan Möbius committed
58 59 60 61
</td></tr>

</table>

Jan Möbius's avatar
Jan Möbius committed
62
\section req_libs Required libraries (Only for included Apps)
Jan Möbius's avatar
Jan Möbius committed
63

Jan Möbius's avatar
Jan Möbius committed
64
Install the following external libraries / frameworks if you want to use the included Applications:<br><br>
65 66 67 68
<table>
<tr><td>OpenGL</td><td><a href="http://www.opengl.org" target="_blank">http://www.opengl.org</a></td></tr>
<tr><td>Qt4</td><td><a href="http://www.qtsoftware.com/downloads" target="_blank">http://www.qtsoftware.com/downloads</a></td></tr>
<tr><td>GLEW</td><td><a href="http://glew.sourceforge.net/" target="_blank">http://glew.sourceforge.net/</a></td></tr>
69
</table><br>
70 71 72

\section build_systems Chosing build system

Jan Möbius's avatar
Jan Möbius committed
73 74
%OpenMesh can be built either using <b>cmake</b> or <b>qmake</b> (that already comes along
with the qt framework) . We strongly recommend use of the <b>cmake</b> build system.
Jan Möbius's avatar
Jan Möbius committed
75 76 77
<br>
<br>
<br>
78 79

\section sec_compiling_unix Unix
80 81 82 83

\subsection linux_using_cmake Compiling OpenMesh using CMake

In order to compile OpenMesh, create a directory named e.g. "build" in
84
OpenMesh's root directory. <b>Change to the newly created directory</b> and type
85 86 87
<br/><br/>
<tt>
cmake&nbsp;..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Generates the appropriate Makefiles<br>
88
make&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Builds the project<br>
89
</tt><br>
90 91 92 93
You can choose the build type by using cmake with the flag<br>
<b>-DCMAKE_BUILD_TYPE=(Debug|Release)</b><br>
The default is: Debug
<br>
Mike Kremer's avatar
Mike Kremer committed
94 95
Other flags are:<br/>
<b>-DBUILD_APPS=OFF</b> to disable build of applications and<br/>
96
<b>-DCMAKE_INSTALL_PREFIX=&lt;path&gt;</b> to specify the install path.
Mike Kremer's avatar
Mike Kremer committed
97 98 99 100 101
<br/>
When calling <b>make install</b> cmake will install OpenMesh into this
directory using the subdirectories lib/include/bin.

CMake builds both shared and static under Linux.
102 103

Everything will then be build in the <b>Build</b> subdirectory containing the libraries in <b>lib</b> and the binaries in <b>bin</b>.
104 105 106 107

There are some additional targets:<br>
<b>doc</b>: Builds the Documentation<br>
<b>doc-install</b>: Builds the Documentation and installs it<br>
108 109
<br>
<br>
110 111 112 113

\subsection linux_using_qmake Compiling OpenMesh using QMake

In order to compile OpenMesh, enter following commands in OpenMesh's root directory:<br><br>
Jan Möbius's avatar
Jan Möbius committed
114 115 116
<tt>
qmake&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Generates the appropriate Makefiles<br>
make&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Builds the project (use 'make debug' to build debug version)<br>
117
</tt><br>
118
Make sure to use Qt version 4 (some linux distributions<br>
Jan Möbius's avatar
Jan Möbius committed
119
use the link \c qmake-qt4 against the executable).
Jan Möbius's avatar
Jan Möbius committed
120 121 122 123 124
<br>
<br>
<br>
<br>

Jan Möbius's avatar
Jan Möbius committed
125 126 127

\section sec_compiling_windows Windows

128 129 130 131 132 133 134 135 136
\subsection windows_using_cmake Compiling OpenMesh using CMake

If you want to use cmake to build your Visual Studio 2008 solution file,<br>
download and install CMake from <a href="http://www.cmake.org/cmake/resources/software.html">www.cmake.org</a>.<br>
(Note: This is not mandatory since there are already VS2008 solution files included in OpenMesh).<br><br>
Install the OpenGL Extension Wrangler Library (GLEW) from <a href="http://glew.sourceforge.net" target="_blank">http://glew.sourceforge.net</a>.
<br>
<br>
<ul>
137 138 139 140 141 142 143 144 145 146
<li> Get Visual Studio 2008 </li>
<li> Extract OpenMesh source code. </li>
<li> Get all required libraries and install them ( including headers! ).</li>
<li> Get cmake for windows from http://www.cmake.org/cmake/resources/software.html <li>
<li> Start the cmake gui and open the OpenMesh toplevel directory </li>
<li> Choose a build directory</li>
<li> Click on configure .... If any libraries are left unconfigured, you can adjust the path in the ui. Rerun configure until everything is configured correctly</li>
<li> Click generate to create the visual studio project files </li>
<li> You can now find a Visual Studio solution file in the <b>build</b> directory you chose in cmake </li>
<li> Now you can build OpenMesh from within Visual Studio using the newly created project file. </li>
147 148 149 150
</ul>

\subsection windows_using_qmake Compiling OpenMesh using QMake

151 152 153
If you want to use qmake to build your Visual Studio 2008 solution file,<br>
download and install the Qt4 framework from <a href="http://www.qtsoftware.com/downloads" target="_blank">Trolltech</a>.<br>
(Note: This is not mandatory since there are already VS2008 solution files included in OpenMesh).<br><br>
Mike Kremer's avatar
 
Mike Kremer committed
154
Install the OpenGL Extension Wrangler Library (GLEW) from <a href="http://glew.sourceforge.net" target="_blank">http://glew.sourceforge.net</a>.
155 156 157 158 159 160
<br>
<br>
Open \c OpenMesh\qmake\packages\packages.Windows in a text editor and change the include and library paths<br>
for GLEW and GLUT such that they match the installed ones (see comments to find the right path entries).
<ul>
<li>In Microsoft Visual Studio 2008 open <tt> Tools->Visual Studio command prompt </tt></li>
Jan Möbius's avatar
Jan Möbius committed
161
<li>Go to the folder of your application and call \c C:\\qt4\\bin\\qmake.exe -r</li>
162 163 164 165
<li>Open the resulting visual studio solution ( *.sln )</li>
<li>Choose which build target to use ( Debug/Release )</li>
<li>Choose \c Build \c solution from the build menu</li>
</ul>
Jan Möbius's avatar
Jan Möbius committed
166

Jan Möbius's avatar
Jan Möbius committed
167 168 169 170 171
<br>
<br>
<br>
<br>

172
\section sec_compiling_macosx MacOS X
Jan Möbius's avatar
Jan Möbius committed
173

174
Download and install required libraries as stated above.
Mike Kremer's avatar
Mike Kremer committed
175
Because some of the examples depend on the GLEW library, it's recommended to install glew via the darwin portage
176 177
system <a href="http://darwinports.com/" target="_blank">darwin ports</a>.<br>
If you have not installed it yet, follow the instructions given on their site in order to install it.<br>
178 179
Type
<tt>
180
sudo port -v install glew
181
</tt>
182
to install glew headers and libraries. ( Darwin ports usually installs header files to \c /usr/local/include and libraries to \c /usr/local/lib. )<br>
183
<br>
184 185 186 187 188 189 190 191 192 193 194 195 196

\subsection mac_using_cmake Compiling OpenMesh using CMake

If you're using cmake as preferred build system create a directory
named e.g. in OpenMesh's root directory and change to it.
<br/><br/>
<tt>
cmake&nbsp;..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Generates the appropriate Makefiles<br>
make&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Builds the project (use 'make debug' to build debug version)<br>
</tt><br>
The mac application bundle will be found under "Build" in the recently created build folder. 
It automatically contains all needed shared objects (libs, fonts, textures, etc.).

Mike Kremer's avatar
Mike Kremer committed
197 198
CMake builds both shared and static under MacOS X.

199 200 201
\subsection mac_using_qmake Compiling OpenMesh using QMake

Adapt the header paths of at least GLEW (optional freetype, FTGL,...) in file <b>OpenMesh/qmake/packages/packages.Darwin</b>.
202
<br><br>
Jan Möbius's avatar
Jan Möbius committed
203 204
In order to compile and install OpenMesh, open a Terminal window and enter following commands in OpenMesh's root directory:<br><br>
<tt>
Jan Möbius's avatar
Jan Möbius committed
205
qmake -spec macx-g++&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Generates the appropriate Makefiles<br>
206
make&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Builds the project (use 'make debug' to build debug version)<br>
Jan Möbius's avatar
Jan Möbius committed
207 208 209 210 211 212
</tt>

**/


//-----------------------------------------------------------------------------