Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ShapeLine.cc

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #include <math.h>
00003 #include <vector>
00004 
00005 #include "ShapeLine.h"
00006 
00007 namespace DualCoding {
00008 
00009 SHAPESTUFF_CC(LineData);   // defined in ShapeRoot.h
00010 
00011 Shape<LineData>::Shape(ShapeSpace &s, const Point &colinear_pt, AngPi orientation)
00012   : ShapeRoot(addShape(new LineData(s, colinear_pt,
00013             Point(colinear_pt.coordX() + 10 * std::cos((orientation_t)orientation),
00014             colinear_pt.coordY() + 10 * std::sin((orientation_t)orientation)))))
00015 {
00016   (*this)->end1_pt.setActive(false);
00017   (*this)->end1_pt.setValid(false);
00018 
00019   (*this)->end2_pt.setActive(false);
00020   (*this)->end2_pt.setValid(false);
00021 }
00022 
00023 
00024 Shape<LineData>::Shape(ShapeSpace &s, const Point &colinear_pt, Slope slope) 
00025   : ShapeRoot(addShape(new LineData(s, colinear_pt,
00026             Point(colinear_pt.coordX()+10,
00027             slope * (colinear_pt.coordX()+10) +
00028             (colinear_pt.coordY()-slope*colinear_pt.coordX())))))
00029 {
00030   (*this)->end1_pt.setActive(false);
00031   (*this)->end1_pt.setValid(false);
00032 
00033   (*this)->end2_pt.setActive(false);
00034   (*this)->end2_pt.setValid(false);
00035 }
00036 
00037 } // namespace

DualCoding 5.1CVS
Generated Mon May 9 04:56:27 2016 by Doxygen 1.6.3