VOID RayTrace(INT pid) { INT j; INT x, y; /* Pixel address. */ REAL xx, yy; VEC3 N; /* Normal at intersection. */ VEC3 Ipoint; /* Intersection point. */ COLOR c; /* Color for storing background. */ RAY *ray; /* Ray pointer. */ RAY rmsg; /* Ray message. */ RAYJOB job; /* Ray job from work pool. */ OBJECT *po; /* Ptr to object. */ BOOL hit; /* An object hit? */ IRECORD hitrecord; /* Intersection record. */ ray = &rmsg; while (GetJobs(&job, pid) != WPS_EMPTY) { while (GetRayJobFromBundle(&job, &x, &y)) { /* Convert the ray job to the ray message format. */ xx = (REAL)x; yy = (REAL)y; if (AntiAlias) for (j = 0; j < NumSubRays; j++) { ConvertPrimRayJobToRayMsg(ray, xx + frand(), yy + frand()); PushRayTreeStack(ray, pid); } else { ConvertPrimRayJobToRayMsg(ray, xx, yy); PushRayTreeStack(ray, pid); } while (PopRayTreeStack(ray, pid) != RTS_EMPTY) { /* Find which object is closest along the ray. */ switch (TraversalType) { case TT_LIST: hit = Intersect(ray, &hitrecord); break; case TT_HUG: hit = TraverseHierarchyUniform(ray, &hitrecord, pid); break; } /* Process the object ray hit. */ if (hit) { /* * Get parent object to be able to access * object operations. */ po = hitrecord.pelem->parent; /* Calculate intersection point. */ RayPoint(Ipoint, ray, hitrecord.t); /* Calculate normal at this point. */ ((void (*)(IRECORD *, VEC3, VEC3))(*po->procs->normal))(&hitrecord, Ipoint, N); /* Make sure normal is pointing toward ray origin. */ if ((VecDot(ray->D, N)) > 0.0) VecNegate(N, N); /* * Compute shade at this point - will process * shadow rays and add secondary reflection * and refraction rays to ray tree stack */ Shade(Ipoint, N, ray, &hitrecord, pid); } else { /* Add background as pixel contribution. */ VecCopy(c, View.bkg); VecScale(c, ray->weight, c); AddPixelColor(c, ray->x, ray->y); } } } } }
wxString CppCheckSettings::GetOptions() const { wxString options; if(GetStyle()) { options << wxT(" --enable=style "); } if(GetPerformance()) { options << wxT(" --enable=performance "); } if(GetPortability()) { options << wxT(" --enable=portability "); } if(GetUnusedFunctions()) { options << wxT(" --enable=unusedFunction "); } if(GetMissingIncludes()) { options << wxT(" --enable=missingInclude "); } if(GetInformation()) { options << wxT(" --enable=information "); } if(GetPosixStandards()) { options << wxT(" --std=posix "); } if(GetC99Standards()) { options << wxT(" --std=c99 "); } if(GetCpp11Standards()) { options << wxT(" --std=c++11 "); } if(GetForce()) { options << wxT("--force "); } if(GetJobs() > 1) { options << wxT("-j") << GetJobs() << " "; } if(GetCheckConfig()) { options << wxT("--check-config "); // Though this turns off other checks, afaict it does not harm to emit them } // Now add any ticked suppressedwarnings std::map<wxString, wxString>::const_iterator iter = m_SuppressedWarnings1.begin(); for(; iter != m_SuppressedWarnings1.end(); ++iter) { options << wxT(" --suppress=") << (*iter).first << " "; } // IncludeDirs for(size_t n = 0; n < m_IncludeDirs.GetCount(); ++n) { wxString item = m_IncludeDirs.Item(n); item.Trim().Trim(false); if(!item.empty()) { options << " -I" << item << " "; } } if(m_SuppressSystemIncludes) { options << wxT(" --suppress=") << "missingIncludeSystem "; } // (Un)Definitions for(size_t n = 0; n < m_definitions.GetCount(); ++n) { wxString item = m_definitions.Item(n); item.Trim().Trim(false); if(!item.empty()) { options << " -D" << item << " "; } } for(size_t n = 0; n < m_undefines.GetCount(); ++n) { wxString item = m_undefines.Item(n); item.Trim().Trim(false); if(!item.empty()) { options << " -U" << item << " "; } } options << wxT(" --template gcc "); return options; }
std::list<Job*>* PersistentStorage::GetAllEncrypted(EncryptionKeys* keys) { return GetJobs(keys, ENCRYPTED->Append(FactoryString::GetInstance()->CreateNewString(" = 1"))); }