casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DisplayMethod.h
Go to the documentation of this file.
1 //# DisplayMethod.h: Base class for drawing data in the Display Library
2 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef TRIALDISPLAY_DISPLAYMETHOD_H
29 #define TRIALDISPLAY_DISPLAYMETHOD_H
30 
31 //# aips includes:
32 #include <casa/aips.h>
33 
34 //# display library includes:
37 
38 namespace casa { //# NAMESPACE CASA - BEGIN
39 
40 //# forwards:
41  class WorldCanvasHolder;
42  class Attribute;
43  class DisplayData;
44 
45 // <summary>
46 // Base class for drawing a particular element (view) of a DisplayData.
47 // </summary>
48 //
49 // <synopsis>
50 // This base class defines an interface for drawing a single view of a
51 // DisplayData object. The fundamental idea is that a DisplayData
52 // class will manage one or more DisplayMethod objects, and request
53 // the individual objects to draw as necessary.
54 // </synopsis>
55 
56  class DisplayMethod {
57  public:
58 
59  // Constructor. DisplayMethods need to know who their parent
60  // DisplayData is.
62 
63  // Destructor.
64  virtual ~DisplayMethod();
65 
66  // Draw on the provided WorldCanvasHolder.
67  virtual void draw(Display::RefreshReason reason,
68  WorldCanvasHolder &wcHolder) = 0;
69 
70  // clear drawlist state.
71  // dk note 11/03: Only used by the PrincipleAxesDM branch, where the
72  // implementation has been moved. Implementation should remain null
73  // on the CachingDD/DM branch, which uses different interface (purgeCache)
74  // and state for this.
75  virtual void cleanup();
76 
77  // Set & remove restrictions
78  // <group>
79  void addRestriction(Attribute& newAt, casacore::Bool permanent);
80  void addRestrictions(AttributeBuffer& newBuf);
81  void setRestriction(Attribute& newAt);
82  void setRestrictions(AttributeBuffer& newBuf);
85  void clearRestrictions();
86  // </group>
87 
88  // match restriction
89  // <group>
92  // </group>
93 
94 
95  // Allow DisplayData objects to find out about restrictions in
96  // DisplayMethod elements...
97  friend class DisplayData;
98 
99  protected:
100 
102 
103  // (Required) default constructor.
104  DisplayMethod();
105 
106  // (Required) copy constructor.
107  DisplayMethod(const DisplayMethod &other);
108 
109  // (Required) copy assignment.
110  void operator=(const DisplayMethod &other);
111 
112  // Return the parent DisplayData.
114  return itsParentDisplayData;
115  }
116 
117  private:
118 
120 
121  };
122 
123 
124 } //# NAMESPACE CASA - END
125 
126 #endif
void addRestriction(Attribute &newAt, casacore::Bool permanent)
Set &amp; remove restrictions.
void setRestrictions(AttributeBuffer &newBuf)
virtual void draw(Display::RefreshReason reason, WorldCanvasHolder &wcHolder)=0
Draw on the provided WorldCanvasHolder.
DisplayMethod()
(Required) default constructor.
Buffer for storing Attributes.
virtual ~DisplayMethod()
Destructor.
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
DisplayData * itsParentDisplayData
Arbitrary name-value pairs used in the display classes.
Definition: Attribute.h:144
void setRestriction(Attribute &newAt)
AttributeBuffer restrictions
casacore::Bool existRestriction(const casacore::String &name)
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
void removeRestriction(const casacore::String &name)
virtual void cleanup()
clear drawlist state.
DisplayData * parentDisplayData()
Return the parent DisplayData.
RefreshReason
Callback reasons for PCRefreshEvent and WCRefreshEvent.
Definition: DisplayEnums.h:267
Base class for drawing a particular element (view) of a DisplayData.
Definition: DisplayMethod.h:56
A holder to interface between DisplayDatas and a WorldCanvas.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void addRestrictions(AttributeBuffer &newBuf)
casacore::Bool matches(Attribute &at)
match restriction
Base class for display objects.
Definition: DisplayData.h:317
void operator=(const DisplayMethod &other)
(Required) copy assignment.