Blender
V3.3
|
#include <ViewMapBuilder.h>
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) |
ViewMap * | BuildViewMap (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) |
Definition at line 42 of file ViewMapBuilder.h.
Enumerator | |
---|---|
sweep_line |
Definition at line 61 of file ViewMapBuilder.h.
Definition at line 65 of file ViewMapBuilder.h.
|
inline |
Definition at line 75 of file ViewMapBuilder.h.
References NULL.
|
inline |
Definition at line 87 of file ViewMapBuilder.h.
References NULL.
void Freestyle::ViewMapBuilder::BuildGrid | ( | WingedEdge & | we, |
const BBox< Vec3r > & | bbox, | ||
unsigned int | sceneNumFaces | ||
) |
Build non-culled Grid in camera space for ray casting
Definition at line 1006 of file ViewMapBuilder.cpp.
References Freestyle::_global, Global::debug, fabs(), Freestyle::WFillGrid::fillGrid(), G_DEBUG_FREESTYLE, Freestyle::BBox< Point >::getMax(), Freestyle::BBox< Point >::getMin(), and size().
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().
|
protected |
Definition at line 1359 of file ViewMapBuilder.cpp.
References usdtokens::density(), blender::robust_pred::epsilon, Freestyle::GridDensityProviderFactory::newGridDensityProvider(), and transform().
Compute Cusps
Definition at line 1282 of file ViewMapBuilder.cpp.
References A, B, Freestyle::Nature::CUSP, Freestyle::ViewVertex::getNature(), Freestyle::ViewMap::InsertViewVertex(), Freestyle::FEdge::nextEdge(), normal, Freestyle::VecMat::Vec< T, N >::normalize(), Freestyle::ViewVertex::setNature(), Freestyle::Nature::SILHOUETTE, Freestyle::FEdge::vertexA(), Freestyle::ViewMap::ViewEdges(), and Freestyle::VecMat::Vec3< T >::z().
|
protected |
Definition at line 1397 of file ViewMapBuilder.cpp.
References usdtokens::density(), blender::robust_pred::epsilon, Freestyle::GridDensityProviderFactory::newGridDensityProvider(), and transform().
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.
|
protected |
Definition at line 1694 of file ViewMapBuilder.cpp.
References counter, blender::robust_pred::epsilon, Freestyle::ViewMap::FEdges(), Freestyle::WShape::GetId(), Freestyle::WFace::GetVertex(), Freestyle::gProgressBarMaxSteps, Freestyle::gProgressBarMinSize, min, Freestyle::FEdge::nextEdge(), Freestyle::FEdge::setaFace(), Freestyle::WVertex::shape(), Freestyle::ViewMap::ViewEdges(), and Freestyle::ViewMap::viewShape().
void Freestyle::ViewMapBuilder::computeInitialViewEdges | ( | WingedEdge & | we | ) |
Compute Shapes from a WingedEdge containing a list of WShapes
Definition at line 1239 of file ViewMapBuilder.cpp.
References Freestyle::SShape::ComputeBBox(), Freestyle::WingedEdge::getWShapes(), Freestyle::SShape::setFrsMaterials(), Freestyle::SShape::setId(), Freestyle::SShape::setLibraryPath(), and Freestyle::SShape::setName().
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().
|
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().
|
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().
|
protected |
Computes intersections on all edges of the scene using a sweep line algorithm
Definition at line 2325 of file ViewMapBuilder.cpp.
References Freestyle::_global, A1, A2, Freestyle::B1(), Freestyle::B2(), counter, Freestyle::ViewMap::CreateTVertex(), Global::debug, blender::robust_pred::epsilon, Freestyle::ViewMap::FEdges(), G_DEBUG_FREESTYLE, Freestyle::SVertex::getId(), Freestyle::gProgressBarMaxSteps, Freestyle::gProgressBarMinSize, id, Freestyle::SilhouetteGeomEngine::ImageToWorldParameter(), Freestyle::SweepLine< T, Point >::intersectedEdges(), Freestyle::SweepLine< T, Point >::intersections(), min, Freestyle::SVertex::point2D(), Freestyle::SVertex::point3D(), Freestyle::SweepLine< T, Point >::process(), sort(), Freestyle::ViewShape::SplitEdge(), Freestyle::ViewMap::SVertices(), Freestyle::ViewVertex::userdata, Freestyle::FEdge::vertexA(), Freestyle::FEdge::vertexB(), Freestyle::FEdge::viewedge(), Freestyle::ViewMap::ViewEdges(), and Freestyle::ViewEdge::viewShape().
|
protected |
Definition at line 1827 of file ViewMapBuilder.cpp.
References counter, blender::robust_pred::epsilon, Freestyle::ViewMap::FEdges(), Freestyle::WShape::GetId(), Freestyle::WFace::GetVertex(), Freestyle::gProgressBarMaxSteps, Freestyle::gProgressBarMinSize, min, Freestyle::FEdge::setaFace(), Freestyle::WVertex::shape(), Freestyle::Geometry::Polygon< Point >::userdata, Freestyle::ViewMap::ViewEdges(), and Freestyle::ViewMap::viewShape().
void Freestyle::ViewMapBuilder::CullViewEdges | ( | ViewMap * | ioViewMap, |
real | viewProscenium[4], | ||
real | occluderProscenium[4], | ||
bool | extensiveFEdgeSearch = true |
||
) |
Definition at line 1078 of file ViewMapBuilder.cpp.
References Freestyle::_global, Freestyle::FEdge::center2d(), Freestyle::crossesProscenium(), Global::debug, Freestyle::distance2D(), blender::robust_pred::epsilon, G_DEBUG_FREESTYLE, Freestyle::GridHelpers::getDefaultViewProscenium(), Freestyle::insideProscenium(), Freestyle::FEdge::isInImage(), Freestyle::FEdge::nextEdge(), point, Freestyle::FEdge::setIsInImage(), and Freestyle::ViewMap::ViewEdges().
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 1988 of file ViewMapBuilder.cpp.
References A, blender::robust_pred::epsilon, Freestyle::FEdgeSmooth::face(), Freestyle::Id::getFirst(), Freestyle::FEdge::getId(), getOrigin(), Freestyle::Id::getSecond(), Freestyle::FEdge::isSmooth(), Freestyle::VecMat::Vec< T, N >::normalize(), and Freestyle::WFace::RetrieveVertexList().
|
protected |
Definition at line 1881 of file ViewMapBuilder.cpp.
References A, Freestyle::Nature::BORDER, Freestyle::Grid::castInfiniteRay(), Freestyle::GeomUtils::COINCIDENT, blender::robust_pred::epsilon, fabs(), Freestyle::FEdgeSmooth::face(), Freestyle::GeomUtils::intersectRayPlane(), Freestyle::FEdge::isSmooth(), normal, Freestyle::FEdge::setOccludeeIntersection(), Freestyle::Nature::SILHOUETTE, t, Freestyle::WFace::userdata, v, and v1.
Definition at line 199 of file ViewMapBuilder.h.
Referenced by Freestyle::Controller::ComputeViewMap().
Definition at line 137 of file ViewMapBuilder.h.
References Freestyle::SilhouetteGeomEngine::setFrustum().
Referenced by Freestyle::Controller::ComputeViewMap().
Definition at line 181 of file ViewMapBuilder.h.
Referenced by Freestyle::Controller::ComputeViewMap().
|
inline |
accessors Modifiers
Definition at line 189 of file ViewMapBuilder.h.
|
inline |
Definition at line 194 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 125 of file ViewMapBuilder.h.
References Freestyle::SilhouetteGeomEngine::setTransform().
Referenced by Freestyle::Controller::ComputeViewMap().
Sets the current viewpoint
Definition at line 111 of file ViewMapBuilder.h.
References Freestyle::SilhouetteGeomEngine::setViewpoint().
Referenced by Freestyle::Controller::ComputeViewMap().