The set of software provided in the vvsystems suite is a complete implementatation of the vertex-vertex data structure and algebra. The components are as follows:
A list of known bugs and programming issues can be found here.
The software has been prepared such that it should compile in Linux and Windows environments. Other environements are not supported, but may still work. Some notes for FreeBSD users have been made by Andrey Mirtchovski.
readme_lin.txt
for
a Linux environment and in readme_win.txt
for Windows
environments.
This tutorial shows a sample implementation of the Dyn-Levin-Gregory curve subdivision algorithm. A Linux environment is assumed.
#include <util/point.hpp> // A point class included with vvlib #include <algorithms/render.hpp> // A set of rendering algorithms // Our definition of the edge properties. As these are // not used in this example program, we have an empty // declaration. edge {}; // Our definition of the vertex properties. Here we // use a geomentric position and a function to tell the // the rendering algorithm how each vertex is displayed. vertex { util::Point<double> pos; void glRender() { glVertex3dv(pos.c_data()); } }; // Our definition of the mesh properties. As this algorithm // does not require properties global to a mesh, the statement // is left empty. mesh {}; // A function that creates a new vertex between to existing ones. vertex insert(vertex p, vertex q) { vertex x; // A vertex x is created. make {p, q} nb_of x; // x is assigned a neighbourhood replace p with x in q; // q is modified to include x in place of p replace q with x in p; // p is modified to include x in place of q return x; } void dgl(mesh& S) { synchronise S; // the old state of all vertices in S is recorded. mesh NV; forall v in S { // iterate over the vertices in S forall p in `v { // iterate over the old neighbours of v if (p < v) continue; vertex x = insert(p, v); x$pos = - 1.0/16.0 * `(nextto p in `v)$pos + 9.0/16.0 * `v$pos + 9.0/16.0 * `p$pos - 1.0/16.0 * `(nextto v in `p)$pos; // set the position of x add x to NV; } } merge S with NV; // add the vertices in NV to S } mesh S; algorithms::DrawWireframe<vertex> draw_func; start { // This is run when the program is loaded into the interpreter S.readXMLFile("model.vvm"); // load the model file forall v in S { // check to see if we need to extend our viewing volume if (v$pos.x() > proxy.view_maxx) proxy.view_maxx = v$pos.x(); if (v$pos.y() > proxy.view_maxy) proxy.view_maxy = v$pos.y(); if (v$pos.z() > proxy.view_maxz) proxy.view_maxz = v$pos.z(); if (v$pos.x() < proxy.view_minx) proxy.view_minx = v$pos.x(); if (v$pos.y() < proxy.view_miny) proxy.view_miny = v$pos.y(); if (v$pos.z() < proxy.view_minz) proxy.view_minz = v$pos.z(); } } step { // this is the iterated part of the program dgl(S); } render_init { // Extra code that is run when the rendering context is created // goes here. Any OpenGL code is valid. glClearColor(1.0, 1.0, 1.0, 1.0); glColor3f(0.0, 0.0, 0.0); } render { // Code that is run when the rendering context is refreshed // goes here. Any OpenGL code is valid. See the vvlib // documentation for the Draw function. Draw(S, draw_func); }
<mesh> <v pos="-1 0" nb="2 1" /> <v pos=" 1 0" nb="0 2" /> <v pos=" 0 1.7321" nb="1 0" /> </mesh>
vvp2cpp program.vvm program.cpp
g++ program.cpp -fPIC -I$(QTDIR)/include -I$(VVLIBDIR) -I$(VVSYSTEMSDIR) -shared -Wl,-soname,vvmodel.so -o vvmodel.so
vvinterpreter vvmodel.so
Email me and I'll keep you up to date when the software is updated.