22 #include "../geometry/GeomUtils.h"
23 #include "../geometry/GridHelpers.h"
25 #include "../winged_edge/WFillGrid.h"
38 template<
typename G,
typename I>
48 vector<WVertex *> &faceVertices)
50 WFace *face =
nullptr;
63 Vec3r v(-u[0], -u[1], -u[2]);
64 bool noIntersection =
true;
67 for (occluders.initAfterTarget(); occluders.validAfterTarget(); occluders.nextOccludee()) {
70 cout <<
"\t\tEvaluating intersection for occludee " << occluders.getWFace() <<
" and ray "
71 <<
A <<
" * " << u << endl;
74 oface = occluders.getWFace();
75 Polygon3r *p = occluders.getCameraSpacePolygon();
79 if (
nullptr != face) {
86 if (faceVertices.empty()) {
90 for (vector<WVertex *>::iterator fv = faceVertices.begin(), fvend = faceVertices.end();
93 if ((*fv)->isBoundary()) {
98 for (ie = iebegin; ie != ieend; ++ie) {
99 if ((*ie) ==
nullptr) {
103 WFace *sface = (*ie)->GetbFace();
104 if (sface == oface) {
125 cout <<
"\t\tRejecting occluder for target coincidence." << endl;
135 cout <<
"\t\tRay " <<
A <<
" * " <<
v <<
" intersects at time " <<
t << endl;
136 cout <<
"\t\t(v * normal) == " << (
v * p->
getNormal()) <<
" for normal "
145 noIntersection =
false;
149 cout <<
"\t\tIs occludee" << endl;
156 occluders.reportDepth(
A,
v,
t);
160 if (noIntersection) {
166 template<
typename G,
typename I>
172 A =
Vec3r(((fe)->vertexA()->point3D() + (fe)->vertexB()->point3D()) / 2.0);
173 edgeDir =
Vec3r((fe)->vertexB()->point3D() - (fe)->vertexA()->point3D());
175 origin =
Vec3r((fe)->vertexA()->point3D());
177 if (grid.orthographicProjection()) {
178 u =
Vec3r(0.0, 0.0, grid.viewpoint().z() -
A.z());
181 u =
Vec3r(grid.viewpoint() -
A);
185 vector<WVertex *> faceVertices;
187 WFace *face =
nullptr;
198 findOccludee<G, I>(fe, grid, occluders,
epsilon, oaFace, u,
A, origin, edgeDir, faceVertices);
203 template<
typename G,
typename I>
210 set<ViewShape *> *foundOccluders)
224 if (grid.orthographicProjection()) {
228 vp =
Vec3r(grid.viewpoint());
234 WFace *face =
nullptr;
239 vector<WVertex *> faceVertices;
251 for (occluders.initBeforeTarget(); occluders.validBeforeTarget(); occluders.nextOccluder()) {
256 oface = occluders.getWFace();
257 Polygon3r *p = occluders.getCameraSpacePolygon();
261 cout <<
"\t\tEvaluating intersection for occluder " << (p->
getVertices())[0]
263 <<
"\t\t\tand ray " << vp <<
" * " << u <<
" (center " <<
center <<
")" << endl;
271 vector<Vec3r> points;
273 for (vector<WOEdge *>::const_iterator woe = oface->
getEdgeList().begin(),
277 points.push_back(
Vec3r((*woe)->GetaVertex()->GetVertex()));
295 cout <<
"\t\tDetermining face adjacency...";
303 cout <<
" Rejecting occluder for face concurrency." << endl;
309 for (vector<WVertex *>::iterator fv = faceVertices.begin(), fvend = faceVertices.end();
312 if ((*fv)->isBoundary()) {
318 for (ie = iebegin; ie != ieend; ++ie) {
319 if ((*ie) ==
nullptr) {
323 WFace *sface = (*ie)->GetbFace();
326 if (sface == oface) {
338 cout <<
" Rejecting occluder for face adjacency." << endl;
352 cout <<
"\t\tRejecting occluder for target coincidence." << endl;
363 cout <<
"\t\tRay should intersect at time " << (rl -
x) <<
". Center: " <<
center
364 <<
", V: " <<
v <<
", RL: " << rl <<
", T:" <<
x << endl;
367 cout <<
"\t\tRay should not intersect. Center: " <<
center <<
", V: " <<
v
368 <<
", RL: " << rl << endl;
376 cout <<
"\t\tRay " <<
center <<
" * " << u <<
" intersects at time " <<
t
377 <<
" (raylength is " << raylength <<
")" << endl;
378 cout <<
"\t\t(u * normal) == " << (u * p->
getNormal()) <<
" for normal " << p->
getNormal()
383 if ((
t > 0.0) && (
t < raylength)) {
386 cout <<
"\t\tIs occluder" << endl;
389 if (foundOccluders !=
nullptr) {
391 foundOccluders->insert(vshape);
395 if (!grid.enableQI()) {
400 occluders.reportDepth(
center, u,
t);
407 fe, grid, occluders,
epsilon, oaWFace, u,
center, origin, edgeDir, faceVertices);
421 template<
typename G,
typename I>
427 vector<ViewEdge *> &vedges = ioViewMap->
ViewEdges();
431 vector<WFace *> wFaces;
432 WFace *wFace =
nullptr;
434 unsigned count_step = (unsigned)
ceil(0.01f * vedges.size());
436 unsigned qiClasses[256];
437 unsigned maxIndex, maxCard;
439 for (vector<ViewEdge *>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) {
440 if (iRenderMonitor) {
444 if (
count % count_step == 0) {
446 ss <<
"Freestyle: Visibility computations " << (100 *
count / vedges.size()) <<
"%";
447 iRenderMonitor->
setInfo(ss.str());
454 cout <<
"Processing ViewEdge " << (*ve)->getId() << endl;
458 if (!(*ve)->isInImage()) {
461 (*ve)->setaShape(
nullptr);
464 cout <<
"\tCulled." << endl;
471 festart = (*ve)->fedgeA();
472 fe = (*ve)->fedgeA();
479 }
while (fe && fe != festart);
481 if (qiMajority == 0) {
485 cout <<
"View Edge in viewport without occludable FEdges: " << (*ve)->
getId() << endl;
490 (*ve)->setaShape(
nullptr);
499 cout <<
"\tqiMajority: " << qiMajority << endl;
507 memset(qiClasses, 0, 256 *
sizeof(*qiClasses));
508 set<ViewShape *> foundOccluders;
510 fe = (*ve)->fedgeA();
516 if (maxCard < qiMajority) {
518 tmpQI = computeVisibility<G, I>(
519 ioViewMap, fe, grid,
epsilon, *ve, &wFace, &foundOccluders);
522 cout <<
"\tFEdge: visibility " << tmpQI << endl;
529 cerr <<
"Warning: too many occluding levels" << endl;
534 if (++qiClasses[tmpQI] > maxCard) {
535 maxCard = qiClasses[tmpQI];
542 findOccludee<G, I>(fe, grid,
epsilon, *ve, &wFace);
545 cout <<
"\tFEdge: occludee only (" << (wFace !=
NULL ?
"found" :
"not found") <<
")"
553 vector<Vec3r> vertices;
554 for (
int i = 0, numEdges = wFace->
numberOfEdges(); i < numEdges; ++i) {
560 wFaces.push_back(wFace);
564 cout <<
"\tFound occludee" << endl;
574 }
while ((maxCard < qiMajority) && (fe) && (fe != festart));
578 cout <<
"\tFinished with " << nSamples <<
" samples, maxCard = " << maxCard << endl;
585 for (
unsigned count = 0, i = 0; i < 256; ++i) {
586 count += qiClasses[i];
587 if (
count >= qiMajority) {
595 for (set<ViewShape *>::iterator o = foundOccluders.begin(), oend = foundOccluders.end();
598 (*ve)->AddOccluder((*o));
602 cout <<
"\tConclusion: QI = " << maxIndex <<
", " << (*ve)->occluders_size() <<
" occluders."
609 if (!wFaces.empty()) {
610 if (wFaces.size() <= (
float)nSamples / 2.0f) {
611 (*ve)->setaShape(
nullptr);
615 (*wFaces.begin())->GetVertex(0)->shape()->GetId());
616 (*ve)->setaShape(vshape);
622 if (iRenderMonitor && !vedges.empty()) {
624 ss <<
"Freestyle: Visibility computations " << (100 *
count / vedges.size()) <<
"%";
625 iRenderMonitor->
setInfo(ss.str());
630 template<
typename G,
typename I>
636 vector<ViewEdge *> &vedges = ioViewMap->
ViewEdges();
640 vector<WFace *> wFaces;
641 WFace *wFace =
nullptr;
643 unsigned qiClasses[256];
644 unsigned maxIndex, maxCard;
646 for (vector<ViewEdge *>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) {
647 if (iRenderMonitor && iRenderMonitor->
testBreak()) {
652 cout <<
"Processing ViewEdge " << (*ve)->getId() << endl;
656 if (!(*ve)->isInImage()) {
659 (*ve)->setaShape(
nullptr);
662 cout <<
"\tCulled." << endl;
669 festart = (*ve)->fedgeA();
670 fe = (*ve)->fedgeA();
677 }
while (fe && fe != festart);
679 if (qiMajority == 0) {
683 cout <<
"View Edge in viewport without occludable FEdges: " << (*ve)->
getId() << endl;
688 (*ve)->setaShape(
nullptr);
697 cout <<
"\tqiMajority: " << qiMajority << endl;
705 memset(qiClasses, 0, 256 *
sizeof(*qiClasses));
706 set<ViewShape *> foundOccluders;
708 fe = (*ve)->fedgeA();
714 if (maxCard < qiMajority) {
716 tmpQI = computeVisibility<G, I>(
717 ioViewMap, fe, grid,
epsilon, *ve, &wFace, &foundOccluders);
720 cout <<
"\tFEdge: visibility " << tmpQI << endl;
727 cerr <<
"Warning: too many occluding levels" << endl;
732 if (++qiClasses[tmpQI] > maxCard) {
733 maxCard = qiClasses[tmpQI];
740 findOccludee<G, I>(fe, grid,
epsilon, *ve, &wFace);
743 cout <<
"\tFEdge: occludee only (" << (wFace !=
NULL ?
"found" :
"not found") <<
")"
751 vector<Vec3r> vertices;
752 for (
int i = 0, numEdges = wFace->
numberOfEdges(); i < numEdges; ++i) {
758 wFaces.push_back(wFace);
762 cout <<
"\tFound occludee" << endl;
772 }
while ((maxCard < qiMajority) && (fe) && (fe != festart));
776 cout <<
"\tFinished with " << nSamples <<
" samples, maxCard = " << maxCard << endl;
782 (*ve)->setQI(maxIndex);
786 for (set<ViewShape *>::iterator o = foundOccluders.begin(), oend = foundOccluders.end();
789 (*ve)->AddOccluder((*o));
793 cout <<
"\tConclusion: QI = " << maxIndex <<
", " << (*ve)->
occluders_size() <<
" occluders."
798 if (!wFaces.empty()) {
799 if (wFaces.size() <= (
float)nSamples / 2.0f) {
800 (*ve)->setaShape(
nullptr);
804 (*wFaces.begin())->GetVertex(0)->shape()->GetId());
805 (*ve)->setaShape(vshape);
813 template<
typename G,
typename I>
816 vector<ViewEdge *> &vedges = ioViewMap->
ViewEdges();
819 unsigned nSamples = 0;
820 vector<WFace *> wFaces;
821 WFace *wFace =
nullptr;
823 unsigned qiClasses[256];
824 unsigned maxIndex, maxCard;
827 for (vector<ViewEdge *>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) {
829 if (!(*ve)->isInImage()) {
832 (*ve)->setaShape(
nullptr);
837 festart = (*ve)->fedgeA();
838 fe = (*ve)->fedgeA();
843 if (even_test && fe && fe->
isInImage()) {
845 even_test = !even_test;
848 }
while (fe && fe != festart);
850 if (qiMajority == 0) {
854 cout <<
"View Edge in viewport without occludable FEdges: " << (*ve)->
getId() << endl;
859 (*ve)->setaShape(
nullptr);
870 memset(qiClasses, 0, 256 *
sizeof(*qiClasses));
871 set<ViewShape *> foundOccluders;
873 fe = (*ve)->fedgeA();
880 if (maxCard < qiMajority) {
882 tmpQI = computeVisibility<G, I>(
883 ioViewMap, fe, grid,
epsilon, *ve, &wFace, &foundOccluders);
888 cerr <<
"Warning: too many occluding levels" << endl;
893 if (++qiClasses[tmpQI] > maxCard) {
894 maxCard = qiClasses[tmpQI];
901 findOccludee<G, I>(fe, grid,
epsilon, *ve, &wFace);
905 vector<Vec3r> vertices;
906 for (
int i = 0, numEdges = wFace->
numberOfEdges(); i < numEdges; ++i) {
912 wFaces.push_back(wFace);
917 even_test = !even_test;
919 }
while ((maxCard < qiMajority) && (fe) && (fe != festart));
922 (*ve)->setQI(maxIndex);
925 for (set<ViewShape *>::iterator o = foundOccluders.begin(), oend = foundOccluders.end();
928 (*ve)->AddOccluder((*o));
932 if (!wFaces.empty()) {
933 if (wFaces.size() < nSamples / 2) {
934 (*ve)->setaShape(
nullptr);
938 (*wFaces.begin())->GetVertex(0)->shape()->GetId());
939 (*ve)->setaShape(vshape);
947 template<
typename G,
typename I>
950 vector<ViewEdge *> &vedges = ioViewMap->
ViewEdges();
954 WFace *wFace =
nullptr;
956 for (vector<ViewEdge *>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) {
958 if (!(*ve)->isInImage()) {
961 (*ve)->setaShape(
nullptr);
964 fe = (*ve)->fedgeA();
967 while (fe && !fe->
isInImage() && fe != festart) {
976 cout <<
"View Edge in viewport without occludable FEdges: " << (*ve)->
getId() << endl;
984 qi = computeVisibility<G, I>(ioViewMap, fe, grid,
epsilon, *ve, &wFace,
NULL);
989 vector<Vec3r> vertices;
990 for (
int i = 0, numEdges = wFace->
numberOfEdges(); i < numEdges; ++i) {
997 (*ve)->setaShape(vshape);
1000 (*ve)->setaShape(
nullptr);
1010 for (
unsigned int i = 0; i < 3; i++) {
1017 cout <<
"Warning: the bbox size is 0 in dimension " << i << endl;
1028 _Grid->displayDebug();
1035 unsigned int sceneNumFaces)
1040 _currentSVertexId = 0;
1043 computeInitialViewEdges(we);
1046 computeCusps(_ViewMap);
1049 ComputeIntersections(_ViewMap, sweep_line,
epsilon);
1052 ComputeEdgesVisibility(_ViewMap, we, bbox, sceneNumFaces, iAlgo,
epsilon);
1064 Vec2r min(proscenium[0], proscenium[2]);
1065 Vec2r max(proscenium[1], proscenium[3]);
1074 return !(
point[0] < proscenium[0] ||
point[0] > proscenium[1] ||
point[1] < proscenium[2] ||
1075 point[1] > proscenium[3]);
1079 real viewProscenium[4],
1080 real occluderProscenium[4],
1081 bool extensiveFEdgeSearch)
1093 real prosceniumOrigin[2];
1094 prosceniumOrigin[0] = (viewProscenium[1] - viewProscenium[0]) / 2.0;
1095 prosceniumOrigin[1] = (viewProscenium[3] - viewProscenium[2]) / 2.0;
1097 cout <<
"Proscenium culling:" << endl;
1098 cout <<
"Proscenium: [" << viewProscenium[0] <<
", " << viewProscenium[1] <<
", "
1099 << viewProscenium[2] <<
", " << viewProscenium[3] <<
"]" << endl;
1100 cout <<
"Origin: [" << prosceniumOrigin[0] <<
", " << prosceniumOrigin[1] <<
"]" << endl;
1113 ViewMap::viewedges_container::iterator ve, veend;
1115 for (ve = ioViewMap->
ViewEdges().begin(), veend = ioViewMap->
ViewEdges().end(); ve != veend;
1126 bool bestOccluderTargetFound =
false;
1127 FEdge *bestOccluderTarget =
nullptr;
1128 real bestOccluderDistance = 0.0;
1129 FEdge *festart = (*ve)->fedgeA();
1130 FEdge *fe = festart;
1141 if (!bestOccluderTargetFound) {
1147 bestOccluderTargetFound =
true;
1148 bestOccluderTarget = fe;
1153 if (bestOccluderTarget ==
nullptr || d < bestOccluderDistance) {
1155 bestOccluderDistance = d;
1156 bestOccluderTarget = fe;
1167 }
while (fe && fe != festart && !(bestOccluderTargetFound && (*ve)->isInImage()));
1171 while (fe && fe != festart) {
1178 if ((*ve)->isInImage() && bestOccluderTarget !=
nullptr && !bestOccluderTargetFound) {
1181 if (
point[0] < occluderProscenium[0]) {
1182 occluderProscenium[0] =
point[0];
1184 else if (
point[0] > occluderProscenium[1]) {
1185 occluderProscenium[1] =
point[0];
1187 if (
point[1] < occluderProscenium[2]) {
1188 occluderProscenium[2] =
point[1];
1190 else if (
point[1] > occluderProscenium[3]) {
1191 occluderProscenium[3] =
point[1];
1201 occluderProscenium[0] -=
epsilon;
1202 occluderProscenium[1] +=
epsilon;
1203 occluderProscenium[2] -=
epsilon;
1204 occluderProscenium[3] +=
epsilon;
1217 if (extensiveFEdgeSearch) {
1219 for (ve = ioViewMap->
ViewEdges().begin(), veend = ioViewMap->
ViewEdges().end(); ve != veend;
1221 if (!(*ve)->isInImage()) {
1225 FEdge *festart = (*ve)->fedgeA();
1226 FEdge *fe = festart;
1234 }
while (fe && fe != festart);
1244 for (vector<WShape *>::const_iterator it = wshapes.begin(); it != wshapes.end(); it++) {
1245 if (_pRenderMonitor && _pRenderMonitor->testBreak()) {
1251 psShape->
setId((*it)->GetId());
1252 psShape->
setName((*it)->getName());
1259 _ViewMap->AddViewShape(vshape);
1262 _pViewEdgeBuilder->setCurrentViewId(_currentId);
1264 _pViewEdgeBuilder->setCurrentFId(_currentFId);
1266 _pViewEdgeBuilder->setCurrentSVertexId(_currentFId);
1267 _pViewEdgeBuilder->BuildViewEdges(
dynamic_cast<WXShape *
>(*it),
1269 _ViewMap->ViewEdges(),
1270 _ViewMap->ViewVertices(),
1272 _ViewMap->SVertices());
1274 _currentId = _pViewEdgeBuilder->currentViewId() + 1;
1275 _currentFId = _pViewEdgeBuilder->currentFId() + 1;
1276 _currentSVertexId = _pViewEdgeBuilder->currentSVertexId() + 1;
1284 vector<ViewVertex *> newVVertices;
1285 vector<ViewEdge *> newVEdges;
1287 ViewMap::viewedges_container::iterator ve = vedges.begin(), veend = vedges.end();
1288 for (; ve != veend; ++ve) {
1289 if (_pRenderMonitor && _pRenderMonitor->testBreak()) {
1292 if ((!((*ve)->getNature() &
Nature::SILHOUETTE)) || (!((*ve)->fedgeA()->isSmooth()))) {
1295 FEdge *fe = (*ve)->fedgeA();
1296 FEdge *fefirst = fe;
1298 bool positive =
true;
1301 Vec3r A((fes)->vertexA()->point3d());
1302 Vec3r B((fes)->vertexB()->point3d());
1309 if (_orthographicProjection) {
1310 viewvector =
Vec3r(0.0, 0.0, m.
z() - _viewpoint.z());
1313 viewvector =
Vec3r(m - _viewpoint);
1317 if (((crossP) * (viewvector)) > 0) {
1328 if (((crossP) * (viewvector)) < -0.1) {
1341 if (((crossP) * (viewvector)) > 0.1) {
1351 }
while (fe && fe != fefirst);
1353 for (ve = newVEdges.begin(), veend = newVEdges.end(); ve != veend; ++ve) {
1354 (*ve)->viewShape()->AddEdge(*ve);
1355 vedges.push_back(*ve);
1369 if (_orthographicProjection) {
1370 transform = std::make_unique<BoxGrid::Transform>();
1373 transform = std::make_unique<SphericalGrid::Transform>();
1377 source = std::make_unique<CulledOccluderSource>(*
transform, we, *ioViewMap,
true);
1380 source = std::make_unique<OccluderSource>(*
transform, we);
1385 if (_orthographicProjection) {
1386 BoxGrid grid(*source, *
density, ioViewMap, _viewpoint, _EnableQI);
1387 computeCumulativeVisibility<BoxGrid, BoxGrid::Iterator>(
1388 ioViewMap, grid,
epsilon, _pRenderMonitor);
1392 computeCumulativeVisibility<SphericalGrid, SphericalGrid::Iterator>(
1393 ioViewMap, grid,
epsilon, _pRenderMonitor);
1407 if (_orthographicProjection) {
1408 transform = std::make_unique<BoxGrid::Transform>();
1411 transform = std::make_unique<SphericalGrid::Transform>();
1415 source = std::make_unique<CulledOccluderSource>(*
transform, we, *ioViewMap,
true);
1418 source = std::make_unique<OccluderSource>(*
transform, we);
1423 if (_orthographicProjection) {
1424 BoxGrid grid(*source, *
density, ioViewMap, _viewpoint, _EnableQI);
1425 computeDetailedVisibility<BoxGrid, BoxGrid::Iterator>(
1426 ioViewMap, grid,
epsilon, _pRenderMonitor);
1430 computeDetailedVisibility<SphericalGrid, SphericalGrid::Iterator>(
1431 ioViewMap, grid,
epsilon, _pRenderMonitor);
1438 unsigned int sceneNumFaces,
1443 iAlgo = ray_casting;
1448 cout <<
"Using ordinary ray casting" << endl;
1450 BuildGrid(we, bbox, sceneNumFaces);
1451 ComputeRayCastingVisibility(ioViewMap,
epsilon);
1453 case ray_casting_fast:
1455 cout <<
"Using fast ray casting" << endl;
1457 BuildGrid(we, bbox, sceneNumFaces);
1458 ComputeFastRayCastingVisibility(ioViewMap,
epsilon);
1460 case ray_casting_very_fast:
1462 cout <<
"Using very fast ray casting" << endl;
1464 BuildGrid(we, bbox, sceneNumFaces);
1465 ComputeVeryFastRayCastingVisibility(ioViewMap,
epsilon);
1467 case ray_casting_culled_adaptive_traditional:
1469 cout <<
"Using culled adaptive grid with heuristic density and traditional QI calculation"
1474 ComputeDetailedVisibility(ioViewMap, we, bbox,
epsilon,
true, factory);
1489 case ray_casting_adaptive_traditional:
1492 <<
"Using unculled adaptive grid with heuristic density and traditional QI calculation"
1497 ComputeDetailedVisibility(ioViewMap, we, bbox,
epsilon,
false, factory);
1503 case ray_casting_culled_adaptive_cumulative:
1505 cout <<
"Using culled adaptive grid with heuristic density and cumulative QI calculation"
1510 ComputeCumulativeVisibility(ioViewMap, we, bbox,
epsilon,
true, factory);
1516 case ray_casting_adaptive_cumulative:
1518 cout <<
"Using unculled adaptive grid with heuristic density and cumulative QI calculation"
1523 ComputeCumulativeVisibility(ioViewMap, we, bbox,
epsilon,
false, factory);
1539 vector<ViewEdge *> &vedges = ioViewMap->
ViewEdges();
1540 bool progressBarDisplay =
false;
1541 unsigned progressBarStep = 0;
1542 unsigned vEdgesSize = vedges.size();
1543 unsigned fEdgesSize = ioViewMap->
FEdges().size();
1547 progressBarStep = vEdgesSize / progressBarSteps;
1548 _pProgressBar->reset();
1549 _pProgressBar->setLabelText(
"Computing Ray casting Visibility");
1550 _pProgressBar->setTotalSteps(progressBarSteps);
1551 _pProgressBar->setProgress(0);
1552 progressBarDisplay =
true;
1555 unsigned counter = progressBarStep;
1556 FEdge *fe, *festart;
1558 vector<Polygon3r *> aFaces;
1561 unsigned qiClasses[256];
1562 unsigned maxIndex, maxCard;
1563 unsigned qiMajority;
1564 static unsigned timestamp = 1;
1565 for (vector<ViewEdge *>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) {
1566 if (_pRenderMonitor && _pRenderMonitor->testBreak()) {
1571 cout <<
"Processing ViewEdge " << (*ve)->
getId() << endl;
1574 festart = (*ve)->fedgeA();
1575 fe = (*ve)->fedgeA();
1580 }
while (fe && fe != festart);
1584 cout <<
"\tqiMajority: " << qiMajority << endl;
1592 fe = (*ve)->fedgeA();
1593 memset(qiClasses, 0, 256 *
sizeof(*qiClasses));
1594 set<ViewShape *> occluders;
1596 if (maxCard < qiMajority) {
1597 tmpQI = ComputeRayCastingVisibility(fe, _Grid,
epsilon, occluders, &aFace, timestamp++);
1601 cout <<
"\tFEdge: visibility " << tmpQI << endl;
1607 cerr <<
"Warning: too many occluding levels" << endl;
1612 if (++qiClasses[tmpQI] > maxCard) {
1613 maxCard = qiClasses[tmpQI];
1619 FindOccludee(fe, _Grid,
epsilon, &aFace, timestamp++);
1622 cout <<
"\tFEdge: occludee only (" << (aFace !=
NULL ?
"found" :
"not found") <<
")"
1630 aFaces.push_back(aFace);
1634 cout <<
"\tFound occludee" << endl;
1648 }
while ((maxCard < qiMajority) && (fe) && (fe != festart));
1651 cout <<
"\tFinished with " << nSamples <<
" samples, maxCard = " << maxCard << endl;
1657 (*ve)->setQI(maxIndex);
1659 for (set<ViewShape *>::iterator o = occluders.begin(), oend = occluders.end(); o != oend;
1661 (*ve)->AddOccluder((*o));
1665 cout <<
"\tConclusion: QI = " << maxIndex <<
", " << (*ve)->
occluders_size() <<
" occluders."
1670 if (!aFaces.empty()) {
1671 if (aFaces.size() <= (
float)nSamples / 2.0f) {
1672 (*ve)->setaShape(
nullptr);
1675 vector<Polygon3r *>::iterator p = aFaces.begin();
1679 (*ve)->setaShape(vshape);
1683 if (progressBarDisplay) {
1687 _pProgressBar->setProgress(_pProgressBar->getProgress() + 1);
1696 vector<ViewEdge *> &vedges = ioViewMap->
ViewEdges();
1697 bool progressBarDisplay =
false;
1698 unsigned progressBarStep = 0;
1699 unsigned vEdgesSize = vedges.size();
1700 unsigned fEdgesSize = ioViewMap->
FEdges().size();
1704 progressBarStep = vEdgesSize / progressBarSteps;
1705 _pProgressBar->reset();
1706 _pProgressBar->setLabelText(
"Computing Ray casting Visibility");
1707 _pProgressBar->setTotalSteps(progressBarSteps);
1708 _pProgressBar->setProgress(0);
1709 progressBarDisplay =
true;
1712 unsigned counter = progressBarStep;
1713 FEdge *fe, *festart;
1714 unsigned nSamples = 0;
1715 vector<Polygon3r *> aFaces;
1718 unsigned qiClasses[256];
1719 unsigned maxIndex, maxCard;
1720 unsigned qiMajority;
1721 static unsigned timestamp = 1;
1723 for (vector<ViewEdge *>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) {
1724 if (_pRenderMonitor && _pRenderMonitor->testBreak()) {
1728 festart = (*ve)->fedgeA();
1729 fe = (*ve)->fedgeA();
1734 }
while (fe && fe != festart);
1735 if (qiMajority >= 4) {
1742 set<ViewShape *> occluders;
1748 memset(qiClasses, 0, 256 *
sizeof(*qiClasses));
1749 fe = (*ve)->fedgeA();
1752 if (maxCard < qiMajority) {
1753 tmpQI = ComputeRayCastingVisibility(fe, _Grid,
epsilon, occluders, &aFace, timestamp++);
1758 cerr <<
"Warning: too many occluding levels" << endl;
1763 if (++qiClasses[tmpQI] > maxCard) {
1764 maxCard = qiClasses[tmpQI];
1770 FindOccludee(fe, _Grid,
epsilon, &aFace, timestamp++);
1775 aFaces.push_back(aFace);
1784 }
while ((maxCard < qiMajority) && (fe) && (fe != festart));
1786 (*ve)->setQI(maxIndex);
1788 if (!aFaces.empty()) {
1789 if (aFaces.size() < nSamples / 2) {
1790 (*ve)->setaShape(
nullptr);
1793 vector<Polygon3r *>::iterator p = aFaces.begin();
1798 for (; p != pend; ++p) {
1809 (*ve)->setaShape(vshape);
1816 if (progressBarDisplay) {
1820 _pProgressBar->setProgress(_pProgressBar->getProgress() + 1);
1829 vector<ViewEdge *> &vedges = ioViewMap->
ViewEdges();
1830 bool progressBarDisplay =
false;
1831 unsigned progressBarStep = 0;
1832 unsigned vEdgesSize = vedges.size();
1833 unsigned fEdgesSize = ioViewMap->
FEdges().size();
1837 progressBarStep = vEdgesSize / progressBarSteps;
1838 _pProgressBar->reset();
1839 _pProgressBar->setLabelText(
"Computing Ray casting Visibility");
1840 _pProgressBar->setTotalSteps(progressBarSteps);
1841 _pProgressBar->setProgress(0);
1842 progressBarDisplay =
true;
1845 unsigned counter = progressBarStep;
1849 static unsigned timestamp = 1;
1850 for (vector<ViewEdge *>::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; ve++) {
1851 if (_pRenderMonitor && _pRenderMonitor->testBreak()) {
1855 set<ViewShape *> occluders;
1857 fe = (*ve)->fedgeA();
1858 qi = ComputeRayCastingVisibility(fe, _Grid,
epsilon, occluders, &aFace, timestamp++);
1863 (*ve)->setaShape(vshape);
1866 (*ve)->setaShape(
nullptr);
1871 if (progressBarDisplay) {
1875 _pProgressBar->setProgress(_pProgressBar->getProgress() + 1);
1890 vector<WVertex *> &faceVertices)
1892 WFace *face =
nullptr;
1902 OccludersSet::iterator p, pend;
1904 *oaPolygon =
nullptr;
1908 Vec3r v(-u[0], -u[1], -u[2]);
1911 bool noIntersection =
true;
1912 real mint = FLT_MAX;
1914 for (p = occluders.begin(), pend = occluders.end(); p != pend; p++) {
1919 Vec3r v1(((*p)->getVertices())[0]);
1927 if (face == oface) {
1931 if (faceVertices.empty()) {
1935 for (vector<WVertex *>::iterator fv = faceVertices.begin(), fvend = faceVertices.end();
1938 if ((*fv)->isBoundary()) {
1943 for (ie = iebegin; ie != ieend; ++ie) {
1944 if ((*ie) ==
nullptr) {
1948 WFace *sface = (*ie)->GetbFace();
1949 if (sface == oface) {
1968 if ((*p)->rayIntersect(
A,
v,
t, t_u, t_v)) {
1974 noIntersection =
false;
1982 if (noIntersection) {
1983 *oaPolygon =
nullptr;
1996 A =
Vec3r(((fe)->vertexA()->point3D() + (fe)->vertexB()->point3D()) / 2.0);
1997 edgeDir =
Vec3r((fe)->vertexB()->point3D() - (fe)->vertexA()->point3D());
1999 origin =
Vec3r((fe)->vertexA()->point3D());
2001 if (_orthographicProjection) {
2002 u =
Vec3r(0.0, 0.0, _viewpoint.z() -
A.z());
2005 u =
Vec3r(_viewpoint -
A);
2009 cerr <<
"Warning: point is out of the grid for fedge " << fe->
getId().
getFirst() <<
"-"
2013 vector<WVertex *> faceVertices;
2015 WFace *face =
nullptr;
2024 return FindOccludee(
2025 fe, iGrid,
epsilon, oaPolygon, timestamp, u,
A, origin, edgeDir, faceVertices);
2031 set<ViewShape *> &oOccluders,
2050 if ((
center.x() < gridOrigin.
x()) || (
center.y() < gridOrigin.
y()) ||
2051 (
center.z() < gridOrigin.
z()) || (
center.x() > gridExtremity.
x()) ||
2052 (
center.y() > gridExtremity.
y()) || (
center.z() > gridExtremity.
z())) {
2053 cerr <<
"Warning: point is out of the grid for fedge " << fe->
getId() << endl;
2062 if ((
A.x() < viewport[0]) || (
A.x() > viewport[2]) || (
A.y() < viewport[1]) ||
2063 (
A.y() > viewport[3]) || (
B.x() < viewport[0]) || (
B.x() > viewport[2]) ||
2064 (
B.y() < viewport[1]) || (
B.y() > viewport[3])) {
2065 cerr <<
"Warning: point is out of the grid for fedge " << fe->
getId() << endl;
2071 if (_orthographicProjection) {
2075 vp =
Vec3r(_viewpoint);
2090 WFace *face =
nullptr;
2095 vector<WVertex *> faceVertices;
2100 OccludersSet::iterator p, pend;
2105 for (p = occluders.begin(), pend = occluders.end(); p != pend; p++) {
2113 cout <<
"\t\tEvaluating intersection for occluder " << ((*p)->getVertices())[0]
2114 << ((*p)->getVertices())[1] << ((*p)->getVertices())[2] << endl
2115 <<
"\t\t\tand ray " << vp <<
" * " << u <<
" (center " <<
center <<
")" << endl;
2118 Vec3r v1(((*p)->getVertices())[0]);
2125 cout <<
"\t\tp: " << ((*p)->getVertices())[0] << ((*p)->getVertices())[1]
2126 << ((*p)->getVertices())[2] <<
", norm: " << (*p)->getNormal() << endl;
2133 cout <<
"\t\tDetermining face adjacency...";
2138 if (face == oface) {
2141 cout <<
" Rejecting occluder for face concurrency." << endl;
2147 for (vector<WVertex *>::iterator fv = faceVertices.begin(), fvend = faceVertices.end();
2150 if ((*fv)->isBoundary()) {
2156 for (ie = iebegin; ie != ieend; ++ie) {
2157 if ((*ie) ==
nullptr) {
2161 WFace *sface = (*ie)->GetbFace();
2164 if (sface == oface) {
2176 cout <<
" Rejecting occluder for face adjacency." << endl;
2191 cout <<
"\t\tRejecting occluder for target coincidence." << endl;
2198 if ((*p)->rayIntersect(
center, u,
t, t_u, t_v)) {
2201 cout <<
"\t\tRay " << vp <<
" * " << u <<
" intersects at time " <<
t <<
" (raylength is "
2202 << raylength <<
")" << endl;
2203 cout <<
"\t\t(u * normal) == " << (u *
normal) <<
" for normal " <<
normal << endl;
2207 if ((
t > 0.0) && (
t < raylength)) {
2210 cout <<
"\t\tIs occluder" << endl;
2215 oOccluders.insert(vshape);
2226 FindOccludee(fe, iGrid,
epsilon, oaPolygon, timestamp, u,
center, origin, edgeDir, faceVertices);
2237 ComputeSweepLineIntersections(ioViewMap,
epsilon);
2245 for (ViewMap::viewvertices_container::iterator vv = vvertices.begin(), vvend = vvertices.end();
2250 cout <<
"TVertex " << tvertex->
getId() <<
" has :" << endl;
2251 cout <<
"FrontEdgeA: " << tvertex->
frontEdgeA().first << endl;
2252 cout <<
"FrontEdgeB: " << tvertex->
frontEdgeB().first << endl;
2253 cout <<
"BackEdgeA: " << tvertex->
backEdgeA().first << endl;
2254 cout <<
"BackEdgeB: " << tvertex->
backEdgeB().first << endl << endl;
2273 for (
unsigned int i = 0; i < 3; i++) {
2301 real tx =
x->getParameter(edge);
2302 real ty =
y->getParameter(edge);
2327 vector<SVertex *> &svertices = ioViewMap->
SVertices();
2328 bool progressBarDisplay =
false;
2329 unsigned sVerticesSize = svertices.size();
2330 unsigned fEdgesSize = ioViewMap->
FEdges().size();
2334 for (ViewMap::fedges_container::const_iterator f = fedges.begin(), end = fedges.end();
2337 cout << (*f)->aMaterialIndex() <<
"-" << (*f)->bMaterialIndex() << endl;
2341 unsigned progressBarStep = 0;
2345 progressBarStep = sVerticesSize / progressBarSteps;
2346 _pProgressBar->reset();
2347 _pProgressBar->setLabelText(
"Computing Sweep Line Intersections");
2348 _pProgressBar->setTotalSteps(progressBarSteps);
2349 _pProgressBar->setProgress(0);
2350 progressBarDisplay =
true;
2353 unsigned counter = progressBarStep;
2359 vector<FEdge *> &ioEdges = ioViewMap->
FEdges();
2361 vector<segment *> segments;
2363 vector<FEdge *>::iterator fe, fend;
2365 for (fe = ioEdges.begin(), fend = ioEdges.end(); fe != fend; fe++) {
2366 segment *s =
new segment((*fe), (*fe)->vertexA()->point2D(), (*fe)->vertexB()->point2D());
2367 (*fe)->userdata = s;
2368 segments.push_back(s);
2371 vector<segment *> vsegments;
2372 for (vector<SVertex *>::iterator sv = svertices.begin(), svend = svertices.end(); sv != svend;
2374 if (_pRenderMonitor && _pRenderMonitor->testBreak()) {
2378 const vector<FEdge *> &vedges = (*sv)->fedges();
2380 for (vector<FEdge *>::const_iterator sve = vedges.begin(), sveend = vedges.end();
2383 vsegments.push_back((
segment *)((*sve)->userdata));
2386 Vec3r evt((*sv)->point2D());
2390 if (progressBarDisplay) {
2394 _pProgressBar->setProgress(_pProgressBar->getProgress() + 1);
2400 if (_pRenderMonitor && _pRenderMonitor->testBreak()) {
2402 if (!segments.empty()) {
2403 vector<segment *>::iterator s, send;
2404 for (s = segments.begin(), send = segments.end(); s != send; s++) {
2412 for (fe = ioEdges.begin(), fend = ioEdges.end(); fe != fend; fe++) {
2413 (*fe)->userdata =
nullptr;
2417 vector<FEdge *> newEdges;
2426 vector<intersection *>::iterator i, iend;
2427 for (i = intersections.begin(), iend = intersections.end(); i != iend; i++) {
2428 FEdge *fA = (*i)->EdgeA->edge();
2429 FEdge *fB = (*i)->EdgeB->edge();
2445 cerr <<
"Warning: 2D intersection out of range for edge " << fA->
vertexA()->
getId() <<
" - "
2450 cerr <<
"Warning: 2D intersection out of range for edge " << fB->
vertexA()->
getId() <<
" - "
2458 cerr <<
"Warning: 3D intersection out of range for edge " << fA->
vertexA()->
getId() <<
" - "
2463 cerr <<
"Warning: 3D intersection out of range for edge " << fB->
vertexA()->
getId() <<
" - "
2470 printf(
"ta %.12e\n", ta);
2471 printf(
"tb %.12e\n", tb);
2472 printf(
"a1 %e, %e -- a2 %e, %e\n", a1[0], a1[1], a2[0], a2[1]);
2473 printf(
"b1 %e, %e -- b2 %e, %e\n", b1[0], b1[1], b2[0], b2[1]);
2477 printf(
"Ta %.12e\n", Ta);
2480 printf(
"Tb %.12e\n", Tb);
2482 printf(
"A1 %e, %e, %e -- A2 %e, %e, %e\n",
A1[0],
A1[1],
A1[2],
A2[0],
A2[1],
A2[2]);
2483 printf(
"B1 %e, %e, %e -- B2 %e, %e, %e\n",
B1[0],
B1[1],
B1[2],
B2[0],
B2[1],
B2[2]);
2489 Vec3r(a1 + ta * (a2 - a1)),
2492 Vec3r(b1 + tb * (b2 - b1)),
2500 progressBarStep = 0;
2502 if (progressBarDisplay) {
2503 unsigned iEdgesSize = iedges.size();
2505 progressBarStep = iEdgesSize / progressBarSteps;
2506 _pProgressBar->reset();
2507 _pProgressBar->setLabelText(
"Splitting intersected edges");
2508 _pProgressBar->setTotalSteps(progressBarSteps);
2509 _pProgressBar->setProgress(0);
2514 vector<TVertex *> edgeVVertices;
2515 vector<ViewEdge *> newVEdges;
2516 vector<segment *>::iterator s, send;
2517 for (s = iedges.begin(), send = iedges.end(); s != send; s++) {
2518 edgeVVertices.clear();
2522 FEdge *fedge = (*s)->edge();
2526 vector<intersection *> &eIntersections = (*s)->intersections();
2529 for (i = eIntersections.begin(), iend = eIntersections.end(); i != iend; i++) {
2530 edgeVVertices.push_back((
TVertex *)(*i)->userdata);
2535 if (progressBarDisplay) {
2539 _pProgressBar->setProgress(_pProgressBar->getProgress() + 1);
2545 for (fe = ioEdges.begin(), fend = ioEdges.end(); fe != fend; fe++) {
2546 (*fe)->userdata =
nullptr;
2550 if (!segments.empty()) {
2551 for (s = segments.begin(), send = segments.end(); s != send; s++) {
typedef float(TangentPoint)[2]
Class to define a cell grid surrounding the projected image of a scene.
Class to define a cell grid surrounding the projected image of a scene.
NSNotificationCenter * center
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Class to define a cell grid surrounding the projected image of a scene.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
Class to define a cell grid surrounding the projected image of a scene.
Class to define a cell grid surrounding the projected image of a scene.
Class to build silhouette edges from a Winged-Edge structure.
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void sort(btMatrix3x3 &U, btVector3 &sigma, btMatrix3x3 &V, int t)
Helper function of 3X3 SVD for sorting singular values.
const Point & getMax() const
const Point & getMin() const
void setOccludeeEmpty(bool iempty)
int occluders_size() const
ViewEdge * viewedge() const
void setIsInImage(bool iFlag)
void setaFace(Polygon3r &iFace)
void setOccludeeIntersection(const Vec3r &iPoint)
bool rayIntersect(const Vec3r &orig, const Vec3r &dir, real &t, real &u, real &v, real epsilon=M_EPSILON) const
const vector< Point > & getVertices() const
virtual AutoPtr< GridDensityProvider > newGridDensityProvider(OccluderSource &source, const real proscenium[4])=0
const Vec3r & getOrigin() const
void castInfiniteRay(const Vec3r &orig, const Vec3r &dir, OccludersSet &occluders, unsigned timestamp)
void castRay(const Vec3r &orig, const Vec3r &end, OccludersSet &occluders, unsigned timestamp)
id_type getSecond() const
void setInfo(string info)
void setFrsMaterials(const vector< FrsMaterial > &iMaterials)
void setLibraryPath(const string &path)
void setName(const string &name)
const Vec3r & point2d() const
const Vec3r & point3D() const
const Vec3r & point2D() const
virtual real getProjectedY() const
virtual real getProjectedX() const
static real ImageToWorldParameter(FEdge *fe, real t)
static void retrieveViewport(int viewport[4])
vector< Intersection< Segment< T, Point > > * > & intersections()
void process(Point &p, vector< Segment< T, Point > * > &segments, binary_rule< Segment< T, Point >, Segment< T, Point >> &binrule, real epsilon=M_EPSILON)
vector< Segment< T, Point > * > & intersectedEdges()
directedViewEdge & frontEdgeB()
directedViewEdge & frontEdgeA()
directedViewEdge & backEdgeB()
directedViewEdge & backEdgeA()
Vec< T, N > & normalize()
void ComputeFastRayCastingVisibility(ViewMap *ioViewMap, real epsilon=1.0e-6)
void ComputeCumulativeVisibility(ViewMap *ioViewMap, WingedEdge &we, const BBox< Vec3r > &bbox, real epsilon, bool cull, GridDensityProviderFactory &factory)
void ComputeEdgesVisibility(ViewMap *ioViewMap, WingedEdge &we, const BBox< Vec3r > &bbox, unsigned int sceneNumFaces, visibility_algo iAlgo=ray_casting, real epsilon=1.0e-6)
void FindOccludee(FEdge *fe, Grid *iGrid, real epsilon, Polygon3r **oaPolygon, unsigned timestamp)
void CullViewEdges(ViewMap *ioViewMap, real viewProscenium[4], real occluderProscenium[4], bool extensiveFEdgeSearch=true)
void computeInitialViewEdges(WingedEdge &)
void ComputeRayCastingVisibility(ViewMap *ioViewMap, real epsilon=1.0e-6)
void BuildGrid(WingedEdge &we, const BBox< Vec3r > &bbox, unsigned int sceneNumFaces)
void computeCusps(ViewMap *ioViewMap)
ViewMap * BuildViewMap(WingedEdge &we, visibility_algo iAlgo, real epsilon, const BBox< Vec3r > &bbox, unsigned int sceneNumFaces)
void ComputeIntersections(ViewMap *ioViewMap, intersection_algo iAlgo=sweep_line, real epsilon=1.0e-06)
void ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsilon=1.0e-6)
void ComputeVeryFastRayCastingVisibility(ViewMap *ioViewMap, real epsilon=1.0e-6)
void ComputeDetailedVisibility(ViewMap *ioViewMap, WingedEdge &we, const BBox< Vec3r > &bbox, real epsilon, bool cull, GridDensityProviderFactory &factory)
vector< FEdge * > fedges_container
ViewShape * viewShape(unsigned id)
vector< ViewVertex * > viewvertices_container
vector< ViewEdge * > viewedges_container
TVertex * CreateTVertex(const Vec3r &iA3D, const Vec3r &iA2D, FEdge *iFEdgeA, const Vec3r &iB3D, const Vec3r &iB2D, FEdge *iFEdgeB, const Id &id)
svertices_container & SVertices()
viewvertices_container & ViewVertices()
fedges_container & FEdges()
ViewVertex * InsertViewVertex(SVertex *iVertex, vector< ViewEdge * > &newViewEdges)
viewedges_container & ViewEdges()
void SplitEdge(FEdge *fe, const vector< TVertex * > &iViewVertices, vector< FEdge * > &ioNewEdges, vector< ViewEdge * > &ioNewViewEdges)
virtual Nature::VertexNature getNature() const
void setNature(Nature::VertexNature iNature)
int numberOfEdges() const
WVertex * GetVertex(unsigned int index)
const vector< WOEdge * > & getEdgeList()
void RetrieveVertexList(vector< WVertex * > &oVertices)
vector< WShape * > & getWShapes()
SyclQueue void void size_t num_bytes void
IconTextureDrawCall normal
ccl_gpu_kernel_postfix ccl_global int * counter
ccl_device_inline float2 fabs(const float2 &a)
ccl_device_inline float3 ceil(const float3 &a)
bool intersect2dSeg2dArea(const Vec2r &min, const Vec2r &max, const Vec2r &A, const Vec2r &B)
intersection_test intersectRayPlane(const Vec3r &orig, const Vec3r &dir, const Vec3r &norm, const real d, real &t, const real epsilon)
VecMat::Vec3< real > Vec3r
void getDefaultViewProscenium(real viewProscenium[4])
static const EdgeNature BORDER
static const VertexNature T_VERTEX
static const VertexNature CUSP
static const EdgeNature SILHOUETTE
static void computeDetailedVisibility(ViewMap *ioViewMap, G &grid, real epsilon, RenderMonitor *iRenderMonitor)
static void computeFastVisibility(ViewMap *ioViewMap, G &grid, real epsilon)
static real distance2D(const Vec3r &point, const real origin[2])
static double B1(double u)
static const Global & _global
static const unsigned gProgressBarMinSize
static const unsigned gProgressBarMaxSteps
static bool insideProscenium(const real proscenium[4], const Vec3r &point)
static void computeCumulativeVisibility(ViewMap *ioViewMap, G &grid, real epsilon, RenderMonitor *iRenderMonitor)
Segment< FEdge *, Vec3r > segment
static int computeVisibility(ViewMap *viewMap, FEdge *fe, G &grid, real epsilon, ViewEdge *, WFace **oaWFace, set< ViewShape * > *foundOccluders)
vector< Polygon3r * > OccludersSet
static void findOccludee(FEdge *fe, G &, I &occluders, real epsilon, WFace **oaWFace, Vec3r &u, Vec3r &A, Vec3r &origin, Vec3r &edgeDir, vector< WVertex * > &faceVertices)
static double B2(double u)
static bool crossesProscenium(real proscenium[4], FEdge *fe)
static void computeVeryFastVisibility(ViewMap *ioViewMap, G &grid, real epsilon)
INLINE Rall1d< T, V, S > hypot(const Rall1d< T, V, S > &y, const Rall1d< T, V, S > &x)
static const pxr::TfToken density("density", pxr::TfToken::Immortal)
bool operator()(intersection *x, intersection *y)
less_Intersection(segment *iEdge)
bool operator()(SVertex *x, SVertex *y)
bool operator()(segment &s1, segment &s2) override