updated documentation
This commit is contained in:
parent
72fb7e1f92
commit
d462d6f9f5
|
|
@ -19,8 +19,6 @@ vtkSmartPointer<SpawnPointCallback> LGlyphLayer::createSpawnPointCallback() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO: add interactionStyle functionality
|
|
||||||
// TODO: add timer + advection (probably from the program class not here)
|
|
||||||
// TODO: how do we handle mapping between pixelspace and lat/lon (needed for advection)? Current idea: store the vtkPoints in lat/lon system, then apply a transformfilter to map them to the current window geometry. This should allow for a changing viewport as well - we can query the new camera position and map accordingly.
|
// TODO: how do we handle mapping between pixelspace and lat/lon (needed for advection)? Current idea: store the vtkPoints in lat/lon system, then apply a transformfilter to map them to the current window geometry. This should allow for a changing viewport as well - we can query the new camera position and map accordingly.
|
||||||
// Further notes; current thinking is to allow tracking a particle's age by using a scalar array in the VtkPolyData. This would be incremented for every tick/updateData function call.
|
// Further notes; current thinking is to allow tracking a particle's age by using a scalar array in the VtkPolyData. This would be incremented for every tick/updateData function call.
|
||||||
// Another challenge is the concept of beaching; dead particles must not be included in the advect function call (wasted computations), but they should not be outright deleted from the vtkPoints either (we still want to display them). Working Solution: have another array of ints in the vtkPolyData, which tracks for how many calls of UpdateData a given particle has not had its position changed. If this int reaches some treshold (5? 10? 3? needs some testing), exclude the particle from the advect call.
|
// Another challenge is the concept of beaching; dead particles must not be included in the advect function call (wasted computations), but they should not be outright deleted from the vtkPoints either (we still want to display them). Working Solution: have another array of ints in the vtkPolyData, which tracks for how many calls of UpdateData a given particle has not had its position changed. If this int reaches some treshold (5? 10? 3? needs some testing), exclude the particle from the advect call.
|
||||||
|
|
|
||||||
|
|
@ -8,25 +8,61 @@
|
||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
#include "SpawnPointCallback.h"
|
#include "SpawnPointCallback.h"
|
||||||
|
|
||||||
|
/** This class manages the upper levels of the vtk pipeline; it has attributes for the vtkrenderWindow and a vector of Layers to represent a variable number of vtkRenderers.
|
||||||
|
* It can also set up a vtkTimer by connecting an instance of TimerCallbackCommand with its contained vtkRenderWindowInteractor.
|
||||||
|
*/
|
||||||
class Program {
|
class Program {
|
||||||
private:
|
private:
|
||||||
|
/** This attribute models a variable number of vtkRenderers, managed through the abstract Layer class.
|
||||||
|
*/
|
||||||
std::vector<Layer *> layers;
|
std::vector<Layer *> layers;
|
||||||
|
|
||||||
|
/** The window this program's layers render to.
|
||||||
|
*/
|
||||||
vtkSmartPointer<vtkRenderWindow> win;
|
vtkSmartPointer<vtkRenderWindow> win;
|
||||||
|
|
||||||
|
/** The interactor through which the layers can interact with the window.
|
||||||
|
*/
|
||||||
vtkSmartPointer<vtkRenderWindowInteractor> interact;
|
vtkSmartPointer<vtkRenderWindowInteractor> interact;
|
||||||
|
|
||||||
|
/** This function sets some default properties on the vtkRenderWindow. Extracted to its' own function to keep the constructor from becoming cluttered.
|
||||||
|
*/
|
||||||
void setWinProperties();
|
void setWinProperties();
|
||||||
|
|
||||||
|
/** This function sets up and connects a TimerCallbackCommand with the program.
|
||||||
|
*/
|
||||||
void setupTimer();
|
void setupTimer();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
/** Constructor.
|
||||||
|
*/
|
||||||
Program();
|
Program();
|
||||||
|
|
||||||
|
/** This function adds a new layer (and thus vtkRenderer) to the program.
|
||||||
|
* The layer is expected to set its own position in the vtkRenderWindow layer system.
|
||||||
|
* @param layer : pointer to the layer to add.
|
||||||
|
*/
|
||||||
void addLayer(Layer *layer);
|
void addLayer(Layer *layer);
|
||||||
|
|
||||||
|
/** This function removes a given layer from the vtkRenderWindow and layers vector.
|
||||||
|
* If the given layer is not actually in the program, nothing happens.
|
||||||
|
* @param layer : the layer to removeLayer
|
||||||
|
*/
|
||||||
void removeLayer(Layer *layer);
|
void removeLayer(Layer *layer);
|
||||||
|
|
||||||
|
/** This function sets the given SpawnpointCallback to be used with the program.
|
||||||
|
* @param cb : the callback to use.
|
||||||
|
*/
|
||||||
void setLagrangeInteractor(SpawnPointCallback *cb);
|
void setLagrangeInteractor(SpawnPointCallback *cb);
|
||||||
|
|
||||||
|
/** This function updates the data for the associated layers to the given timestamp.
|
||||||
|
* Also updates the renderWindow.
|
||||||
|
* @param t : the timestamp to update the data to.
|
||||||
|
*/
|
||||||
void updateData(int t);
|
void updateData(int t);
|
||||||
|
|
||||||
|
/** This function renders the vtkRenderWindow for the first time.
|
||||||
|
*/
|
||||||
void render();
|
void render();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue