Blender  V3.3
Public Types | Public Member Functions | Protected Member Functions | List of all members
Freestyle::ViewMapBuilder Class Reference

#include <ViewMapBuilder.h>

Public Types

enum  intersection_algo { sweep_line }
 
enum  visibility_algo {
  ray_casting , ray_casting_fast , ray_casting_very_fast , ray_casting_culled_adaptive_traditional ,
  ray_casting_adaptive_traditional , ray_casting_culled_adaptive_cumulative , ray_casting_adaptive_cumulative
}
 

Public Member Functions

 ViewMapBuilder ()
 
 ~ViewMapBuilder ()
 
void BuildGrid (WingedEdge &we, const BBox< Vec3r > &bbox, unsigned int sceneNumFaces)
 
void computeInitialViewEdges (WingedEdge &)
 
void computeCusps (ViewMap *ioViewMap)
 
void DetectCusps (ViewEdge *ioEdge)
 
void setViewpoint (const Vec3r &ivp)
 
void setTransform (const real iModelViewMatrix[4][4], const real iProjectionMatrix[4][4], const int iViewport[4], real iFocalLength, real, real)
 
void setFrustum (real iZnear, real iZfar)
 
ViewMapBuildViewMap (WingedEdge &we, visibility_algo iAlgo, real epsilon, const BBox< Vec3r > &bbox, unsigned int sceneNumFaces)
 
void CullViewEdges (ViewMap *ioViewMap, real viewProscenium[4], real occluderProscenium[4], bool extensiveFEdgeSearch=true)
 
void ComputeIntersections (ViewMap *ioViewMap, intersection_algo iAlgo=sweep_line, real epsilon=1.0e-06)
 
void ComputeEdgesVisibility (ViewMap *ioViewMap, WingedEdge &we, const BBox< Vec3r > &bbox, unsigned int sceneNumFaces, visibility_algo iAlgo=ray_casting, real epsilon=1.0e-6)
 
void setGrid (Grid *iGrid)
 
void setProgressBar (ProgressBar *iProgressBar)
 
void setRenderMonitor (RenderMonitor *iRenderMonitor)
 
void setEnableQI (bool iBool)
 

Protected Member Functions

void ComputeSweepLineIntersections (ViewMap *ioViewMap, real epsilon=1.0e-6)
 
void ComputeRayCastingVisibility (ViewMap *ioViewMap, real epsilon=1.0e-6)
 
void ComputeFastRayCastingVisibility (ViewMap *ioViewMap, real epsilon=1.0e-6)
 
void ComputeVeryFastRayCastingVisibility (ViewMap *ioViewMap, real epsilon=1.0e-6)
 
void ComputeCumulativeVisibility (ViewMap *ioViewMap, WingedEdge &we, const BBox< Vec3r > &bbox, real epsilon, bool cull, GridDensityProviderFactory &factory)
 
void ComputeDetailedVisibility (ViewMap *ioViewMap, WingedEdge &we, const BBox< Vec3r > &bbox, real epsilon, bool cull, GridDensityProviderFactory &factory)
 
int ComputeRayCastingVisibility (FEdge *fe, Grid *iGrid, real epsilon, set< ViewShape * > &oOccluders, Polygon3r **oaPolygon, unsigned timestamp)
 
void FindOccludee (FEdge *fe, Grid *iGrid, real epsilon, Polygon3r **oaPolygon, unsigned timestamp)
 
void FindOccludee (FEdge *fe, Grid *iGrid, real epsilon, Polygon3r **oaPolygon, unsigned timestamp, Vec3r &u, Vec3r &A, Vec3r &origin, Vec3r &edgeDir, vector< WVertex * > &faceVertices)
 

Detailed Description

Definition at line 42 of file ViewMapBuilder.h.

Member Enumeration Documentation

◆ intersection_algo

Enumerator
sweep_line 

Definition at line 61 of file ViewMapBuilder.h.

◆ visibility_algo

