Commit 2ac4d52e authored by Lionel Untereiner's avatar Lionel Untereiner

adding a new plugin and somme changes to import/export volumetric objects

parent 035fdf2f
......@@ -196,6 +196,16 @@ void MyQT::cb_Open()
updateGL() ;
}
void MyQT::cb_Save()
{
std::string filters("all (*.*);; tetmesh (*.tetmesh);; tet (*.tet);; node (*.node);; msh (*.msh);; vtu (*.vtu);; nas (*.nas);; vbgz (*.vbgz)") ;
std::string filename = selectFileSave("Save Mesh", "", filters) ;
if (filename.empty())
return ;
Algo::Volume::Export::exportMesh<PFP>(myMap,position,filename);
}
void MyQT::cb_initGL()
{
......
......@@ -48,6 +48,8 @@
#include "ui_volumeExplorer.h"
#include "Utils/Qt/qtui.h"
#include "Algo/Export/exportVol.h"
using namespace CGoGN ;
......@@ -127,6 +129,7 @@ protected:
void cb_mousePress(int button, int x, int y);
void cb_mouseRelease(int button, int x, int y);
void cb_Open();
void cb_Save();
// slots locaux
......
......@@ -9,5 +9,5 @@ ADD_SUBDIRECTORY(renderScalar)
ADD_SUBDIRECTORY(renderExplod)
ADD_SUBDIRECTORY(renderTopoSurface)
ADD_SUBDIRECTORY(subdivideSurface)
ADD_SUBDIRECTORY(surfaceDeformation)
#ADD_SUBDIRECTORY(surfaceDeformation)
ADD_SUBDIRECTORY(subdivideMRVolume)
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>174</width>
<width>200</width>
<height>545</height>
</rect>
</property>
......@@ -101,7 +101,7 @@
<item row="1" column="1">
<widget class="QSlider" name="slider_facesScaleFactor">
<property name="value">
<number>50</number>
<number>99</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
......@@ -118,7 +118,7 @@
<item row="2" column="1">
<widget class="QSlider" name="slider_volumesScaleFactor">
<property name="value">
<number>50</number>
<number>99</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
......
......@@ -276,7 +276,7 @@ void RenderExplodPlugin::changeRenderFaces(View* view, MapHandlerGen* map, bool
void RenderExplodPlugin::changeFacesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI)
{
ParameterSet* params = h_viewParams[view];
params->perMap[map->getName()]->facesScaleFactor = i / 50.0;
params->perMap[map->getName()]->facesScaleFactor = i / 99.0;
if(view->isCurrentView())
{
......@@ -289,7 +289,7 @@ void RenderExplodPlugin::changeFacesScaleFactor(View* view, MapHandlerGen* map,
void RenderExplodPlugin::changeVolumesScaleFactor(View* view, MapHandlerGen* map, int i, bool fromUI)
{
ParameterSet* params = h_viewParams[view];
params->perMap[map->getName()]->volumesScaleFactor = i / 50.0;
params->perMap[map->getName()]->volumesScaleFactor = i / 99.0;
if(view->isCurrentView())
{
......
......@@ -775,7 +775,7 @@ bool exportTetmesh(typename PFP::MAP& map, const VertexAttribute<typename PFP::V
VertexAutoAttribute<unsigned int> indices(map,"indices_vert");
fout << " Vertices" << std::endl<< position.nbElements() << std::endl;
fout << "Vertices" << std::endl<< position.nbElements() << std::endl;
std::vector<unsigned int> tetra;
tetra.reserve(2048);
......@@ -784,7 +784,7 @@ bool exportTetmesh(typename PFP::MAP& map, const VertexAttribute<typename PFP::V
for (unsigned int i = position.begin(); i != position.end(); position.next(i))
{
const VEC3& P = position[i];
fout << P[0]<< " " << P[1]<< " " << P[2] << std::endl;
fout << P[0]<< " " << P[1]<< " " << P[2] << " " << "0" << std::endl;
indices[i] = count++;
}
......@@ -815,7 +815,7 @@ bool exportTetmesh(typename PFP::MAP& map, const VertexAttribute<typename PFP::V
}
unsigned int nbtetra = tetra.size()/4;
fout << " Tetrahedra" << std::endl << nbtetra << std::endl;
fout << "Tetrahedra" << std::endl << nbtetra << std::endl;
for (unsigned int i=0; i<nbtetra; ++i)
{
......
......@@ -100,7 +100,6 @@ void subdivideFace(typename PFP::MAP& map, Dart d, AttributeHandler<typename PFP
unsigned int degree = 0 ;
typename PFP::VEC3 p ;
Traversor2FE<typename PFP::MAP> travE(map, old);
for(Dart it = travE.begin(); it != travE.end() ; it = travE.next())
{
++degree;
......@@ -306,12 +305,9 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, AttributeHandler<typ
newEdges.reserve(50);
Dart centralDart = NIL;
//Second step : deconnect each corner, close each hole, subdivide each new face into 3
for (std::vector<Dart>::iterator edge = oldEdges.begin(); edge != oldEdges.end(); ++edge)
{
Dart e = *edge;
std::vector<Dart> v ;
......
......@@ -896,6 +896,20 @@ unsigned int Map3MR<PFP>::subdivideHexa(Dart d, bool OneLevelDifference)
if(m_map.getCurrentLevel() == m_map.getMaxLevel())
m_map.addLevelBack() ;
Traversor3WV<typename PFP::MAP> tWV(m_map, d);
for(Dart ditWV = tWV.begin(); ditWV != tWV.end(); ditWV = tWV.next())
{
//dupliquer tous les brins de l'orbite
TraversorDartsOfOrbit<typename PFP::MAP, VERTEX> td(m_map, ditWV);
for(Dart dtd = td.begin() ; dtd != td.end() ; dtd = td.next())
{
m_map.incCurrentLevel();
m_map.duplicateDart(dtd);
m_map.decCurrentLevel() ;
}
}
//
// Subdivide Faces and Edges
//
......@@ -914,6 +928,7 @@ unsigned int Map3MR<PFP>::subdivideHexa(Dart d, bool OneLevelDifference)
for(Dart ditWV = traWV.begin(); ditWV != traWV.end(); ditWV = traWV.next())
{
m_map.incCurrentLevel() ;
(*vertexVertexFunctor)(ditWV) ;
Dart e = ditWV;
......@@ -954,8 +969,6 @@ unsigned int Map3MR<PFP>::subdivideHexa(Dart d, bool OneLevelDifference)
}
m_map.decCurrentLevel() ;
}
m_map.incCurrentLevel();
......
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