浏览代码

comments

Former-commit-id: e48fb4fa21010aa80aa843660299f6a970fb9b2c
Alec Jacobson 9 年之前
父节点
当前提交
20e0e9a082

+ 7 - 7
include/igl/AABB.h

@@ -8,18 +8,18 @@
 #ifndef IGL_AABB_H
 #define IGL_AABB_H
 
-// Implementation of semi-general purpose axis-aligned bounding box hierarchy.
-// The mesh (V,Ele) is stored and managed by the caller and each routine here
-// simply takes it as references (it better not change between calls).
-//
-// It's a little annoying that the Dimension is a template parameter and not
-// picked up at run time from V. This leads to duplicated code for 2d/3d (up to
-// dim).
 #include <Eigen/Core>
 #include <Eigen/Geometry>
 #include <vector>
 namespace igl
 {
+  // Implementation of semi-general purpose axis-aligned bounding box hierarchy.
+  // The mesh (V,Ele) is stored and managed by the caller and each routine here
+  // simply takes it as references (it better not change between calls).
+  //
+  // It's a little annoying that the Dimension is a template parameter and not
+  // picked up at run time from V. This leads to duplicated code for 2d/3d (up to
+  // dim).
   template <typename DerivedV, int DIM>
     class AABB 
     {

+ 3 - 1
include/igl/ConjugateFFSolverData.h

@@ -11,7 +11,9 @@
 #include <Eigen/Core>
 #include <Eigen/Sparse>
 
-namespace igl {
+namespace igl 
+{
+  // Data class for the Conjugate Frame Field Solver
   template <typename DerivedV, typename DerivedF>
   class ConjugateFFSolverData
   {

+ 1 - 1
include/igl/EPS.h

@@ -8,9 +8,9 @@
 #ifndef IGL_EPS_H
 #define IGL_EPS_H
 #include "igl_inline.h"
-// Define a standard value for double epsilon
 namespace igl
 {
+  // Define a standard value for double epsilon
   const double DOUBLE_EPS    = 1.0e-14;
   const double DOUBLE_EPS_SQ = 1.0e-28;
   const float FLOAT_EPS    = 1.0e-7;

+ 0 - 1
include/igl/HalfEdgeIterator.h

@@ -5,7 +5,6 @@
 // This Source Code Form is subject to the terms of the Mozilla Public License
 // v. 2.0. If a copy of the MPL was not distributed with this file, You can
 // obtain one at http://mozilla.org/MPL/2.0/.
-
 #ifndef IGL_HALFEDGEITERATOR_H
 #define IGL_HALFEDGEITERATOR_H
 

+ 2 - 2
include/igl/IndexComparison.h

@@ -8,9 +8,9 @@
 #ifndef IGL_INDEXCOMPARISON_H
 #define IGL_INDEXCOMPARISON_H
 #include <iostream>
-// Comparison struct used by sort
-// http://bytes.com/topic/c/answers/132045-sort-get-index
 namespace igl{
+  // Comparison struct used by sort
+  // http://bytes.com/topic/c/answers/132045-sort-get-index
 
   // For use with functions like std::sort
   template<class T> struct IndexLessThan

+ 4 - 0
include/igl/NormalType.h

@@ -10,6 +10,10 @@
 
 namespace igl
 {
+  // PER_VERTEX_NORMALS  Normals computed per vertex based on incident faces
+  // PER_FACE_NORMALS  Normals computed per face
+  // PER_CORNER_NORMALS  Normals computed per corner (aka wedge) based on
+  //   incident faces without sharp edge
   enum NormalType
   {
     PER_VERTEX_NORMALS,

+ 3 - 3
include/igl/ONE.h

@@ -7,11 +7,11 @@
 // obtain one at http://mozilla.org/MPL/2.0/.
 #ifndef IGL_ONE_H
 #define IGL_ONE_H
-// Often one needs a reference to a dummy variable containing one as its
-// value, for example when using AntTweakBar's
-// TwSetParam( "3D View", "opened", TW_PARAM_INT32, 1, &INT_ONE);
 namespace igl
 {
+  // Often one needs a reference to a dummy variable containing one as its
+  // value, for example when using AntTweakBar's
+  // TwSetParam( "3D View", "opened", TW_PARAM_INT32, 1, &INT_ONE);
   const char CHAR_ONE = 1;
   const int INT_ONE = 1;
   const unsigned int UNSIGNED_INT_ONE = 1;

+ 1 - 0
include/igl/Viewport.h

@@ -10,6 +10,7 @@
 
 namespace igl
 {
+  // Simple Viewport class for an opengl context. Handles reshaping and mouse.
   struct Viewport
   {
     int x,y,width,height;

+ 5 - 2
include/igl/WindingNumberMethod.h

@@ -9,11 +9,14 @@
 #define IGL_WINDINGNUMBERMETHOD_H
 namespace igl
 {
+  // EXACT_WINDING_NUMBER_METHOD  exact hierarchical evaluation
+  // APPROX_SIMPLE_WINDING_NUMBER_METHOD  poor approximation
+  // APPROX_CACHE_WINDING_NUMBER_METHOD  another poor approximation
   enum WindingNumberMethod
   {
-    EXACT_WINDING_NUMBER_METHOD = 0, // Exact hierarchical evaluation
+    EXACT_WINDING_NUMBER_METHOD = 0,
     APPROX_SIMPLE_WINDING_NUMBER_METHOD = 1,
-    APPROX_CACHE_WINDING_NUMBER_METHOD = 2, // Approximate hierarchical evaluation
+    APPROX_CACHE_WINDING_NUMBER_METHOD = 2,
     NUM_WINDING_NUMBER_METHODS = 3
   };
 }

+ 7 - 3
include/igl/WindingNumberTree.h

@@ -12,9 +12,13 @@
 #include <Eigen/Dense>
 #include "WindingNumberMethod.h"
 
-static Eigen::MatrixXd dummyV;
 namespace igl
 {
+  // This is only need to fill in references, it should never actually be touched
+  // and shouldn't cause race conditions. (This is a hack, but I think it's "safe")
+  static Eigen::MatrixXd dummyV;
+  // Space partitioning tree for computing winding number hierarchically.
+  //
   // Templates:
   //   Point  type for points in space, e.g. Eigen::Vector3d
   template <typename Point>
@@ -146,7 +150,7 @@ template <typename Point>
 inline igl::WindingNumberTree<Point>::WindingNumberTree():
   method(EXACT_WINDING_NUMBER_METHOD),
   parent(NULL),
-  V(dummyV),
+  V(igl::dummyV),
   SV(),
   F(),
   //boundary(igl::boundary_facets<Eigen::MatrixXi,Eigen::MatrixXi>(F))
@@ -162,7 +166,7 @@ inline igl::WindingNumberTree<Point>::WindingNumberTree(
   const Eigen::MatrixXi & _F):
   method(EXACT_WINDING_NUMBER_METHOD),
   parent(NULL),
-  V(dummyV),
+  V(igl::dummyV),
   SV(),
   F(),
   //boundary(igl::boundary_facets<Eigen::MatrixXi,Eigen::MatrixXi>(F))

+ 3 - 3
include/igl/ZERO.h

@@ -7,11 +7,11 @@
 // obtain one at http://mozilla.org/MPL/2.0/.
 #ifndef IGL_ZERO_H
 #define IGL_ZERO_H
-// Often one needs a reference to a dummy variable containing zero as its
-// value, for example when using AntTweakBar's
-// TwSetParam( "3D View", "opened", TW_PARAM_INT32, 1, &INT_ZERO);
 namespace igl
 {
+  // Often one needs a reference to a dummy variable containing zero as its
+  // value, for example when using AntTweakBar's
+  // TwSetParam( "3D View", "opened", TW_PARAM_INT32, 1, &INT_ZERO);
   const char CHAR_ZERO = 0;
   const int INT_ZERO = 0;
   const unsigned int UNSIGNED_INT_ZERO = 0;

+ 0 - 2
include/igl/active_set.h

@@ -28,7 +28,6 @@ namespace igl
   // and further optionally subject to the linear inequality constraints that
   // Aieq*Z <= Bieq and constant inequality constraints lx <= x <= ux
   //
-  // Templates:
   // Inputs:
   //   A  n by n matrix of quadratic coefficients
   //   B  n by 1 column of linear coefficients
@@ -50,7 +49,6 @@ namespace igl
   // Benchmark: For a harmonic solve on a mesh with 325K facets, matlab 2.2
   // secs, igl/min_quad_with_fixed.h 7.1 secs
   //
-
   template <
     typename AT, 
     typename DerivedB,