Enumerator
ray_casting 
ray_casting_fast 
ray_casting_very_fast 
ray_casting_culled_adaptive_traditional 
ray_casting_adaptive_traditional 
ray_casting_culled_adaptive_cumulative 
ray_casting_adaptive_cumulative 

Definition at line 65 of file ViewMapBuilder.h.

Constructor & Destructor Documentation

◆ ViewMapBuilder()

Freestyle::ViewMapBuilder::ViewMapBuilder ( )
inline

Definition at line 75 of file ViewMapBuilder.h.

References NULL.

◆ ~ViewMapBuilder()

Freestyle::ViewMapBuilder::~ViewMapBuilder ( )
inline

Definition at line 87 of file ViewMapBuilder.h.

References NULL.

Member Function Documentation

◆ BuildGrid()

void Freestyle::ViewMapBuilder::BuildGrid ( WingedEdge we,
const BBox< Vec3r > &  bbox,
unsigned int  sceneNumFaces 
)

◆ BuildViewMap()

ViewMap * Freestyle::ViewMapBuilder::BuildViewMap ( WingedEdge we,
visibility_algo  iAlgo,
real  epsilon,
const BBox< Vec3r > &  bbox,
unsigned int  sceneNumFaces 
)

Builds the scene view map returns the list the view map it is up to the caller to delete this ViewMap iWRoot The root group node containing the WEdge structured scene

Definition at line 1031 of file ViewMapBuilder.cpp.

References blender::robust_pred::epsilon.

Referenced by Freestyle::Controller::ComputeViewMap().

◆ ComputeCumulativeVisibility()

void Freestyle::ViewMapBuilder::ComputeCumulativeVisibility ( ViewMap ioViewMap,
WingedEdge we,
const BBox< Vec3r > &  bbox,
real  epsilon,
bool  cull,
GridDensityProviderFactory factory 
)
protected

◆ computeCusps()

void Freestyle::ViewMapBuilder::computeCusps ( ViewMap ioViewMap)

◆ ComputeDetailedVisibility()

void Freestyle::ViewMapBuilder::ComputeDetailedVisibility ( ViewMap ioViewMap,
WingedEdge we,
const BBox< Vec3r > &  bbox,
real  epsilon,
bool  cull,
GridDensityProviderFactory factory 
)
protected

◆ ComputeEdgesVisibility()

void Freestyle::ViewMapBuilder::ComputeEdgesVisibility ( ViewMap ioViewMap,
WingedEdge we,
const BBox< Vec3r > &  bbox,
unsigned int  sceneNumFaces,
visibility_algo  iAlgo = ray_casting,
real  epsilon = 1.0e-6 
)

Computes the 2D scene silhouette edges visibility iGrid For the Ray Casting algorithm.

Definition at line 1435 of file ViewMapBuilder.cpp.

References Freestyle::_global, Global::debug, blender::robust_pred::epsilon, and G_DEBUG_FREESTYLE.

◆ ComputeFastRayCastingVisibility()

void Freestyle::ViewMapBuilder::ComputeFastRayCastingVisibility ( ViewMap ioViewMap,
real  epsilon = 1.0e-6 
)
protected

◆ computeInitialViewEdges()

void Freestyle::ViewMapBuilder::computeInitialViewEdges ( WingedEdge we)

◆ ComputeIntersections()

void Freestyle::ViewMapBuilder::ComputeIntersections ( ViewMap ioViewMap,
intersection_algo  iAlgo = sweep_line,
real  epsilon = 1.0e-06 
)

computes the intersection between all 2D feature edges of the scene. ioViewMap The view map. It is modified by the method. The list of all features edges of the scene. Each time an intersection is found, the 2 intersecting edges are splitted (creating 2 new vertices) At the end, this list is updated with the adding of all new created edges (resulting from splitting). iAlgo The algo to use for computing the intersections

Definition at line 2231 of file ViewMapBuilder.cpp.

