Blender V4.3
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, uint 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, uint 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, uint 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, uint timestamp)
 
void FindOccludee (FEdge *fe, Grid *iGrid, real epsilon, Polygon3r **oaPolygon, uint timestamp)
 
void FindOccludee (FEdge *fe, Grid *iGrid, real epsilon, Polygon3r **oaPolygon, uint timestamp, Vec3r &u, Vec3r &A, Vec3r &origin, Vec3r &edgeDir, vector< WVertex * > &faceVertices)
 

Detailed Description

Definition at line 44 of file ViewMapBuilder.h.

Member Enumeration Documentation

◆ intersection_algo

Enumerator
sweep_line 

Definition at line 63 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 67 of file ViewMapBuilder.h.

Constructor & Destructor Documentation

◆ ViewMapBuilder()

Freestyle::ViewMapBuilder::ViewMapBuilder ( )
inline

Definition at line 77 of file ViewMapBuilder.h.

◆ ~ViewMapBuilder()

Freestyle::ViewMapBuilder::~ViewMapBuilder ( )
inline

Definition at line 89 of file ViewMapBuilder.h.

Member Function Documentation

◆ BuildGrid()

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

◆ BuildViewMap()

ViewMap * Freestyle::ViewMapBuilder::BuildViewMap ( WingedEdge & we,
visibility_algo iAlgo,
real epsilon,
const BBox< Vec3r > & bbox,
uint 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 1043 of file ViewMapBuilder.cpp.

References computeCusps(), ComputeEdgesVisibility(), computeInitialViewEdges(), ComputeIntersections(), and sweep_line.

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()

◆ ComputeDetailedVisibility()

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

◆ ComputeEdgesVisibility()

◆ ComputeFastRayCastingVisibility()

◆ computeInitialViewEdges()

◆ 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 2248 of file ViewMapBuilder.cpp.

References Freestyle::_global, Freestyle::TVertex::backEdgeA(), Freestyle::TVertex::backEdgeB(), ComputeSweepLineIntersections(), Freestyle::TVertex::frontEdgeA(), Freestyle::TVertex::frontEdgeB(), G_DEBUG_FREESTYLE, Freestyle::TVertex::getId(), sweep_line, Freestyle::Nature::T_VERTEX, and Freestyle::ViewMap::ViewVertices().

Referenced by BuildViewMap().

◆ ComputeRayCastingVisibility() [1/2]

int Freestyle::ViewMapBuilder::ComputeRayCastingVisibility ( FEdge * fe,
Grid * iGrid,
real epsilon,
set< ViewShape * > & oOccluders,
Polygon3r ** oaPolygon,
uint 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 2041 of file ViewMapBuilder.cpp.

References Freestyle::_global, A, B, Freestyle::Grid::castRay(), Freestyle::FEdge::center3d(), Freestyle::GeomUtils::COINCIDENT, fabs(), Freestyle::FEdgeSmooth::face(), FindOccludee(), G_DEBUG_FREESTYLE, Freestyle::WShape::GetId(), Freestyle::FEdge::getId(), Freestyle::Grid::getOrigin(), Freestyle::WFace::GetVertex(), Freestyle::Grid::gridSize(), Freestyle::GeomUtils::intersectRayPlane(), Freestyle::FEdge::isSmooth(), Freestyle::VecMat::Vec< T, N >::norm(), Freestyle::VecMat::Vec< T, N >::normalize(), Freestyle::SVertex::point2d(), Freestyle::SVertex::point3D(), Freestyle::WFace::RetrieveVertexList(), Freestyle::SilhouetteGeomEngine::retrieveViewport(), Freestyle::WVertex::shape(), Freestyle::WFace::userdata, Freestyle::FEdge::vertexA(), Freestyle::FEdge::vertexB(), Freestyle::ViewMap::viewShape(), 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 1550 of file ViewMapBuilder.cpp.

References Freestyle::_global, ComputeRayCastingVisibility(), Freestyle::ViewMap::FEdges(), FindOccludee(), float, G_DEBUG_FREESTYLE, Freestyle::WShape::GetId(), Freestyle::Geometry::Polygon< Point >::getId(), Freestyle::ProgressBar::getProgress(), Freestyle::WFace::GetVertex(), Freestyle::gProgressBarMaxSteps, Freestyle::gProgressBarMinSize, min, Freestyle::FEdge::nextEdge(), Freestyle::FEdge::occluders_size(), Freestyle::ProgressBar::reset(), Freestyle::FEdge::setaFace(), Freestyle::ProgressBar::setLabelText(), Freestyle::FEdge::setOccludeeEmpty(), Freestyle::ProgressBar::setProgress(), Freestyle::ProgressBar::setTotalSteps(), Freestyle::WVertex::shape(), Freestyle::RenderMonitor::testBreak(), Freestyle::ViewMap::ViewEdges(), and Freestyle::ViewMap::viewShape().

Referenced by ComputeEdgesVisibility(), ComputeFastRayCastingVisibility(), ComputeRayCastingVisibility(), and ComputeVeryFastRayCastingVisibility().

◆ ComputeSweepLineIntersections()

◆ ComputeVeryFastRayCastingVisibility()

◆ CullViewEdges()

◆ 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]

◆ FindOccludee() [2/2]

◆ setEnableQI()

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

Definition at line 201 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 183 of file ViewMapBuilder.h.

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

◆ setProgressBar()

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

accessors Modifiers

Definition at line 191 of file ViewMapBuilder.h.

◆ setRenderMonitor()

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

Definition at line 196 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 127 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 113 of file ViewMapBuilder.h.

References Freestyle::SilhouetteGeomEngine::setViewpoint().

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


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