Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

/home/xchen/xia/src/glrender/demoVolumeTorus2.cc

#include <View.H>                                             // openGL display defined here.
#include <TensorBlossom.H>                                    // Bsplines defined here.   

using namespace xchen;


void volume_torus(View* v)
{
  typedef TensorBlossom<3,4> VolBspType;                      // a dimension 3 manifold embedding in E4, or P3 if rational tag is set.
  
  VolBspType *vtorus = new VolBspType(2, 8,  2, 8,  1, 2);    // deg = 2 ctlPointSz = 8, for dimension 2 and 1, deg = 1, ctlPointSz = 2 for dim 0.

  vtorus->ControlMesh() =                                     // This is copied from the output of revolution volume torus in demoVolumeTorus1.cc
    E4(  1.5,  0,  0,       1), E4(   2.5,          0,          0,       1), 
    E4(1.061,  0,  0,  0.7071), E4( 1.768,    -0.7071, -2.311e-07,  0.7071), 
    E4(  1.5,  0,  0,       1), E4(   1.5,         -1, -3.268e-07,       1), 
    E4(1.061,  0,  0,  0.7071), E4(0.3536,    -0.7071, -2.311e-07,  0.7071), 
    E4(  1.5,  0,  0,       1), E4(   0.5, -6.536e-07, -2.136e-13,       1), 
    E4(1.061,  0,  0,  0.7071), E4(0.3536,     0.7071,  2.311e-07,  0.7071), 
    E4(  1.5,  0,  0,       1), E4(   1.5,          1,  3.268e-07,       1), 
    E4(1.061,  0,  0,  0.7071), E4( 1.768,     0.7071,  2.311e-07,  0.7071), 

    E4(1.061,  0, -1.061,  0.7071), E4( 1.768,          0,  -1.768,  0.7071), 
    E4( 0.75,  0,  -0.75,     0.5), E4(  1.25,       -0.5,   -1.25,     0.5), 
    E4(1.061,  0, -1.061,  0.7071), E4( 1.061,    -0.7071,  -1.061,  0.7071), 
    E4( 0.75,  0,  -0.75,     0.5), E4(  0.25,       -0.5,   -0.25,     0.5), 
    E4(1.061,  0, -1.061,  0.7071), E4(0.3536, -4.622e-07, -0.3536,  0.7071), 
    E4( 0.75,  0,  -0.75,     0.5), E4(  0.25,        0.5,   -0.25,     0.5), 
    E4(1.061,  0, -1.061,  0.7071), E4( 1.061,     0.7071,  -1.061,  0.7071), 
    E4( 0.75,  0,  -0.75,     0.5), E4(  1.25,        0.5,   -1.25,     0.5), 

    E4( 4.902e-07,  0,    -1.5,       1), E4(  8.17e-07,          0,    -2.5,       1), 
    E4( 3.466e-07,  0,  -1.061,  0.7071), E4( 3.466e-07,    -0.7071,  -1.768,  0.7071), 
    E4( 4.902e-07,  0,    -1.5,       1), E4( 1.634e-07,         -1,    -1.5,       1), 
    E4( 3.466e-07,  0,  -1.061,  0.7071), E4(-1.155e-07,    -0.7071, -0.3536,  0.7071), 
    E4( 4.902e-07,  0,    -1.5,       1), E4( 1.634e-07, -6.536e-07,    -0.5,       1), 
    E4( 3.466e-07,  0,  -1.061,  0.7071), E4( 3.466e-07,     0.7071, -0.3536,  0.7071), 
    E4( 4.902e-07,  0,    -1.5,       1), E4(  8.17e-07,          1,    -1.5,       1), 
    E4( 3.466e-07,  0,  -1.061,  0.7071), E4( 8.088e-07,     0.7071,  -1.768,  0.7071), 

    E4(-1.061,  0, -1.061, 0.7071), E4( -1.768,          0,  -1.768, 0.7071), 
    E4( -0.75,  0,  -0.75,    0.5), E4(  -1.25,       -0.5,   -1.25,    0.5), 
    E4(-1.061,  0, -1.061, 0.7071), E4( -1.061,    -0.7071,  -1.061, 0.7071), 
    E4( -0.75,  0,  -0.75,    0.5), E4(  -0.25,       -0.5,   -0.25,    0.5), 
    E4(-1.061,  0, -1.061, 0.7071), E4(-0.3536, -4.622e-07, -0.3536, 0.7071), 
    E4( -0.75,  0,  -0.75,    0.5), E4(  -0.25,        0.5,   -0.25,    0.5), 
    E4(-1.061,  0, -1.061, 0.7071), E4( -1.061,     0.7071,  -1.061, 0.7071), 
    E4( -0.75,  0,  -0.75,    0.5), E4(  -1.25,        0.5,   -1.25,    0.5), 

    E4(  -1.5,  0, -9.804e-07,      1), E4(    -2.5,          0, -1.634e-06,       1), 
    E4(-1.061,  0, -6.932e-07, 0.7071), E4(  -1.768,    -0.7071, -9.243e-07,  0.7071), 
    E4(  -1.5,  0, -9.804e-07,      1), E4(    -1.5,         -1, -6.536e-07,       1), 
    E4(-1.061,  0, -6.932e-07, 0.7071), E4( -0.3536,    -0.7071, -1.133e-13,  0.7071), 
    E4(  -1.5,  0, -9.804e-07,      1), E4(    -0.5, -6.536e-07, -3.268e-07,       1), 
    E4(-1.061,  0, -6.932e-07, 0.7071), E4( -0.3536,     0.7071, -4.622e-07,  0.7071), 
    E4(  -1.5,  0, -9.804e-07,      1), E4(    -1.5,          1, -1.307e-06,       1), 
    E4(-1.061,  0, -6.932e-07, 0.7071), E4(  -1.768,     0.7071, -1.386e-06,  0.7071), 

    E4(-1.061,  0, 1.061, 0.7071), E4(  -1.768,          0, 1.768,  0.7071), 
    E4( -0.75,  0,  0.75,    0.5), E4(   -1.25,       -0.5,  1.25,     0.5), 
    E4(-1.061,  0, 1.061, 0.7071), E4(  -1.061,    -0.7071, 1.061,  0.7071), 
    E4( -0.75,  0,  0.75,    0.5), E4(   -0.25,       -0.5,  0.25,     0.5), 
    E4(-1.061,  0, 1.061, 0.7071), E4( -0.3536, -4.622e-07,0.3536,  0.7071), 
    E4( -0.75,  0,  0.75,    0.5), E4(   -0.25,        0.5,  0.25,     0.5), 
    E4(-1.061,  0, 1.061, 0.7071), E4(  -1.061,     0.7071, 1.061,  0.7071), 
    E4( -0.75,  0,  0.75,    0.5), E4(   -1.25,        0.5,  1.25,     0.5), 

    E4(-1.471e-06, 0,   1.5,      1), E4(-2.451e-06,          0,    2.5,      1), 
    E4( -1.04e-06, 0, 1.061, 0.7071), E4(-1.502e-06,    -0.7071,  1.768, 0.7071), 
    E4(-1.471e-06, 0,   1.5,      1), E4(-1.144e-06,         -1,    1.5,      1), 
    E4( -1.04e-06, 0, 1.061, 0.7071), E4(-1.155e-07,    -0.7071, 0.3536, 0.7071), 
    E4(-1.471e-06, 0,   1.5,      1), E4(-4.902e-07, -6.536e-07,    0.5,      1), 
    E4( -1.04e-06, 0, 1.061, 0.7071), E4(-5.777e-07,     0.7071, 0.3536, 0.7071), 
    E4(-1.471e-06, 0,   1.5,      1), E4(-1.797e-06,          1,    1.5,      1), 
    E4( -1.04e-06, 0, 1.061, 0.7071), E4(-1.964e-06,     0.7071,  1.768, 0.7071), 

    E4(1.061,  0,  1.061,  0.7071), E4( 1.768,          0,  1.768, 0.7071), 
    E4( 0.75,  0,   0.75,     0.5), E4(  1.25,       -0.5,   1.25,    0.5), 
    E4(1.061,  0,  1.061,  0.7071), E4( 1.061,    -0.7071,  1.061, 0.7071), 
    E4( 0.75,  0,   0.75,     0.5), E4(  0.25,       -0.5,   0.25,    0.5), 
    E4(1.061,  0,  1.061,  0.7071), E4(0.3536, -4.622e-07, 0.3536, 0.7071), 
    E4( 0.75,  0,   0.75,     0.5), E4(  0.25,        0.5,   0.25,    0.5), 
    E4(1.061,  0,  1.061,  0.7071), E4( 1.061,     0.7071,  1.061, 0.7071), 
    E4( 0.75,  0,   0.75,     0.5), E4(  1.25,        0.5,   1.25,    0.5);



  vtorus->SetPeriodicEnd(1);     // set dimension 1 (i.e. the concentric circles in the disk) periodic end condition.
  vtorus->SetPeriodicEnd(2);     // set dimension 2 (i.e. the revolution direction of the disk) periodic end condition.

  vtorus->KnotVector() =        
    0., 1,                       // the knot vector of dimension 0, i.e., the radius direction 
    0,0,1,1,2,2,3,3,4,           // the knot vector of dimension 1.
    0,0,1,1,2,2,3,3,4;           // the knot vector of dimension 2.

  vtorus->IsRational() = true;   // all the E4 points will be P3 points.

  new glModel(v, vtorus);
}
  

void new_glModel(View* v) 
{
  volume_torus(v);
}




Generated on Wed Apr 7 21:40:48 2004 by doxygen1.2.18