References Freestyle::_global, Freestyle::TVertex::backEdgeA(), Freestyle::TVertex::backEdgeB(), Global::debug, blender::robust_pred::epsilon, Freestyle::TVertex::frontEdgeA(), Freestyle::TVertex::frontEdgeB(), G_DEBUG_FREESTYLE, Freestyle::TVertex::getId(), Freestyle::Nature::T_VERTEX, and Freestyle::ViewMap::ViewVertices().

◆ ComputeRayCastingVisibility() [1/2]

int Freestyle::ViewMapBuilder::ComputeRayCastingVisibility ( FEdge fe,
Grid iGrid,
real  epsilon,
set< ViewShape * > &  oOccluders,
Polygon3r **  oaPolygon,
unsigned  timestamp 
)
protected

Compute the visibility for the FEdge fe. The occluders are added to fe occluders list. fe The FEdge iGrid The grid used to compute the ray casting visibility epsilon The epsilon used for computation oShapeId fe is the border (in 2D) between 2 2D spaces. if fe is a silhouette, One of these 2D spaces is occupied by the shape to which fe belongs (on its left) and the other one is either occupied by another shape or empty or occupied by the same shape. We use this ray casting operation to determine which shape lies on fe's right. The result is the shape id stored in oShapeId

Definition at line 2028 of file ViewMapBuilder.cpp.

References Freestyle::_global, A, B, Freestyle::Grid::castRay(), center, Freestyle::FEdge::center3d(), Freestyle::GeomUtils::COINCIDENT, Global::debug, blender::robust_pred::epsilon, fabs(), Freestyle::FEdgeSmooth::face(), G_DEBUG_FREESTYLE, Freestyle::WShape::GetId(), Freestyle::FEdge::getId(), Freestyle::Grid::getOrigin(), Freestyle::WFace::GetVertex(), Freestyle::Grid::gridSize(), if(), Freestyle::GeomUtils::intersectRayPlane(), Freestyle::FEdge::isSmooth(), LOGGING, Freestyle::VecMat::Vec< T, N >::norm(), normal, Freestyle::VecMat::Vec< T, N >::normalize(), Freestyle::SVertex::point2d(), Freestyle::SVertex::point3D(), Freestyle::WFace::RetrieveVertexList(), Freestyle::SilhouetteGeomEngine::retrieveViewport(), Freestyle::WVertex::shape(), t, Freestyle::WFace::userdata, v1, Freestyle::FEdge::vertexA(), Freestyle::FEdge::vertexB(), Freestyle::VecMat::Vec3< T >::x(), Freestyle::VecMat::Vec3< T >::y(), and Freestyle::VecMat::Vec3< T >::z().

◆ ComputeRayCastingVisibility() [2/2]

void Freestyle::ViewMapBuilder::ComputeRayCastingVisibility ( ViewMap ioViewMap,
real  epsilon = 1.0e-6 
)
protected

Computes the 2D scene silhouette edges visibility using a ray casting. On each edge, a ray is cast to check its quantitative invisibility. The list of occluders are each time stored in the tested edge. ioViewMap The view map. The 2D scene silhouette edges as FEdges. These edges have already been splitted at their intersections points. Thus, these edges do not intersect anymore. The visibility corresponding to each edge of ioScene is set is this edge.

Definition at line 1537 of file ViewMapBuilder.cpp.

References Freestyle::_global, counter, Global::debug, blender::robust_pred::epsilon, Freestyle::ViewMap::FEdges(), float(), G_DEBUG_FREESTYLE, Freestyle::WShape::GetId(), Freestyle::Geometry::Polygon< Point >::getId(), Freestyle::WFace::GetVertex(), Freestyle::gProgressBarMaxSteps, Freestyle::gProgressBarMinSize, min, Freestyle::FEdge::nextEdge(), NULL, Freestyle::FEdge::occluders_size(), Freestyle::FEdge::setaFace(), Freestyle::FEdge::setOccludeeEmpty(), Freestyle::WVertex::shape(), Freestyle::ViewMap::ViewEdges(), and Freestyle::ViewMap::viewShape().

