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

« back to all changes in this revision

Viewing changes to src/dg/solidverticalbar.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 1998, Vrije Universiteit Amsterdam and University of Twente.
 
5
// Author: Henk van de Zandschulp (henkz@cs.utwente.nl).
 
6
// Author: Frank Dehne (frank@cs.vu.nl).
 
7
 
 
8
// TCM is free software; you can redistribute it and/or modify
 
9
// it under the terms of the GNU General Public License as published by
 
10
// the Free Software Foundation; either version 2 of the License, or
 
11
// (at your option) any later version.
 
12
//
 
13
// TCM is distributed in the hope that it will be useful,
 
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
// GNU General Public License for more details.
 
17
//
 
18
// You should have received a copy of the GNU General Public License
 
19
// along with TCM; if not, write to the Free Software
 
20
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
21
// 02111-1307, USA.
 
22
////////////////////////////////////////////////////////////////////////////////
 
23
 
 
24
#include "solidverticalbar.h"
 
25
 
 
26
const PolyPoint SolidVerticalBar::p0(-2, 0, 0, 0,    0, 0, -0.5, 0);
 
27
const PolyPoint SolidVerticalBar::p1(-2, 0, 0, 0,    0, 0,  0.5, 0);
 
28
const PolyPoint SolidVerticalBar::p2( 2, 0, 0, 0,    0, 0,  0.5, 0);
 
29
const PolyPoint SolidVerticalBar::p3( 2, 0, 0, 0,    0, 0, -0.5, 0);
 
30
 
 
31
const Polygon SolidVerticalBar::exterior((new List<const PolyPoint *>)
 
32
        ->add(&p0)->add(&p1)->add(&p2)->add(&p3), Polygon::ALWAYS);
 
33
 
 
34
const ShapeType SolidVerticalBar::svType(Code::SOLID_VERTICAL_BAR, 4.0, 40.0,
 
35
        0.0, 0.0, (const Polygon *) NULL, (const Polygon *) NULL,
 
36
        (const PolyPoint *) NULL, (const PolyPoint *) NULL,
 
37
        (const PolyPoint *) NULL, &exterior);
 
38
 
 
39
 
 
40
SolidVerticalBar::SolidVerticalBar(ShapeView *v, Grafport *g, double x, double y)
 
41
        :NodeShape(v, g, x, y, &svType)
 
42
{
 
43
}
 
44
 
 
45
 
 
46
SolidVerticalBar::SolidVerticalBar(const NodeShape &c)
 
47
        :NodeShape(c, &svType)
 
48
{
 
49
}
 
50
 
 
51
 
 
52
bool SolidVerticalBar::ReadMembers(InputFile *ifile, double format) {
 
53
        if ( ! NodeShape::ReadMembers(ifile, format) )
 
54
                return False;
 
55
        if (format < 1.26) {    // setting defaults
 
56
//              SetWidth(BAR_WIDTH);
 
57
                SetHeight(max(GetHeight(), MIN_HEIGHT));
 
58
//              SetFillStyle(FillStyle::FILLED);
 
59
                string s = "black";
 
60
                SetFillColor(&s);
 
61
        }
 
62
        return True;
 
63
}