File: icososphere.hpp

package info (click to toggle)
python-visual 1%3A5.12-1.1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 7,672 kB
  • ctags: 7,636
  • sloc: cpp: 15,593; sh: 9,615; ansic: 6,631; python: 4,737; makefile: 385
file content (32 lines) | stat: -rw-r--r-- 707 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef VPYTHON_UTIL_ICOSOSPHERE_HPP
#define VPYTHON_UTIL_ICOSOSPHERE_HPP

#include <boost/shared_array.hpp>

namespace cvisual {

class icososphere
{
    boost::shared_array<float> verts;
    boost::shared_array<int> indices;
    int nverts;
    int ni;

    inline float*
    newe( int span)
    {
        float* e = verts.get() + 3*(nverts - 1);  // one before the beginning
        nverts += span-1;
        return e;
    }

    void subdivide( int span, float* v1, float* v2, float *v3, 
        float* s1, float* s2, float* s3,
        float* e1, float* e2, float* e3 );
 public:
	icososphere( int depth);
	void gl_render();
};

} // !namespace cvisual
#endif // !defined VPYTHON_UTIL_ICOSOSPHERE_HPP