Commit 6c01192e authored by Pierre Kraemer's avatar Pierre Kraemer

specialisation des embeddedMap pour Map et GMap

parent 5559a670
......@@ -35,8 +35,7 @@
#include "Utils/qtui.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map3.h"
#include "Topology/generic/embeddedMap3.h"
#include "Topology/map/embeddedMap3.h"
#include "Geometry/vector_gen.h"
#include "Geometry/matrix.h"
......@@ -66,7 +65,7 @@ using namespace CGoGN ;
struct PFP: public PFP_STANDARD
{
// definition of the map
typedef EmbeddedMap3<Map3> MAP;
typedef EmbeddedMap3 MAP;
};
......
......@@ -27,8 +27,7 @@
#include "extrusionView.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"
#include "Topology/map/embeddedMap2.h"
#include "Geometry/vector_gen.h"
#include "Geometry/matrix.h"
......@@ -51,7 +50,7 @@ using namespace CGoGN;
struct PFP: public PFP_STANDARD
{
// definition de la carte
typedef EmbeddedMap2<Map2> MAP;
typedef EmbeddedMap2 MAP;
};
......
......@@ -27,8 +27,7 @@
#include "frame_manip.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"
#include "Topology/map/embeddedMap2.h"
#include "Geometry/vector_gen.h"
#include "Geometry/matrix.h"
......@@ -42,7 +41,6 @@
#include "Utils/Shaders/shaderFlat.h"
#include "Utils/Shaders/shaderSimpleColor.h"
#include "glm/gtc/matrix_transform.hpp"
#include "glm/gtc/type_precision.hpp"
#include "glm/gtc/type_ptr.hpp"
......@@ -52,7 +50,7 @@ using namespace CGoGN;
struct PFP: public PFP_STANDARD
{
// definition de la carte
typedef EmbeddedMap2<Map2> MAP;
typedef EmbeddedMap2 MAP;
};
PFP::MAP myMap;
......
......@@ -27,8 +27,7 @@
#include "Utils/glutwin_atb.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"
#include "Topology/map/embeddedMap2.h"
#include "Geometry/matrix.h"
#include "Geometry/vector_gen.h"
......@@ -51,7 +50,7 @@ using namespace CGoGN ;
struct PFP: public PFP_STANDARD
{
// definition of the map
typedef EmbeddedMap2<Map2> MAP;
typedef EmbeddedMap2 MAP;
};
typedef PFP::MAP MAP;
......
......@@ -27,8 +27,7 @@
#include "polyhedronsView.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"
#include "Topology/map/embeddedMap2.h"
#include "Geometry/vector_gen.h"
#include "Geometry/matrix.h"
......@@ -47,7 +46,7 @@ using namespace CGoGN;
struct PFP: public PFP_STANDARD
{
// definition de la carte
typedef EmbeddedMap2<Map2> MAP;
typedef EmbeddedMap2 MAP;
};
PFP::MAP myMap;
......
......@@ -27,8 +27,7 @@
#include "Utils/glutwin.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"
#include "Topology/map/embeddedMap2.h"
#include "Geometry/vector_gen.h"
#include "Geometry/matrix.h"
......@@ -49,7 +48,7 @@ using namespace CGoGN;
struct PFP: public PFP_STANDARD
{
// definition de la carte
typedef EmbeddedMap2<Map2> MAP;
typedef EmbeddedMap2 MAP;
};
......
......@@ -29,8 +29,7 @@
#include "Utils/glutwin.h"
#include "Topology/generic/parameters.h"
#include "Topology/gmap/gmap2.h"
#include "Topology/generic/embeddedMap2.h"
#include "Topology/gmap/embeddedGMap2.h"
#include "Geometry/matrix.h"
#include "Geometry/vector_gen.h"
......@@ -46,7 +45,7 @@ using namespace CGoGN;
struct PFP: public PFP_STANDARD
{
// definition of the map
typedef EmbeddedMap2<GMap2> MAP;
typedef EmbeddedGMap2 MAP;
};
PFP::MAP myMap;
......
......@@ -27,8 +27,7 @@
#include "Utils/glutwin.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"
#include "Topology/map/embeddedMap2.h"
#include "Geometry/vector_gen.h"
......@@ -47,7 +46,7 @@ using namespace CGoGN ;
struct PFP: public PFP_STANDARD
{
// definition of the map
typedef EmbeddedMap2<Map2> MAP;
typedef EmbeddedMap2 MAP;
};
/**
......
......@@ -32,8 +32,7 @@
#include "Utils/Shaders/shaderSimpleTexture.h"
#include "Utils/Shaders/shaderTextureMask.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"
#include "Topology/map/embeddedMap2.h"
#include "Algo/Render/GL2/mapRender.h"
......@@ -47,7 +46,7 @@ using namespace CGoGN ;
struct PFP: public PFP_STANDARD
{
// definition of the map
typedef EmbeddedMap2<Map2> MAP ;
typedef EmbeddedMap2 MAP ;
};
typedef PFP::MAP MAP ;
......
......@@ -28,8 +28,7 @@
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"
#include "Topology/map/embeddedMap2.h"
#include "Geometry/vector_gen.h"
......@@ -48,7 +47,7 @@ using namespace CGoGN ;
struct PFP: public PFP_STANDARD
{
// definition of the map
typedef EmbeddedMap2<Map2> MAP;
typedef EmbeddedMap2 MAP;
};
/**
......
......@@ -29,8 +29,7 @@
#include "Utils/qtui.h"
#include "Topology/generic/parameters.h"
#include "Topology/map/map2.h"
#include "Topology/generic/embeddedMap2.h"
#include "Topology/map/embeddedMap2.h"
#include "Geometry/vector_gen.h"
#include "Geometry/matrix.h"
......@@ -53,7 +52,7 @@ using namespace CGoGN ;
struct PFP: public PFP_STANDARD
{
// definition of the map
typedef EmbeddedMap2<Map2> MAP ;
typedef EmbeddedMap2 MAP ;
};
typedef PFP::MAP MAP ;
......
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2011, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* 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: http://cgogn.u-strasbg.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __EMBEDDED_GMAP2_H__
#define __EMBEDDED_GMAP2_H__
#include "Topology/gmap/gmap2.h"
namespace CGoGN
{
/**
* Class of 2-dimensional G-maps
* with managed embeddings
*/
class EmbeddedGMap2 : public GMap2
{
public:
typedef GMap2 TOPO_MAP;
/**
* The attributes attached to the old vertex are duplicated on both resulting vertices
* No attribute is attached to the new edge
*/
virtual void splitVertex(Dart d, Dart e) ;
/**
* The attributes attached to the face of d are kept on the resulting face
*/
virtual bool deleteVertex(Dart d) ;
// /**
// * No attribute is attached to the new edge
// * The attributes attached to the face of dart d are kept on the resulting face
// */
// virtual void linkVertices(Dart d, Dart e) ;
/**
* No attribute is attached to the new vertex
* The attributes attached to the old edge are duplicated on both resulting edges
*/
virtual void cutEdge(Dart d) ;
// /**
// * The attributes attached to the edge of d are kept on the resulting edge
// */
// virtual void uncutEdge(Dart d) ;
/**
* Check if the edge of d can be collapsed or not based on some topological conditions
* @param d a dart of the edge to test
* @return true if the edge can be collapsed, false otherwise
*/
bool edgeCanCollapse(Dart d) ;
/**
* The attributes attached to the vertex of dart d are kept on the resulting vertex
* See 'collapseDegeneratedFace' to see what can happen to edges attributes
* Nothing has to be done for the faces (some degenerate ones can be deleted)
*/
virtual Dart collapseEdge(Dart d, bool delDegenerateFaces = true) ;
/**
* No cell is created or deleted
*/
virtual bool flipEdge(Dart d) ;
/**
* No cell is created or deleted
*/
virtual bool flipBackEdge(Dart d) ;
// /**
// * The attributes attached to the vertex of dart d are kept on the resulting vertex
// * The attributes attached to the face of dart d are overwritten on the face of dart e
// */
// virtual void insertEdgeInVertex(Dart d, Dart e);
// /**
// * The attributes attached to the vertex of dart d are kept on the resulting vertex
// * The attributes attached to the face of dart d are overwritten on the face of dart e
// */
// virtual void removeEdgeFromVertex(Dart d);
/**
* The attributes attached to the vertices of the edge of d are kept on the vertices of the resulting edge
* The attributes attached to the edge of d are kept on the resulting edge
*/
virtual void sewFaces(Dart d, Dart e) ;
/**
* The attributes attached to the vertices of the old edge of d are duplicated on the vertices of both resulting edges
* The attributes attached to the old edge are duplicated on both resulting edges
*/
virtual void unsewFaces(Dart d) ;
/**
* The attributes attached to the edge of d are kept on the resulting edge
*/
virtual bool collapseDegeneratedFace(Dart d);
/**
* No attribute is attached to the new edge
* The attributes attached to the old face are duplicated on both resulting faces
*/
virtual void splitFace(Dart d, Dart e) ;
/**
* The attributes attached to the face of dart d are kept on the resulting face
*/
virtual bool mergeFaces(Dart d) ;
/**
* The attributes attached to the vertices of the face of d are kept on the resulting vertices
* The attributes attached to the edges of the face of d are kept on the resulting edges
*/
virtual bool mergeVolumes(Dart d, Dart e) ;
/**
* No attribute is attached to the new face
*/
virtual unsigned int closeHole(Dart d);
virtual bool check() ;
} ;
} // namespace CGoGN
#endif
......@@ -22,100 +22,86 @@
* *
*******************************************************************************/
#ifndef __EMAP3_H__
#define __EMAP3_H__
#ifndef __EMBEDDED_GMAP3_H__
#define __EMBEDDED_GMAP3_H__
#include "Topology/map/map3.h"
#include "Topology/gmap/gmap3.h"
namespace CGoGN
{
/**
* Class of 3-dimensional combinatorial maps
* Class of 3-dimensional G-maps
* with managed embeddings
* See Map3 class for comments..
*/
class EMap3: public Map3
class EmbeddedGMap3 : public GMap3
{
public:
/**
* cut face in two faces between to vertices
* @param d the dart of first vertex
* @param e the dart of second vertex
* @return a dart of the created edge
*/
Dart cutFace(Dart d, Dart e);
/**
* cut a face in n faces with a central point
* @param d a dart of the face
* @return a dart of central point
*/
Dart trianguleFace(Dart d);
/**
* quadrangule a face in n faces with a central point
* WARNING: edges of faces must already be cutted
* @param d a dart of the face
* @return a dart of central point
*/
Dart quadranguleFace(Dart d);
void embeddxxguledFace(Dart d, Dart n);
/**
* cut an edge
* @param d a dart of the edge
* @return a dart of middle point
*/
Dart cutEdge(Dart d);
/**Collapse an edge (that is deleted) possibly merging its vertices
* If delDegenerateFaces is true, the method checks that no degenerate
* faces are build (faces with less than 3 edges). If it occurs the faces
* are deleted and the adjacencies are updated (see deleteIfDegenerated).
* The new embedding is at the middle of the collapsed edge
* \warning This may produce two distinct vertices if the edge
* was the only link between two border faces
* @param d a dart in the deleted edge
* @param delDegenerateFaces a boolean (default to true)
* @return a dart from the vertex at the middle of the edge
*/
Dart edgeCollapse(Dart d, bool delDegenerateFaces=true, bool delDegenerateVolumes=true);
/**
* start from a volume composed only by triangles
* add tetrahedrons inside the volume
* @param a dart from the volume
* @return a dart from the new tetra (center of the old volume)
typedef GMap3 TOPO_MAP;
//!
/*!
*
*/
virtual void sewVolumes(Dart d, Dart e);
//!
/*!
*
*/
virtual void unsewVolumes(Dart d);
//!
/*!
*
*/
virtual bool mergeVolumes(Dart d);
//! Split a face inserting an edge between two vertices
/*! \pre Dart d and e should belong to the same face and be distinct
* @param d dart of first vertex
* @param e dart of second vertex
* @return the dart of the new edge lying in the vertex of d after the cut
*/
Dart tetrahedrizeVolume(Dart d);
bool check();
/**
* Embed (vertex) the darts of the boundary
* @param m the marker defining the boundary
*/
void embedBoundaryDarts(Marker m)
{
for( Dart d=this->begin(); d != this->end(); this->next(d))
{
if (isMarkedDart(d,m))
{
copyEmbedding(d, phi1(phi3(d)), VERTEX);
}
}
}
/** Flip the edge of d.
* WARNING : works only if the edge is owned by exactly two volumes
* @param d the edge to flip
virtual void splitFace(Dart d, Dart e);
//! Cut the edge of d
/*! @param d a dart of the edge to cut
*/
void flipEdge(Dart d);
};
virtual void cutEdge(Dart d);
// //!
// /*!
// *
// */
// virtual Dart cutSpike(Dart d);
// //! Collapse an edge (that is deleted) possibly merging its vertices
// /*! If delDegenerateFaces is true, the method checks that no degenerate
// * faces are build (faces with less than 3 edges). If it occurs the faces
// * are deleted and the adjacencies are updated (see deleteIfDegenerated).
// * \warning This may produce two distinct vertices if the edge
// * was the only link between two border faces
// * @param d a dart in the deleted edge
// * @param delDegenerateFaces a boolean (default to true)
// */
// virtual int collapseEdge(Dart d, bool delDegenerateFaces = true,
// bool delDegenerateVolumes = true);
// //!
// /*!
// *
// */
// virtual void collapseFace(Dart d, bool delDegenerateFaces = true,
// bool delDegenerateVolumes = true);
virtual unsigned int closeHole(Dart d);
virtual void closeMap(DartMarker &marker);
virtual bool check();
} ;
} // namespace CGoGN
......
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2011, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* 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: http://cgogn.u-strasbg.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __EMBEDDED_MAP2_H__
#define __EMBEDDED_MAP2_H__
#include "Topology/map/map2.h"
namespace CGoGN
{
/**
* Class of 2-dimensional maps
* with managed embeddings
*/
class EmbeddedMap2 : public Map2
{
public:
typedef Map2 TOPO_MAP;
/**
* The attributes attached to the old vertex are duplicated on both resulting vertices
* No attribute is attached to the new edge
*/
virtual void splitVertex(Dart d, Dart e) ;
/**
* The attributes attached to the face of d are kept on the resulting face
*/
virtual bool deleteVertex(Dart d) ;
/**
* No attribute is attached to the new edge
* The attributes attached to the face of dart d are kept on the resulting face
*/
virtual void linkVertices(Dart d, Dart e) ;
/**
* No attribute is attached to the new vertex
* The attributes attached to the old edge are duplicated on both resulting edges
*/
virtual void cutEdge(Dart d) ;
/**
* The attributes attached to the edge of d are kept on the resulting edge
*/
virtual void uncutEdge(Dart d) ;
/**
* Check if the edge of d can be collapsed or not based on some topological conditions
* @param d a dart of the edge to test
* @return true if the edge can be collapsed, false otherwise
*/
bool edgeCanCollapse(Dart d) ;
/**
* The attributes attached to the vertex of dart d are kept on the resulting vertex
* See 'collapseDegeneratedFace' to see what can happen to edges attributes
* Nothing has to be done for the faces (some degenerate ones can be deleted)
*/
virtual Dart collapseEdge(Dart d, bool delDegenerateFaces = true) ;
/**
* No cell is created or deleted
*/
virtual bool flipEdge(Dart d) ;
/**
* No cell is created or deleted
*/
virtual bool flipBackEdge(Dart d) ;
/**
* The attributes attached to the vertex of dart d are kept on the resulting vertex
* The attributes attached to the face of dart d are overwritten on the face of dart e
*/
virtual void insertEdgeInVertex(Dart d, Dart e);
/**
* The attributes attached to the vertex of dart d are kept on the resulting vertex
* The attributes attached to the face of dart d are overwritten on the face of dart e
*/
virtual void removeEdgeFromVertex(Dart d);
/**
* The attributes attached to the vertices of the edge of d are kept on the vertices of the resulting edge
* The attributes attached to the edge of d are kept on the resulting edge
*/
virtual void sewFaces(Dart d, Dart e) ;
/**
* The attributes attached to the vertices of the old edge of d are duplicated on the vertices of both resulting edges
* The attributes attached to the old edge are duplicated on both resulting edges
*/
virtual void unsewFaces(Dart d) ;
/**
* The attributes attached to the edge of d are kept on the resulting edge
*/
virtual bool collapseDegeneratedFace(Dart d);
/**