From: Rob C. <rob...@at...> - 2002-01-30 11:01:55
|
Thanks for correcting me. It's good advice that I'm going to start following in my own project, fclib.sourceforge.net. Rob Campbell rob...@at... > -----Original Message----- > From: vxl...@li... > [mailto:vxl...@li...]On Behalf Of Andrew > Fitzgibbon > Sent: Monday, January 28, 2002 5:55 AM > To: 'Peter Vanroose'; 'Rob Campbell' > Cc: vxl...@li... > Subject: RE: [Vxl-users] [CONTRIBUTION] vcsl_tutorial.cpp > > > > Thanks for the contribution Rob! > > The body of the code looks great, but I would suggest that > the headers are changed to follow the principles in the VXL > book. To summarize, because they may prove useful: > > 0. Use forward slashes in include lines. > Rationale: > Very few operating systems use backslash as a filename > separator. > > 1. All standard headers included as <x> should use <vcl_x.h> > Rationale: > This is the only supported way to get cross-platform > portability. > > 2. Order from general to specific. > Rationale: > Think of inheritance -- the more general (base) class must > be defined before the more specific (dervied) class. > If this order is not possible -- i.e. there is a cycle, > that's a bug in the libraries, and should be fixed. > > Note that vcsl depends on vnl, so vnl headers should be > included first. > > 3. Use <> rather than "". > Rationale: > Safety -- one might copy the example file elsewhere, to > a directory with confusing contents. The -I flags should > control the order of search, not the contents of the current > directory. > > 4. The exception to 2 and 3 is the header file corresponding > to the current .cxx file. This should be included at the > top of file.cxx, in "", with no path. > Rationale: > If the .h is at the top of the file, it ensures it's > free-standing and doesn't have any hidden dependencies. > Forces the .cxx and .h to be copied together, as a change > in the cxx will probably require a change in .h, and on many > compilation environments, it's hard to get the cxx right > unless the compiler includes exactly the correct .h. > > So, in the supplied example, the head of the file should be > > #include <vcl_iostream.h> > #include <vxl/vxl/vnl/vnl_math.h> > #include <vxl/vxl/vcsl/vcsl_cartesian_3d.h> > #include <vxl/vxl/vcsl/vcsl_translation.h> > #include <vxl/vxl/vcsl/vcsl_rotation.h> > #include <vxl/vxl/vcsl/vcsl_displacement.h> > #include <vxl/vxl/vcsl/vcsl_graph.h> > > > > _______________________________________________ > Vxl-users mailing list > Vxl...@li... > https://lists.sourceforge.net/lists/listinfo/vxl-users |