~ubuntu-branches/ubuntu/intrepid/tcm/intrepid

« back to all changes in this revision

Viewing changes to src/dg/disk.c

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2003-07-03 20:08:21 UTC
  • Revision ID: james.westby@ubuntu.com-20030703200821-se4xtqx25e5miczi
Tags: upstream-2.20
ImportĀ upstreamĀ versionĀ 2.20

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
////////////////////////////////////////////////////////////////////////////////
 
2
//
 
3
// This file is part of Toolkit for Conceptual Modeling (TCM).
 
4
// (c) copyright 2001, Universiteit Twente.
 
5
// Author: Frank Dehne (frank@cs.vu.nl), David N. Jansen (dnjansen@cs.utwente.nl).
 
6
//
 
7
// TCM is free software; you can redistribute it and/or modify
 
8
// it under the terms of the GNU General Public License as published by
 
9
// the Free Software Foundation; either version 2 of the License, or
 
10
// (at your option) any later version.
 
11
//
 
12
// TCM is distributed in the hope that it will be useful,
 
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
// GNU General Public License for more details.
 
16
//
 
17
// You should have received a copy of the GNU General Public License
 
18
// along with TCM; if not, write to the Free Software
 
19
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
20
// 02111-1307, USA.
 
21
////////////////////////////////////////////////////////////////////////////////
 
22
#include "disk.h"
 
23
#include "code.h"
 
24
 
 
25
/*           _p5_               p5=TopArc
 
26
      __,---'    `---.__
 
27
   ,-'                  `-.
 
28
  p0                      p4    p0=i0, p4=i2
 
29
   |-.__              __,-|
 
30
  c0    `---._i1_,---'    c1
 
31
   |                      |
 
32
  t0                      t1
 
33
   |                      |
 
34
  p1                      p3
 
35
   `-.__              __,-'
 
36
        `---._p2_,---'          p2=BottomArc */
 
37
 
 
38
const PolyPoint Disk::p0(0, -0.5, 0, 0,   0, 0, -0.35, 0, true);
 
39
const PolyPoint Disk::p1(0, -0.5, 0, 0,   0, 0,  0.35, 0, true, true);
 
40
const PolyPoint Disk::p3(0,  0.5, 0, 0,   0, 0,  0.35, 0, true);
 
41
const PolyPoint Disk::p4(0,  0.5, 0, 0,   0, 0, -0.35, 0, true, true);
 
42
const PolyPoint Disk::i0(0, -0.5, 0, 0,   0, 0, -0.35, 0, true, true);
 
43
const PolyPoint Disk::i1(0,  0.0, 0, 0,   0, 0, -0.2 , 0, true, true);
 
44
const PolyPoint Disk::i2(0,  0.5, 0, 0,   0, 0, -0.35, 0);
 
45
const PolyPoint Disk::t0(0, -0.5, 0, 0,   0, 0, -0.05, 0);
 
46
const PolyPoint Disk::t1(0,  0.5, 0, 0,   0, 0, -0.05, 0, false, true);
 
47
const PolyPoint Disk::c0(0, -0.5, 0, 0,   0, 0, -0.2 , 0);
 
48
const PolyPoint Disk::c1(0,  0.5, 0, 0,   0, 0, -0.2 , 0);
 
49
 
 
50
const Polygon Disk::exterior((new List<const PolyPoint *>)
 
51
        ->add(&p0)->add(&p1)->add(&PolyPoint::BottomArc)
 
52
        ->add(&p3)->add(&p4)->add(&PolyPoint::TopArc), Polygon::ON_DEMAND);
 
53
const Polygon Disk::interior((new List<const PolyPoint *>)
 
54
        ->add(&i0)->add(&i1)->add(&i2));
 
55
const Polygon Disk::namearea((new List<const PolyPoint *>)
 
56
        ->add(&t0)->add(&p1)->add(&PolyPoint::BottomArc)
 
57
        ->add(&p3)->add(&t1)->add(&i1));
 
58
const Polygon Disk::childarea((new List<const PolyPoint *>)
 
59
        ->add(&c0)->add(&p1)->add(&PolyPoint::BottomArc)->add(&p3)->add(&c1));
 
60
 
 
61
const ShapeType Disk::diskType(Code::DISK, 80.0, 48.0, 0.0, 0.0, &namearea,
 
62
        &childarea, &PolyPoint::Index, &PolyPoint::Dupli, &PolyPoint::Multi,
 
63
        &exterior, &interior);
 
64
 
 
65
Disk::Disk(ShapeView *v, Grafport *g, double x, double y)
 
66
        :NodeShape(v, g, x, y, &diskType)
 
67
{
 
68
}
 
69
 
 
70
 
 
71
Disk::Disk(const NodeShape &c)
 
72
        :NodeShape(c, &diskType)
 
73
{
 
74
}
 
75