void KeyFace::addCycle(const Cycle & cycle) { cycles_ << cycle; foreach(KeyCell * cell, cycle.cells()) addMeToSpatialStarOf_(cell); geometryChanged_(); }
KeyEdge::KeyEdge(VAC * vac, Time time, KeyVertex * startVertex, KeyVertex * endVertex, EdgeGeometry * geometry) : Cell(vac), KeyCell(vac, time), EdgeCell(vac), startVertex_(startVertex), endVertex_(endVertex), geometry_(geometry) { if(startVertex_) addMeToSpatialStarOf_(startVertex_); if(endVertex_) addMeToSpatialStarOf_(endVertex_); // todo: if geometry == 0, create it, store that it has been // created automatically, delete it in ~KeyEdge }
InbetweenEdge::InbetweenEdge(VAC * vac, const Path & beforePath, const Path & afterPath, const AnimatedVertex & startAnimatedVertex, const AnimatedVertex & endAnimatedVertex) : Cell(vac), InbetweenCell(vac), EdgeCell(vac), beforePath_(beforePath), afterPath_(afterPath), startAnimatedVertex_(startAnimatedVertex), endAnimatedVertex_(endAnimatedVertex) { // Check pre-conditions assert(beforePath_.isValid()); assert(afterPath_.isValid()); assert(beforePath_.time() < afterPath_.time()); assert(startAnimatedVertex_.isValid()); assert(endAnimatedVertex_.isValid()); assert(beforePath_.startVertex() == startAnimatedVertex_.beforeVertex()); assert(afterPath_.startVertex() == startAnimatedVertex_.afterVertex()); assert(beforePath_.endVertex() == endAnimatedVertex_.beforeVertex()); assert(afterPath_.endVertex() == endAnimatedVertex_.afterVertex()); // Cache star foreach(VertexCell * vertex, startVertices()) addMeToSpatialStarOf_(vertex); foreach(VertexCell * vertex, endVertices()) addMeToSpatialStarOf_(vertex); foreach(KeyCell * kcell, beforeCells()) addMeToTemporalStarAfterOf_(kcell); foreach(KeyCell * kcell, afterCells()) addMeToTemporalStarBeforeOf_(kcell); }