Commit 82646324 authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

Merge cgogn:~kraemer/CGoGN

parents 94f9a08e 3288e972
......@@ -28,11 +28,11 @@
#include <iostream>
#include "Utils/Qt/qtSimple.h"
#include "Utils/Qt/qtInputs.h"
#include "Utils/qtInputs.h"
#include "ui_clipping.h"
// inclure qtui.h juste après le ui_xxx.h
#include "Utils/Qt/qtui.h"
#include "Utils/qtui.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap3.h"
......
......@@ -17,7 +17,7 @@
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: https://iggservis.u-strasbg.fr/CGoGN/ *
* Web site: http://cgogn.unistra.fr *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
......@@ -26,7 +26,7 @@
#include "Utils/Qt/qtSimple.h"
#include "ui_mcmesh.h"
#include "Utils/Qt/qtui.h"
#include "Utils/qtui.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
......
......@@ -26,7 +26,7 @@
#include "Utils/Qt/qtSimple.h"
#include "ui_viewer.h"
#include "Utils/Qt/qtui.h"
#include "Utils/qtui.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/embeddedMap2.h"
......
......@@ -46,7 +46,7 @@
#include "Utils/frameManipulator.h"
#include "ui_volumeExplorer.h"
#include "Utils/Qt/qtui.h"
#include "Utils/qtui.h"
using namespace CGoGN ;
......
......@@ -56,7 +56,7 @@
#include "ui_show_traversors.h"
// inclure qtui.h juste après le ui_xxx.h
#include "Utils/Qt/qtui.h"
#include "Utils/qtui.h"
using namespace CGoGN ;
......
......@@ -57,7 +57,7 @@
#include "ui_tuto5.h"
// inclure qtui.h juste après le ui_xxx.h
#include "Utils/Qt/qtui.h"
#include "Utils/qtui.h"
using namespace CGoGN ;
......
......@@ -42,7 +42,7 @@
#include "Algo/Parallel/parallel_foreach.h"
// for file input
#include "Utils/Qt/qtInputs.h"
#include "Utils/qtInputs.h"
using namespace CGoGN ;
......
......@@ -40,7 +40,7 @@
#include "ui_tuto_oper2.h"
#include "Utils/Qt/qtui.h"
#include "Utils/qtui.h"
#include "Utils/Qt/qtSimple.h"
#include "Utils/cgognStream.h"
......
......@@ -40,7 +40,7 @@
#include "ui_tuto_oper3.h"
#include "Utils/Qt/qtui.h"
#include "Utils/qtui.h"
#include "Utils/Qt/qtSimple.h"
#include "Utils/cgognStream.h"
......
......@@ -57,7 +57,7 @@
#include "ui_tuto_orbits.h"
// inclure qtui.h juste après le ui_xxx.h
#include "Utils/Qt/qtui.h"
#include "Utils/qtui.h"
using namespace CGoGN ;
......
......@@ -25,6 +25,8 @@
#ifndef __ALGO_GEOMETRY_FEATURE_H__
#define __ALGO_GEOMETRY_FEATURE_H__
namespace CGoGN
{
......@@ -34,44 +36,144 @@ namespace Algo
namespace Geometry
{
enum
{
EMPTY,
SEGMENT,
BARY
};
//#define EMPTY 0
//#define SEGMENT 1
//#define BARY 2
typedef struct { Dart d ; float w ; } e0point ;
typedef struct { e0point p1 ; e0point p2 ; unsigned char type ; } e0segment ;
typedef NoMathIONameAttribute<e0segment> ridgeSegment ;
template <typename PFP>
void featureEdgeDetection(typename PFP::MAP& map, const typename PFP::TVEC3& position, CellMarker& featureEdge) ;
void featureEdgeDetection(
typename PFP::MAP& map,
const typename PFP::TVEC3& position,
CellMarker& featureEdge) ;
template <typename PFP>
void computeArea(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TREAL& area, const FunctorSelect& select = allDarts, unsigned int thread = 0) ;
void computeFaceGradient(
typename PFP::MAP& map,
const typename PFP::TVEC3& position,
typename PFP::TVEC3& face_gradient,
const typename PFP::TVEC3& face_normal,
const typename PFP::TREAL& kmax,
const typename PFP::TREAL& area,
const FunctorSelect& select = allDarts,
unsigned int thread = 0) ;
//template <typename PFP>
//void computeVertexGradient(
// typename PFP::MAP& map,
// const typename PFP::TVEC3& position,
// typename PFP::TVEC3& gradient,
// typename PFP::TVEC3& face_gradient,
// const typename PFP::TREAL& area,
// const FunctorSelect& select = allDarts,
// unsigned int thread = 0) ;
template <typename PFP>
void computeFaceGradient(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& face_gradient, const typename PFP::TVEC3& face_normal, const typename PFP::TREAL& kmax, const typename PFP::TREAL& area, const FunctorSelect& select = allDarts, unsigned int thread = 0) ;
void computeTriangleType(
typename PFP::MAP& map,
const typename PFP::TVEC3& Kmax,
CellMarker& regularMarker,
const FunctorSelect& select = allDarts,
unsigned int thread = 0) ;
template <typename PFP>
void computeGradient(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& gradient, typename PFP::TVEC3& face_gradient, const typename PFP::TREAL& area, const FunctorSelect& select = allDarts, unsigned int thread = 0) ;
void computeRidgeLines(
typename PFP::MAP& map,
const typename PFP::TVEC3& position,
CellMarker& regularMarker,
const typename PFP::TVEC3& faceGradient,
const typename PFP::TREAL& area,
const typename PFP::TVEC3& K,
AttributeHandler<ridgeSegment>& ridge_segments,
const FunctorSelect& select = allDarts,
unsigned int thread = 0) ;
template <typename PFP>
void computeTriangleType(typename PFP::MAP& map, const typename PFP::TVEC3& position, CellMarker& regularMarker, const FunctorSelect& select = allDarts, unsigned int thread = 0) ;
void initRidgeSegments(
typename PFP::MAP& map,
const typename PFP::TVEC3& position,
AttributeHandler<ridgeSegment>& ridge_segments,
const FunctorSelect& select = allDarts,
unsigned int thread = 0) ;
template <typename PFP>
void computeCurvatureSign(typename PFP::MAP& map, const typename PFP::TVEC3& position, typename PFP::TVEC3& triangle_type, typename PFP::TVEC3& k, const FunctorSelect& select = allDarts, unsigned int thread = 0) ;
void computeSingularTriangle(
typename PFP::MAP& map,
const typename PFP::TVEC3& position,
CellMarker& regularMarker,
typename PFP::TVEC3& k,
AttributeHandler<ridgeSegment>& ridge_segments,
const FunctorSelect& select = allDarts,
unsigned int thread = 0) ;
template <typename PFP>
std::vector<typename PFP::VEC3> occludingContoursDetection(typename PFP::MAP& map, const typename PFP::VEC3& cameraPosition, const typename PFP::TVEC3& position, const typename PFP::TVEC3& normal) ;
std::vector<typename PFP::VEC3> occludingContoursDetection(
typename PFP::MAP& map,
const typename PFP::VEC3& cameraPosition,
const typename PFP::TVEC3& position,
const typename PFP::TVEC3& normal) ;
template <typename PFP>
typename PFP::TREAL faceArea(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) ;
typename PFP::VEC3 faceGradient(
typename PFP::MAP& map,
Dart d,
const typename PFP::TVEC3& position,
const typename PFP::TVEC3& face_normal,
const typename PFP::TREAL& kmax,
const typename PFP::TREAL& area) ;
template <typename PFP>
typename PFP::VEC3 faceGradient(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, const typename PFP::TVEC3& face_normal, const typename PFP::TREAL& kmax, const typename PFP::TREAL& area) ;
bool isTriangleRegular(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& Kmax) ;
//template <typename PFP>
//bool isInSameOctant(const typename PFP::VEC3& pos1, const typename PFP::VEC3& pos2) ;
template <typename PFP>
bool triangleType(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position) ;
void ridgeLines(
typename PFP::MAP& map,
Dart d,
const typename PFP::TVEC3& position,
const typename PFP::TVEC3& K,
const typename PFP::TVEC3& faceGradient,
const typename PFP::TREAL& area,
AttributeHandler<ridgeSegment>& ridge_segments) ;
template <typename PFP>
bool isInSameOctant(const typename PFP::VEC3& pos1, const typename PFP::VEC3& pos2) ;
typename PFP::REAL extremality(
typename PFP::MAP& map,
Dart d,
const typename PFP::VEC3& K,
const typename PFP::TVEC3& faceGradient,
const typename PFP::TREAL& area) ;
//template <typename PFP>
//typename PFP::TVEC3 vertexGradient(
// typename PFP::MAP& map,
// Dart d,
// const typename PFP::TVEC3& position,
// const typename PFP::TVEC3& face_gradient,
// const typename PFP::TREAL& area) ;
template <typename PFP>
void curvatureSign(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, typename PFP::TVEC3& triangle_type, typename PFP::TVEC3& k) ;
void singularTriangle(
typename PFP::MAP& map,
Dart d,
const typename PFP::TVEC3& position,
CellMarker& regularMarker,
AttributeHandler<ridgeSegment>& ridge_segments) ;
template <typename PFP>
typename PFP::TVEC3 vertexGradient(typename PFP::MAP& map, Dart d, const typename PFP::TVEC3& position, const typename PFP::TVEC3& face_gradient, const typename PFP::TREAL& area) ;
bool isEdgeInTriangle(typename PFP::MAP& map, Dart edge, Dart triangle) ;
} // namespace Geometry
......
This diff is collapsed.
......@@ -326,8 +326,8 @@ void foreach_cell(typename PFP::MAP& map, unsigned int cell, FunctorMapThreaded<
template <typename PFP>
void foreach_dart(typename PFP::MAP& map, FunctorMapThreaded<typename PFP::MAP>& func, unsigned int nbth, unsigned int szbuff, bool needMarkers, const FunctorSelect& good)
{
std::vector<Dart> vd[nbth];
boost::thread* threads[nbth];
std::vector<Dart>* vd = new std::vector<Dart>[nbth];
boost::thread** threads = new boost::thread*[nbth];
Dart d=map.begin();
......@@ -370,7 +370,7 @@ void foreach_dart(typename PFP::MAP& map, FunctorMapThreaded<typename PFP::MAP>&
threads[i] = new boost::thread(ThreadFunction<typename PFP::MAP>(func, vd[i],sync1,sync2, finished,0));
}
// and continue to traverse the map
std::vector<Dart> tempo[nbth];
std::vector<Dart>* tempo = new std::vector<Dart>[nbth];
for (unsigned int i=0; i<nbth; ++i)
tempo[i].reserve(szbuff);
......@@ -406,6 +406,10 @@ void foreach_dart(typename PFP::MAP& map, FunctorMapThreaded<typename PFP::MAP>&
threads[i]->join();
delete threads[i];
}
delete vd;
delete threads;
delete tempo;
}
......
......@@ -587,7 +587,7 @@ template <typename TYPEDOUBLE>
void Image<DIM,TYPE>::subSample2()
{
Image<DIM,TYPE>* newImg = subSampleToNewImage2<TYPEDOUBLE>();
swap(*newImg);
this->swap(*newImg);
delete newImg;
}
......@@ -720,7 +720,7 @@ template < unsigned int DIM, typename TYPE >
void Image<DIM,TYPE>::rotate90(int axis)
{
Image<DIM,TYPE>* newImg = rotate90ToNewImage(axis);
swap(*newImg);
this->swap(*newImg);
delete newImg;
}
......
......@@ -21,7 +21,8 @@
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include "Utils/Qt/qtInputs.h"
#include "Utils/qtInputs.h"
#include <iostream>
namespace CGoGN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment