-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Source tree reorganization #161
Comments
I like this reorganization. A few comments:
|
In that case, it's to me not clear whether
I strongly prefer having detail implementation in separate directories unless there is a compelling reason. I believe one of quickest way of figuring out a project is scanning the source tree, and putting all the detail files into
I actually about to propose using code formatter (probably |
If you can separate the detail stuff that makes sense. But often it is closely tied to some more user-visible code has to be mixed in. Also, there are likely to be math details, geometry details, narrowphase details, etc. -- did you mean to have a subdirectory in each one? We use clang-format with this style. We don't require people to use it, but we guarantee that if they do they won't get whining from cpplint about it! |
Yeah, I believe it's possible.
For those user-visible code, I think they shouldn't be in
Yes. I'm working on this branch for this and you could see how it would look like. Edit:
That's so simple! I will create a new issue for the code style when ready. |
The problem is that when much of the code is in headers it is all exposed. I've seen Possibly we might be talking about different things? |
If header files are moved to different locations, all code that depends on FCL will break. Perhaps you could create stubs for the old headers that have a |
That's my first approach. But I realized FCL 0.6 will break the API anyways because of source tree reorganization. So as a band aid I propose the top level FCL header |
Oh, I see. I think it would be fine to have those helper classes in the same file. I intend to hide files that all the containing classes are in |
Addressed by #163. |
I think the structure of FCL classes is well designed, but the structure of the source tree doesn't seem to accord with it. Here are some issues and suggestions I found while working on #150 and #154.
Minimal classes in a header file
Some files have too many classes in them. This makes hard to learn FCL from navigating the source tree and to maintain the source code. Also, they are vulnerable to circular dependency issues as FCL will be templatized (#154). I propose splitting those files and having minimal classes (ideally single class) in a header file. One exception would be having specialized template classes in the same file of the template class.
Reorganizing source tree structure
The top level directories and files are scattered. I suggest grouping them as
common
,math
,object
,narrowphase
, andbroadphase
. Here (or see this) is a source tree I imagine (bold denotes directory):deprecated.h
,profiler.h
,time.h
,types.h
,warning.h
AABB.h
andOBB.h
constants.h
,geometry.h
(utilities),rng.h
,triangle.h
,variance3.h
box.h
,capsule.h
)BVH_model.h
and related filescollision_geometry.h
collision_object.h
,continuous_collision_object.h
gjk_solver_(indep/libccd).h
(could be renamed properly)(collision/distance/conservative_advancement)_func_matrix.h
collision.h
,distance.h
,continuous_collision.h
(collision/distance/continuous_collision)_(request/result).h
contact.h
,contact_point.h
,cost_source.h
Lower cases for directory names
It seems using lower cases is the convention for directory names, but there are few directories doesn't obey the convention such as
BV
andBVH
. It would be good to be consistent with the lower case convention.Top level FCL header
It would be useful to provide a single header file,
fcl.h
that includes all the necessary fcl headers to use all the fcl functionalities. This would allow the user doesn't need to learn the structure of the source tree to find headers they want.Unused code
There are several directories that include unused implementations:
articulated_model
,learning
,simd
, andinterpolation
. We could either entirely remove them or move them frominclude/fcl
to somewhere like[fcl_root]/unused
or[fcl_root]/deprecated
.detail
namespaceThere are many implementations that might not be necessary to be exposed to the user who is only interested in using FCL rather than understanding the detailed implementation. We could hide them by using nested namespace,
detail
, underfcl
and putting them intodetail
directory. This would make easier to learn FCL for casual users. Also, this could be useful to developers because the developers would be less stressful about the API compatibility for thedetail
namespace.The text was updated successfully, but these errors were encountered: