|
Blender V4.3
|
#include <ViewMapBuilder.h>
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) |
| ViewMap * | BuildViewMap (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) |
Definition at line 44 of file ViewMapBuilder.h.
| Enumerator | |
|---|---|
| sweep_line | |
Definition at line 63 of file ViewMapBuilder.h.
Definition at line 67 of file ViewMapBuilder.h.
|
inline |
Definition at line 77 of file ViewMapBuilder.h.
|
inline |
Definition at line 89 of file ViewMapBuilder.h.
| void Freestyle::ViewMapBuilder::BuildGrid | ( | WingedEdge & | we, |
| const BBox< Vec3r > & | bbox, | ||
| uint | sceneNumFaces ) |
Build non-culled Grid in camera space for ray casting
Definition at line 1018 of file ViewMapBuilder.cpp.
References Freestyle::_global, Freestyle::Grid::clear(), Freestyle::Grid::configure(), Freestyle::Grid::displayDebug(), fabs(), Freestyle::WFillGrid::fillGrid(), G_DEBUG_FREESTYLE, Freestyle::BBox< Point >::getMax(), Freestyle::BBox< Point >::getMin(), and size().
Referenced by ComputeEdgesVisibility().
| 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().
|
protected |
Definition at line 1372 of file ViewMapBuilder.cpp.
References Freestyle::computeCumulativeVisibility(), Freestyle::GridDensityProviderFactory::newGridDensityProvider(), and transform().
Referenced by ComputeEdgesVisibility().
| void Freestyle::ViewMapBuilder::computeCusps | ( | ViewMap * | ioViewMap | ) |
Compute Cusps
Definition at line 1296 of file ViewMapBuilder.cpp.
References A, B, Freestyle::Nature::CUSP, Freestyle::ViewVertex::getNature(), Freestyle::ViewMap::InsertViewVertex(), Freestyle::FEdge::nextEdge(), Freestyle::VecMat::Vec< T, N >::normalize(), Freestyle::ViewVertex::setNature(), Freestyle::Nature::SILHOUETTE, Freestyle::RenderMonitor::testBreak(), Freestyle::FEdge::vertexA(), Freestyle::ViewMap::ViewEdges(), and Freestyle::VecMat::Vec3< T >::z().
Referenced by BuildViewMap().
|
protected |
Definition at line 1410 of file ViewMapBuilder.cpp.
References Freestyle::computeDetailedVisibility(), Freestyle::GridDensityProviderFactory::newGridDensityProvider(), and transform().
Referenced by ComputeEdgesVisibility().
| void Freestyle::ViewMapBuilder::ComputeEdgesVisibility | ( | ViewMap * | ioViewMap, |
| WingedEdge & | we, | ||
| const BBox< Vec3r > & | bbox, | ||
| uint | 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 1448 of file ViewMapBuilder.cpp.
References Freestyle::_global, BuildGrid(), ComputeCumulativeVisibility(), ComputeDetailedVisibility(), ComputeFastRayCastingVisibility(), ComputeRayCastingVisibility(), ComputeVeryFastRayCastingVisibility(), G_DEBUG_FREESTYLE, ray_casting, ray_casting_adaptive_cumulative, ray_casting_adaptive_traditional, ray_casting_culled_adaptive_cumulative, ray_casting_culled_adaptive_traditional, ray_casting_fast, and ray_casting_very_fast.
Referenced by BuildViewMap().
|
protected |
Definition at line 1707 of file ViewMapBuilder.cpp.
References ComputeRayCastingVisibility(), Freestyle::ViewMap::FEdges(), FindOccludee(), Freestyle::WShape::GetId(), Freestyle::ProgressBar::getProgress(), Freestyle::WFace::GetVertex(), Freestyle::gProgressBarMaxSteps, Freestyle::gProgressBarMinSize, min, Freestyle::FEdge::nextEdge(), Freestyle::ProgressBar::reset(), Freestyle::FEdge::setaFace(), Freestyle::ProgressBar::setLabelText(), Freestyle::ProgressBar::setProgress(), Freestyle::ProgressBar::setTotalSteps(), Freestyle::WVertex::shape(), Freestyle::RenderMonitor::testBreak(), Freestyle::ViewMap::ViewEdges(), and Freestyle::ViewMap::viewShape().
Referenced by ComputeEdgesVisibility().
| void Freestyle::ViewMapBuilder::computeInitialViewEdges | ( | WingedEdge & | we | ) |
Compute Shapes from a WingedEdge containing a list of WShapes
Definition at line 1253 of file ViewMapBuilder.cpp.
References Freestyle::ViewMap::AddViewShape(), Freestyle::ViewEdgeXBuilder::BuildViewEdges(), Freestyle::SShape::ComputeBBox(), Freestyle::ViewEdgeXBuilder::currentFId(), Freestyle::ViewEdgeXBuilder::currentSVertexId(), Freestyle::ViewEdgeXBuilder::currentViewId(), Freestyle::ViewMap::FEdges(), Freestyle::WingedEdge::getWShapes(), Freestyle::ViewEdgeXBuilder::setCurrentFId(), Freestyle::ViewEdgeXBuilder::setCurrentSVertexId(), Freestyle::ViewEdgeXBuilder::setCurrentViewId(), Freestyle::SShape::setFrsMaterials(), Freestyle::SShape::setId(), Freestyle::SShape::setLibraryPath(), Freestyle::SShape::setName(), Freestyle::ViewMap::SVertices(), Freestyle::RenderMonitor::testBreak(), Freestyle::ViewMap::ViewEdges(), and Freestyle::ViewMap::ViewVertices().
Referenced by BuildViewMap().
| 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().
|
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().
|
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().
|
protected |
Computes intersections on all edges of the scene using a sweep line algorithm
Definition at line 2344 of file ViewMapBuilder.cpp.
References Freestyle::_global, A1, A2, Freestyle::B1(), Freestyle::B2(), Freestyle::ViewMap::CreateTVertex(), Freestyle::ViewMap::FEdges(), G_DEBUG_FREESTYLE, Freestyle::SVertex::getId(), Freestyle::ProgressBar::getProgress(), Freestyle::gProgressBarMaxSteps, Freestyle::gProgressBarMinSize, Freestyle::SilhouetteGeomEngine::ImageToWorldParameter(), Freestyle::SweepLine< T, Point >::intersectedEdges(), Freestyle::SweepLine< T, Point >::intersections(), min, Freestyle::SVertex::point2D(), Freestyle::SVertex::point3D(), printf, Freestyle::SweepLine< T, Point >::process(), Freestyle::ProgressBar::reset(), Freestyle::ProgressBar::setLabelText(), Freestyle::ProgressBar::setProgress(), Freestyle::ProgressBar::setTotalSteps(), sort(), Freestyle::ViewMap::SVertices(), Freestyle::RenderMonitor::testBreak(), Freestyle::ViewVertex::userdata, Freestyle::FEdge::vertexA(), Freestyle::FEdge::vertexB(), Freestyle::FEdge::viewedge(), Freestyle::ViewMap::ViewEdges(), and Freestyle::ViewEdge::viewShape().
Referenced by ComputeIntersections().
|
protected |
Definition at line 1840 of file ViewMapBuilder.cpp.
References ComputeRayCastingVisibility(), Freestyle::ViewMap::FEdges(), Freestyle::WShape::GetId(), Freestyle::ProgressBar::getProgress(), Freestyle::WFace::GetVertex(), Freestyle::gProgressBarMaxSteps, Freestyle::gProgressBarMinSize, min, Freestyle::ProgressBar::reset(), Freestyle::FEdge::setaFace(), Freestyle::ProgressBar::setLabelText(), Freestyle::ProgressBar::setProgress(), Freestyle::ProgressBar::setTotalSteps(), Freestyle::WVertex::shape(), Freestyle::RenderMonitor::testBreak(), Freestyle::Geometry::Polygon< Point >::userdata, Freestyle::ViewMap::ViewEdges(), and Freestyle::ViewMap::viewShape().
Referenced by ComputeEdgesVisibility().
| void Freestyle::ViewMapBuilder::CullViewEdges | ( | ViewMap * | ioViewMap, |
| real | viewProscenium[4], | ||
| real | occluderProscenium[4], | ||
| bool | extensiveFEdgeSearch = true ) |
Definition at line 1090 of file ViewMapBuilder.cpp.
References Freestyle::_global, Freestyle::FEdge::center2d(), Freestyle::crossesProscenium(), Freestyle::distance2D(), G_DEBUG_FREESTYLE, Freestyle::GridHelpers::getDefaultViewProscenium(), Freestyle::insideProscenium(), Freestyle::FEdge::isInImage(), Freestyle::FEdge::nextEdge(), Freestyle::FEdge::setIsInImage(), and Freestyle::ViewMap::ViewEdges().
| 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.
|
protected |
Definition at line 2003 of file ViewMapBuilder.cpp.
References A, Freestyle::FEdgeSmooth::face(), FindOccludee(), Freestyle::Id::getFirst(), Freestyle::FEdge::getId(), getOrigin(), Freestyle::Id::getSecond(), Freestyle::FEdge::isSmooth(), Freestyle::VecMat::Vec< T, N >::normalize(), and Freestyle::VecMat::Vec3< T >::z().
Referenced by ComputeFastRayCastingVisibility(), ComputeRayCastingVisibility(), ComputeRayCastingVisibility(), and FindOccludee().
|
protected |
Definition at line 1894 of file ViewMapBuilder.cpp.
References Freestyle::Nature::BORDER, Freestyle::Grid::castInfiniteRay(), Freestyle::GeomUtils::COINCIDENT, fabs(), Freestyle::FEdgeSmooth::face(), FLT_MAX, Freestyle::GeomUtils::intersectRayPlane(), Freestyle::FEdge::isSmooth(), Freestyle::FEdge::setOccludeeIntersection(), Freestyle::Nature::SILHOUETTE, Freestyle::WFace::userdata, and v.
|
inline |
Definition at line 201 of file ViewMapBuilder.h.
Referenced by Freestyle::Controller::ComputeViewMap().
Definition at line 139 of file ViewMapBuilder.h.
References Freestyle::SilhouetteGeomEngine::setFrustum().
Referenced by Freestyle::Controller::ComputeViewMap().
|
inline |
Definition at line 183 of file ViewMapBuilder.h.
Referenced by Freestyle::Controller::ComputeViewMap().
|
inline |
accessors Modifiers
Definition at line 191 of file ViewMapBuilder.h.
|
inline |
Definition at line 196 of file ViewMapBuilder.h.
Referenced by Freestyle::Controller::ComputeViewMap().
|
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().
|
inline |
Sets the current viewpoint
Definition at line 113 of file ViewMapBuilder.h.
References Freestyle::SilhouetteGeomEngine::setViewpoint().
Referenced by Freestyle::Controller::ComputeViewMap().