Skip to content

Commit

Permalink
Migrate on gmds 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoudot committed Mar 13, 2024
1 parent bea9127 commit dad35f4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/GQGMDS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ target_include_directories (GQGMDS PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOUR
target_compile_definitions (GQGMDS PUBLIC ${GQGMDS_PUBLIC_FLAGS})
target_compile_definitions (GQGMDS PRIVATE ${GQGMDS_PRIVATE_FLAGS})
target_compile_options (GQGMDS PRIVATE ${SHARED_CFLAGS}) # Requested by Qt ...
target_link_libraries (GQGMDS PUBLIC gmds GQualif)
target_link_libraries (GQGMDS PUBLIC GMDSIg GQualif)
# Etre capable une fois installée de retrouver TkUtil, Qualif*, ... :
# (Rem : en son absence on a Set runtime path of "/tmp/pignerol/install/lib/libGQGMDS.so.5.0.0" to "") ...
set_target_properties (GQGMDS PROPERTIES INSTALL_RPATH_USE_LINK_PATH 1)
Expand Down
40 changes: 18 additions & 22 deletions src/GQGMDS/GMDSQualifSerie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static const Charset charset ("àéèùô");


GMDSQualifSerie::GMDSQualifSerie (
gmds::IGMesh& mesh, bool destroy,
gmds::Mesh& mesh, bool destroy,
unsigned char dimension,
const std::string& name, const std::string& fileName)
: AbstractQualifSerieAdapter (fileName, name, dimension),
Expand All @@ -42,13 +42,13 @@ GMDSQualifSerie::GMDSQualifSerie (
{
case 2 :
if (0 != name.size ( ))
_surface = &mesh.getSurface (name);
_surface = mesh.getGroup<Face> (name);
else
mesh.getAll<Face> (_faces);
break;
case 3 :
if (0 != name.size ( ))
_volume = &mesh.getVolume (name);
_volume = mesh.getGroup<Region> (name);
else
mesh.getAll<Region> (_regions);
break;
Expand Down Expand Up @@ -97,7 +97,7 @@ GMDSQualifSerie::GMDSQualifSerie (


GMDSQualifSerie::GMDSQualifSerie (
IGMesh::surface& s, const std::string& name,
gmds::CellGroup<gmds::Face>& s, const std::string& name,
const std::string& fileName)
: AbstractQualifSerieAdapter (fileName, name, 2),
_mesh (0), _destroy (false), _surface (&s), _volume (0),
Expand All @@ -107,7 +107,7 @@ GMDSQualifSerie::GMDSQualifSerie (


GMDSQualifSerie::GMDSQualifSerie (
IGMesh::volume& v, const std::string& name, const std::string& fileName)
gmds::CellGroup<gmds::Region>& v, const std::string& name, const std::string& fileName)
: AbstractQualifSerieAdapter (fileName, name, 3),
_mesh (0), _destroy (false), _surface (0), _volume (&v),
_faces ( ), _regions ( )
Expand Down Expand Up @@ -194,7 +194,7 @@ Qualif::Maille& GMDSQualifSerie::getCell (size_t i) const
gmds::Face face = getGMDSFace (i);
face.getAll<Node>(nodes);

switch (face.getType ( ))
switch (face.type())
{
case gmds::GMDS_TRIANGLE :
for (s = 0; s < 3; s++)
Expand All @@ -217,11 +217,11 @@ Qualif::Maille& GMDSQualifSerie::getCell (size_t i) const
{
TkUtil::UTF8String error (charset);
error << "Type de maille GMDS invalide ("
<< (unsigned long)face.getType ( ) << " pour la "
<< (unsigned long)face.type() << " pour la "
<< i << "-ème maille de type polygone.";
throw TkUtil::Exception (error);
} // default
} // switch (face.getType ( ))
} // switch (face.type())
} // case 2
break;
case 3 :
Expand All @@ -240,7 +240,7 @@ Qualif::Maille& GMDSQualifSerie::getCell (size_t i) const
gmds::Region cell = getGMDSRegion (i);
cell.getAll<Node>(nodes);

switch (cell.getType ( ))
switch (cell.type())
{
case gmds::GMDS_TETRA :
for (s = 0; s < 4; s++)
Expand Down Expand Up @@ -282,7 +282,7 @@ Qualif::Maille& GMDSQualifSerie::getCell (size_t i) const
{
TkUtil::UTF8String error (charset);
error << "Type de maille GMDS invalide ("
<< (unsigned long)cell.getType ( ) << " pour la "
<< (unsigned long)cell.type() << " pour la "
<< i << "-ème maille de type polyèdre.";
throw TkUtil::Exception (error);
} // default
Expand Down Expand Up @@ -349,8 +349,7 @@ Face GMDSQualifSerie::getGMDSFace (size_t i) const
throw exc;
} // if ((0 == _surface) && (0 == _mesh))

gmds::Face face = 0 == _surface ? _faces [i] : (*_surface) [i];

gmds::Face face = 0 == _surface ? _faces[i] : _mesh->get<gmds::Face>((*_surface) [i]);
return face;
} // GMDSQualifSerie::getGMDSFace

Expand All @@ -364,7 +363,7 @@ Region GMDSQualifSerie::getGMDSRegion (size_t i) const
throw exc;
} // if ((0 == _volume) && (0 == _mesh))

