ChangeEdgeSegmentDelta.cpp

Go to the documentation of this file.
00001 
00005 /* Copyright © 2009 James Legg.
00006     This program is free software: you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation, either version 3 of the License, or
00009     (at your option) any later version.
00010 */
00011 
00012 #include "ChangeEdgeSegmentDelta.h"
00013 #include "../Track.h"
00014 
00015 namespace Document
00016 {
00017 
00018 EdgeSegmentFinder::EdgeSegmentFinder(std::size_t edge_id)
00019     :   edge_id(edge_id)
00020 {
00021 }
00022 
00023 void EdgeSegmentFinder::read(const Track::Track & track, std::size_t & new_segment_index)
00024 {
00025     new_segment_index = track.get_path().get_edge(edge_id).segment_index;
00026 }
00027 
00028 void EdgeSegmentFinder::write(Track::Track & track, const std::size_t & new_segment_index)
00029 {
00030     Track::Path & path = track.get_path();
00031     Track::PathEdge & edge = path.get_edge(edge_id);
00032     // set the new segment.
00033     edge.segment_index = new_segment_index;
00034     edge.segment = &track.get_theme().get_segment(new_segment_index);
00035     edge.update();
00036 }
00037 
00038 }

Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:11 2010 by Doxygen version 1.4.7 for Racer version svn335.