39 if ((iA ==
nullptr) && (
t == 1.0f)) {
43 else if ((iB ==
nullptr) && (
t == 0.0f)) {
59 if ((iA->
A() == iB->
A()) && (iA->
B() == iB->
B()) && (iA->
A() !=
nullptr) &&
60 (iA->
B() !=
nullptr) && (iB->
A() !=
nullptr) && (iB->
B() !=
nullptr)) {
63 _t2d = t1 + t2 * t3 - t1 * t3;
65 else if ((iA->
B() ==
nullptr) && (iB->
B() ==
nullptr)) {
70 else if ((iA->
t2d() == 0) && (iB->
t2d() == 0)) {
75 else if (iA->
A() == iB->
A()) {
82 else if (iB->
t2d() == 0) {
88 else if (iA->
B() == iB->
B()) {
95 else if (iB->
t2d() == 1) {
101 else if (iA->
B() == iB->
A()) {
103 if ((iA->
t2d() != 1.0f) && (iB->
t2d() == 0.0f)) {
106 _t2d = t1 + t3 - t1 * t3;
109 else if ((iA->
t2d() == 1.0f) && (iB->
t2d() != 0.0f)) {
122 else if (iA->
A() !=
nullptr && iB->
A() !=
nullptr &&
126 else if (iA->
B() !=
nullptr && iB->
B() !=
nullptr &&
130 else if (iA->
B() !=
nullptr && iB->
A() !=
nullptr &&
148 cerr <<
"Fatal error in CurvePoint::CurvePoint(CurvePoint *iA, CurvePoint *iB, float t3)"
193 cerr <<
"Warning: CurvePoint::getFEdge() failed to cast the given 0D element to CurvePoint."
197 if (((
__A == iVertexB->
__A) && (
__B == iVertexB->
__B)) ||
201 if (
__B ==
nullptr) {
202 if (iVertexB->
__B ==
nullptr) {
205 if (iVertexB->
__A ==
__A) {
208 if (iVertexB->
__B ==
__A) {
212 if (iVertexB->
__B ==
nullptr) {
213 if (iVertexB->
__A ==
__A) {
216 if (iVertexB->
__A ==
__B) {
220 if (
__B == iVertexB->
__A) {
221 if ((
_t2d != 1) && (iVertexB->
_t2d == 0)) {
224 if ((
_t2d == 1) && (iVertexB->
_t2d != 0)) {
228 if (
__B == iVertexB->
__B) {
229 if ((
_t2d != 1) && (iVertexB->
_t2d == 1)) {
232 if ((
_t2d == 1) && (iVertexB->
_t2d != 1)) {
236 if (
__A == iVertexB->
__A) {
237 if ((
_t2d == 0) && (iVertexB->
_t2d != 0)) {
240 if ((
_t2d != 0) && (iVertexB->
_t2d == 0)) {
244 if (
__A == iVertexB->
__B) {
245 if ((
_t2d == 0) && (iVertexB->
_t2d != 1)) {
248 if ((
_t2d != 0) && (iVertexB->
_t2d == 1)) {
256 printf(
"iVertexB->A() 0x%p p (%f, %f)\n",
260 printf(
"iVertexB->B() 0x%p p (%f, %f)\n",
265 printf(
"iVertexB->t2d() %f p (%f, %f)\n",
271 cerr <<
"Warning: CurvePoint::getFEdge() failed." << endl;
278 if (
__B ==
nullptr) {
281 if (
__A ==
nullptr) {
294 return ((1 - t3d) * Na + t3d * Nb);
301 return __B->material();
303 return __A->material();
306 Id CurvePoint::shape_id()
const
317 if (
__A ==
nullptr) {
324 float CurvePoint::shape_importance()
const
332 const unsigned CurvePoint::qi()
const
346 if (
__A ==
nullptr) {
349 if (
__B ==
nullptr) {
357 if (
__A ==
nullptr) {
360 if (
__B ==
nullptr) {
368 if (
__A ==
nullptr) {
371 if (
__B ==
nullptr) {
379 if (
__A ==
nullptr) {
382 if (
__B ==
nullptr) {
390 if (
__A ==
nullptr) {
393 if (
__B ==
nullptr) {
401 if (
__A ==
nullptr) {
404 if (
__B ==
nullptr) {
412 if (
__A ==
nullptr) {
415 if (
__B ==
nullptr) {
423 if (
__A ==
nullptr) {
426 if (
__B ==
nullptr) {
437 float CurvePoint::local_average_depth()
const
439 return local_average_depth_function<CurvePoint>(
this);
442 float CurvePoint::local_depth_variance()
const
444 return local_depth_variance_function<CurvePoint>(
this);
447 real CurvePoint::local_average_density(
float sigma)
const
450 return density_function<CurvePoint>(
this);
453 Vec3r shaded_color()
const;
455 Vec3r CurvePoint::orientation2d()
const
458 return __B->orientation2d();
461 return __A->orientation2d();
466 Vec3r CurvePoint::orientation3d()
const
469 return __B->orientation3d();
472 return __A->orientation3d();
477 real curvature2d()
const
479 return viewedge()->curvature2d((_VertexA->point2d() + _VertexB->point2d()) / 2.0);
482 Vec3r CurvePoint::curvature2d_as_vector()
const
487 return edgeA + edgeB;
490 return __B->curvature2d_as_vector();
493 return __A->curvature2d_as_vector();
495 return ((1 -
_t2d) *
__A->curvature2d_as_vector() +
_t2d *
__B->curvature2d_as_vector());
498 real CurvePoint::curvature2d_as_angle()
const
501 Vec3r edgeA = (_FEdges[0])->orientation2d();
502 Vec3r edgeB = (_FEdges[1])->orientation2d();
503 Vec2d N1(-edgeA.y(), edgeA.x());
505 Vec2d N2(-edgeB.y(), edgeB.x());
507 return acos((N1 * N2));
510 return __B->curvature2d_as_angle();
513 return __A->curvature2d_as_angle();
515 return ((1 -
_t2d) *
__A->curvature2d_as_angle() +
_t2d *
__B->curvature2d_as_angle());
518 real CurvePoint::curvatureFredo()
const
521 return __B->curvatureFredo();
524 return __A->curvatureFredo();
526 return ((1 -
_t2d) *
__A->curvatureFredo() +
_t2d *
__B->curvatureFredo());
529 Vec2d CurvePoint::directionFredo()
const
532 return __B->directionFredo();
535 return __A->directionFredo();
537 return ((1 -
_t2d) *
__A->directionFredo() +
_t2d *
__B->directionFredo());
554 for (vertex_container::iterator it =
_Vertices.begin(), itend =
_Vertices.end(); it != itend;
565 vertex_container::iterator second =
_Vertices.begin();
574 vertex_container::const_iterator second =
_Vertices.begin();
632 vertex_container::iterator second =
_Vertices.begin();
648 vertex_container::iterator last =
_Vertices.end();
674 vertex_container::iterator second =
_Vertices.begin();
691 vertex_container::iterator last =
_Vertices.end();
717 Vec3r shaded_color(
int iCombination = 0)
const;
719 Vec3r Curve::orientation2d(point_iterator it)
const
721 return (*it)->orientation2d();
724 template<
class BaseVertex>
Vec3r Curve::orientation2d(
int iCombination)
const
726 return edge_orientation2d_function<Curve>(
this, iCombination);
729 Vec3r Curve::orientation3d(point_iterator it)
const
731 return (*it)->orientation3d();
734 Vec3r Curve::orientation3d(
int iCombination)
const
736 return edge_orientation3d_function<Curve>(
this, iCombination);
739 real curvature2d(point_iterator it)
const
741 return (*it)->curvature2d();
744 real curvature2d(
int iCombination = 0)
const;
749 const Material &mat = (*v)->material();
750 for (;
v != vend; ++
v) {
751 if ((*v)->material() != mat) {
758 int Curve::qi()
const
761 int qi_ = (*v)->qi();
762 for (;
v != vend; ++
v) {
763 if ((*v)->qi() != qi_) {
770 occluder_container::const_iterator occluders_begin()
const
772 return _FEdgeA->occluders().begin();
775 occluder_container::const_iterator occluders_end()
const
777 return _FEdgeA->occluders().end();
780 int Curve::occluders_size()
const
785 bool Curve::occluders_empty()
const
788 bool empty = (*v)->occluders_empty();
789 for (;
v != vend; ++
v) {
790 if ((*v)->occluders_empty() !=
empty) {
797 const Polygon3r &occludee()
const
799 return *(_FEdgeA->aFace());
802 const SShape *Curve::occluded_shape()
const
805 const SShape *sshape = (*v)->occluded_shape();
806 for (;
v != vend; ++
v) {
807 if ((*v)->occluded_shape() != sshape) {
814 const bool Curve::occludee_empty()
const
817 bool empty = (*v)->occludee_empty();
818 for (;
v != vend; ++
v) {
819 if ((*v)->occludee_empty() !=
empty) {
825 real Curve::z_discontinuity(
int iCombination)
const
827 return z_discontinuity_edge_function<Curve>(
this, iCombination);
830 int Curve::shape_id()
const
833 Id
id = (*v)->shape_id();
834 for (;
v != vend; ++
v) {
835 if ((*v)->shape_id() !=
id) {
842 const SShape *Curve::shape()
const
845 const SShape *sshape = (*v)->shape();
846 for (;
v != vend; ++
v) {
847 if ((*v)->shape() != sshape) {
854 occluder_container::const_iterator Curve::occluders_begin()
const
857 return (*v)->occluders_begin();
860 occluder_container::const_iterator Curve::occluders_end()
const
863 return (*v)->occluders_end();
866 Vec3r Curve::curvature2d_as_vector(
int iCombination)
const
868 return curvature2d_as_vector_edge_function<Curve>(
this, iCombination);
871 real Curve::curvature2d_as_angle(
int iCombination)
const
873 return curvature2d_as_angle_edge_function<Curve>(
this, iCombination);
876 float Curve::shape_importance(
int iCombination)
const
878 return shape_importance_edge_function<Curve>(
this, iCombination);
881 float Curve::local_average_depth(
int iCombination)
const
883 return local_average_depth_edge_function<Curve>(
this, iCombination);
886 float Curve::local_depth_variance(
int iCombination)
const
888 return local_depth_variance_edge_function<Curve>(
this, iCombination);
890 local_depth_variance_functor<Point> functor;
892 Evaluate<float, local_depth_variance_functor<Point> >(&functor, iCombination,
result);
897 real Curve::local_average_density(
float sigma,
int iCombination)
const
899 return density_edge_function<Curve>(
this, iCombination);
901 density_functor<Point> functor;
903 Evaluate<real, density_functor<Point> >(&functor, iCombination,
result);
911 void Curve::computeCurvatureAndOrientation()
918 p0 =
Vec2d(p[0], p[1]);
922 p1 =
Vec2d(p[0], p[1]);
923 Vec2d prevDir(p1 - p0);
925 for (;
v ! = vend; ++
v) {
931 Vec3r p2 = (*v2)->point2d();
935 real lba = BA.norm(), lbc = BC.norm();
938 Vec2d normalCurvature = BA + BC;
944 if (lba + lbc > MY_EPSILON) {
945 curvature /= (0.5 * lba + lbc);
947 if (dir.norm() < MY_EPSILON) {
950 (*v)->setCurvatureFredo(curvature);
951 (*v)->setDirectionFredo(dir);
959 (*v)->setCurvatureFredo((*prevV)->curvatureFredo());
960 (*v)->setDirectionFredo((*v)->point2d() - (*prevV)->point2d());
964 (*v0)->setCurvatureFredo((*v2)->curvatureFredo());
965 (*v0)->setDirectionFredo((*v2)->point2d() - (*v0)->point2d());
977 p0 =
Vec2d(p[0], p[1]);
981 p1 =
Vec2d(p[0], p[1]);
982 bool isReliable =
false;
983 if ((p1 - p0).
norm > EPS_CURVA) {
988 for (;
v != vend; ++
v) {
994 Vec3r p2 = (*v2)->point2d();
998 real lba = BA.norm(), lbc = BC.norm();
1000 if ((lba + lbc) < EPS_CURVA) {
1008 for (; vfix !=
v; ++vfix) {
1009 (*vfix)->setCurvatureFredo((*v)->curvatureFredo());
1010 (*vfix)->setDirectionFredo((*v)->directionFredo());
Iterators used to iterate over the elements of the Curve. Can't be used in python.
Iterators used to iterate over the elements of the Curve.
Class to define a container for curves.
_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
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
const Vec3r & point2d() const
virtual FEdge * getFEdge(Interface0D &inter)
int occluders_size() const
real z_discontinuity() const
CurvePoint & operator=(const CurvePoint &iBrother)
bool occluders_empty() const
occluder_container::const_iterator occluders_begin() const
const SShape * occluded_shape() const
virtual Nature::VertexNature getNature() const
bool occludee_empty() const
virtual Vec2r getPoint2D() const
occluder_container::const_iterator occluders_end() const
const Polygon3r & occludee() const
const SShape * shape() const
point_iterator vertices_end()
vertex_container _Vertices
CurveInternal::__point_iterator< CurveInternal::CurvePoint_nonconst_traits > point_iterator
virtual Interface0DIterator verticesBegin()
virtual Interface0DIterator verticesEnd()
point_iterator points_end(float step=0)
CurveInternal::__point_iterator< CurveInternal::CurvePoint_const_traits > const_point_iterator
virtual Interface0DIterator pointsBegin(float t=0.0f)
CurveInternal::CurvePointIterator curvePointsBegin(float t=0.0f)
CurveInternal::CurvePointIterator curveVerticesBegin()
CurveInternal::CurvePointIterator curveVerticesEnd()
virtual Interface0DIterator pointsEnd(float t=0.0f)
point_iterator vertices_begin()
point_iterator points_begin(float step=0)
const_point_iterator const_vertex_iterator
CurveInternal::CurvePointIterator curvePointsEnd(float t=0.0f)
static int getException()
static int raiseException(exception_type exception=UNDEFINED)
bool occluders_empty() const
int occluders_size() const
occluder_container::const_iterator occluders_end() const
occluder_container::const_iterator occluders_begin() const
const SShape * occluded_shape() const
const Polygon3r & occludee() const
real z_discontinuity() const
bool occludee_empty() const
const SShape * occluded_shape() const
virtual FEdge * getFEdge(Interface0D &)
const Vec3r & point2d() const
real z_discontinuity() const
occluder_container::const_iterator occluders_begin() const
bool occluders_empty() const
virtual Vec2r getPoint2D() const
occluder_container::const_iterator occluders_end() const
int occluders_size() const
const Polygon3r & occludee() const
const Vec3r & point3d() const
bool occludee_empty() const
float shape_importance() const
static real ImageToWorldParameter(FEdge *fe, real t)
Vec< T, N > & normalize()
IconTextureDrawCall normal
VecMat::Vec2< double > Vec2d
VecMat::Vec3< real > Vec3r
static const VertexNature T_VERTEX
INLINE Rall1d< T, V, S > acos(const Rall1d< T, V, S > &x)