diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/collada/GeometryExporter.h | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/collada/GeometryExporter.h')
-rw-r--r-- | source/blender/collada/GeometryExporter.h | 143 |
1 files changed, 72 insertions, 71 deletions
diff --git a/source/blender/collada/GeometryExporter.h b/source/blender/collada/GeometryExporter.h index 5eba68165d2..1e2643b7e57 100644 --- a/source/blender/collada/GeometryExporter.h +++ b/source/blender/collada/GeometryExporter.h @@ -43,103 +43,104 @@ struct Depsgraph; extern Object *bc_get_highest_selected_ancestor_or_self(Object *ob); -class Normal -{ - public: - float x; - float y; - float z; - - friend bool operator< (const Normal &, const Normal &); +class Normal { + public: + float x; + float y; + float z; + friend bool operator<(const Normal &, const Normal &); }; -bool operator< (const Normal &, const Normal &); - +bool operator<(const Normal &, const Normal &); // TODO: optimize UV sets by making indexed list with duplicates removed -class GeometryExporter : COLLADASW::LibraryGeometries -{ - struct Face - { - unsigned int v1, v2, v3, v4; - }; - - Normal n; +class GeometryExporter : COLLADASW::LibraryGeometries { + struct Face { + unsigned int v1, v2, v3, v4; + }; -public: + Normal n; - // TODO: optimize UV sets by making indexed list with duplicates removed - GeometryExporter(BlenderContext &blender_context, COLLADASW::StreamWriter *sw, const ExportSettings *export_settings) : - COLLADASW::LibraryGeometries(sw), - blender_context(blender_context), - export_settings(export_settings) - {} + public: + // TODO: optimize UV sets by making indexed list with duplicates removed + GeometryExporter(BlenderContext &blender_context, + COLLADASW::StreamWriter *sw, + const ExportSettings *export_settings) + : COLLADASW::LibraryGeometries(sw), + blender_context(blender_context), + export_settings(export_settings) + { + } - void exportGeom(); + void exportGeom(); - void operator()(Object *ob); + void operator()(Object *ob); - void createLooseEdgeList(Object *ob, - Mesh *me, - std::string& geom_id); + void createLooseEdgeList(Object *ob, Mesh *me, std::string &geom_id); - // powerful because it handles both cases when there is material and when there's not - void create_mesh_primitive_list(short material_index, - bool has_uvs, - bool has_color, - Object *ob, - Mesh *me, - std::string& geom_id, - std::vector<BCPolygonNormalsIndices>& norind); + // powerful because it handles both cases when there is material and when there's not + void create_mesh_primitive_list(short material_index, + bool has_uvs, + bool has_color, + Object *ob, + Mesh *me, + std::string &geom_id, + std::vector<BCPolygonNormalsIndices> &norind); - // creates <source> for positions - void createVertsSource(std::string geom_id, Mesh *me); + // creates <source> for positions + void createVertsSource(std::string geom_id, Mesh *me); - void createVertexColorSource(std::string geom_id, Mesh *me); + void createVertexColorSource(std::string geom_id, Mesh *me); - std::string makeTexcoordSourceId(std::string& geom_id, int layer_index, bool is_single_layer); + std::string makeTexcoordSourceId(std::string &geom_id, int layer_index, bool is_single_layer); - //creates <source> for texcoords - void createTexcoordsSource(std::string geom_id, Mesh *me); - void createTesselatedTexcoordsSource(std::string geom_id, Mesh *me); + //creates <source> for texcoords + void createTexcoordsSource(std::string geom_id, Mesh *me); + void createTesselatedTexcoordsSource(std::string geom_id, Mesh *me); - //creates <source> for normals - void createNormalsSource(std::string geom_id, Mesh *me, std::vector<Normal>& nor); + //creates <source> for normals + void createNormalsSource(std::string geom_id, Mesh *me, std::vector<Normal> &nor); - void create_normals(std::vector<Normal> &nor, std::vector<BCPolygonNormalsIndices> &ind, Mesh *me); + void create_normals(std::vector<Normal> &nor, + std::vector<BCPolygonNormalsIndices> &ind, + Mesh *me); - std::string getIdBySemantics(std::string geom_id, COLLADASW::InputSemantic::Semantics type, std::string other_suffix = ""); - std::string makeVertexColorSourceId(std::string& geom_id, char *layer_name); + std::string getIdBySemantics(std::string geom_id, + COLLADASW::InputSemantic::Semantics type, + std::string other_suffix = ""); + std::string makeVertexColorSourceId(std::string &geom_id, char *layer_name); - COLLADASW::URI getUrlBySemantics(std::string geom_id, COLLADASW::InputSemantic::Semantics type, std::string other_suffix = ""); + COLLADASW::URI getUrlBySemantics(std::string geom_id, + COLLADASW::InputSemantic::Semantics type, + std::string other_suffix = ""); - COLLADASW::URI makeUrl(std::string id); + COLLADASW::URI makeUrl(std::string id); - void export_key_mesh(Object *ob, Mesh *me, KeyBlock *kb); + void export_key_mesh(Object *ob, Mesh *me, KeyBlock *kb); -private: - std::set<std::string> exportedGeometry; - BlenderContext &blender_context; - const ExportSettings *export_settings; + private: + std::set<std::string> exportedGeometry; + BlenderContext &blender_context; + const ExportSettings *export_settings; - Mesh *get_mesh(Scene *sce, Object *ob, int apply_modifiers); + Mesh *get_mesh(Scene *sce, Object *ob, int apply_modifiers); }; struct GeometryFunctor { - // f should have - // void operator()(Object *ob) - template<class Functor> - void forEachMeshObjectInExportSet(Scene *sce, Functor &f, LinkNode *export_set) - { - LinkNode *node; - for (node=export_set; node; node = node->next) { - Object *ob = (Object *)node->link; - if (ob->type == OB_MESH) { - f(ob); - } - } - } + // f should have + // void operator()(Object *ob) + template<class Functor> + void forEachMeshObjectInExportSet(Scene *sce, Functor &f, LinkNode *export_set) + { + LinkNode *node; + for (node = export_set; node; node = node->next) { + Object *ob = (Object *)node->link; + if (ob->type == OB_MESH) { + f(ob); + } + } + } }; #endif |