vcglib/docs/Doxygen/style.dxy

112 lines
3.1 KiB
Plaintext
Raw Normal View History

2004-09-28 12:10:19 +02:00
/**
\page "VCG Library Coding Guide"
2013-06-19 07:36:49 +02:00
VCG Library Coding Guide
=========================
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
Naming Rules
------------
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
<B><I>Class names </I></B> with first letter Uppercase and internal
2004-09-28 12:10:19 +02:00
uppercase to separate compound words.\n
2013-06-19 07:36:49 +02:00
<B><I>Function members</I></B> of classes follow the same rule.
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
Example:
2004-09-28 12:10:19 +02:00
\code
Point3f
{
2013-06-19 07:36:49 +02:00
public:
2004-09-28 12:10:19 +02:00
ScalarType &amp;V(const int i);
}
\endcode
2013-06-19 07:36:49 +02:00
<B><I>Public Variable members</I></B> has the first letter
lowercase and internal uppercase to separate compound words.
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
Example:
2004-09-28 12:10:19 +02:00
<pre></pre>
2013-06-19 07:36:49 +02:00
<B><I>Private Variable members</I></B> has an underscore as first char and
2004-09-28 12:10:19 +02:00
the first letter lowercase and internal uppercase to separate compound
2013-06-19 07:36:49 +02:00
words.
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
Example:
2004-09-28 12:10:19 +02:00
<pre>
Point3f
{
private:
ScalarType _v[3];
}
</pre>
2013-06-19 07:36:49 +02:00
<B><I>Class Template Arguments</I></B> all capitalized and with names
2004-09-28 12:10:19 +02:00
remembering where they have been defined.<br>
Class TypeDefs used for templated Class arguments or for shortness are just like Class Names,
2013-06-19 07:36:49 +02:00
but ending with &ldquo;Type&rdquo;, &ldquo;Iterator&rdquo;, &ldquo;Pointer&rdquo;, or &ldquo;Container&rdquo;.
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
Example:
2004-09-28 12:10:19 +02:00
<pre>
typedef typename VertexType::CoordType CoordType;
typedef typename VertContainer::iterator VertexIterator;
2013-06-19 07:36:49 +02:00
2004-09-28 12:10:19 +02:00
</pre>
2013-06-19 07:36:49 +02:00
<H2 >Header Files</H2>
Header filenames and folders always fully lower case. Compound names
are separated by '_'.
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
Example:
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
#include<vcg/space/point3.h>;
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
Each include file must begin with the standard legal
2004-09-28 12:10:19 +02:00
disclamier/license intestation and report in the first line of history
2013-06-19 07:36:49 +02:00
the $LOG$ cvs string.
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
The following automatically generated history can be, from time to
time, compressed and shortened to save space.
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
Each file of the library has to include all the files that it
2004-09-28 12:10:19 +02:00
requires. A include file should rely on the files included by its own
2013-06-19 07:36:49 +02:00
include files. Example: in vcg/space/box3.h:
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
#include<vcg/math/base.h>; // not necessary because included by point3.h
#include<vcg/space/point3.h>;
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
In Class definitions place all the prototypes all together before
the inline or templated implementations.
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
<H2 >Editing Rules</H2>
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
Tabs are equivalent to two spaces.
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
There are no strict rules for the placement of '{' or indenting.
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
<H2 >Constructors and casting</H2>
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
All basic classes (point3, box3 ecc) must have null
2004-09-28 12:10:19 +02:00
constructors. Non null constructors can be added in debug
2013-06-19 07:36:49 +02:00
versions.
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
Implicit casting is disallowed. Write a member Import function for
2004-09-28 12:10:19 +02:00
casting from different integral types and a static.<br>
2013-06-19 07:36:49 +02:00
Construct to build an object from different a integral type.
2004-09-28 12:10:19 +02:00
2013-06-19 07:36:49 +02:00
Example:
2004-09-28 12:10:19 +02:00
<pre>
Point3f pf(1.0f,0.0f,0.0f);
Point3d pd=Point3f::Construct(pf);
pf.Import(pd);
</pre>
2013-06-19 07:36:49 +02:00
<H2 >Comment and documenting</H2>
All the classes, algorithms and functions <B>MUST</B> be documented using Doxygen. Please add a short intro before each class explaining design choices and for non trivial classes give some short usage example. For complex classes try to group similar members under categories. Non trivial algorithms should refer the paper/book where they are explained.
Namespaces and files should be also documented trying to explain how the file/namespace partitioning works.
*/