32#ifdef WITH_CXX_GUARDEDALLOC
112 return Vec2r(_Point2D.
x(), _Point2D.
y());
147 vector<FEdge *> _FEdges;
151 real _curvatureFredo;
152 Vec2r _directionFredo;
189 _Normals = iBrother._Normals;
190 _FEdges = iBrother.
fedges();
191 _Shape = iBrother.
shape();
192 _pViewVertex = iBrother._pViewVertex;
193 if (!(iBrother._curvature_info)) {
197 _curvature_info =
new CurvatureInfo(*(iBrother._curvature_info));
206 if (_curvature_info) {
207 delete _curvature_info;
221 return ((_Point2D == iBrother._Point2D) && (_Point3D == iBrother._Point3D));
247 return _Normals.size();
257 return _FEdges.begin();
262 return _FEdges.end();
300 _Normals.insert(iNormal);
305 if (_curvature_info) {
306 delete _curvature_info;
308 _curvature_info = ci;
313 return _curvature_info;
318 void setCurvatureFredo(
real c)
323 void setDirectionFredo(
Vec2r d)
328 real curvatureFredo()
330 return _curvatureFredo;
333 const Vec2r directionFredo()
335 return _directionFredo;
357 _pViewVertex = iViewVertex;
363 _FEdges.push_back(iFEdge);
369 for (vector<FEdge *>::iterator fe = _FEdges.begin(), fend = _FEdges.end(); fe != fend; fe++) {
370 if (iFEdge == (*fe)) {
380 vector<FEdge *>::iterator insertedfe;
381 for (vector<FEdge *>::iterator fe = _FEdges.begin(), fend = _FEdges.end(); fe != fend; fe++) {
383 insertedfe = _FEdges.insert(fe, e2);
387 _FEdges.erase(insertedfe);
409 if (_Normals.size() == 1) {
410 return (*(_Normals.begin()));
413 return *(_Normals.begin());
431 inline float local_average_depth()
const;
432 inline float local_depth_variance()
const;
433 inline real local_average_density(
float sigma = 2.3f)
const;
434 inline Vec3r shaded_color()
const;
435 inline Vec3r orientation2d()
const;
436 inline Vec3r orientation3d()
const;
437 inline Vec3r curvature2d_as_vector()
const;
439 inline real curvature2d_as_angle()
const;
442#ifdef WITH_CXX_GUARDEDALLOC
443 MEM_CXX_CLASS_ALLOC_FUNCS(
"Freestyle:SVertex")
644 return _Occluders.size();
674 inline bool hasVisibilityPoint()
const
676 return _hasVisibilityPoint;
679 inline Vec3r visibilityPointA()
const
681 return _VisibilityPointA;
684 inline Vec3r visibilityPointB()
const
686 return _VisibilityPointB;
759 inline void AddOccluder(
Polygon3r &iPolygon)
761 _Occluders.push_back(iPolygon);
772 inline void setHasVisibilityPoint(
bool iBool)
774 _hasVisibilityPoint = iBool;
777 inline void setVisibilityPointA(
const Vec3r &iPoint)
779 _VisibilityPointA = iPoint;
782 inline void setVisibilityPointB(
const Vec3r &iPoint)
784 _VisibilityPointB = iPoint;
826 if ((
nullptr == iEdge1) || (
nullptr == iEdge2)) {
835 if ((sv1 == sv3) || (sv1 == sv4)) {
838 else if ((sv2 == sv3) || (sv2 == sv4)) {
872 inline const int qi()
const
900 inline float local_average_depth(
int iCombination = 0)
const;
901 inline float local_depth_variance(
int iCombination = 0)
const;
902 inline real local_average_density(
float sigma = 2.3f,
int iCombination = 0)
const;
903 inline Vec3r shaded_color(
int iCombination = 0)
const {}
921 inline real curvature2d()
const
926 inline Vec3r curvature2d_as_vector(
int iCombination = 0)
const;
929 inline real curvature2d_as_angle(
int iCombination = 0)
const;
945 virtual inline Interface0DIterator
pointsBegin(
float t = 0.0f);
953 virtual inline Interface0DIterator
pointsEnd(
float t = 0.0f);
955#ifdef WITH_CXX_GUARDEDALLOC
956 MEM_CXX_CLASS_ALLOC_FUNCS(
"Freestyle:FEdge")
965namespace FEdgeInternal {
977 _vertex = vi._vertex;
989 _vertex = vi._vertex;
996 return "SVertexIterator";
1037 if (_vertex == _edge->
vertexB()) {
1047 if (_vertex == _edge->
vertexA()) {
1057 return _vertex == _edge->
vertexA();
1062 return _vertex == _edge->
vertexB();
1071 return ((_vertex == it_exact->_vertex) && (_edge == it_exact->_edge));
1074 virtual float t()
const
1076 if (_vertex == _edge->
vertexA()) {
1081 virtual float u()
const
1083 if (_vertex == _edge->
vertexA()) {
1143 return "FEdgeSharp";
1268#ifdef WITH_CXX_GUARDEDALLOC
1269 MEM_CXX_CLASS_ALLOC_FUNCS(
"Freestyle:FEdgeSharp")
1281 bool _hasVisibilityPoint;
1282 Vec3r _VisibilityPointA;
1283 Vec3r _VisibilityPointB;
1293 return "FEdgeSmooth";
1383#ifdef WITH_CXX_GUARDEDALLOC
1384 MEM_CXX_CLASS_ALLOC_FUNCS(
"Freestyle:FEdgeSmooth")
1400 vector<FEdge *> _chains;
1401 vector<SVertex *> _verticesList;
1402 vector<FEdge *> _edgesList;
1405 string _LibraryPath;
1407 vector<FrsMaterial> _FrsMaterials;
1424 _ViewShape =
nullptr;
1432 _Name = iBrother._Name;
1433 _LibraryPath = iBrother._LibraryPath;
1434 _BBox = iBrother.
bbox();
1435 _FrsMaterials = iBrother._FrsMaterials;
1436 _importance = iBrother._importance;
1437 _ViewShape = iBrother._ViewShape;
1442 vector<SVertex *>::iterator sv, svend;
1444 for (sv = verticesList.begin(), svend = verticesList.end(); sv != svend; sv++) {
1447 _verticesList.push_back(newv);
1453 vector<FEdge *>::iterator
e, eend;
1454 vector<FEdge *> &edgesList = iBrother.
getEdgeList();
1455 for (
e = edgesList.begin(), eend = edgesList.end();
e != eend;
e++) {
1457 _edgesList.push_back(newe);
1463 vector<FEdge *>::iterator fe, fend;
1464 vector<FEdge *> &fedges = iBrother.
getChains();
1465 for (fe = fedges.begin(), fend = fedges.end(); fe != fend; fe++) {
1466 _chains.push_back((
FEdge *)((*fe)->userdata));
1472 for (sv = _verticesList.begin(), svend = _verticesList.end(); sv != svend; sv++) {
1473 const vector<FEdge *> &fedgeList = (*sv)->fedges();
1474 vector<FEdge *> newfedgelist;
1475 for (vector<FEdge *>::const_iterator fed = fedgeList.begin(), fedend = fedgeList.end();
1479 FEdge *current = *fed;
1480 newfedgelist.push_back((
FEdge *)current->userdata);
1482 (*sv)->setFEdges(newfedgelist);
1488 for (
e = _edgesList.begin(), eend = _edgesList.end();
e != eend;
e++) {
1489 (*e)->setVertexA((
SVertex *)((*e)->vertexA()->userdata));
1490 (*e)->setVertexB((
SVertex *)((*e)->vertexB()->userdata));
1491 (*e)->setNextEdge((
FEdge *)((*e)->nextEdge()->userdata));
1492 (*e)->setPreviousEdge((
FEdge *)((*e)->previousEdge()->userdata));
1500 for (sv = _verticesList.begin(), svend = _verticesList.end(); sv != svend; sv++) {
1501 (*sv)->userdata =
nullptr;
1507 for (
e = _edgesList.begin(), eend = _edgesList.end();
e != eend;
e++) {
1508 (*e)->userdata =
nullptr;
1522 vector<SVertex *>::iterator sv, svend;
1523 vector<FEdge *>::iterator
e, eend;
1524 if (0 != _verticesList.size()) {
1525 for (sv = _verticesList.begin(), svend = _verticesList.end(); sv != svend; sv++) {
1528 _verticesList.clear();
1531 if (0 != _edgesList.size()) {
1532 for (
e = _edgesList.begin(), eend = _edgesList.end();
e != eend;
e++) {
1540 if (0 != _chains.size()) {
1548 _edgesList.push_back(iEdge);
1557 _verticesList.push_back(iv);
1562 _chains.push_back(iEdge);
1591 inline void SplitEdge(
FEdge *fe,
const vector<Vec2r> &iParameters, vector<FEdge *> &ioNewEdges)
1600 Vec3r newpoint3d, newpoint2d;
1601 vector<SVertex *> intersections;
1603 for (vector<Vec2r>::const_iterator p = iParameters.begin(), pend = iParameters.end();
1610 if ((t < 0) || (t > 1)) {
1611 cerr <<
"Warning: Intersection out of range for edge " << ioA->
getId() <<
" - "
1612 << ioB->
getId() << endl;
1616 newpoint3d =
Vec3r(A + T * (
B - A));
1617 newpoint2d =
Vec3r(a + t * (
b - a));
1625 intersections.push_back(newVertex);
1631 for (vector<SVertex *>::iterator sv = intersections.begin(), svend = intersections.end();
1642 (fe)->setVertexB((*sv));
1666 ioNewEdges.push_back(newEdge);
1677 (fe)->setNextEdge(
nullptr);
1683 (*sv)->AddFEdge((fe));
1684 (*sv)->AddFEdge(newEdge);
1740 B->Replace(ioEdge, newEdge);
1768 if (0 == _verticesList.size()) {
1772 Vec3r firstVertex = _verticesList[0]->point3D();
1773 real XMax = firstVertex[0];
1774 real YMax = firstVertex[1];
1775 real ZMax = firstVertex[2];
1777 real XMin = firstVertex[0];
1778 real YMin = firstVertex[1];
1779 real ZMin = firstVertex[2];
1781 vector<SVertex *>::iterator
v, vend;
1783 for (
v = _verticesList.begin(), vend = _verticesList.end();
v != vend;
v++) {
1784 Vec3r vertex = (*v)->point3D();
1790 else if (x < XMin) {
1799 else if (y < YMin) {
1808 else if (
z < ZMin) {
1818 for (vector<FEdge *>::iterator fe = _chains.begin(), feend = _chains.end(); fe != feend; fe++)
1820 if (iEdge == (*fe)) {
1829 for (vector<FEdge *>::iterator fe = _edgesList.begin(), feend = _edgesList.end(); fe != feend;
1832 if (iEdge == (*fe)) {
1833 _edgesList.erase(fe);
1843 return _verticesList;
1866 return _FrsMaterials[i];
1872 return _FrsMaterials;
1900 return _LibraryPath;
1919 _LibraryPath = path;
1925 _FrsMaterials = iMaterials;
1930 _ViewShape = iShape;
1938#ifdef WITH_CXX_GUARDEDALLOC
1939 MEM_CXX_CLASS_ALLOC_FUNCS(
"Freestyle:SShape")
A class to hold a bounding box.
GTS - Library for the manipulation of triangulated surfaces.
Singleton to manage exceptions.
Configuration definitions.
Class used to handle materials.
Vectors and Matrices (useful type definitions)
Interface to 0D elements.
Interface 1D and related tools definitions.
Read Guarded memory(de)allocation.
Class to define a polygon.
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
static int raiseException(exception_type exception=UNDEFINED)
virtual bool isEnd() const
virtual SVertex & operator*()
SVertexIterator & operator=(const SVertexIterator &vi)
virtual SVertexIterator & operator--()
virtual bool operator==(const Interface0DIteratorNested &it) const
virtual string getExactTypeName() const
virtual bool isBegin() const
SVertexIterator(const SVertexIterator &vi)
virtual SVertexIterator operator--(int)
virtual SVertex * operator->()
SVertexIterator(SVertex *v, FEdge *edge)
virtual SVertexIterator * copy() const
virtual SVertexIterator & operator++()
virtual SVertexIterator operator++(int)
const FrsMaterial & aFrsMaterial() const
void setaFaceMark(bool iFaceMark)
void setaFrsMaterialIndex(uint i)
virtual string getExactTypeName() const
uint aFrsMaterialIndex() const
FEdgeSharp(FEdgeSharp &iBrother)
void setNormalB(const Vec3r &iNormal)
const FrsMaterial & bFrsMaterial() const
void setbFrsMaterialIndex(uint i)
FEdgeSharp(SVertex *vA, SVertex *vB)
void setbFaceMark(bool iFaceMark)
virtual FEdge * duplicate()
void setNormalA(const Vec3r &iNormal)
uint bFrsMaterialIndex() const
virtual string getExactTypeName() const
void setNormal(const Vec3r &iNormal)
void setFrsMaterialIndex(uint i)
virtual FEdge * duplicate()
FEdgeSmooth(FEdgeSmooth &iBrother)
const FrsMaterial & frs_material() const
FEdgeSmooth(SVertex *vA, SVertex *vB)
void setFaceMark(bool iFaceMark)
void setFace(void *iFace)
uint frs_materialIndex() const
virtual Interface0DIterator verticesBegin()
void setOccludeeEmpty(bool iempty)
ViewEdge * viewedge() const
void setTemporary(bool iFlag)
bool occluders_empty() const
int occluders_size() const
void setVertexB(SVertex *vB)
occluder_container::const_iterator occluders_end() const
const SVertex * max2d() const
occluder_container::const_iterator occluders_begin() const
static SVertex * CommonVertex(FEdge *iEdge1, FEdge *iEdge2)
virtual FEdge * duplicate()
virtual Interface0DIterator pointsBegin(float t=0.0f)
const SVertex * min2d() const
Vec3r orientation2d() const
void setViewEdge(ViewEdge *iViewEdge)
const Polygon3r & aFace() const
const SShape * occluded_shape() const
int viewedge_nature() const
void setNextEdge(FEdge *iEdge)
SVertex * operator[](const ushort &i) const
FEdge(SVertex *vA, SVertex *vB)
virtual real getLength2D() const
void setNature(Nature::EdgeNature iNature)
Vec3r _occludeeIntersection
virtual Interface0DIterator pointsEnd(float t=0.0f)
void setSmooth(bool iFlag)
void setPreviousEdge(FEdge *iEdge)
void setIsInImage(bool iFlag)
virtual string getExactTypeName() const
float shape_importance() const
void setaFace(Polygon3r &iFace)
virtual Interface0DIterator verticesEnd()
Vec3r orientation3d() const
void setVertexA(SVertex *vA)
Nature::EdgeNature getNature() const
void setOccludeeIntersection(const Vec3r &iPoint)
real z_discontinuity() const
Nature::EdgeNature _Nature
const Vec3r & getOccludeeIntersection()
const Polygon3r & occludee() const
bool occludee_empty() const
id_type getSecond() const
void RemoveEdgeFromChain(FEdge *iEdge)
vector< SVertex * > & getVertexList()
FEdge * SplitEdgeIn2(FEdge *ioEdge, SVertex *ioNewVertex)
void AddChain(FEdge *iEdge)
void setFrsMaterials(const vector< FrsMaterial > &iMaterials)
void setImportance(float importance)
void setViewShape(ViewShape *iShape)
const BBox< Vec3r > & bbox()
const vector< FrsMaterial > & frs_materials() const
virtual SShape * duplicate()
SVertex * CreateSVertex(const Vec3r &P3D, const Vec3r &P2D, const Id &id)
void setLibraryPath(const string &path)
vector< FEdge * > & getChains()
void SplitEdge(FEdge *fe, const vector< Vec2r > &iParameters, vector< FEdge * > &ioNewEdges)
void RemoveEdge(FEdge *iEdge)
void setBBox(const BBox< Vec3r > &iBBox)
void AddNewVertex(SVertex *iv)
const FrsMaterial & frs_material(uint i) const
void setName(const string &name)
vector< FEdge * > & getEdgeList()
const string & getLibraryPath() const
const string & getName() const
void AddEdge(FEdge *iEdge)
virtual bool operator==(const SVertex &iBrother)
ViewVertex * viewvertex()
const SShape * occluded_shape() const
virtual FEdge * getFEdge(Interface0D &)
virtual real getY() const
void setPoint2D(const Vec3r &iPoint2D)
void setViewVertex(ViewVertex *iViewVertex)
void setShape(SShape *iShape)
fedges_container::iterator fedges_begin()
virtual Vec3r getPoint3D() const
void setCurvatureInfo(CurvatureInfo *ci)
virtual ViewVertex * castToViewVertex()
real z_discontinuity() const
occluder_container::const_iterator occluders_begin() const
virtual real getX() const
fedges_container::iterator fedges_end()
bool occluders_empty() const
void AddNormal(const Vec3r &iNormal)
const Vec3r & point3d() const
virtual Vec2r getPoint2D() const
virtual string getExactTypeName() const
virtual NonTVertex * castToNonTVertex()
void setPoint3D(const Vec3r &iPoint3D)
virtual SVertex * castToSVertex()
void AddFEdge(FEdge *iFEdge)
occluder_container::const_iterator occluders_end() const
virtual real getProjectedZ() const
virtual TVertex * castToTVertex()
const Vec3r & point2d() const
virtual Nature::VertexNature getNature() const
int occluders_size() const
virtual real getZ() const
const Polygon3r & occludee() const
const Vec3r & point2D() const
void RemoveFEdge(FEdge *iFEdge)
const vector< FEdge * > & fedges()
virtual real getProjectedY() const
vector< FEdge * > fedges_container
SVertex(const Vec3r &iPoint3D, const Id &id)
virtual SVertex * duplicate()
void setFEdges(const vector< FEdge * > &iFEdges)
bool occludee_empty() const
virtual real getProjectedX() const
SVertex(SVertex &iBrother)
const Vec3r & point3D() const
float shape_importance() const
void Replace(FEdge *e1, FEdge *e2)
const CurvatureInfo * getCurvatureInfo() const
local_group_size(16, 16) .push_constant(Type b
VecMat::Vec2< real > Vec2r
VecMat::Vec3< real > Vec3r
static const EdgeNature NO_FEATURE
vector< ViewShape * > occluder_container