~ubuntu-branches/ubuntu/trusty/blender/trusty-proposed

« back to all changes in this revision

Viewing changes to source/blender/freestyle/intern/geometry/FastGrid.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2013-08-14 10:43:49 UTC
  • mfrom: (14.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20130814104349-t1d5mtwkphp12dyj
Tags: 2.68a-3
* Upload to unstable
* debian/: python3.3 Depends simplified
  - debian/control: python3.3 Depends dropped
    for blender-data package
  - 0001-blender_thumbnailer.patch refreshed
* debian/control: libavcodec b-dep versioning dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * ***** BEGIN GPL LICENSE BLOCK *****
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License
 
6
 * as published by the Free Software Foundation; either version 2
 
7
 * of the License, or (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software Foundation,
 
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
17
 *
 
18
 * ***** END GPL LICENSE BLOCK *****
 
19
 */
 
20
 
 
21
#ifndef __FASTGRID_H__
 
22
#define __FASTGRID_H__
 
23
 
 
24
/** \file blender/freestyle/intern/geometry/FastGrid.h
 
25
 *  \ingroup freestyle
 
26
 *  \brief Class to define a cell grid surrounding the bounding box of the scene
 
27
 *  \author Stephane Grabli
 
28
 *  \date 30/07/2002
 
29
 */
 
30
 
 
31
#include <cassert>
 
32
 
 
33
#include "Grid.h"
 
34
 
 
35
namespace Freestyle {
 
36
 
 
37
/*! Class to define a regular grid used for ray casting computations 
 
38
 *  We don't use a hashtable here. The grid is explicitly stored for faster computations.
 
39
 *  However, this might result in significant increase in memory usage (compared to the regular grid)
 
40
 */
 
41
class LIB_GEOMETRY_EXPORT FastGrid : public Grid
 
42
{
 
43
public:
 
44
        FastGrid() : Grid()
 
45
        {
 
46
                _cells = NULL;
 
47
                _cells_size = 0;
 
48
        }
 
49
 
 
50
        virtual ~FastGrid()
 
51
        {
 
52
                clear();
 
53
        }
 
54
 
 
55
        /*! clears the grid
 
56
         *  Deletes all the cells, clears the hashtable, resets size, size of cell, number of cells.
 
57
         */
 
58
        virtual void clear();
 
59
 
 
60
        /*! Sets the different parameters of the grid
 
61
         *    orig
 
62
         *      The grid origin
 
63
         *    size
 
64
         *      The grid's dimensions
 
65
         *    nb
 
66
         *      The number of cells of the grid
 
67
         */
 
68
        virtual void configure(const Vec3r& orig, const Vec3r& size, unsigned nb);
 
69
 
 
70
        /*! returns the cell whose coordinates are pased as argument */
 
71
        Cell *getCell(const Vec3u& p);
 
72
 
 
73
        /*! Fills the case p with the cell iCell */
 
74
        virtual void fillCell(const Vec3u& p, Cell& cell);
 
75
 
 
76
protected:
 
77
        Cell **_cells;
 
78
        unsigned _cells_size;
 
79
};
 
80
 
 
81
} /* namespace Freestyle */
 
82
 
 
83
#endif // __FASTGRID_H__