I am making a 2D platform game using cocos2dx and box2d.
And I am just now making of a player collitions with an attack of enemy.
An attack of enemy is such as a sword or a club, so I want to collition when a player is contacted with an edge of sword(or club) of enemy.
So far I made of a player collitions with a bullet using box2d, but I don't know that how to make the bounding box to an edge of sword(or club) of enemy like the following picture.
I believe that what you want isn't a bounding box but a collection of bodies, fixtures, and shapes to make a realistic enough simulation of the enemy and player interacting with each other.
To do that, you'll need to partition the pink lined shape (the enemy and its weapons) into a set of convex polygons — just like you'd need to do for the player.
Note that mathematically speaking, any concave shape can be expressed as a combination of convex polygons. From Wikipedia's entry for Concave polygon:
It is always possible to partition a concave polygon into a set of convex polygons.
If there's few enough entities you need to deal with this for, I'd just manually do the partitioning.
For one thing, it looks like you'd need to partition things manually anyway just in order to partition the ideally immutable parts from each other. Parts like the mace (or club), the forearm, the upper arm, etc where structures like metal, wood, or bone make a part rigid enough for the detail of the simulation you want to achieve.
Then you'll need to partition these rigid parts again to match the level of detail of the simulation that you want. So the mace's head, might be represented using something close to a pentagon shaped polygon. The mace's shaft, by just a rectangular polygon. Attach those two convex shapes to a single body for the mace. And so on.
You can use algorithms (or use implementations of those algorithms) to compute the sets of convex polygons that make up concave parts if you'd prefer. Unless you're going to do this for arbitrary shapes however, I'm not sure it's worth it.