VCG Library Coding Guide

Naming Rules

Class names with first letter Uppercase and internal uppercase to separate compound words.

Function members of classes follow the same rule.

Example:

Point3f

{

public:

ScalarType &V(const int i);

}

Public Variable members has the first letter lowercase and internal uppercase to separate compound words.

Example:


Private Variable members has an underscore as first char and the first letter lowercase and internal uppercase to separate compound words.

Example:

Point3f

{

private:

ScalarType _v[3];

}

Class Template Arguments all capitalized and with names remembering where they have been defined.

TypeDefs used for templated Class arguments just like Class Names, but ending with “Type”

Example:

Point3f::ScalarType

Header Files

Each file of the library has to include all the files that it requires.

Header filenames and folders are always fully lower case. Compound names are separated by '_'.

In Class definitions place prototypes all togheter before the inline or templated implemetations.

Example:

#include<vcg/space/point3.h>

Editing Rules

Tabs are equivalent to two spaces.

There are no strict rules for the plaement of '{' or indenting.