◆ ComputeSweepLineIntersections()

void Freestyle::ViewMapBuilder::ComputeSweepLineIntersections ( ViewMap ioViewMap,
real  epsilon = 1.0e-6 
)
protected

◆ ComputeVeryFastRayCastingVisibility()

void Freestyle::ViewMapBuilder::ComputeVeryFastRayCastingVisibility ( ViewMap ioViewMap,
real  epsilon = 1.0e-6 
)
protected

◆ CullViewEdges()

void Freestyle::ViewMapBuilder::CullViewEdges ( ViewMap ioViewMap,
real  viewProscenium[4],
real  occluderProscenium[4],
bool  extensiveFEdgeSearch = true 
)

◆ DetectCusps()

void Freestyle::ViewMapBuilder::DetectCusps ( ViewEdge ioEdge)

Detects cusps (for a single ViewEdge) among SVertices and builds a ViewVertex on top of each cusp SVertex We use a hysteresis approach to avoid noise.

◆ FindOccludee() [1/2]

void Freestyle::ViewMapBuilder::FindOccludee ( FEdge fe,
Grid iGrid,
real  epsilon,
Polygon3r **  oaPolygon,
unsigned  timestamp 
)
protected

◆ FindOccludee() [2/2]

void Freestyle::ViewMapBuilder::FindOccludee ( FEdge fe,
Grid iGrid,
real  epsilon,
Polygon3r **  oaPolygon,
unsigned  timestamp,
Vec3r u,
Vec3r A,
Vec3r origin,
Vec3r edgeDir,
vector< WVertex * > &  faceVertices 
)
protected

◆ setEnableQI()

void Freestyle::ViewMapBuilder::setEnableQI ( bool  iBool)
inline

Definition at line 199 of file ViewMapBuilder.h.

Referenced by Freestyle::Controller::ComputeViewMap().

◆ setFrustum()

void Freestyle::ViewMapBuilder::setFrustum ( real  iZnear,
real  iZfar 
)
inline

◆ setGrid()

void Freestyle::ViewMapBuilder::setGrid ( Grid iGrid)
inline

Definition at line 181 of file ViewMapBuilder.h.

Referenced by Freestyle::Controller::ComputeViewMap().

◆ setProgressBar()

void Freestyle::ViewMapBuilder::setProgressBar ( ProgressBar iProgressBar)
inline

accessors Modifiers

Definition at line 189 of file ViewMapBuilder.h.

◆ setRenderMonitor()

void Freestyle::ViewMapBuilder::setRenderMonitor ( RenderMonitor iRenderMonitor)
inline

Definition at line 194 of file ViewMapBuilder.h.

Referenced by Freestyle::Controller::ComputeViewMap().

◆ setTransform()

void Freestyle::ViewMapBuilder::setTransform ( const real  iModelViewMatrix[4][4],
const real  iProjectionMatrix[4][4],
const int  iViewport[4],
real  iFocalLength,
real  ,
real   
)
inline

Sets the current transformation iModelViewMatrix The 4x4 model view matrix, in column major order (openGL like). iProjection matrix The 4x4 projection matrix, in column major order (openGL like). iViewport The viewport. 4 real array: origin.x, origin.y, width, length

Definition at line 125 of file ViewMapBuilder.h.

References Freestyle::SilhouetteGeomEngine::setTransform().

Referenced by Freestyle::Controller::ComputeViewMap().

◆ setViewpoint()

void Freestyle::ViewMapBuilder::setViewpoint ( const Vec3r ivp)
inline

Sets the current viewpoint

Definition at line 111 of file ViewMapBuilder.h.

References Freestyle::SilhouetteGeomEngine::setViewpoint().

Referenced by Freestyle::Controller::ComputeViewMap().


The documentation for this class was generated from the following files: