Editing User:Clouddrift/GSoC2014/Midterm
From BRL-CAD
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
== Reorganize NMG Data Structure == | == Reorganize NMG Data Structure == | ||
− | The functionality of struct '''model''' and '''nmgregion''' are | + | The functionality of struct '''model''' and '''nmgregion''' are redundant to '''combination''' concept in BRL-CAD. |
− | |||
struct model | struct model | ||
{ | { | ||
Line 10: | Line 9: | ||
char *manifolds; /**< @brief structure 1-3manifold table */ | char *manifolds; /**< @brief structure 1-3manifold table */ | ||
long index; /**< @brief struct # in this model */ | long index; /**< @brief struct # in this model */ | ||
− | long maxindex; /**< @brief # of structs so far */ | + | '''long maxindex; /**< @brief # of structs so far */''' |
}; | }; | ||
− | |||
− | |||
struct nmgregion { | struct nmgregion { | ||
struct bu_list l; /**< @brief regions, in model's r_hd list */ | struct bu_list l; /**< @brief regions, in model's r_hd list */ | ||
Line 22: | Line 19: | ||
long index; /**< @brief struct # in this model */ | long index; /**< @brief struct # in this model */ | ||
}; | }; | ||
− | |||
− | + | Then, change struct '''shell''' to fit new nmg philosophy. | |
− | + | old: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
struct shell { | struct shell { | ||
− | struct bu_list l; /**< @brief shells, in region's s_hd list */ | + | '''struct bu_list l; /**< @brief shells, in region's s_hd list */''' |
− | struct nmgregion *r_p; /**< @brief owning region */ | + | '''struct nmgregion *r_p; /**< @brief owning region */''' |
struct shell_a *sa_p; /**< @brief attribs */ | struct shell_a *sa_p; /**< @brief attribs */ | ||
struct bu_list fu_hd; /**< @brief list of face uses in shell */ | struct bu_list fu_hd; /**< @brief list of face uses in shell */ | ||
Line 44: | Line 34: | ||
long index; /**< @brief struct # in this model */ | long index; /**< @brief struct # in this model */ | ||
}; | }; | ||
− | |||
− | + | new: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
struct shell { | struct shell { | ||
− | uint32_t magic; | + | '''uint32_t magic;''' |
struct shell_a *sa_p; /**< @brief attribs */ | struct shell_a *sa_p; /**< @brief attribs */ | ||
struct bu_list fu_hd; /**< @brief list of face uses in shell */ | struct bu_list fu_hd; /**< @brief list of face uses in shell */ | ||
Line 60: | Line 43: | ||
struct bu_list eu_hd; /**< @brief wire list (shell has wires) */ | struct bu_list eu_hd; /**< @brief wire list (shell has wires) */ | ||
struct vertexuse *vu_p; /**< @brief internal ptr to single vertexuse */ | struct vertexuse *vu_p; /**< @brief internal ptr to single vertexuse */ | ||
− | char *manifolds; /**< @brief structure 1-3manifold table */ | + | '''char *manifolds; /**< @brief structure 1-3manifold table */''' |
long index; /**< @brief struct # in this model */ | long index; /**< @brief struct # in this model */ | ||
− | long maxindex; /**< @brief # of structs so far */ | + | '''long maxindex; /**< @brief # of structs so far */''' |
}; | }; | ||
− | |||
− | == | + | == Fix Debugs == |
− | + | Due to the change of core NMG data structure, thousands of compiling errors are coming. I spend most time in these weeks to fix and test them properly. | |
− | + | 28 functions in raytrace.h are removed because they are no longer necessary. The detailed list is as following: | |
* struct model *'''nmg_mmr'''(void); | * struct model *'''nmg_mmr'''(void); | ||
Line 100: | Line 82: | ||
* void '''nmg_visit_region'''(struct nmgregion *r, const struct nmg_visit_handlers *htab, genptr_t state); | * void '''nmg_visit_region'''(struct nmgregion *r, const struct nmg_visit_handlers *htab, genptr_t state); | ||
* void '''nmg_visit_model'''(struct model *model, const struct nmg_visit_handlers *htab, genptr_t state); | * void '''nmg_visit_model'''(struct model *model, const struct nmg_visit_handlers *htab, genptr_t state); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
== Conclusion == | == Conclusion == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− |