Commit 1c3da58f authored by pitiot's avatar pitiot

reparation particules 3D

parent 38233cd7
......@@ -170,7 +170,7 @@ void MCMesh::updateRender()
void MCMesh::fromFile(char* fname)
{
myImg = new SAlgo::MC::Image<DATATYPE>();
myImg->loadInrgz(fname);
// myImg->loadInrgz(fname);
CGoGNout << "Image chargee"<<CGoGNendl;
CGoGNout << myImg->getWidthX() <<"x"<< myImg->getWidthY() <<"x"<< myImg->getWidthZ() << "voxels"<<CGoGNendl;
}
......
......@@ -78,11 +78,9 @@ IF(WIN32)
ELSE(WIN32)
find_package(SuiteSparse REQUIRED)
SET (COMMON_INCLUDES ${COMMON_INCLUDES} ${SUITESPARSE_INCLUDE_DIRS})
<<<<<<< HEAD
SET (COMMON_LIBS ${SUITESPARSE_LIBRARIES} lapack blas ${COMMON_LIBS})
=======
SET (COMMON_LIBS ${SUITESPARSE_LIBRARIES} lapack blas ${COMMON_LIBS} )
>>>>>>> c2fbbbce446c3f437c531debda00b48f13f29790
ENDIF(WIN32)
......
......@@ -478,7 +478,7 @@ public:
} // namespace CGoGN
#include "Algo/ImplicitHierarchicalMesh/ihm3.hpp"
#include "Algo/ImplicitHierarchicalMesh/ihm3.hppxx"
#endif
......
......@@ -48,7 +48,7 @@ enum SubdivideType
template <typename PFP>
void newLevelHexa(typename PFP::MAP& map, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
void newLevelHexa(typename PFP::MAP& map, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position);
/***********************************************************************************
......@@ -56,13 +56,13 @@ void newLevelHexa(typename PFP::MAP& map, AttributeHandler<typename PFP::VEC3, V
***********************************************************************************/
template <typename PFP>
void subdivideEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
void subdivideEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position) ;
template <typename PFP>
void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position, SubdivideType sType = S_TRI);
void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position, SubdivideType sType = S_TRI);
template <typename PFP>
Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position);
......@@ -72,13 +72,13 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
template <typename PFP>
void subdivideEdgeWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position) ;
void subdivideEdgeWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position) ;
template <typename PFP>
void subdivideFaceWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position, SubdivideType sType = S_TRI);
void subdivideFaceWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position, SubdivideType sType = S_TRI);
template <typename PFP>
Dart subdivideVolumeClassicWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
Dart subdivideVolumeClassicWrong(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position);
......@@ -89,23 +89,23 @@ Dart subdivideVolumeClassicWrong(typename PFP::MAP& map, Dart d, AttributeHandle
template <typename PFP>
Dart subdivideVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
Dart subdivideVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position);
template <typename PFP>
Dart subdivideVolumeGen(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
Dart subdivideVolumeGen(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position);
template <typename PFP>
Dart subdivideVolumeClassic2(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
Dart subdivideVolumeClassic2(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position);
template <typename PFP>
void subdivideLoop(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
void subdivideLoop(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position);
/***********************************************************************************
......@@ -113,13 +113,13 @@ void subdivideLoop(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
***********************************************************************************/
template <typename PFP>
void coarsenEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
void coarsenEdge(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position);
template <typename PFP>
void coarsenFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position, SubdivideType sType = S_TRI);
void coarsenFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position, SubdivideType sType = S_TRI);
template <typename PFP>
void coarsenVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
void coarsenVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position);
/***********************************************************************************
* Raffinement
......@@ -128,7 +128,7 @@ void coarsenVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
* Un brin de la face oppose aux faces a spliter
*/
template <typename PFP>
void splitVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX>& position);
void splitVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& position);
......@@ -138,6 +138,6 @@ void splitVolume(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP::
} //namespace Algo
} //namespace CGoGN
#include "Algo/ImplicitHierarchicalMesh/subdivision3.hpp"
#include "Algo/ImplicitHierarchicalMesh/subdivision3.hppxx"
#endif
......@@ -131,10 +131,10 @@ bool MeshTablesVolume<PFP>::importMesh(const std::string& filename, std::vector<
template <typename PFP>
bool MeshTablesVolume<PFP>::importTet(const std::string& filename, std::vector<std::string>& attrNames)
{
VertexAttribute<VEC3, MAP> position = m_map.template getAttribute<VEC3, VERTEX, MAP>("position") ;
VertexAttribute<VEC3, MAP> position = m_map.template getAttribute<VEC3, VERTEX, MAP>("position") ;
if (!position.isValid())
position = m_map.template addAttribute<VEC3, VERTEX, MAP>("position") ;
position = m_map.template addAttribute<VEC3, VERTEX, MAP>("position") ;
attrNames.push_back(position.name()) ;
......
......@@ -101,7 +101,7 @@ void ParticleCell2DMemo<PFP>::vertexState(const VEC3& current, CellMarkerMemo<MA
CGoGNout << "vertexState" << this->d << CGoGNendl ;
#endif
assert(std::isfinite(current[0]) && std::isfinite(current[1]) && std::isfinite(current[2])) ;
memo_cross.mark(this->d);
if(!memo_cross.isMarked(this->d))memo_cross.mark(this->d);
this->crossCell = CROSS_OTHER ;
if (Geometry::isPointOnVertex < PFP > (this->m, this->d, this->positionAttribut, current))
......@@ -190,7 +190,7 @@ void ParticleCell2DMemo<PFP>::edgeState(const VEC3& current, CellMarkerMemo<MAP,
assert(std::isfinite(current[0]) && std::isfinite(current[1]) && std::isfinite(current[2])) ;
// assert(Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
memo_cross.mark(this->d);
if(!memo_cross.isMarked(this->d)) memo_cross.mark(this->d);
if (this->crossCell == NO_CROSS)
{
this->crossCell = CROSS_EDGE ;
......@@ -247,7 +247,7 @@ void ParticleCell2DMemo<PFP>::faceState(const VEC3& current, CellMarkerMemo<MAP,
&& std::isfinite(this->getPosition()[2])) ;
assert(std::isfinite(current[0]) && std::isfinite(current[1]) && std::isfinite(current[2])) ;
// assert(Geometry::isPointInConvexFace2D<PFP>(m,d,m_positions,m_position,true));
memo_cross.mark(this->d);
if(!memo_cross.isMarked(this->d)) memo_cross.mark(this->d);
Dart dd = this->d ;
float wsoe = this->getOrientationFace(current, this->m.phi1(this->d)) ;
......
......@@ -107,7 +107,7 @@ void ParticleCell2DAndHalfMemo<PFP>::vertexState(VEC3 current, CellMarkerMemo<MA
CGoGNout << "vertexState" << d << CGoGNendl;
#endif
assert(current.isFinite());
if(!memo_cross.isMarked(this->d)) memo_cross.mark(this->d);
this->crossCell = CROSS_OTHER;
if(Geometry::isPointOnVertex<PFP>(this->m,this->d,this->m_positions,current))
......@@ -176,7 +176,7 @@ void ParticleCell2DAndHalfMemo<PFP>::edgeState(VEC3 current, CellMarkerMemo<MAP,
#ifdef DEBUG
CGoGNout << "edgeState" << d << CGoGNendl;
#endif
if(!memo_cross.isMarked(this->d)) memo_cross.mark(this->d);
assert(current.isFinite());
// assert(Geometry::isPointOnEdge<PFP>(m,d,m_positions,m_position));
......@@ -247,7 +247,7 @@ void ParticleCell2DAndHalfMemo<PFP>::faceState(VEC3 current, CellMarkerMemo<MAP,
CGoGNout << "faceState" << this->d << CGoGNendl;
#endif
if(memo_cross.isMarked(this->d)) return ;
memo_cross.mark(this->d);
if(!memo_cross.isMarked(this->d)) memo_cross.mark(this->d);
assert(this->getPosition().isFinite());
assert(current.isFinite());
......
......@@ -60,7 +60,7 @@ public :
m(map),
position(tabPos),
d(belonging_cell),
state(3)
state(4)
{
m_positionFace = pointInFace(d);
}
......
......@@ -185,6 +185,12 @@ public:
/***************************************************
* ID MANAGEMENT *
***************************************************/
unsigned int triRefinementEdgeId(Dart d);
unsigned int quadRefinementEdgeId(Dart d);
unsigned int faceId(Dart d);
//! Give a new unique id to all the edges of the map
/*!
*/
......
......@@ -573,20 +573,7 @@ inline unsigned int ImplicitHierarchicalMap3::faceId(Dart d)
{
unsigned int fId = getFaceId(phi2(d));
if(fId == 0)
return 1;
else if(id == 1)
return 2;
else if(id == 2)
{
if(dId == eId)
return 0;
else
return 1;
}
//else if(id == 3)
return 0;
return (fId+1)%2;
}
inline unsigned int ImplicitHierarchicalMap3::getFaceId(Dart d)
......
......@@ -866,7 +866,7 @@ bool Map2<MAP_IMPL>::sameOrientedVolume(Vol v1, Vol v2) const
mark.mark(it); // Mark
Dart adj = phi2(it); // Get adjacent face
if (!this->isBoundaryMarked2(adj) && !mark.isMarked(adj))
if (!this->isBoundaryMarked(2,adj) && !mark.isMarked(adj))
visitedFaces.push_back(adj); // Add it
it = this->phi1(it);
} while(it != *face);
......
......@@ -1428,7 +1428,7 @@ unsigned int Map3<MAP_IMPL>::closeMap()
if (phi3(d) == d)
{
++nb ;
closeHole(d,true);
closeHole(d);
}
}
return nb ;
......
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