root/OpenSceneGraph/trunk/src/osgPlugins/fbx/WriterCompareTriangle.h @ 13041

Revision 13041, 1.5 kB (checked in by robert, 3 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
Line 
1#ifndef _3DS_WRITER_COMPARE_TRIANGLE_HEADER__
2#define _3DS_WRITER_COMPARE_TRIANGLE_HEADER__
3
4#include <osg/Geode>
5#include <osg/Geometry>
6#include <iostream>
7
8struct Triangle
9{
10    unsigned int t1;
11    unsigned int t2;
12    unsigned int t3;
13    unsigned int material;
14};
15
16class WriterCompareTriangle {
17public:
18    WriterCompareTriangle(const osg::Geode& geode,
19                          unsigned int nbVertices);
20
21    bool operator()(const std::pair<Triangle, int>& t1,
22                    const std::pair<Triangle, int>& t2) const;
23private:
24    void // This function prevents the scene being cut into too many boxes
25        setMaxMin(unsigned int& nbVerticesX,
26                  unsigned int& nbVerticesY,
27                  unsigned int& nbVerticesZ) const;
28
29    /**
30    *  Cut the scene in different box to sort.
31    *  \param nbVertices is the number of vertices in mesh.
32    *  \param sceneBox contain the size of the scene.
33    */
34    void
35    cutscene(int                     nbVertices,
36             const osg::BoundingBox& sceneBox);
37
38    /**
39    *  Find in which box those points are.
40    *  \return the place of the box in the vector.
41    *  \sa See cutScene() about the definition of the boxes for faces sorting.
42    */
43    int inWhichBox(const osg::Vec3::value_type x,
44                   const osg::Vec3::value_type y,
45                   const osg::Vec3::value_type z) const;
46
47    const osg::Geode&                    geode;
48    std::vector<osg::BoundingBox>        boxList;
49};
50
51#endif // _3DS_WRITER_COMPARE_TRIANGLE_HEADER__
Note: See TracBrowser for help on using the browser.