{"push_id":857558630,"size":6,"distinct_size":6,"ref":"refs/heads/refact","head":"9a342952876d1d1b4c0fe6f8318cf39eaf7c8227","before":"7cb37cf6ef274ff9b9ec8b80d73f380470377873","commits":[{"sha":"377ffb3f43372d0fae6578957f06dcd48cc53f63","author":{"email":"5d61c11e6df8ed8ffd2a3627a86b97e825765970@Widor","name":"Alban Kraus"},"message":"OK for mainwindow.","distinct":true,"url":"https://api.github.com/repos/clemousse/megafi/commits/377ffb3f43372d0fae6578957f06dcd48cc53f63"},{"sha":"07e4cbf6760a4ae3a12b010e8c66b60f4a3bb0b7","author":{"email":"5d61c11e6df8ed8ffd2a3627a86b97e825765970@Widor","name":"Alban Kraus"},"message":"This does not work","distinct":true,"url":"https://api.github.com/repos/clemousse/megafi/commits/07e4cbf6760a4ae3a12b010e8c66b60f4a3bb0b7"},{"sha":"cc1b84eaedf4a00a3e27f995ae68e1984a476b8f","author":{"email":"5d61c11e6df8ed8ffd2a3627a86b97e825765970@Widor","name":"Alban Kraus"},"message":"Provisoire","distinct":true,"url":"https://api.github.com/repos/clemousse/megafi/commits/cc1b84eaedf4a00a3e27f995ae68e1984a476b8f"},{"sha":"08f619b58e976691168cdf36b521c2e4b1cc96d0","author":{"email":"5d61c11e6df8ed8ffd2a3627a86b97e825765970@Widor","name":"Alban Kraus"},"message":"New architecture.\n\nClasses MainWindow and glDisplay only handle the related ui widget.  Data is stored in a DTM or FlowPath object (both derives from Drawable base class).\n\nglDisplay stores a reference to communicate with the main window, and const references to the data (that needs a reinterpret_cast between QList<FlowPath*> and QList<const FlowPath*>.\ninit() and draw() methods have been moved to private:, but a slot beginDraw has been written in replacement.\nThe drawing process begins with init(). Then, draw() calls drawData() on each object to be drawn. drawData calls the right (i.e. buildLegacy or buildArrays depending on the graphics primitive) drawing method. If arrays need to be built, as the object is constant, it cannot be achieved in glDisplay; thus a signal is emitted.\nWhen a point is clicked in the viewer, DTM::ComputeIndex interpolates the coordinates on the DTM to find an index; this index is sent to MainWindow::addFlow that builds a new flow and adds it to the list. Succession of DTM points that makes the flow is computed inside the FlowPath class.\nIt seems that the inheritance of QGLViewer un glDisplay causes the link error.\n\nMainWindow handles the operations on the data and other various UI processes.\nThe DTM is a pointer on an object, because it can change during the MainWindow session.\nopenDialog() empties the DTM (along with all flow paths, because they depends on the DTM used) and opens an other one.\nrebuildArrays() calls the right method to build each data object's array.\ndeleteFlows is a small function called when all flows need to be destroyed.\nFlows are iterated with an iterator most time.\n\ndraw.h defines two enumeration: the drawing mode, and the drawing primitive.\nThere is an helper function to get a string for debug messages, and an exception that should occur only when bad programming.\nThe helper function glPrimitive translates the enum primitive into the right OpenGL primitive.\n\nBoth DTM and FlowPath derives from Drawable class.\nThe Drawable class stores the vertices (while letting derivated classes handle it), and provides the interface to build and get the vertex array and the indices array.\nDerivated classes cannot directly modify the vertex array and the indices array; they are stored as basic arrays because their size can be computed berforehand.\nThe Drawable class provides a build function (and a const overload) that can be called by child classes at building time. This build function uses the right mode.\nThe two top-level building functions are buildArrays() and buildLegacy() const. They are pure virtuals because only derivated classes have enough information to handle the global build process.\nVertex arrays and indices arrays have to be rebuilt at each mode or primitive change.\nCopy constructor makes a deep copy that could fail if allocation fails. In that case, a std::bad_alloc is thrown.\nUSER: to customize the building once you have all your m_vertices, you should first call prepareBuild() that will reallocate arrays. Then, iterate your nodes in the order you want and simply call buildFunction.\n\nDTM uses the parent's m_vertices. It has some mode infos and their getters.\nMethods computeIndex is called by MainWindow when a point is entered or clicked.\nreadDTM, computeLineLength and computeDataSize are well known.\nOther functions handles the building / drawing process. The super buildArrays() and buildLegacy() const are redefined. Template functions contains code specific for each primitive. And array_size computes the size of arrays for the current primitive.\nThe template functions are defined in a .inl file that do not need to be included when using the class declaration but has to be included when explicitely calling one of the functions (a priori, this only happens in dtm.cpp). A macro allows to define both const and non-const templates in a single line. For each primitive, an ARRAY_SIZE macro is defined (then used in the array_size function); its definition can call NB_CALL_LINE and NB_CALL_BACK macros that are defined in dtm.cpp and represents the number of times each template function is called.\nIn dtm.cpp, implementation of buildArrays and buildLegacy use the same code: it has been stored in macros to be written once.\n\nFlowPath is simpler: the path is computed at the object construction and is not modified afterwards.\nIndices are stored in m_minIndices and the corresponding vertices in m_vertices. The vertex array is thus m_vertices, indexed by [0..n].","distinct":true,"url":"https://api.github.com/repos/clemousse/megafi/commits/08f619b58e976691168cdf36b521c2e4b1cc96d0"},{"sha":"d5ec35f610d118a2c56019d0ac70caee158f2215","author":{"email":"5d61c11e6df8ed8ffd2a3627a86b97e825765970@Widor","name":"Alban Kraus"},"message":"Useless throw specifier on destructor.","distinct":true,"url":"https://api.github.com/repos/clemousse/megafi/commits/d5ec35f610d118a2c56019d0ac70caee158f2215"},{"sha":"9a342952876d1d1b4c0fe6f8318cf39eaf7c8227","author":{"email":"5d61c11e6df8ed8ffd2a3627a86b97e825765970@Widor","name":"Alban Kraus"},"message":"DTM pointer reference was not updated. Changed to a pointer pointer.","distinct":true,"url":"https://api.github.com/repos/clemousse/megafi/commits/9a342952876d1d1b4c0fe6f8318cf39eaf7c8227"}]}