gmds::Region region = 0 == _volume ? _regions [i] : (*_volume) [i];
gmds::Region region = 0 == _volume ? _regions [i] : _mesh->get<Region>((*_volume) [i]);
return region;
} // GMDSQualifSerie::getGMDSRegion

Expand Down Expand Up @@ -393,19 +392,17 @@ size_t GMDSQualifSerie::getCellType (size_t i) const
" GMDSQualifSerie::getCellType")
throw exc;
} // if ((0 == _surface) && (0 == _mesh))
gmds::Face face =
0 == _surface ? _faces [i] : (*_surface) [i];
gmds::Face face = 0 == _surface ? _faces [i] : _mesh->get<Face>((*_surface) [i]);


switch (face.getType ( ))
switch (face.type())
{
case gmds::GMDS_TRIANGLE : return QualifHelper::TRIANGLE;
case gmds::GMDS_QUAD : return QualifHelper::QUADRANGLE;
default :
{
TkUtil::UTF8String error (charset);
error << "Type de maille GMDS invalide ("
<< (unsigned long)face.getType ( ) << " pour la "
<< (unsigned long)face.type() << " pour la "
<< i << "-ème maille de type polygone.";
throw TkUtil::Exception (error);
} // default
Expand All @@ -421,10 +418,9 @@ size_t GMDSQualifSerie::getCellType (size_t i) const
throw exc;
} // if ((0 == _volume) && (0 == _mesh))

gmds::Region cell =
0 == _volume ? _regions [i] : (*_volume) [i];
gmds::Region cell = 0 == _volume ? _regions [i] : _mesh->get<Region>((*_volume) [i]);

switch (cell.getType ( ))
switch (cell.type())
{
case gmds::GMDS_TETRA : return QualifHelper::TETRAEDRON;
case gmds::GMDS_PYRAMID : return QualifHelper::PYRAMID;
Expand All @@ -434,7 +430,7 @@ size_t GMDSQualifSerie::getCellType (size_t i) const
{
TkUtil::UTF8String error (charset);
error << "Type de maille GMDS invalide ("
<< (unsigned long)cell.getType ( ) << " pour la "
<< (unsigned long)cell.type() << " pour la "
<< i << "-ème maille de type polyèdre.";
throw TkUtil::Exception (error);
} // default
Expand Down
22 changes: 11 additions & 11 deletions src/GQGMDS/public/GQGMDS/GMDSQualifSerie.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "GQualif/AbstractQualifSerieAdapter.h"

#include <GMDS/IG/IGMesh.h>
#include <gmds/ig/Mesh.h>

#include <vector>

Expand Down Expand Up @@ -40,7 +40,7 @@ public :
* @param Eventuel nom du fichier d'où est chargée la série.
*/
GMDSQualifSerie (
gmds::IGMesh& mesh, bool destroy,
gmds::Mesh& mesh, bool destroy,
unsigned char dimension,
const std::string& name, const std::string& fileName);

Expand All @@ -53,7 +53,7 @@ public :
* @param Nom du fichier d'où est éventuellement issue la surface.
*/
GMDSQualifSerie (
gmds::IGMesh::surface&, const std::string& name,
gmds::CellGroup<gmds::Face>& surface, const std::string& name,
const std::string& fileName);

/**
Expand All @@ -65,7 +65,7 @@ public :
* @param Nom du fichier d'où est éventuellement issue le volume.
*/
GMDSQualifSerie (
gmds::IGMesh::volume&, const std::string& name,
gmds::CellGroup<gmds::Region>& volume, const std::string& name,
const std::string& fileName);

/**
Expand Down Expand Up @@ -137,22 +137,22 @@ private :
GMDSQualifSerie& operator = (const GMDSQualifSerie&);

/** L'éventuel maillage associé. */
gmds::IGMesh* _mesh;
gmds::Mesh* _mesh;

/** Faut-il détruire ce maillageà la fin ? */
bool _destroy;
/** Faut-il détruire ce maillage à la fin ? */
bool _destroy;

/** L'éventuelle surface représentée. */
gmds::IGMesh::surface* _surface;
gmds::CellGroup<gmds::Face>* _surface;

/** L'éventuel volume représenté. */
gmds::IGMesh::volume* _volume;
gmds::CellGroup<gmds::Region>* _volume;

/** Pour les maillages sans groupes de mailles (surfaces ou volumes) :
* avoir la liste (non trouée) des mailles analysées (polygones/polyèdres).
*/
std::vector<gmds::Face> _faces;
std::vector<gmds::Region> _regions;
std::vector<gmds::Face> _faces;
std::vector<gmds::Region> _regions;
}; // class GMDSQualifSerie

} // namespace GQualif
Expand Down

0 comments on commit dad35f4

Please sign in to comment.