Skip to content

Commit 80c46a5

Browse files
committed
Refactor
1 parent d09d9fa commit 80c46a5

File tree

152 files changed

+6192
-1113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+6192
-1113
lines changed

include/holonomy/holonomy/core/VF_mesh.h

Lines changed: 0 additions & 34 deletions
This file was deleted.

include/holonomy/holonomy/core/boundary_basis.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#pragma once
22

33
#include "holonomy/core/common.h"
4-
#include "holonomy/core/spanning_tree.h"
4+
#include "util/spanning_tree.h"
55

6-
namespace PennerHolonomy {
6+
namespace Penner {
7+
namespace Holonomy {
78

89
/**
910
* @brief Class to generate boundary loops and boundary path basis loops
@@ -55,4 +56,5 @@ class BoundaryBasisGenerator
5556
DualTree m_dual_tree;
5657
};
5758

58-
} // namespace PennerHolonomy
59+
} // namespace Holonomy
60+
} // namespace Penner

include/holonomy/holonomy/core/common.h

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,15 @@
99
#include <Eigen/Sparse>
1010

1111
#include "optimization/penner_optimization_interface.h"
12+
#include "optimization/core/common.h"
1213
#include "optimization/core/cone_metric.h"
13-
#include "optimization/core/vector.h"
14+
#include "util/vector.h"
1415

15-
namespace PennerHolonomy {
16+
namespace Penner {
17+
namespace Holonomy {
1618

1719
// Typedefs
18-
using CurvatureMetric::DifferentiableConeMetric;
19-
using CurvatureMetric::float_equal;
20-
using CurvatureMetric::MatrixX;
21-
using CurvatureMetric::max;
22-
using CurvatureMetric::Mesh;
23-
using CurvatureMetric::OverlayMesh;
24-
using CurvatureMetric::Scalar;
25-
using CurvatureMetric::swap;
26-
using CurvatureMetric::T;
27-
using CurvatureMetric::VectorX;
28-
using std::isnan;
29-
using std::min;
30-
typedef Eigen::Matrix<Scalar, 2, 1> Vector2;
31-
typedef Eigen::Matrix<Scalar, 3, 1> Vector3;
32-
typedef Eigen::Matrix<Scalar, 2, 2> Matrix2x2;
20+
using Optimization::DifferentiableConeMetric;
3321
typedef Eigen::Matrix<int, Eigen::Dynamic, 2> RowVectors2i;
3422

3523

@@ -72,23 +60,6 @@ int compute_euler_characteristic(const Mesh<Scalar>& m);
7260
*/
7361
int compute_genus(const Mesh<Scalar>& m);
7462

75-
/**
76-
* @brief Compute a rotation matrix corresponding to a given angle
77-
*
78-
* @param theta: rotation angle
79-
* @return rotation angle
80-
*/
81-
Matrix2x2 compute_rotation(Scalar theta);
82-
83-
/**
84-
* @brief Solve a linear system with matrix valued right hand side
85-
*
86-
* @param A: matrix to invert
87-
* @param B: right hand side matrix
88-
* @return solution to AX = B
89-
*/
90-
MatrixX solve_linear_system(const MatrixX& A, const MatrixX& B);
91-
9263
/**
9364
* @brief Compute the map from vertex-vertex edges to primal mesh halfedges
9465
*
@@ -99,4 +70,5 @@ MatrixX solve_linear_system(const MatrixX& A, const MatrixX& B);
9970
*/
10071
Eigen::SparseMatrix<int> compute_vv_to_halfedge_matrix(const Mesh<Scalar>& m);
10172

102-
} // namespace PennerHolonomy
73+
} // namespace Holonomy
74+
} // namespace Penner
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#pragma once
2+
3+
#include "holonomy/core/common.h"
4+
5+
#include "util/spanning_tree.h"
6+
7+
namespace Penner {
8+
namespace Holonomy {
9+
10+
/**
11+
* @brief Compute dual edge lengths using the DEC formulation with dual vertices at circumcenters.
12+
*
13+
* @param m: mesh with primal edge lengths
14+
* @return per-halfedge dual edge lengths
15+
*/
16+
std::vector<Scalar> compute_dual_edge_lengths(const Mesh<Scalar>& m);
17+
18+
/**
19+
* @brief Compute the edge weights for a primal tree given by the length of the root cycle
20+
* generated by adding an edge to a dual spanning tree (or 0 if the edge is in the spanning tree)
21+
*
22+
* @param m: underlying mesh
23+
* @param weights: weights on the dual mesh for loop lengths
24+
* @param dual_tree: spanning dual tree
25+
* @return per-halfedge dual loop length weights
26+
*/
27+
std::vector<Scalar> compute_dual_loop_length_weights(
28+
const Mesh<Scalar>& m,
29+
const std::vector<Scalar>& weights,
30+
const DualTree& dual_tree);
31+
32+
} // namespace Holonomy
33+
} // namespace Penner

