12 #include "../geometry/GeomUtils.h"
13 #include "../geometry/normal_cycle.h"
21 bool progressBarDisplay =
false;
33 progressBarDisplay =
true;
36 for (vector<WShape *>::const_iterator it = wshapes.begin(); it != wshapes.end(); it++) {
40 wxs =
dynamic_cast<WXShape *
>(*it);
43 _bbox_diagonal = (Max - Min).
norm();
47 for (vector<WFace *>::iterator wf = wfaces.begin(), wfend = wfaces.end(); wf != wfend;
54 else if (!(wxs)->getComputeViewIndependentFlag()) {
62 if (progressBarDisplay) {
78 if (progressBarDisplay) {
89 if (progressBarDisplay) {
98 (*it)->ResetUserData();
120 vector<WFace *>::iterator f, fend;
122 for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
128 for (vector<WVertex *>::iterator wv = wvertices.begin(), wvend = wvertices.end(); wv != wvend;
173 printf(
"Warning: WVertex %d has no associated edges.\n", vertex->
GetId());
182 real cos2theta, sin2theta;
201 C->K1 = ncycle.
kmin();
202 C->K2 = ncycle.
kmax();
203 C->e1 = ncycle.
Kmax();
204 C->e2 = ncycle.
Kmin();
229 C->er =
v - (
v * n) * n;
233 cos2theta =
C->er * e1;
234 cos2theta *= cos2theta;
235 sin2theta = 1 - cos2theta;
236 C->Kr =
C->K1 * cos2theta +
C->K2 * sin2theta;
255 vector<WFace *>::iterator f, fend;
256 for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
261 vector<WEdge *>::iterator we, weend;
263 for (we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
274 int closestPointId = 0;
275 float dist, minDist = FLT_MAX;
298 dist = dist_vec.
norm();
300 if (dist < minDist) {
348 vector<WEdge *>::iterator we, weend;
350 for (we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
374 vector<WEdge *>::iterator we, weend;
376 for (we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
410 vector<WFace *>::iterator f, fend;
411 for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
453 vector<WXFaceLayer *> SmoothLayers;
456 real K1_a(0), K1_b(0);
457 Vec3r Inter_a, Inter_b;
461 if (SmoothLayers.size() != 1) {
464 faceLayer = SmoothLayers[0];
466 layer_info = (Face_Curvature_Info *)faceLayer->
userdata;
476 WVertex::face_iterator fit =
v->faces_begin();
477 WVertex::face_iterator fitend =
v->faces_end();
478 for (; fit != fitend; ++fit) {
479 WXFace *wxf =
dynamic_cast<WXFace *
>(*fit);
480 WOEdge *oppositeEdge;
481 if (!(wxf->getOppositeEdge(
v, oppositeEdge))) {
484 v1v2 = oppositeEdge->GetbVertex()->GetVertex() - oppositeEdge->GetaVertex()->GetVertex();
487 oppositeEdge->GetaVertex()->GetVertex(), v1v2, e2, -(
v->GetVertex() * e2),
t, 1.0e-06);
489 vector<WXFaceLayer *> second_ridge_layer;
490 wxf->retrieveSmoothLayers(
Nature::RIDGE, second_ridge_layer);
491 if (second_ridge_layer.size() != 1) {
494 Face_Curvature_Info *second_layer_info =
495 (Face_Curvature_Info *)second_ridge_layer[0]->userdata;
497 unsigned index1 = wxf->GetIndex(oppositeEdge->GetaVertex());
498 unsigned index2 = wxf->GetIndex(oppositeEdge->GetbVertex());
499 real K1_1 = second_layer_info->vec_curvature_info[index1]->K1;
500 real K1_2 = second_layer_info->vec_curvature_info[index2]->K1;
501 real K1 = (1.0 -
t) * K1_1 +
t * K1_2;
502 Vec3r inter((1.0 -
t) * oppositeEdge->GetaVertex()->GetVertex() +
503 t * oppositeEdge->GetbVertex()->GetVertex());
504 Vec3r vtmp(inter -
v->GetVertex());
522 d = (K1_b) - (K1_a) / (Inter_b - Inter_a).
norm();
546 if ((faceLayer->
dotP(0) < minDiff) && (faceLayer->
dotP(1) < minDiff) && (faceLayer->
dotP(2) < minDiff)) {
562 vector<WFace *>::iterator f, fend;
563 for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
596 vector<WFace *>::iterator f, fend;
597 for (f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
609 vector<WXFaceLayer *> sc_layers;
611 if (sc_layers.empty()) {
616 sc_layer = sc_layers[0];
619 vector<real> kr_derivatives;
622 WXVertex *
v, *opposite_vertex_a, *opposite_vertex_b;
625 Vec3r normal_vec, radial_normal_vec, er_vec, v_vec, inter, inter1, inter2, tmp_vec;
627 real kr(0), kr1(0), kr2(0),
t;
629 for (
unsigned int i = 0; i < vertices_nb; ++i) {
633 if (
v->isBoundary()) {
634 kr_derivatives.push_back(0);
638 v_vec =
v->GetVertex();
639 er_vec =
v->curvatures()->er;
644 wxf =
dynamic_cast<WXFace *
>(*fit);
652 radial_normal_vec = er_vec ^ normal_vec;
658 -(v_vec * radial_normal_vec),
667 tmp_vec = inter -
v->GetVertex();
669 if (tmp_vec * er_vec > 0) {
684 v->curvatures()->dKr = (kr2 - kr1) / (inter2 - inter1).norm();
685 kr_derivatives.push_back(
v->curvatures()->dKr);
700 sc_oedge = sc_edge->
woeb();
717 vector<WEdge *>::iterator we, weend;
719 for (we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
739 vector<WEdge *>::iterator we, weend;
741 for (we = wedges.begin(), weend = wedges.end(); we != weend; ++we) {
757 bool hasSmoothEdges =
false;
762 for (vector<WFace *>::iterator f = wfaces.begin(), fend = wfaces.end(); f != fend; ++f) {
763 vector<WXFaceLayer *> &faceLayers = ((
WXFace *)(*f))->getSmoothLayers();
764 for (vector<WXFaceLayer *>::iterator wxfl = faceLayers.begin(), wxflend = faceLayers.end();
767 if ((*wxfl)->BuildSmoothEdge()) {
768 hasSmoothEdges =
true;
775 for (vector<WVertex *>::iterator wv = wvertices.begin(), wvend = wvertices.end(); wv != wvend;
Detects/flags/builds extended features edges on the WXEdge structure.
_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
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
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 setProgress(unsigned i)
unsigned int getProgress() const
virtual void setTotalSteps(unsigned n)
Vec< T, N > & normalize()
unsigned frs_materialIndex() const
Vec3f & GetVertexNormal(int index)
int numberOfVertices() const
bool getOppositeEdge(const WVertex *v, WOEdge *&e)
WVertex * GetVertex(unsigned int index)
int GetIndex(WVertex *iVertex)
vector< WEdge * > & getEdgeList()
real ComputeMeanEdgeSize() const
vector< WVertex * > & getVertexList()
vector< WFace * > & GetFaceList()
vector< WEdge * > & GetEdges()
void AddNature(WXNature iNature)
const float dotP(int i) const
void setClosestPointIndex(int iIndex)
void PushDotP(float iDotP)
void ReplaceDotP(unsigned int index, float newDotP)
unsigned nPosDotP() const
WXSmoothEdge * getSmoothEdge()
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)
void setCurvatures(CurvatureInfo *ci)
CurvatureInfo * curvatures()
vector< WShape * > & getWShapes()
IconTextureDrawCall normal
ccl_gpu_kernel_postfix ccl_global float int int int int float threshold
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< 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