25 bool progressBarDisplay =
false;
37 progressBarDisplay =
true;
40 for (vector<WShape *>::const_iterator it = wshapes.begin(); it != wshapes.end(); it++) {
44 wxs =
dynamic_cast<WXShape *
>(*it);
47 _bbox_diagonal = (Max - Min).
norm();
51 for (vector<WFace *>::iterator wf = wfaces.begin(), wfend = wfaces.end(); wf != wfend; ++wf)
58 else if (!(wxs)->getComputeViewIndependentFlag()) {
66 if (progressBarDisplay) {
82 if (progressBarDisplay) {
93 if (progressBarDisplay) {
102 (*it)->ResetUserData();
124 vector<WFace *>::iterator f, fend;
126 for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
132 for (vector<WVertex *>::iterator wv = wvertices.begin(), wvend = wvertices.end(); wv != wvend;
176 if (vertex->GetEdges().empty()) {
178 printf(
"Warning: WVertex %d has no associated edges.\n", vertex->GetId());
187 real cos2theta, sin2theta;
196 vertex->setCurvatures(C);
206 C->K1 = ncycle.
kmin();
207 C->K2 = ncycle.
kmax();
208 C->e1 = ncycle.
Kmax();
209 C->e2 = ncycle.
Kmin();
221 C = vertex->curvatures();
234 C->er =
v - (
v * n) * n;
238 cos2theta = C->er * e1;
239 cos2theta *= cos2theta;
240 sin2theta = 1 - cos2theta;
241 C->Kr = C->K1 * cos2theta + C->K2 * sin2theta;
260 vector<WFace *>::iterator f, fend;
261 for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
266 vector<WEdge *>::iterator we, weend;
268 for (we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
279 int closestPointId = 0;
295 float d = normal *
V;
303 dist = dist_vec.
norm();
305 if (dist < minDist) {
353 vector<WEdge *>::iterator we, weend;
355 for (we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
379 vector<WEdge *>::iterator we, weend;
381 for (we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
415 vector<WFace *>::iterator f, fend;
416 for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
440 if ((
fabs(flayer->
dotP(0)) < threshold) && (
fabs(flayer->
dotP(1)) < threshold) &&
441 (
fabs(flayer->
dotP(2)) < threshold))
460 vector<WXFaceLayer *> SmoothLayers;
463 real K1_a(0), K1_b(0);
464 Vec3r Inter_a, Inter_b;
468 if (SmoothLayers.size() != 1) {
471 faceLayer = SmoothLayers[0];
473 layer_info = (Face_Curvature_Info *)faceLayer->
userdata;
483 WVertex::face_iterator fit =
v->faces_begin();
484 WVertex::face_iterator fitend =
v->faces_end();
485 for (; fit != fitend; ++fit) {
486 WXFace *wxf =
dynamic_cast<WXFace *
>(*fit);
487 WOEdge *oppositeEdge;
488 if (!(wxf->getOppositeEdge(
v, oppositeEdge))) {
491 v1v2 = oppositeEdge->GetbVertex()->GetVertex() - oppositeEdge->GetaVertex()->GetVertex();
494 oppositeEdge->GetaVertex()->GetVertex(), v1v2, e2, -(
v->GetVertex() * e2), t, 1.0e-06);
497 wxf->retrieveSmoothLayers(
Nature::RIDGE, second_ridge_layer);
498 if (second_ridge_layer.size() != 1) {
501 Face_Curvature_Info *second_layer_info =
502 (Face_Curvature_Info *)second_ridge_layer[0]->userdata;
504 uint index1 = wxf->GetIndex(oppositeEdge->GetaVertex());
505 uint index2 = wxf->GetIndex(oppositeEdge->GetbVertex());
506 real K1_1 = second_layer_info->vec_curvature_info[index1]->K1;
507 real K1_2 = second_layer_info->vec_curvature_info[index2]->K1;
508 real K1 = (1.0 - t) * K1_1 + t * K1_2;
509 Vec3r inter((1.0 - t) * oppositeEdge->GetaVertex()->GetVertex() +
510 t * oppositeEdge->GetbVertex()->GetVertex());
511 Vec3r vtmp(inter -
v->GetVertex());
529 d = (K1_b) - (K1_a) / (Inter_b - Inter_a).
norm();
554 if ((faceLayer->
dotP(0) < minDiff) && (faceLayer->
dotP(1) < minDiff) &&
555 (faceLayer->
dotP(2) < minDiff))
572 vector<WFace *>::iterator f, fend;
573 for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
593 if ((
fabs(faceLayer->
dotP(0)) < threshold) && (
fabs(faceLayer->
dotP(1)) < threshold) &&
594 (
fabs(faceLayer->
dotP(2)) < threshold))
607 vector<WFace *>::iterator f, fend;
608 for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
620 vector<WXFaceLayer *> sc_layers;
622 if (sc_layers.empty()) {
627 sc_layer = sc_layers[0];
630 vector<real> kr_derivatives;
633 WXVertex *
v, *opposite_vertex_a, *opposite_vertex_b;
636 Vec3r normal_vec, radial_normal_vec, er_vec, v_vec, inter, inter1, inter2, tmp_vec;
638 real kr(0), kr1(0), kr2(0), t;
640 for (
uint i = 0; i < vertices_nb; ++i) {
644 if (
v->isBoundary()) {
645 kr_derivatives.push_back(0);
649 v_vec =
v->GetVertex();
650 er_vec =
v->curvatures()->er;
656 wxf =
dynamic_cast<WXFace *
>(*fit);
664 radial_normal_vec = er_vec ^ normal_vec;
670 -(v_vec * radial_normal_vec),
679 tmp_vec = inter -
v->GetVertex();
681 if (tmp_vec * er_vec > 0) {
696 v->curvatures()->dKr = (kr2 - kr1) / (inter2 - inter1).norm();
697 kr_derivatives.push_back(
v->curvatures()->dKr);
713 sc_oedge = sc_edge->
woeb();
731 vector<WEdge *>::iterator we, weend;
733 for (we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
753 vector<WEdge *>::iterator we, weend;
755 for (we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
771 bool hasSmoothEdges =
false;
776 for (vector<WFace *>::iterator f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
777 vector<WXFaceLayer *> &faceLayers = ((
WXFace *)(*f))->getSmoothLayers();
778 for (vector<WXFaceLayer *>::iterator wxfl = faceLayers.begin(), wxflend = faceLayers.end();
782 if ((*wxfl)->BuildSmoothEdge()) {
783 hasSmoothEdges =
true;
790 for (vector<WVertex *>::iterator wv = wvertices.begin(), wvend = wvertices.end(); wv != wvend;
Detects/flags/builds extended features edges on the WXEdge structure.
Various tools for geometry.
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 Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture 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
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
virtual void processRidgesAndValleysShape(WXShape *iWShape)
virtual void ProcessBorderEdge(WXEdge *iEdge)
bool _computeMaterialBoundaries
virtual void processShapes(WingedEdge &)
virtual void ProcessMaterialBoundaryEdge(WXEdge *iEdge)
virtual void processEdgeMarksShape(WXShape *iShape)
virtual void processCreaseShape(WXShape *iWShape)
virtual void ProcessEdgeMarks(WXEdge *iEdge)
virtual void ProcessRidgeFace(WXFace *iFace)
virtual void processMaterialBoundaryShape(WXShape *iWShape)
virtual void preProcessFace(WXFace *iFace)
virtual void ProcessSilhouetteFace(WXFace *iFace)
virtual void buildSmoothEdges(WXShape *iShape)
virtual void preProcessShape(WXShape *iWShape)
RenderMonitor * _pRenderMonitor
virtual void computeCurvatures(WXVertex *iVertex)
float _kr_derivative_epsilon
virtual void processSuggestiveContourShape(WXShape *iWShape)
ProgressBar * _pProgressBar
virtual void processSilhouetteShape(WXShape *iWShape)
bool _computeRidgesAndValleys
bool _orthographicProjection
virtual void ProcessSilhouetteEdge(WXEdge *iEdge)
virtual void postProcessSuggestiveContourShape(WXShape *iShape)
virtual void ProcessCreaseEdge(WXEdge *iEdge)
bool _computeSuggestiveContours
bool _computeViewIndependent
virtual void ProcessSuggestiveContourFace(WXFace *iFace)
virtual void postProcessSuggestiveContourFace(WXFace *iFace)
virtual void processBorderShape(WXShape *iWShape)
vector< CurvatureInfo * > vec_curvature_info
const Vec3r & Kmin() const
const Vec3r & Kmax() const
virtual void setLabelText(const string &s)
virtual void setTotalSteps(uint n)
virtual void setProgress(uint i)
Vec< T, N > & normalize()
int numberOfVertices() const
bool getOppositeEdge(const WVertex *v, WOEdge *&e)
Vec3f & GetVertexNormal(int index)
uint frs_materialIndex() const
WVertex * GetVertex(uint index)
int GetIndex(WVertex *iVertex)
vector< WVertex * > & getVertexList()
real ComputeMeanEdgeSize() const
vector< WEdge * > & getEdgeList()
vector< WFace * > & GetFaceList()
void AddNature(WXNature iNature)
const float dotP(int i) const
void setClosestPointIndex(int iIndex)
void ReplaceDotP(uint index, float newDotP)
WXSmoothEdge * getSmoothEdge()
void PushDotP(float iDotP)
void setDotP(float iDotP)
void retrieveSmoothLayers(WXNature iNature, vector< WXFaceLayer * > &oSmoothLayers)
void retrieveSmoothEdgesLayers(WXNature iNature, vector< WXFaceLayer * > &oSmoothEdgesLayers)
void AddSmoothLayer(WXFaceLayer *iLayer)
void setComputeViewIndependentFlag(bool iFlag)
CurvatureInfo * curvatures()
vector< WShape * > & getWShapes()
ccl_device_inline float2 fabs(const float2 a)
intersection_test intersectRayPlane(const Vec3r &orig, const Vec3r &dir, const Vec3r &norm, const real d, real &t, const real epsilon)
VecMat::Vec3< float > Vec3f
VecMat::Vec3< real > Vec3r
static const EdgeNature BORDER
static const EdgeNature MATERIAL_BOUNDARY
static const EdgeNature EDGE_MARK
static const EdgeNature VALLEY
static const EdgeNature CREASE
static const EdgeNature RIDGE
static const EdgeNature SILHOUETTE
static const EdgeNature SUGGESTIVE_CONTOUR
void compute_curvature_tensor(WVertex *start, real radius, NormalCycle &nc)
void compute_curvature_tensor_one_ring(WVertex *start, NormalCycle &nc)
CCL_NAMESPACE_BEGIN struct Window V