include/holonomy/holonomy/core/dual_loop.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
#include "holonomy/core/common.h"
44
#include "holonomy/core/dual_segment.h"
55

6-
namespace PennerHolonomy {
6+
namespace Penner {
7+
namespace Holonomy {
78

89
typedef std::array<int, 2> DualSegment;
910

@@ -346,5 +347,5 @@ class DualLoopManager{
346347
std::vector<int> m_temp_list;
347348
};
348349

349-
350-
} // namespace PennerHolonomy
350+
} // namespace Holonomy
351+
} // namespace Penner

include/holonomy/holonomy/core/dual_segment.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
#include "holonomy/core/common.h"
44

5-
namespace PennerHolonomy {
5+
namespace Penner {
6+
namespace Holonomy {
67

78
typedef std::array<int, 2> DualSegment;
89

@@ -136,4 +137,5 @@ void view_dual_path(
136137
const Mesh<Scalar>& m,
137138
const std::vector<DualSegment>& dual_path);
138139

139-
} // namespace PennerHolonomy
140+
} // namespace Holonomy
141+
} // namespace Penner

include/holonomy/holonomy/core/field.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
#include "holonomy/core/common.h"
55

6-
namespace PennerHolonomy {
6+
namespace Penner {
7+
namespace Holonomy {
78

89
/**
910
* @brief Generate a cross field for a mesh
@@ -18,4 +19,5 @@ std::tuple<Eigen::MatrixXd, std::vector<Scalar>> generate_cross_field(
1819
const Eigen::MatrixXi& F);
1920

2021

21-
} // namespace PennerHolonomy
22+
} // namespace Holonomy
23+
} // namespace Penner

include/holonomy/holonomy/core/forms.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
#include "holonomy/core/common.h"
44
#include "holonomy/core/dual_loop.h"
55

6-
namespace PennerHolonomy {
6+
namespace Penner {
7+
namespace Holonomy {
78

89
/**
910
* @brief Determine if a one form is valid.
@@ -128,4 +129,5 @@ VectorX scale_edges_by_zero_form(
128129
const VectorX& metric_coords,
129130
const VectorX& zero_form);
130131

131-
} // namespace PennerHolonomy
132+
} // namespace Holonomy
133+
} // namespace Penner

include/holonomy/holonomy/core/homology_basis.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
#include "holonomy/core/common.h"
55
#include "holonomy/core/dual_loop.h"
6-
#include "holonomy/core/spanning_tree.h"
6+
#include "util/spanning_tree.h"
77

8-
namespace PennerHolonomy {
8+
namespace Penner {
9+
namespace Holonomy {
910

1011
/**
1112
* @brief Construct a clockwise dual path around a vertex in the mesh.
@@ -133,4 +134,5 @@ class HomotopyBasisGenerator
133134
typedef HomotopyBasisGenerator HomologyBasisGenerator;
134135

135136

136-
} // namespace PennerHolonomy
137+
} // namespace Holonomy
138+
} // namespace Penner

include/holonomy/holonomy/core/intrinsic_field.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
#include "holonomy/core/common.h"
44

5-
namespace PennerHolonomy {
5+
namespace Penner {
6+
namespace Holonomy {
67

78
class IntrinsicNRosyField
89
{
@@ -57,6 +58,5 @@ class IntrinsicNRosyField
5758
VectorX compute_rotation_form(const Mesh<Scalar>& m);
5859
};
5960

60-
61-
62-
} // namespace PennerHolonomy
61+
} // namespace Holonomy
62+
} // namespace Penner

0 commit comments

Comments
 (0)