Documentation Improvement: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(New page: ==Default values== This applies to many, many, classes, but let's take an example. Can things like this (from the constructor of vtkOBBTree) be listed on the class reference websites? t...)
 
No edit summary
Line 1: Line 1:
=Documentation Improvement!==
==Function Parameters==
<source lang="cpp">
virtual int IntersectWithLine (double p1[3], double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)
</source>
(taken from vtkAbstractCellLocator's reference page)
Description: "Return intersection point (if any) of finite line with cells contained in cell locator."
Many users first thoughts are: "What is 'tol'? What is 't'? What is 'subId'? What is 'x'? What is 'pcoords'? What are 'p1' and 'p2'? Why does it return an int?"
I recommend having a table like this for every function:
(if you see a '?' in the table, that means I'm not sure about this particular cell of the table :) )
{| border="1"
|- bgcolor="#abcdef"
! Variable!! Description!!Reasonable value
|-
|  Return value || 1 if the line intersected the polydata, 0 otherwise || n/a
|-
|  p1 & p2 || The end points of the line segment to be intersected with the polydata || n/a
|-
| tol || Accounts for floating point precision problems when performing ray/cell intersections || 0.01
|-
| t|| determines ?  || ?
|-
| x|| Return the coordinate of the intersection  || n/a
|-
| subId|| Return the index of the cell relative to a triangle strip, if applicable (rarely used) || n/a
|-
| pcoords|| ? || ?
|}
==Default values==
==Default values==
This applies to many, many, classes, but let's take an example.
This applies to many, many, classes, but let's take an example.


Can things like this (from the constructor of vtkOBBTree) be listed on the class reference websites?
Can things like this (from the constructor of vtkOBBTree) be listed on the class reference websites?
<source lang="cpp">
   this->Level = 4;
   this->Level = 4;
   this->MaxLevel = 12;
   this->MaxLevel = 12;
   this->Automatic = 1;
   this->Automatic = 1;
   this->Tolerance = 0.01;
   this->Tolerance = 0.01;
</source>


A little section like:
A little section like:
 
(again, '?' indicates I'm not sure of the value in this example)
{| border="1"
{| border="1"
|- bgcolor="#abcdef"
|- bgcolor="#abcdef"
! Variable!! Description!! Default value
! Variable!! Description!! Default value
|-
|-
|  Level ||I don't even know what this is and I use this class || 4 ||  || ||
|  Level ||I don't even know what this is and I use this class || 4
|-
|-
| MaxLevel || the depth of the tree? || 12 || || ||
| MaxLevel || The depth of the tree? || 12
|-
|-
| Tolerance || determines how close XX are ? || 0.01 || || ||
| Tolerance || Determines ? || 0.01


|}
|}
Line 26: Line 62:
It seems like it would be extremely informative (instead of going digging through cxx files for this type of information, and often still not finding it).
It seems like it would be extremely informative (instead of going digging through cxx files for this type of information, and often still not finding it).


Function Paramters
==Virtual Member functions (defined in superclasses)==
 
virtual int IntersectWithLine (double p1[3], double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)
 
(taken from vtkAbstractCellLocator's reference page)
 
The description is: "Return intersection point (if any) of finite line with cells contained in cell locator. "
 
Here's what I claim is missing: What is tol? What is t? What is subId? What is x? What is pcoords? And for that matter, what are p1 and p2 (when I first started using vtk I was expecting to pass a vtkLine object, not 2 points defining a line segment.)
 
Even after digging around for quite a while I can't find some of these answers - and I thought they would have been right on the class reference page.
 
Virtual Member functions (defined in superclasses)
I will often call a function on a derived class, go to look for it, and find that it is not there! Of course the answer is that it lives in a superclass, but there could be users with limited c++ experience that would not know to look there. Could there be some kind of pointer to the superclass function on the
I will often call a function on a derived class, go to look for it, and find that it is not there! Of course the answer is that it lives in a superclass, but there could be users with limited c++ experience that would not know to look there. Could there be some kind of pointer to the superclass function on the


For example, in my code I often do this:
For example, in my code I often do this:
<source lang="cpp">
vtkPolyData* polydata = vtkPolyData::New();
vtkPolyData* polydata = vtkPolyData::New();
vtkPoints* points3D = vtkPoints::New();
vtkPoints* points3D = vtkPoints::New();
// ... fill points3D ....
// ... fill points3D ....
polydata->SetPoints(points3d);
polydata->SetPoints(points3d);
</source lang="cpp">


However, if I go here:
However, if I go here:
Line 56: Line 82:


On the PolyData page, could there be
On the PolyData page, could there be
<source lang="cpp">
virtual void SetPoints (vtkPoints *) (see vtkPointSet)
virtual void SetPoints (vtkPoints *) (see vtkPointSet)
</source>


or something like that? Maybe this is not supported by the dogygen framework?
or something like that? Maybe this is not supported by the dogygen framework?




Action
==Action==
I think it would take someone with some knowledge of the class less than 10 minutes to go through and make these type of statements, and it would IMMENSELY improve usability for new (and all) users.
I think it would take someone with some knowledge of the class less than 10 minutes to go through and make these type of statements, and it would IMMENSELY improve usability for new (and all) users.


Thoughts/comments? If I am the only one that finds this a bit annoying, then fine. But if others agree with me, maybe I can start some sort of wiki "sign up" page with a list of the classes and who will improve the documentation pages? With a group effort I don't think it would take long at all to clean up.
Thoughts/comments? If I am the only one that finds this a bit annoying, then fine. But if others agree with me, maybe I can start some sort of wiki "sign up" page with a list of the classes and who will improve the documentation pages? With a group effort I don't think it would take long at all to clean up.

Revision as of 20:57, 13 August 2009

Documentation Improvement!=

Function Parameters

<source lang="cpp"> virtual int IntersectWithLine (double p1[3], double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId) </source> (taken from vtkAbstractCellLocator's reference page)

Description: "Return intersection point (if any) of finite line with cells contained in cell locator."

Many users first thoughts are: "What is 'tol'? What is 't'? What is 'subId'? What is 'x'? What is 'pcoords'? What are 'p1' and 'p2'? Why does it return an int?"

I recommend having a table like this for every function: (if you see a '?' in the table, that means I'm not sure about this particular cell of the table :) )

Variable Description Reasonable value
Return value 1 if the line intersected the polydata, 0 otherwise n/a
p1 & p2 The end points of the line segment to be intersected with the polydata n/a
tol Accounts for floating point precision problems when performing ray/cell intersections 0.01
t determines ? ?
x Return the coordinate of the intersection n/a
subId Return the index of the cell relative to a triangle strip, if applicable (rarely used) n/a
pcoords ? ?

Default values

This applies to many, many, classes, but let's take an example.

Can things like this (from the constructor of vtkOBBTree) be listed on the class reference websites? <source lang="cpp">

 this->Level = 4;
 this->MaxLevel = 12;
 this->Automatic = 1;
 this->Tolerance = 0.01;

</source>

A little section like: (again, '?' indicates I'm not sure of the value in this example)

Variable Description Default value
Level I don't even know what this is and I use this class 4
MaxLevel The depth of the tree? 12
Tolerance Determines ? 0.01


It seems like it would be extremely informative (instead of going digging through cxx files for this type of information, and often still not finding it).

Virtual Member functions (defined in superclasses)

I will often call a function on a derived class, go to look for it, and find that it is not there! Of course the answer is that it lives in a superclass, but there could be users with limited c++ experience that would not know to look there. Could there be some kind of pointer to the superclass function on the

For example, in my code I often do this: <source lang="cpp"> vtkPolyData* polydata = vtkPolyData::New(); vtkPoints* points3D = vtkPoints::New(); // ... fill points3D .... polydata->SetPoints(points3d); </source lang="cpp">

However, if I go here: http://www.vtk.org/doc/nightly/html/classvtkPolyData.html and search for "setpoints", there is nothing!

Of course going up the hierarchy to: http://www.vtk.org/doc/nightly/html/classvtkPointSet.html will find you what you're looking for, but often you have to go up 3 or 4 levels and by that time it can get very confusing.

On the PolyData page, could there be <source lang="cpp"> virtual void SetPoints (vtkPoints *) (see vtkPointSet) </source>

or something like that? Maybe this is not supported by the dogygen framework?


Action

I think it would take someone with some knowledge of the class less than 10 minutes to go through and make these type of statements, and it would IMMENSELY improve usability for new (and all) users.

Thoughts/comments? If I am the only one that finds this a bit annoying, then fine. But if others agree with me, maybe I can start some sort of wiki "sign up" page with a list of the classes and who will improve the documentation pages? With a group effort I don't think it would take long at all to clean up.