Blender  V2.93
HeuristicGridDensityProviderFactory.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
23 
24 namespace Freestyle {
25 
27  unsigned numFaces)
28  : sizeFactor(sizeFactor), numFaces(numFaces)
29 {
30 }
31 
33  OccluderSource &source, const real proscenium[4])
34 {
36  new AverageAreaGridDensityProvider(source, proscenium, sizeFactor));
38  new Pow23GridDensityProvider(source, proscenium, numFaces));
39  if (avg->cellSize() > p23->cellSize()) {
40  return (AutoPtr<GridDensityProvider>)p23;
41  }
42 
43  return (AutoPtr<GridDensityProvider>)avg;
44 }
45 
47  OccluderSource &source, const BBox<Vec3r> &bbox, const GridHelpers::Transform &transform)
48 {
52  new Pow23GridDensityProvider(source, bbox, transform, numFaces));
53  if (avg->cellSize() > p23->cellSize()) {
54  return (AutoPtr<GridDensityProvider>)p23;
55  }
56 
57  return (AutoPtr<GridDensityProvider>)avg;
58 }
59 
61  OccluderSource &source)
62 {
63  real proscenium[4];
66  new AverageAreaGridDensityProvider(source, proscenium, sizeFactor));
68  new Pow23GridDensityProvider(source, proscenium, numFaces));
69  if (avg->cellSize() > p23->cellSize()) {
70  return (AutoPtr<GridDensityProvider>)p23;
71  }
72 
73  return (AutoPtr<GridDensityProvider>)avg;
74 }
75 
76 } /* namespace Freestyle */
Class to define a cell grid surrounding the projected image of a scene.
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
static void calculateOptimalProscenium(OccluderSource &source, real proscenium[4])
AutoPtr< GridDensityProvider > newGridDensityProvider(OccluderSource &source, const real proscenium[4])
inherits from class Rep
Definition: AppCanvas.cpp:32
double real
Definition: Precision.h:26