From 68563494ae37a658a4353defc17e8ed9f455c701 Mon Sep 17 00:00:00 2001 From: tangziwen Date: Fri, 27 Mar 2015 14:10:41 +0800 Subject: [PATCH 1/3] fix doxygen add to group --- cocos/3d/CCAABB.h | 8 ++++++++ cocos/3d/CCAnimate3D.h | 11 ++++++++++- cocos/3d/CCAnimation3D.h | 8 +++++++- cocos/3d/CCAnimationCurve.h | 10 +++++++++- cocos/3d/CCAttachNode.h | 9 +++++++-- cocos/3d/CCBillBoard.h | 9 +++++++-- cocos/3d/CCBundle3D.h | 11 ++++++++++- cocos/3d/CCBundle3DData.h | 32 ++++++++++++++++++++------------ cocos/3d/CCBundleReader.h | 9 ++++++++- cocos/3d/CCMesh.h | 11 ++++++++++- cocos/3d/CCMeshSkin.h | 10 +++++++++- cocos/3d/CCMeshVertexIndexData.h | 8 ++++++++ cocos/3d/CCOBB.h | 8 ++++++++ cocos/3d/CCObjLoader.h | 10 +++++++++- cocos/3d/CCRay.h | 10 +++++++++- cocos/3d/CCSkeleton3D.h | 10 +++++++++- cocos/3d/CCSprite3D.h | 10 +++++++++- cocos/3d/CCSprite3DMaterial.h | 10 +++++++++- 18 files changed, 166 insertions(+), 28 deletions(-) diff --git a/cocos/3d/CCAABB.h b/cocos/3d/CCAABB.h index 662d4c278f..27814eadfd 100644 --- a/cocos/3d/CCAABB.h +++ b/cocos/3d/CCAABB.h @@ -30,6 +30,11 @@ NS_CC_BEGIN +/** + * @addtogroup _3d + * @{ + */ + /** * Axis Aligned Bounding Box (AABB), usually caculate some rough but fast collision detection. */ @@ -117,6 +122,9 @@ public: Vec3 _max; }; +// end of actions group +/// @} + NS_CC_END #endif diff --git a/cocos/3d/CCAnimate3D.h b/cocos/3d/CCAnimate3D.h index 021f6118f5..2942371ad6 100644 --- a/cocos/3d/CCAnimate3D.h +++ b/cocos/3d/CCAnimate3D.h @@ -37,8 +37,14 @@ NS_CC_BEGIN class Bone3D; class Sprite3D; + /** - * Animate3D, Animates a Sprite3D given with an Animation3D + * @addtogroup _3d + * @{ + */ + +/** + * @brief Animate3D, Animates a Sprite3D given with an Animation3D */ class CC_DLL Animate3D: public ActionInterval { @@ -139,6 +145,9 @@ protected: static std::unordered_map s_runningAnimates; }; +// end of actions group +/// @} + NS_CC_END #endif // __CCANIMATE3D_H__ diff --git a/cocos/3d/CCAnimation3D.h b/cocos/3d/CCAnimation3D.h index 5b57384627..04c52e3544 100644 --- a/cocos/3d/CCAnimation3D.h +++ b/cocos/3d/CCAnimation3D.h @@ -34,9 +34,13 @@ #include "3d/CCBundle3DData.h" NS_CC_BEGIN +/** + * @addtogroup _3d + * @{ + */ /** - * static animation data, shared + * @brief static animation data, shared */ class CC_DLL Animation3D: public Ref { @@ -114,6 +118,8 @@ protected: std::unordered_map _animations; //cached animations }; +// end of actions group +/// @} NS_CC_END #endif // __CCANIMATION3D_H__ diff --git a/cocos/3d/CCAnimationCurve.h b/cocos/3d/CCAnimationCurve.h index 07966a0bfd..9708d0349b 100644 --- a/cocos/3d/CCAnimationCurve.h +++ b/cocos/3d/CCAnimationCurve.h @@ -36,6 +36,11 @@ NS_CC_BEGIN +/** + * @addtogroup _3d + * @{ + */ + /** * Evaluate Type */ @@ -48,7 +53,7 @@ enum class EvaluateType }; /** - * curve of bone's position, rotation or scale + * @brief curve of bone's position, rotation or scale */ template class AnimationCurve: public Ref @@ -95,6 +100,9 @@ protected: std::function _evaluateFun; //user defined function }; +// end of actions group +/// @} + NS_CC_END #include "CCAnimationCurve.inl" diff --git a/cocos/3d/CCAttachNode.h b/cocos/3d/CCAttachNode.h index c03bf625ee..fadb6d19b1 100644 --- a/cocos/3d/CCAttachNode.h +++ b/cocos/3d/CCAttachNode.h @@ -29,11 +29,14 @@ #include "2d/CCNode.h" NS_CC_BEGIN - +/** + * @addtogroup _3d + * @{ + */ class Bone3D; /** - * attach a node to a bone + * @brief attach a node to a bone * usage: auto sprite = Sprite3D::create("girl.c3b"); * auto weapon = Sprite3D::create("weapon.c3b"); * auto attachNode = sprite->getAttachNode("left hand"); @@ -65,6 +68,8 @@ protected: mutable Mat4 _transformToParent; }; +// end of actions group +/// @} NS_CC_END #endif // __CCATTACHNODE_H__ diff --git a/cocos/3d/CCBillBoard.h b/cocos/3d/CCBillBoard.h index 86b0006953..0f94ff68ad 100644 --- a/cocos/3d/CCBillBoard.h +++ b/cocos/3d/CCBillBoard.h @@ -28,9 +28,13 @@ #include "2d/CCSprite.h" NS_CC_BEGIN +/** + * @addtogroup _3d + * @{ + */ /** - * Inherit from Sprite, achieve BillBoard. + * @brief Inherit from Sprite, achieve BillBoard. */ class CC_DLL BillBoard : public Sprite { @@ -118,7 +122,8 @@ private: }; - +// end of actions group +/// @} NS_CC_END diff --git a/cocos/3d/CCBundle3D.h b/cocos/3d/CCBundle3D.h index 5a7a6e2c6d..c0e2b87aa4 100644 --- a/cocos/3d/CCBundle3D.h +++ b/cocos/3d/CCBundle3D.h @@ -30,11 +30,17 @@ #include "json/document.h" NS_CC_BEGIN + +/** + * @addtogroup _3d + * @{ + */ + class Animation3D; class Data; /** - * Defines a bundle file that contains a collection of assets. Mesh, Material, MeshSkin, Animation + * @brief Defines a bundle file that contains a collection of assets. Mesh, Material, MeshSkin, Animation * There are two types of bundle files, c3t and c3b. * c3t text file * c3b binary file @@ -174,6 +180,9 @@ protected: bool _isBinary; }; +// end of actions group +/// @} + NS_CC_END #endif // __CCBUNDLE3D_H__ diff --git a/cocos/3d/CCBundle3DData.h b/cocos/3d/CCBundle3DData.h index d0cda7cc9f..86d49e914a 100644 --- a/cocos/3d/CCBundle3DData.h +++ b/cocos/3d/CCBundle3DData.h @@ -35,7 +35,12 @@ NS_CC_BEGIN -/**mesh vertex attribute*/ +/** + * @addtogroup _3d + * @{ + */ + +/** @brief mesh vertex attribute*/ struct MeshVertexAttrib { //attribute size @@ -50,7 +55,7 @@ struct MeshVertexAttrib struct ModelData; -/** Node data, since 3.3 */ +/** @brief Node data, since 3.3 */ struct NodeData { std::string id; @@ -75,7 +80,7 @@ struct NodeData }; -/** model node data, since 3.3 */ +/** @brief model node data, since 3.3 */ struct ModelData { std::string subMeshId; @@ -94,7 +99,7 @@ struct ModelData } }; -/** node datas, since 3.3 */ +/** @brief node datas, since 3.3 */ struct NodeDatas { std::vector skeleton; //skeleton @@ -115,7 +120,7 @@ struct NodeDatas } }; -/**mesh data*/ +/** @brief mesh data*/ struct MeshData { typedef std::vector IndexArray; @@ -168,7 +173,7 @@ public: } }; -/** mesh datas */ +/** @brief mesh datas */ struct MeshDatas { std::vector meshDatas; @@ -187,7 +192,7 @@ struct MeshDatas } }; -/**skin data*/ +/** @brief skin data*/ struct SkinData { std::vector skinBoneNames; //skin bones affect skin @@ -256,7 +261,7 @@ struct SkinData }; -/**material data, */ +/** @brief material data, */ struct MaterialData { std::map texturePaths; //submesh id, texture path @@ -267,7 +272,7 @@ struct MaterialData }; -/**new material, since 3.3 */ +/** @brief new material, since 3.3 */ struct NTextureData { enum class Usage { @@ -303,7 +308,7 @@ struct NMaterialData return nullptr; } }; -/** material datas, since 3.3 */ +/** @brief material datas, since 3.3 */ struct MaterialDatas { std::vector materials; @@ -321,7 +326,7 @@ struct MaterialDatas return nullptr; } }; -/**animation data*/ +/** @brief animation data*/ struct Animation3DData { public: @@ -391,7 +396,7 @@ public: } }; -/**reference data*/ +/** @brief reference data*/ struct Reference { public: @@ -404,6 +409,9 @@ public: ~Reference(){} }; +// end of actions group +/// @} + NS_CC_END #endif //__CC_BUNDLE_3D_DATA_H__ diff --git a/cocos/3d/CCBundleReader.h b/cocos/3d/CCBundleReader.h index f4a47a5947..9335ffffbc 100644 --- a/cocos/3d/CCBundleReader.h +++ b/cocos/3d/CCBundleReader.h @@ -35,7 +35,12 @@ NS_CC_BEGIN /** - * BundleReader is an interface for reading sequence of bytes. + * @addtogroup _3d + * @{ + */ + +/** + * @brief BundleReader is an interface for reading sequence of bytes. */ class BundleReader: public cocos2d::Ref { @@ -201,6 +206,8 @@ inline bool BundleReader::readArray(unsigned int *length, std::vect return true; } +// end of actions group +/// @} NS_CC_END diff --git a/cocos/3d/CCMesh.h b/cocos/3d/CCMesh.h index 04787e3c60..c5ef7cf347 100644 --- a/cocos/3d/CCMesh.h +++ b/cocos/3d/CCMesh.h @@ -36,13 +36,18 @@ NS_CC_BEGIN +/** + * @addtogroup _3d + * @{ + */ + class Texture2D; class MeshSkin; class MeshIndexData; class GLProgramState; class GLProgram; /** - * Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on + * @brief Mesh: contains ref to index buffer, GLProgramState, texture, skin, blend function, aabb and so on */ class CC_DLL Mesh : public Ref { @@ -158,6 +163,10 @@ protected: std::function _visibleChanged; }; +// end of actions group +/// @} + + NS_CC_END #endif // __CCMESH_H__ diff --git a/cocos/3d/CCMeshSkin.h b/cocos/3d/CCMeshSkin.h index b76e152e4e..fc0ef03989 100644 --- a/cocos/3d/CCMeshSkin.h +++ b/cocos/3d/CCMeshSkin.h @@ -33,11 +33,16 @@ NS_CC_BEGIN +/** + * @addtogroup _3d + * @{ + */ + class Bone3D; class Skeleton3D; /** - * MeshSkin, A class maintain a collection of bones that affect Mesh vertex. + * @brief MeshSkin, A class maintain a collection of bones that affect Mesh vertex. * And it is responsible for computing matrix palletes that used by skin mesh rendering. */ class CC_DLL MeshSkin: public Ref @@ -99,6 +104,9 @@ protected: Vec4* _matrixPalette; }; +// end of actions group +/// @} + NS_CC_END #endif // __CCSKIN_H__ diff --git a/cocos/3d/CCMeshVertexIndexData.h b/cocos/3d/CCMeshVertexIndexData.h index 74b1f089a5..02bda81e5f 100644 --- a/cocos/3d/CCMeshVertexIndexData.h +++ b/cocos/3d/CCMeshVertexIndexData.h @@ -41,6 +41,11 @@ NS_CC_BEGIN +/** + * @addtogroup _3d + * @{ + */ + class MeshVertexData; /** @@ -132,6 +137,9 @@ protected: int _vertexCount; //vertex count }; +// end of actions group +/// @} + NS_CC_END #endif // __CCMESHVERTEXINDEXDATA_H__ diff --git a/cocos/3d/CCOBB.h b/cocos/3d/CCOBB.h index 5a7e9f8efb..47cbbb1179 100644 --- a/cocos/3d/CCOBB.h +++ b/cocos/3d/CCOBB.h @@ -29,6 +29,11 @@ NS_CC_BEGIN +/** + * @addtogroup _3d + * @{ + */ + /** * Oritened Bounding Box(OBB) * @brief the OBB is similar to the AABB but the bounding box has the same direction as Sprite3D. so it's collistion detection more precise than AABB @@ -129,6 +134,9 @@ public: Vec3 _extents; // obb length along each axis }; +// end of actions group +/// @} + NS_CC_END #endif diff --git a/cocos/3d/CCObjLoader.h b/cocos/3d/CCObjLoader.h index 8f5d547028..b81994dfb6 100644 --- a/cocos/3d/CCObjLoader.h +++ b/cocos/3d/CCObjLoader.h @@ -17,7 +17,12 @@ NS_CC_BEGIN /** - * .obj file Loader + * @addtogroup _3d + * @{ + */ + +/** + * @brief .obj file Loader **/ class ObjLoader { @@ -100,6 +105,9 @@ public: }; +// end of actions group +/// @} + NS_CC_END #endif // _TINY_OBJ_LOADER_H diff --git a/cocos/3d/CCRay.h b/cocos/3d/CCRay.h index 53350fc472..4fdd55d7a6 100644 --- a/cocos/3d/CCRay.h +++ b/cocos/3d/CCRay.h @@ -33,7 +33,12 @@ NS_CC_BEGIN /** - * Ray is a line with one end. usually use it to check intersects with some object,such as Plane, OBB, AABB + * @addtogroup _3d + * @{ + */ + +/** + * @brief Ray is a line with one end. usually use it to check intersects with some object,such as Plane, OBB, AABB **/ class CC_DLL Ray { @@ -93,6 +98,9 @@ public: Vec3 _direction; // The ray direction vector. }; +// end of actions group +/// @} + NS_CC_END #endif diff --git a/cocos/3d/CCSkeleton3D.h b/cocos/3d/CCSkeleton3D.h index 0bd033896d..303917d009 100644 --- a/cocos/3d/CCSkeleton3D.h +++ b/cocos/3d/CCSkeleton3D.h @@ -33,7 +33,12 @@ NS_CC_BEGIN /** - * Defines a basic hierachial structure of transformation spaces. + * @addtogroup _3d + * @{ + */ + +/** + * @brief Defines a basic hierachial structure of transformation spaces. */ class CC_DLL Bone3D : public Ref { @@ -226,6 +231,9 @@ protected: Vector _rootBones; }; +// end of actions group +/// @} + NS_CC_END #endif // __CCSKELETON3D_H__ diff --git a/cocos/3d/CCSprite3D.h b/cocos/3d/CCSprite3D.h index 4d18cac1f0..d1d17a1e77 100644 --- a/cocos/3d/CCSprite3D.h +++ b/cocos/3d/CCSprite3D.h @@ -41,12 +41,17 @@ NS_CC_BEGIN +/** + * @addtogroup _3d + * @{ + */ + class Mesh; class Texture2D; class MeshSkin; class AttachNode; struct NodeData; -/** Sprite3D: A sprite can be loaded from 3D model files, .obj, .c3t, .c3b, then can be drawed as sprite */ +/** @brief Sprite3D: A sprite can be loaded from 3D model files, .obj, .c3t, .c3b, then can be drawed as sprite */ class CC_DLL Sprite3D : public Node, public BlendProtocol { public: @@ -286,5 +291,8 @@ protected: extern std::string CC_DLL s_attributeNames[];//attribute names array +// end of actions group +/// @} + NS_CC_END #endif // __SPRITE3D_H_ diff --git a/cocos/3d/CCSprite3DMaterial.h b/cocos/3d/CCSprite3DMaterial.h index bed804841c..c947f082d8 100644 --- a/cocos/3d/CCSprite3DMaterial.h +++ b/cocos/3d/CCSprite3DMaterial.h @@ -31,10 +31,15 @@ NS_CC_BEGIN +/** + * @addtogroup _3d + * @{ + */ + class Texture2D; /** - * the sprite3D material is only texture for now + * @brief the sprite3D material is only texture for now */ class Sprite3DMaterialCache { @@ -65,6 +70,9 @@ protected: }; +// end of actions group +/// @} + NS_CC_END #endif // __CCSPRIT3DMATERIAL_H__ From 12bcdc88682d5b5172a5d313f7166cc7681403ef Mon Sep 17 00:00:00 2001 From: tangziwen Date: Fri, 27 Mar 2015 15:08:20 +0800 Subject: [PATCH 2/3] fix conflict --- cocos/3d/CCBundle3DData.h | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/cocos/3d/CCBundle3DData.h b/cocos/3d/CCBundle3DData.h index 86d49e914a..21f77e8b91 100644 --- a/cocos/3d/CCBundle3DData.h +++ b/cocos/3d/CCBundle3DData.h @@ -53,8 +53,25 @@ struct MeshVertexAttrib int attribSizeBytes; }; +/** @brief model node data, since 3.3 */ +struct ModelData +{ + std::string subMeshId; + std::string matrialId; + std::vector bones; + std::vector invBindPose; + + virtual ~ModelData() + { + resetData(); + } + virtual void resetData() + { + bones.clear(); + invBindPose.clear(); + } +}; -struct ModelData; /** @brief Node data, since 3.3 */ struct NodeData { @@ -80,24 +97,6 @@ struct NodeData }; -/** @brief model node data, since 3.3 */ -struct ModelData -{ - std::string subMeshId; - std::string matrialId; - std::vector bones; - std::vector invBindPose; - - virtual ~ModelData() - { - resetData(); - } - virtual void resetData() - { - bones.clear(); - invBindPose.clear(); - } -}; /** @brief node datas, since 3.3 */ struct NodeDatas From 56c31845ff2e59fee9cde86dd6b7f0f907fbb519 Mon Sep 17 00:00:00 2001 From: tangziwen Date: Fri, 27 Mar 2015 15:25:16 +0800 Subject: [PATCH 3/3] fix conflict again --- cocos/3d/CCBundle3DData.h | 42 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/cocos/3d/CCBundle3DData.h b/cocos/3d/CCBundle3DData.h index 21f77e8b91..2d83075ea6 100644 --- a/cocos/3d/CCBundle3DData.h +++ b/cocos/3d/CCBundle3DData.h @@ -35,12 +35,7 @@ NS_CC_BEGIN -/** - * @addtogroup _3d - * @{ - */ - -/** @brief mesh vertex attribute*/ +/**mesh vertex attribute*/ struct MeshVertexAttrib { //attribute size @@ -53,14 +48,15 @@ struct MeshVertexAttrib int attribSizeBytes; }; -/** @brief model node data, since 3.3 */ + +/** model node data, since 3.3 */ struct ModelData { std::string subMeshId; std::string matrialId; std::vector bones; std::vector invBindPose; - + virtual ~ModelData() { resetData(); @@ -72,7 +68,7 @@ struct ModelData } }; -/** @brief Node data, since 3.3 */ +/** Node data, since 3.3 */ struct NodeData { std::string id; @@ -93,12 +89,17 @@ struct NodeData delete it; } children.clear(); + + for(auto& modeldata : modelNodeDatas) + { + delete modeldata; + } + modelNodeDatas.clear(); } }; - -/** @brief node datas, since 3.3 */ +/** node datas, since 3.3 */ struct NodeDatas { std::vector skeleton; //skeleton @@ -119,7 +120,7 @@ struct NodeDatas } }; -/** @brief mesh data*/ +/**mesh data*/ struct MeshData { typedef std::vector IndexArray; @@ -172,7 +173,7 @@ public: } }; -/** @brief mesh datas */ +/** mesh datas */ struct MeshDatas { std::vector meshDatas; @@ -191,7 +192,7 @@ struct MeshDatas } }; -/** @brief skin data*/ +/**skin data*/ struct SkinData { std::vector skinBoneNames; //skin bones affect skin @@ -260,7 +261,7 @@ struct SkinData }; -/** @brief material data, */ +/**material data, */ struct MaterialData { std::map texturePaths; //submesh id, texture path @@ -271,7 +272,7 @@ struct MaterialData }; -/** @brief new material, since 3.3 */ +/**new material, since 3.3 */ struct NTextureData { enum class Usage { @@ -307,7 +308,7 @@ struct NMaterialData return nullptr; } }; -/** @brief material datas, since 3.3 */ +/** material datas, since 3.3 */ struct MaterialDatas { std::vector materials; @@ -325,7 +326,7 @@ struct MaterialDatas return nullptr; } }; -/** @brief animation data*/ +/**animation data*/ struct Animation3DData { public: @@ -395,7 +396,7 @@ public: } }; -/** @brief reference data*/ +/**reference data*/ struct Reference { public: @@ -408,9 +409,6 @@ public: ~Reference(){} }; -// end of actions group -/// @} - NS_CC_END #endif //__CC_BUNDLE_3D_DATA_H__