C++ implementation of half edge mesh