*** empty log message ***
This commit is contained in:
parent
d84b6632fa
commit
a34f7765b3
|
@ -1,112 +1,123 @@
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||||
<HTML>
|
<HTML> <HEAD>
|
||||||
<HEAD>
|
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
|
||||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
|
<TITLE></TITLE>
|
||||||
<TITLE></TITLE>
|
|
||||||
<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.0 (Win32)">
|
<STYLE> <!--
|
||||||
<META NAME="CREATED" CONTENT="20040209;363100">
|
|
||||||
<META NAME="CHANGEDBY" CONTENT="Paolo Cignoni">
|
|
||||||
<META NAME="CHANGED" CONTENT="20040218;284695">
|
|
||||||
<STYLE>
|
|
||||||
<!--
|
|
||||||
@page { size: 21.59cm 27.94cm; margin: 2cm }
|
@page { size: 21.59cm 27.94cm; margin: 2cm }
|
||||||
P { margin-bottom: 0.21cm }
|
body { background-color: #FFFFFF }
|
||||||
H1 { margin-bottom: 0.21cm }
|
body { margin-left:8%; margin-right:8%; }
|
||||||
H1.western { font-family: "Arial", sans-serif; font-size: 16pt }
|
pre { font-family: monospace; }
|
||||||
H1.cjk { font-family: "MS Mincho"; font-size: 16pt }
|
P { text-indent: 0em; margin-bottom: 0.21cm }
|
||||||
H1.ctl { font-family: "Tahoma"; font-size: 16pt }
|
H1.old { margin-bottom: 0.21cm }
|
||||||
H2 { margin-bottom: 0.21cm }
|
H1.old { font-family: "Arial", sans-serif; font-size: 16pt }
|
||||||
H2.western { font-family: "Arial", sans-serif; font-size: 14pt; font-style: italic }
|
|
||||||
H2.cjk { font-family: "MS Mincho"; font-size: 14pt; font-style: italic }
|
H2.old { margin-bottom: 0.21cm }
|
||||||
H2.ctl { font-family: "Arial Unicode MS"; font-size: 14pt; font-style: italic }
|
H2.old { font-family: "Arial", sans-serif; font-size: 14pt; font-style: italic }
|
||||||
P.code-western { text-indent: 1.01cm; margin-bottom: 0cm; font-family: "Courier New", monospace; font-size: 9pt }
|
P.old { text-indent: 1.01cm; margin-bottom: 0cm; }
|
||||||
P.code-cjk { text-indent: 1.01cm; margin-bottom: 0cm }
|
--> </STYLE>
|
||||||
P.code-ctl { text-indent: 1.01cm; margin-bottom: 0cm }
|
|
||||||
P.code-western { margin-left: 1cm; margin-bottom: 0cm; font-family: "Courier New", monospace; font-size: 10pt }
|
|
||||||
P.code-cjk { margin-left: 1cm; margin-bottom: 0cm }
|
|
||||||
P.code-ctl { margin-left: 1cm; margin-bottom: 0cm }
|
|
||||||
-->
|
|
||||||
</STYLE>
|
|
||||||
</HEAD>
|
</HEAD>
|
||||||
<BODY LANG="en-US" DIR="LTR">
|
<BODY LANG="en-US" DIR="LTR">
|
||||||
<H1 CLASS="western">VCG Library Coding Guide</H1>
|
<H1 >VCG Library Coding Guide</H1>
|
||||||
<H2 CLASS="western">Naming Rules</H2>
|
<H2 >Naming Rules</H2>
|
||||||
<P STYLE="margin-bottom: 0cm"><B><I>Class</I></B> names with first
|
<P><B><I>Class</I></B> names with first letter Uppercase and internal
|
||||||
letter Uppercase and internal uppercase to separate compound words.</P>
|
uppercase to separate compound words.</P>
|
||||||
<P STYLE="margin-bottom: 0cm"><B><I>Function members</I></B> of
|
|
||||||
classes follow the same rule.</P>
|
<P><B><I>Function members</I></B> of classes follow the same rule.</P>
|
||||||
<P STYLE="margin-bottom: 0cm">Example:</P>
|
|
||||||
<P CLASS="code-western"><BR>Point3f <BR>{<BR>public:<BR>ScalarType
|
<P>Example:</P>
|
||||||
&V(const int i);<BR>}</P>
|
|
||||||
<P CLASS="code-western"><BR>
|
<pre>
|
||||||
</P>
|
Point3f
|
||||||
<P STYLE="margin-bottom: 0cm"><B><I>Public Variable members</I></B>
|
{
|
||||||
has the first letter lowercase and internal uppercase to separate
|
public:
|
||||||
compound words.</P>
|
ScalarType &V(const int i);
|
||||||
<P STYLE="margin-bottom: 0cm">Example:</P>
|
}
|
||||||
<P STYLE="margin-bottom: 0cm"><BR>
|
</pre>
|
||||||
</P>
|
|
||||||
<P STYLE="margin-bottom: 0cm"><B><I>Private Variable members</I></B>
|
<P><B><I>Public Variable members</I></B> has the first letter
|
||||||
has an underscore as first char and the first letter lowercase and
|
lowercase and internal uppercase to separate compound words.</P>
|
||||||
internal uppercase to separate compound words.</P>
|
|
||||||
<P STYLE="margin-bottom: 0cm">Example:</P>
|
<P>Example:</P>
|
||||||
<P CLASS="code-western"><BR>Point3f <BR>{<BR> private:<BR>
|
|
||||||
ScalarType _v[3];<BR>}</P>
|
<pre></pre>
|
||||||
<P CLASS="code-western"><BR>
|
|
||||||
</P>
|
<P><B><I>Private Variable members</I></B> has an underscore as first char and
|
||||||
<P><B><I>Class Template Arguments</I></B> all capitalized and with
|
the first letter lowercase and internal uppercase to separate compound
|
||||||
names remembering where they have been defined.</P>
|
words.</P>
|
||||||
<P STYLE="margin-bottom: 0cm">TypeDefs used for templated Class
|
|
||||||
arguments just like Class Names, but ending with “Type”</P>
|
<P>Example:</P>
|
||||||
<P STYLE="margin-bottom: 0cm">Example:</P>
|
|
||||||
<P CLASS="code-western" STYLE="margin-bottom: 0.5cm"><FONT SIZE=2><FONT FACE="Courier New, sans-serif"><BR>Point3f::ScalarType</FONT></FONT>
|
<pre>
|
||||||
</P>
|
Point3f
|
||||||
<H2 CLASS="western">Header Files</H2>
|
{
|
||||||
<P STYLE="margin-bottom: 0cm">Header filenames and folders are always
|
private:
|
||||||
fully lower case. Compound names are separated by '_'.</P>
|
ScalarType _v[3];
|
||||||
<P STYLE="margin-bottom: 0cm">Example:</P>
|
}
|
||||||
<P STYLE="margin-bottom: 0cm"><FONT FACE="Courier New, sans-serif"><FONT SIZE=2>#include<vcg/space/point3.h></FONT></FONT></P>
|
</pre>
|
||||||
<P><FONT FACE="Times New Roman, serif"><FONT SIZE=3>Each include file
|
|
||||||
must begin with the standard legal disclamier/license intestation and
|
<P><B><I>Class Template Arguments</I></B> all capitalized and with names
|
||||||
report in the first line of history the $LOG$ cvs string. </FONT></FONT>
|
remembering where they have been defined.<br>
|
||||||
</P>
|
TypeDefs used for templated Class arguments just like Class Names,
|
||||||
<P><FONT FACE="Times New Roman, serif"><FONT SIZE=3>The following
|
but ending with “Type”</P>
|
||||||
automatically ge\nerated history can be, from time to time,
|
|
||||||
compressed/shortened. </FONT></FONT>
|
<P>Example:</P>
|
||||||
</P>
|
<pre>
|
||||||
|
Point3f::ScalarType
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<H2 >Header Files</H2>
|
||||||
|
<P>Header filenames and folders always fully lower case. Compound names
|
||||||
|
are separated by '_'.</P>
|
||||||
|
|
||||||
|
<P>Example:</P>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
#include<vcg/space/point3.h>
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<P>Each include file must begin with the standard legal
|
||||||
|
disclamier/license intestation and report in the first line of history
|
||||||
|
the $LOG$ cvs string.</P>
|
||||||
|
|
||||||
|
<P>The following automatically ge\nerated history can be, from time to
|
||||||
|
time, compressed/shortened.</P>
|
||||||
|
|
||||||
<P>Each file of the library has to include all the files that it
|
<P>Each file of the library has to include all the files that it
|
||||||
requires. A include file should relies on the files included by its
|
requires. A include file should relies on the files included by its
|
||||||
include files. Example: in vcg/space/box3.h:</P>
|
include files. Example: in vcg/space/box3.h:</P>
|
||||||
<P STYLE="margin-bottom: 0cm"><BR>
|
|
||||||
</P>
|
<pre>
|
||||||
<P CLASS="code-western">#include<vcg/math/base.h> // not
|
#include<vcg/math/base.h> // not necessary because included by point3.h
|
||||||
necessary because included by point3.h</P>
|
|
||||||
<P CLASS="code-western">#include<vcg/space/point3.h>
|
#include<vcg/space/point3.h>
|
||||||
</P>
|
</pre>
|
||||||
<P CLASS="code-western"><BR>
|
|
||||||
</P>
|
<P>In Class definitions place all the prototypes all together before
|
||||||
<P STYLE="margin-bottom: 0cm">In Class definitions place all the
|
the inline or templated implementations.</P>
|
||||||
prototypes all together before the inline or templated
|
|
||||||
implementations.</P>
|
<H2 >Editing Rules</H2>
|
||||||
<P STYLE="margin-bottom: 0cm"><BR>
|
|
||||||
</P>
|
<P>Tabs are equivalent to two spaces.</P>
|
||||||
<H2 CLASS="western">Editing Rules</H2>
|
|
||||||
<P STYLE="margin-bottom: 0cm">Tabs are equivalent to two spaces.
|
<P>There are no strict rules for the placement of '{' or indenting.</P>
|
||||||
</P>
|
|
||||||
<P STYLE="margin-bottom: 0cm">There are no strict rules for the
|
<H2 >Constructors and casting</H2>
|
||||||
placement of '{' or indenting.</P>
|
|
||||||
<H2 CLASS="western">Constructors and casting</H2>
|
<P>All basic classes (point3, box3 ecc) must have null
|
||||||
<P STYLE="margin-bottom: 0cm">All basic classes (point3, box3 ecc)
|
constructors. Non null constructors can be added in debug
|
||||||
must have null constructors. Non null constructors can be added in
|
versions.</P>
|
||||||
debug versions.</P>
|
|
||||||
<P STYLE="margin-bottom: 0cm">Implicit casting is disallowed. Write a
|
<P>Implicit casting is disallowed. Write a member Import function for
|
||||||
member Import function for casting from different integral types and
|
casting from different integral types and a static.<br>
|
||||||
a static Construct to build an object from different a integral type.</P>
|
Construct to build an object from different a integral type.</P>
|
||||||
<P STYLE="margin-bottom: 0cm"><BR>
|
|
||||||
</P>
|
<P>Example:</P>
|
||||||
<P STYLE="margin-bottom: 0cm">Example:</P>
|
|
||||||
<P CLASS="code-western" STYLE="margin-bottom: 0.5cm"><BR>Point3f
|
<pre>
|
||||||
pf(1.0f,0.0f,0.0f); <BR>Point3d
|
Point3f pf(1.0f,0.0f,0.0f);
|
||||||
pd=Point3f::Construct(pf);<BR>pf.Import(pd);</P>
|
Point3d pd=Point3f::Construct(pf);
|
||||||
|
pf.Import(pd);
|
||||||
|
</pre>
|
||||||
</BODY>
|
</BODY>
|
||||||
</HTML>
|
</HTML>
|
Loading…
Reference in New Issue