53 if ((iA ==
nullptr) && (
t == 1.0f)) {
57 else if ((iB ==
nullptr) && (
t == 0.0f)) {
73 if ((iA->
A() == iB->
A()) && (iA->
B() == iB->
B()) && (iA->
A() !=
nullptr) &&
74 (iA->
B() !=
nullptr) && (iB->
A() !=
nullptr) && (iB->
B() !=
nullptr)) {
77 _t2d = t1 + t2 * t3 - t1 * t3;
79 else if ((iA->
B() ==
nullptr) && (iB->
B() ==
nullptr)) {
84 else if ((iA->
t2d() == 0) && (iB->
t2d() == 0)) {
89 else if (iA->
A() == iB->
A()) {
96 else if (iB->
t2d() == 0) {
102 else if (iA->
B() == iB->
B()) {
104 if (iA->
t2d() == 1) {
109 else if (iB->
t2d() == 1) {
115 else if (iA->
B() == iB->
A()) {
117 if ((iA->
t2d() != 1.0f) && (iB->
t2d() == 0.0f)) {
120 _t2d = t1 + t3 - t1 * t3;
123 else if ((iA->
t2d() == 1.0f) && (iB->
t2d() != 0.0f)) {
136 else if (iA->
A() !=
nullptr && iB->
A() !=
nullptr &&
140 else if (iA->
B() !=
nullptr && iB->
B() !=
nullptr &&
144 else if (iA->
B() !=
nullptr && iB->
A() !=
nullptr &&
162 cerr <<
"Fatal error in CurvePoint::CurvePoint(CurvePoint *iA, CurvePoint *iB, float t3)"
207 cerr <<
"Warning: CurvePoint::getFEdge() failed to cast the given 0D element to CurvePoint."
211 if (((
__A == iVertexB->
__A) && (
__B == iVertexB->
__B)) ||
215 if (
__B ==
nullptr) {
216 if (iVertexB->
__B ==
nullptr) {
219 if (iVertexB->
__A ==
__A) {
222 if (iVertexB->
__B ==
__A) {
226 if (iVertexB->
__B ==
nullptr) {
227 if (iVertexB->
__A ==
__A) {
230 if (iVertexB->
__A ==
__B) {
234 if (
__B == iVertexB->
__A) {
235 if ((
_t2d != 1) && (iVertexB->
_t2d == 0)) {
238 if ((
_t2d == 1) && (iVertexB->
_t2d != 0)) {
242 if (
__B == iVertexB->
__B) {
243 if ((
_t2d != 1) && (iVertexB->
_t2d == 1)) {
246 if ((
_t2d == 1) && (iVertexB->
_t2d != 1)) {
250 if (
__A == iVertexB->
__A) {
251 if ((
_t2d == 0) && (iVertexB->
_t2d != 0)) {
254 if ((
_t2d != 0) && (iVertexB->
_t2d == 0)) {
258 if (
__A == iVertexB->
__B) {
259 if ((
_t2d == 0) && (iVertexB->
_t2d != 1)) {
262 if ((
_t2d != 0) && (iVertexB->
_t2d == 1)) {
270 printf(
"iVertexB->A() 0x%p p (%f, %f)\n",
274 printf(
"iVertexB->B() 0x%p p (%f, %f)\n",
279 printf(
"iVertexB->t2d() %f p (%f, %f)\n",
285 cerr <<
"Warning: CurvePoint::getFEdge() failed." << endl;
292 if (
__B ==
nullptr) {
295 if (
__A ==
nullptr) {
308 return ((1 - t3d) * Na + t3d * Nb);
315 return __B->material();
317 return __A->material();
320 Id CurvePoint::shape_id()
const
331 if (
__A ==
nullptr) {
338 float CurvePoint::shape_importance()
const
346 const unsigned CurvePoint::qi()
const
360 if (
__A ==
nullptr) {
363 if (
__B ==
nullptr) {
371 if (
__A ==
nullptr) {
374 if (
__B ==
nullptr) {
382 if (
__A ==
nullptr) {
385 if (
__B ==
nullptr) {
393 if (
__A ==
nullptr) {
396 if (
__B ==
nullptr) {
404 if (
__A ==
nullptr) {
407 if (
__B ==
nullptr) {
415 if (
__A ==
nullptr) {
418 if (
__B ==
nullptr) {
426 if (
__A ==
nullptr) {
429 if (
__B ==
nullptr) {
437 if (
__A ==
nullptr) {
440 if (
__B ==
nullptr) {
451 float CurvePoint::local_average_depth()
const
453 return local_average_depth_function<CurvePoint>(
this);
456 float CurvePoint::local_depth_variance()
const
458 return local_depth_variance_function<CurvePoint>(
this);
461 real CurvePoint::local_average_density(
float sigma)
const
464 return density_function<CurvePoint>(
this);
467 Vec3r shaded_color()
const;
469 Vec3r CurvePoint::orientation2d()
const
472 return __B->orientation2d();
475 return __A->orientation2d();
480 Vec3r CurvePoint::orientation3d()
const
483 return __B->orientation3d();
486 return __A->orientation3d();
491 real curvature2d()
const
493 return viewedge()->curvature2d((_VertexA->point2d() + _VertexB->point2d()) / 2.0);
496 Vec3r CurvePoint::curvature2d_as_vector()
const
501 return edgeA + edgeB;
504 return __B->curvature2d_as_vector();
507 return __A->curvature2d_as_vector();
509 return ((1 -
_t2d) *
__A->curvature2d_as_vector() +
_t2d *
__B->curvature2d_as_vector());
512 real CurvePoint::curvature2d_as_angle()
const
515 Vec3r edgeA = (_FEdges[0])->orientation2d();
516 Vec3r edgeB = (_FEdges[1])->orientation2d();
517 Vec2d N1(-edgeA.y(), edgeA.x());
519 Vec2d N2(-edgeB.y(), edgeB.x());
521 return acos((N1 * N2));
524 return __B->curvature2d_as_angle();
527 return __A->curvature2d_as_angle();
529 return ((1 -
_t2d) *
__A->curvature2d_as_angle() +
_t2d *
__B->curvature2d_as_angle());
532 real CurvePoint::curvatureFredo()
const
535 return __B->curvatureFredo();
538 return __A->curvatureFredo();
540 return ((1 -
_t2d) *
__A->curvatureFredo() +
_t2d *
__B->curvatureFredo());
543 Vec2d CurvePoint::directionFredo()
const
546 return __B->directionFredo();
549 return __A->directionFredo();
551 return ((1 -
_t2d) *
__A->directionFredo() +
_t2d *
__B->directionFredo());
568 for (vertex_container::iterator it =
_Vertices.begin(), itend =
_Vertices.end(); it != itend;
579 vertex_container::iterator second =
_Vertices.begin();
588 vertex_container::const_iterator second =
_Vertices.begin();
646 vertex_container::iterator second =
_Vertices.begin();
662 vertex_container::iterator last =
_Vertices.end();
688 vertex_container::iterator second =
_Vertices.begin();
705 vertex_container::iterator last =
_Vertices.end();
731 Vec3r shaded_color(
int iCombination = 0)
const;
733 Vec3r Curve::orientation2d(point_iterator it)
const
735 return (*it)->orientation2d();
738 template<
class BaseVertex>
Vec3r Curve::orientation2d(
int iCombination)
const
740 return edge_orientation2d_function<Curve>(
this, iCombination);
743 Vec3r Curve::orientation3d(point_iterator it)
const
745 return (*it)->orientation3d();
748 Vec3r Curve::orientation3d(
int iCombination)
const
750 return edge_orientation3d_function<Curve>(
this, iCombination);
753 real curvature2d(point_iterator it)
const
755 return (*it)->curvature2d();
758 real curvature2d(
int iCombination = 0)
const;
763 const Material &mat = (*v)->material();
764 for (;
v != vend; ++
v) {
765 if ((*v)->material() != mat) {
772 int Curve::qi()
const
775 int qi_ = (*v)->qi();
776 for (;
v != vend; ++
v) {
777 if ((*v)->qi() != qi_) {
784 occluder_container::const_iterator occluders_begin()
const
786 return _FEdgeA->occluders().begin();
789 occluder_container::const_iterator occluders_end()
const
791 return _FEdgeA->occluders().end();
794 int Curve::occluders_size()
const
799 bool Curve::occluders_empty()
const
802 bool empty = (*v)->occluders_empty();
803 for (;
v != vend; ++
v) {
804 if ((*v)->occluders_empty() !=
empty) {
811 const Polygon3r &occludee()
const
813 return *(_FEdgeA->aFace());
816 const SShape *Curve::occluded_shape()
const
819 const SShape *sshape = (*v)->occluded_shape();
820 for (;
v != vend; ++
v) {
821 if ((*v)->occluded_shape() != sshape) {
828 const bool Curve::occludee_empty()
const
831 bool empty = (*v)->occludee_empty();
832 for (;
v != vend; ++
v) {
833 if ((*v)->occludee_empty() !=
empty) {
839 real Curve::z_discontinuity(
int iCombination)
const
841 return z_discontinuity_edge_function<Curve>(
this, iCombination);
844 int Curve::shape_id()
const
847 Id
id = (*v)->shape_id();
848 for (;
v != vend; ++
v) {
849 if ((*v)->shape_id() !=
id) {
856 const SShape *Curve::shape()
const
859 const SShape *sshape = (*v)->shape();
860 for (;
v != vend; ++
v) {
861 if ((*v)->shape() != sshape) {
868 occluder_container::const_iterator Curve::occluders_begin()
const
871 return (*v)->occluders_begin();
874 occluder_container::const_iterator Curve::occluders_end()
const
877 return (*v)->occluders_end();
880 Vec3r Curve::curvature2d_as_vector(
int iCombination)
const
882 return curvature2d_as_vector_edge_function<Curve>(
this, iCombination);
885 real Curve::curvature2d_as_angle(
int iCombination)
const
887 return curvature2d_as_angle_edge_function<Curve>(
this, iCombination);
890 float Curve::shape_importance(
int iCombination)
const
892 return shape_importance_edge_function<Curve>(
this, iCombination);
895 float Curve::local_average_depth(
int iCombination)
const
897 return local_average_depth_edge_function<Curve>(
this, iCombination);
900 float Curve::local_depth_variance(
int iCombination)
const
902 return local_depth_variance_edge_function<Curve>(
this, iCombination);
904 local_depth_variance_functor<Point> functor;
906 Evaluate<float, local_depth_variance_functor<Point> >(&functor, iCombination,
result);
911 real Curve::local_average_density(
float sigma,
int iCombination)
const
913 return density_edge_function<Curve>(
this, iCombination);
915 density_functor<Point> functor;
917 Evaluate<real, density_functor<Point> >(&functor, iCombination,
result);
925 void Curve::computeCurvatureAndOrientation()
932 p0 =
Vec2d(p[0], p[1]);
936 p1 =
Vec2d(p[0], p[1]);
937 Vec2d prevDir(p1 - p0);
939 for (;
v ! = vend; ++
v) {
945 Vec3r p2 = (*v2)->point2d();
949 real lba = BA.norm(), lbc = BC.norm();
952 Vec2d normalCurvature = BA + BC;
958 if (lba + lbc > MY_EPSILON) {
959 curvature /= (0.5 * lba + lbc);
961 if (dir.norm() < MY_EPSILON) {
964 (*v)->setCurvatureFredo(curvature);
965 (*v)->setDirectionFredo(dir);
973 (*v)->setCurvatureFredo((*prevV)->curvatureFredo());
974 (*v)->setDirectionFredo((*v)->point2d() - (*prevV)->point2d());
978 (*v0)->setCurvatureFredo((*v2)->curvatureFredo());
979 (*v0)->setDirectionFredo((*v2)->point2d() - (*v0)->point2d());
991 p0 =
Vec2d(p[0], p[1]);
995 p1 =
Vec2d(p[0], p[1]);
996 bool isReliable =
false;
997 if ((p1 - p0).
norm > EPS_CURVA) {
1002 for (;
v != vend; ++
v) {
1008 Vec3r p2 = (*v2)->point2d();
1012 real lba = BA.norm(), lbc = BC.norm();
1014 if ((lba + lbc) < EPS_CURVA) {
1022 for (; vfix !=
v; ++vfix) {
1023 (*vfix)->setCurvatureFredo((*v)->curvatureFredo());
1024 (*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)