@@ -130,6 +130,12 @@ class LIB_GMDS_MEDIALAXIS_API MedialAxis2D
130130 */
131131 void setMedialPointType ();
132132
133+ /* -------------------------------------------------------------------------*/
134+ /* * \brief Get the medial point type
135+ * @param AId medial point id
136+ */
137+ int getMedialPointType (TCellID AId);
138+
133139 /* -------------------------------------------------------------------------*/
134140 /* * \brief Set the medial edge type
135141 * @param
@@ -228,6 +234,13 @@ class LIB_GMDS_MEDIALAXIS_API MedialAxis2D
228234 */
229235 void checkSingularities (const double & AOrthogonalityDefaultTol);
230236
237+ /* -------------------------------------------------------------------------*/
238+ /* * \brief Check if singularities are close to an intersection point up to ANbPoints points. If it is the case,
239+ * move the singularity to the IP.
240+ * @param ANbPoints a number of points
241+ */
242+ void moveSingularitiesToIPs (const double & ANbPoints);
243+
231244 /* -------------------------------------------------------------------------*/
232245 /* * \brief Get a point's adjacent point with respect to one of its edges
233246 * @param A medial point id and a medial edge id.
@@ -348,6 +361,125 @@ class LIB_GMDS_MEDIALAXIS_API MedialAxis2D
348361 */
349362 Eigen::MatrixXd constraintMatrix ();
350363
364+ /* -------------------------------------------------------------------------*/
365+ /* * \brief Return the given node's neighbouring node of the topological representation with respect to the given edge
366+ * @param AN, AE a node and an edge which contains the node
367+ */
368+ Node getNextSingularNode (Node &AN, Edge &AE);
369+
370+ /* -------------------------------------------------------------------------*/
371+ /* * \brief Return the given edge's neighbouring edge of the topological representation with respect to the given node
372+ * @param AE, AN an edge and a node contained by th edge
373+ */
374+ Edge getNextMedialSection (Edge &AE, Node &AN);
375+
376+ /* -------------------------------------------------------------------------*/
377+ /* * \brief Wander around the medial axis topological representation
378+ * @param
379+ */
380+ void browseTopoRep ();
381+
382+ /* -------------------------------------------------------------------------*/
383+ /* * \brief Build the degrees of freedom graph nodes
384+ * @param
385+ */
386+ void buildDofGraphNodes ();
387+
388+ /* -------------------------------------------------------------------------*/
389+ /* * \brief Build the degrees of freedom edge corresponding to the two given sections of type 0 and 0,
390+ * oriented by the two given sides (0 = left, 1 = right)
391+ * @param ASection1, ASection2, ASide1, ASide2
392+ */
393+ void dofEdge00 (Edge &ASection1, Edge &ASection2, int ASide1, int ASide2);
394+
395+ /* -------------------------------------------------------------------------*/
396+ /* * \brief Build the degrees of freedom edges corresponding to the two given sections of type 1 and 1,
397+ * oriented by the two given sides (0 = left, 1 = right)
398+ * @param ASection1, ASection2, ASide1, ASide2
399+ */
400+ void dofEdges11 (Edge &ASection1, Edge &ASection2, int ASide1, int ASide2);
401+
402+ /* -------------------------------------------------------------------------*/
403+ /* * \brief Build the degrees of freedom edges corresponding to the two given sections of type 0 and 1,
404+ * oriented by the two given sides (0 = left, 1 = right)
405+ * @param ASection1, ASection2, ASide1, ASide2
406+ */
407+ void dofEdges01 (Edge &ASection1, Edge &ASection2, int ASide1, int ASide2);
408+
409+ /* -------------------------------------------------------------------------*/
410+ /* * \brief Build the degrees of freedom edges corresponding to the two given sections of type 1 and 0,
411+ * oriented by the two given sides (0 = left, 1 = right)
412+ * @param ASection1, ASection2, ASide1, ASide2
413+ */
414+ void dofEdges10 (Edge &ASection1, Edge &ASection2, int ASide1, int ASide2);
415+
416+ /* -------------------------------------------------------------------------*/
417+ /* * \brief Build the degrees of freedom edges corresponding to the right side of the path formed by the two given edges
418+ * @param ASection1, ASection2
419+ */
420+ void dofEdges (Edge &ASection1, Edge &ASection2);
421+
422+ /* -------------------------------------------------------------------------*/
423+ /* * \brief Build the degrees of freedom graph edges
424+ * @param
425+ */
426+ void buildDofGraphEdges ();
427+
428+ /* -------------------------------------------------------------------------*/
429+ /* * \brief Set the connectivity of the quantization degrees of freedom graph
430+ * @param
431+ */
432+ void setDofGraphConnectivity ();
433+
434+ /* -------------------------------------------------------------------------*/
435+ /* * \brief Build a solution to the quantization problem in the case without cycle
436+ * @param
437+ */
438+ void buildQuantizationWithoutCycleSolution ();
439+
440+ /* -------------------------------------------------------------------------*/
441+ /* * \brief Build the nodes of the medial axis based block decomposition
442+ * @param
443+ */
444+ void buildBlockDecompMedialAndBoundaryNodes ();
445+
446+ /* -------------------------------------------------------------------------*/
447+ /* * \brief Write the block decomposition
448+ * @param
449+ */
450+ void writeBlockDecomp (std::basic_string<char > AFileName);
451+
452+ /* -------------------------------------------------------------------------*/
453+ /* * \brief Build blocks
454+ * @param
455+ */
456+ void buildSection2MedialAndBoundaryNodesAdjacency ();
457+
458+ /* -------------------------------------------------------------------------*/
459+ /* * \brief Build middle nodes
460+ * @param
461+ */
462+ void buildMiddleNodes ();
463+
464+ /* -------------------------------------------------------------------------*/
465+ /* * \brief Build blocks
466+ * @param
467+ */
468+ void buildBlocks ();
469+
470+ /* -------------------------------------------------------------------------*/
471+ /* * \brief Sort adjacent edges with respect to their angle with the x-axis.
472+ * @param AN a node
473+ */
474+ std::vector<Edge> sortedAdjacentEdges (Node &AN);
475+
476+ /* -------------------------------------------------------------------------*/
477+ /* * \brief Take an edge and a node belonging to the edge. Return the edges closest to
478+ * the given edge in the list of sorted edges of n.
479+ * @param AE, AN an edge and a node
480+ */
481+ std::vector<Edge> neighbouringEdges (Edge &AE, Node &AN);
482+
351483 private:
352484
353485 // Geometrical representation of the medial axis
@@ -357,8 +489,12 @@ class LIB_GMDS_MEDIALAXIS_API MedialAxis2D
357489 std::vector<Node> m_singular_nodes;
358490 std::vector<double > m_singularity_indexes;
359491
360- // Topological representation of the medial axis (used for quantisation )
492+ // Topological representation of the medial axis (used for quantization )
361493 Mesh* m_topological_representation;
494+ // Quantization degrees of freedom graph
495+ Mesh* m_dof_graph;
496+ // Topology of a medial axis based block decomposition
497+ Mesh* m_ma_block_decomposition;
362498};
363499/* ----------------------------------------------------------------------------*/
364500} // end namespace medialaxis
0 commit comments