MCPcopy Index your code
hub / github.com/ad-si/LuaCAD / renderDispatch

Function renderDispatch

OpenCSG/src/opencsgRender.cpp:61–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60
61 static void renderDispatch(const std::vector<Primitive*>& primitives,
62 Algorithm algorithm,
63 DepthComplexityAlgorithm depthComplexityAlgorithm)
64 {
65 if (primitives.empty()) {
66 return;
67 }
68
69 bool hasIntersected = false;
70 for (std::vector<Primitive*>::const_iterator itr = primitives.begin(); itr != primitives.end(); ++itr) {
71 Operation operation = (*itr)->getOperation();
72 if (operation == Intersection) {
73 hasIntersected = true;
74 break;
75 }
76 }
77 if (!hasIntersected) {
78 return;
79 }
80
81 if (algorithm == Automatic) {
82 algorithm = chooseAlgorithm(primitives);
83 depthComplexityAlgorithm = chooseDepthComplexityAlgorithm(primitives);
84 }
85
86 if (depthComplexityAlgorithm == OcclusionQuery && !haveHardwareOcclusionQueries()) {
87 // hardware support is missing. issue a warning?
88 depthComplexityAlgorithm = DepthComplexitySampling;
89 }
90
91 if (algorithm != Automatic) {
92 switch (algorithm) {
93 case Goldfeather:
94 renderGoldfeather(primitives, depthComplexityAlgorithm);
95 break;
96
97 case SCS:
98 renderSCS(primitives, depthComplexityAlgorithm);
99 break;
100
101 default:
102 break;
103 }
104 }
105 }
106
107 void render(const std::vector<Primitive*>& primitives)
108 {

Callers 1

renderFunction · 0.85

Calls 9

chooseAlgorithmFunction · 0.85
renderGoldfeatherFunction · 0.85
renderSCSFunction · 0.85
emptyMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
getOperationMethod · 0.80

Tested by

no test coverage detected