Commit 6d652049 authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

Import/export for SLF in binary works

parent b9d06a5a
......@@ -78,6 +78,21 @@ bool exportTrian(typename PFP::MAP& map, const typename PFP::TVEC3& position, ch
template <typename PFP>
bool exportPlySLFgeneric(typename PFP::MAP& map, const typename PFP::TVEC3& position, const char* filename, const FunctorSelect& good = allDarts) ;
/**
* export the map into a PLYPTMgeneric file (K. Vanhoey generic format).
*
* exports position + any attribute named : "frame_T" (frame tangent : VEC3), "frame_B" (frame binormal : VEC3), "frame_N" (frame normal : VEC3),
* "colorPTM_a<i> : VEC3" (coefficient number i of the 3 polynomials - one per channel - ; the max i depends on the degree of the PTM polynomial),
* "errL2 : REAL" (L2 fitting error), "errLmax : REAL" (maximal fitting error), "stdDev : REAL" (standard deviation of the L2 fitting errors).
*
* @param map map to be exported
* @param filename filename of ply file
* @param position the position container
* @return true
*/
template <typename PFP>
bool exportPlySLFgenericBin(typename PFP::MAP& map, const typename PFP::TVEC3& position, const char* filename, const FunctorSelect& good = allDarts) ;
/**
* export the map into a PLYSLF file (K. Vanhoey generic format).
*
......
......@@ -402,7 +402,7 @@ public:
*/
std::string selectFileSave(const std::string& title = "open file", const std::string& dir = ".", const std::string& filters = "all (*.*)");
void snapshot(const QString& filename);
void snapshot(const QString& filename, const char* format = 0, const int& quality = -1);
public slots:
virtual void cb_New() { std::cerr << "callback not implemented" << std::endl; }
......
......@@ -514,10 +514,10 @@ void SimpleQT::cb_about()
QMessageBox::about(this, tr("About App"), m_helpString.c_str());
}
void SimpleQT::snapshot(const QString& filename)
void SimpleQT::snapshot(const QString& filename, const char* format, const int& quality)
{
QImage im = m_glWidget->grabFrameBuffer(false);
im.save(filename);
im.save(filename, format, quality);
}
void SimpleQT::setGeometry(int x, int y, int w, int h)
......
......@@ -117,7 +117,7 @@ void GLWidget::recalcModelView()
oglTranslate(m_obj_pos[0], m_obj_pos[1], m_obj_pos[2]);
// ajout transformation
// m_cbs->modelViewMatrix() *=m_cbs->transfoMatrix();
// m_cbs->modelViewMatrix() *= m_cbs->transfoMatrix();
newModel = 0;
......@@ -487,6 +487,7 @@ float GLWidget::getWidthInWorld(unsigned int pixel_width, const Geom::Vec3f& cen
void GLWidget::transfoRotate(float angle, float x, float y, float z)
{
m_cbs->transfoMatrix() = glm::rotate( m_cbs->transfoMatrix(), angle, glm::vec3(x,y,z));
recalcModelView() ;
}
void GLWidget::transfoTranslate(float tx, float ty, float tz)
......
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