~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to src/ipelib/ipevisitor.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2004-06-08 00:44:02 UTC
  • Revision ID: james.westby@ubuntu.com-20040608004402-72yu51xlh7vt6p9m
Tags: upstream-6.0pre16
ImportĀ upstreamĀ versionĀ 6.0pre16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// --------------------------------------------------------------------
 
2
// The visitor base class.
 
3
// --------------------------------------------------------------------
 
4
/*
 
5
 
 
6
    This file is part of the extensible drawing editor Ipe.
 
7
    Copyright (C) 1993-2004  Otfried Cheong
 
8
 
 
9
    Ipe is free software; you can redistribute it and/or modify it
 
10
    under the terms of the GNU General Public License as published by
 
11
    the Free Software Foundation; either version 2 of the License, or
 
12
    (at your option) any later version.
 
13
 
 
14
    As a special exception, you have permission to link Ipe with the
 
15
    CGAL library and distribute executables, as long as you follow the
 
16
    requirements of the Gnu General Public License in regard to all of
 
17
    the software in the executable aside from CGAL.
 
18
 
 
19
    Ipe is distributed in the hope that it will be useful, but WITHOUT
 
20
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
21
    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
 
22
    License for more details.
 
23
 
 
24
    You should have received a copy of the GNU General Public License
 
25
    along with Ipe; if not, you can find it at
 
26
    "http://www.gnu.org/copyleft/gpl.html", or write to the Free
 
27
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
28
 
 
29
*/
 
30
 
 
31
#include "ipevisitor.h"
 
32
#include "ipegroup.h"
 
33
#include "ipepath.h"
 
34
#include "ipemark.h"
 
35
#include "ipetext.h"
 
36
#include "iperef.h"
 
37
#include "ipeimage.h"
 
38
 
 
39
// --------------------------------------------------------------------
 
40
 
 
41
/*! \class IpeVisitor
 
42
  \ingroup high
 
43
  \brief Base class for visitors to IpeObject.
 
44
 
 
45
  Many operations on Ipe objects are implemented as visitors, all
 
46
  derived from IpeVisitor.
 
47
 
 
48
  The default implementation of each VisitXXX member calls
 
49
  VisitObject.  The default implementation of VisitObject doesn't do
 
50
  anything.
 
51
*/
 
52
 
 
53
//! Pure virtual destructor.
 
54
IpeVisitor::~IpeVisitor()
 
55
{
 
56
  // void
 
57
}
 
58
 
 
59
//! Called on an IpeGroup object.
 
60
void IpeVisitor::VisitGroup(const IpeGroup *obj)
 
61
{
 
62
  VisitObject(obj);
 
63
}
 
64
 
 
65
//! Called on an IpePath object.
 
66
void IpeVisitor::VisitPath(const IpePath *obj)
 
67
{
 
68
  VisitObject(obj);
 
69
}
 
70
 
 
71
//! Called on an IpeMark object.
 
72
void IpeVisitor::VisitMark(const IpeMark * obj)
 
73
{
 
74
  VisitObject(obj);
 
75
}
 
76
 
 
77
//! Called on an IpeImage object.
 
78
void IpeVisitor::VisitImage(const IpeImage * obj)
 
79
{
 
80
  VisitObject(obj);
 
81
}
 
82
 
 
83
//! Called on an IpeText object.
 
84
void IpeVisitor::VisitText(const IpeText * obj)
 
85
{
 
86
  VisitObject(obj);
 
87
}
 
88
 
 
89
//! Called on an IpeReference object.
 
90
void IpeVisitor::VisitReference(const IpeReference * obj)
 
91
{
 
92
  VisitObject(obj);
 
93
}
 
94
 
 
95
//! Called on an IpeObject.
 
96
/*! This is called if the more specific function is not implemented by
 
97
  a derived class. */
 
98
void IpeVisitor::VisitObject(const IpeObject *)
 
99
{
 
100
  // nothing
 
101
}
 
102
 
 
103
// --------------------------------------------------------------------