27 #ifndef PLOTOPTIONS_H_
28 #define PLOTOPTIONS_H_
44 typedef std::pair<double, double>
psize_t;
151 virtual double alpha()
const = 0;
155 virtual void setAlpha(
double a) = 0;
240 virtual bool italics()
const = 0;
242 virtual bool bold()
const = 0;
243 virtual void setBold(
bool b =
true) = 0;
390 virtual double width()
const = 0;
486 virtual void setSize(
double width,
double height,
516 virtual void setUSymbol(
unsigned short unicode) = 0;
614 class PlotCoordinate {
634 PlotCoordinate(
double dx,
double dy, System s = WORLD);
637 PlotCoordinate(
const PlotCoordinate&
c);
646 System system()
const;
658 PlotCoordinate&
operator=(
const PlotCoordinate& rh);
662 bool operator==(
const PlotCoordinate& rh)
const;
666 bool operator!=(
const PlotCoordinate& rh)
const;
714 double right()
const;
759 unsigned int size()
const;
762 std::vector<PlotRegion>
stack()
const;
766 std::vector<std::pair<PlotAxis, PlotAxis> >
stackAxes()
const;
789 void move(
int delta);
803 std::vector<std::pair<PlotAxis, PlotAxis> >
m_axes;
894 #define INHERITANCE_POINTER(cname, cptrname, pname, pptrname, gname, gptrname)\
895 class cptrname : public pptrname { \
897 cptrname () : pptrname () { } \
898 cptrname ( cname * val, bool del = true ) : pptrname() { \
899 gname * v = dynamic_cast< gname *>(val); \
900 if(v != NULL) gptrname ::operator=( gptrname (v, del)); \
902 cptrname ( const gptrname & val ) : pptrname () { \
903 const cname * v = dynamic_cast<const cname *>( \
905 if(v != NULL) gptrname ::operator=(val); \
907 cname & operator*() { \
908 return dynamic_cast< cname &>(**(( gptrname *)this)); \
910 cname * operator->() { \
911 return dynamic_cast< cname *>((( gptrname *)this)->operator->()); \
913 const cname & operator*() const { \
914 return dynamic_cast<const cname &>(**(( gptrname * )this)); \
916 const cname * operator->() const { \
917 return dynamic_cast<const cname *>( \
918 (( gptrname *)this)->operator->()); \
920 cptrname & operator=(const gptrname & val) { \
921 const cname * v = dynamic_cast<const cname *>(val.operator->()); \
922 if(v != NULL) (( gptrname *)this)->operator=(val); \
925 cptrname & operator=( gname * val) { \
926 cname * v = dynamic_cast< cname *>(val); \
927 if(v != NULL) (( gptrname *)this)->operator=(val); \
933 #define INHERITANCE_POINTER2(cname, cptrname, pname, pptrname) \
934 INHERITANCE_POINTER(cname, cptrname, pname, pptrname, pname, pptrname)
937 #define INHERITANCE_TPOINTER(cname, cptrname, pname, pptrname, gname,gptrname)\
938 template <class T> class cptrname : public pptrname { \
940 cptrname () : pptrname () { } \
941 cptrname ( cname <T>* val, bool del = true ) : pptrname(){ \
942 gname * v = dynamic_cast< gname *>(val); \
943 if(v != NULL) gptrname ::operator=( gptrname (v, del)); \
945 cptrname ( const gptrname & val ) : pptrname () { \
946 const cname <T>* v = dynamic_cast<const cname <T>*>( \
948 if(v != NULL) gptrname ::operator=(val); \
950 cptrname ( const cptrname <T> & val ) : pptrname() { \
951 gptrname ::operator=((const gptrname &)val); \
953 cname <T>& operator*() { \
954 return dynamic_cast< cname <T>&>(**(( gptrname *)this)); \
956 cname <T>* operator->() { \
957 return dynamic_cast< cname <T>*>( \
958 (( gptrname *)this)->operator->()); \
960 const cname <T>& operator*() const { \
961 return dynamic_cast<const cname <T>&>(**(( gptrname * )this)); \
963 const cname <T>* operator->() const { \
964 return dynamic_cast<const cname <T>*>( \
965 (( gptrname *)this)->operator->()); \
967 cptrname <T>& operator=(const gptrname & val) { \
968 const cname <T>* v = dynamic_cast<const cname <T>*>( \
970 if(v != NULL) (( gptrname *)this)->operator=(val); \
973 cptrname <T>& operator=( gname * val) { \
974 cname <T>* v = dynamic_cast< cname <T>*>(val); \
975 if(v != NULL) (( gptrname *)this)->operator=(val); \
981 #define INHERITANCE_TPOINTER2(cname, cptrname, pname, pptrname) \
982 INHERITANCE_TPOINTER(cname, cptrname, pname, pptrname, pname, pptrname)
virtual bool italics() const =0
Gets/sets whether this font is italicized, bolded, and/or underlined, respectively.
virtual bool isCharacter() const
Returns true if this symbol is set to a character or not.
static const casacore::String REC_PATTERN
casacore::CountedPtr< PlotAreaFill > PlotAreaFillPtr
virtual void setUnderline(bool u=true)=0
virtual PlotColorPtr color() const =0
Returns a copy of the color for this font.
virtual PlotColorPtr color() const =0
Returns a copy of the color used for this line.
bool isValid() const
Returns true if the region is valid, false otherwise.
static const casacore::String REC_COLOR
casacore::CountedPtr< PlotColor > PlotColorPtr
virtual void setColor(const PlotColor &color)=0
Sets the area fill color to the given.
PlotRegion currentRegion() const
Returns the current region in the stack.
virtual void setWidth(double width)=0
Sets the width to the given.
virtual bool underline() const =0
StatsData< AccumType > copy(const StatsData< AccumType > &stats)
virtual void fromRecord(const casacore::Record &record)
static const casacore::String REC_ITALICS
PlotCoordinate m_upperLeft
Upper-left coordinate.
virtual casacore::Record toRecord() const
RECORD METHODS //.
virtual void setPointSize(double size)=0
Sets the point size of this font to the given.
static const casacore::String REC_ALPHA
virtual void fromRecord(const casacore::Record &record)
casacore::CountedPtr< PlotLine > PlotLinePtr
virtual int pixelSize() const =0
Returns the pixel size of this font, or -1 if the size was set in points.
virtual void setColor(const PlotColor &color)
Convenience method for setting color of both line and area fill.
unsigned int PlotAxisBitset
Set of bit flags to indicate combinations of sides, used (as of this writing) for indicating which ax...
virtual bool operator!=(const PlotLine &rh) const
Returns true if this PlotLine is NOT equal to the given; false otherwise.
virtual PlotAreaFillPtr areaFill() const =0
Returns a copy of the area fill for this symbol.
virtual casacore::Record toRecord() const
RECORD METHODS //.
virtual void setSize(double width, double height, bool heightIsPixel=true)=0
Sets the size of the symbol in pixels.
unsigned int m_stackIndex
casacore::Stack index.
static const casacore::String REC_PIXELSIZE
void move(int delta)
Moves the stack index the given delta.
virtual PlotColor & operator=(const PlotColor &rh)
OPERATORS //.
virtual void setAreaFill(const PlotAreaFill &fill)=0
Sets the area fill of this symbol to the given.
PtrHolder< T > & operator=(const PtrHolder< T > &other)
LatticeExprNode operator!=(const LatticeExprNode &left, const LatticeExprNode &right)
const PlotAxisBitset all_four_sides
virtual bool operator==(const PlotSymbol &rh) const
Returns true if this PlotSymbol is equal to the given; false otherwise.
static const casacore::String REC_BOLD
static const casacore::String REC_HEIGHTISPIXEL
virtual void setLine(const PlotLine &color)=0
Sets the outline of this symbol to the given.
Abstract class for area fill.
static const casacore::String REC_POINTSIZE
casacore::Record key names.
virtual bool operator!=(const PlotSymbol &rh) const
Returns true if this PlotSymbol is NOT equal to the given; false otherwise.
PlotAxis currentXAxis() const
Returns the x-axis for the current region in the stack.
std::vector< std::pair< PlotAxis, PlotAxis > > m_axes
Axes stack.
virtual PlotLine & operator=(const PlotLine &rh)
OPERATORS //.
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
virtual void setAsName(const casacore::String &name)
Set's this color's value to the given named color.
virtual bool bold() const =0
virtual PlotFont & operator=(const PlotFont &rh)
OPERATORS //.
Pattern
Pattern enum, similar in spirit to http://doc.trolltech.com/4.3/qt.html#BrushStyle-enum.
virtual ~PlotFont()
Destructor.
virtual void setBold(bool b=true)=0
virtual double alpha() const =0
Returns this color's alpha as a value between 0 (transparent) and 1 (opaque).
double left() const
Returns the left x value.
static const casacore::String REC_LINE
static const casacore::String REC_COLOR
virtual ~PlotColor()
Destructor.
PlotAreaFill()
Constructor.
virtual PlotLinePtr line() const =0
Returns a copy of the line for the outline of this symbol.
virtual bool operator==(const PlotAreaFill &rh) const
Returns true if this PlotAreaFill is equal to the given; false otherwise.
virtual casacore::Record toRecord() const
RECORD METHODS //.
TableExprNode pattern(const TableExprNode &node)
unsigned int stackIndex() const
Returns the current stack index.
static const casacore::String REC_AREAFILL
static const casacore::String REC_COLOR
static const casacore::String REC_HEIGHT
virtual void setFontFamily(const casacore::String &font)=0
Sets the font family to the given.
~PlotAxesStack()
Destructor.
virtual void setAlpha(double a)=0
Sets this color's alpha as a value between 0 (transparent) and 1 (opaque).
virtual unsigned short symbolUChar() const =0
Returns the character unicode for this symbol.
virtual void fromRecord(const casacore::Record &record)
double top() const
Returns the top y value.
virtual casacore::Record toRecord() const
RECORD METHODS //.
PlotCoordinate m_lowerRight
Lower-right coordinate.
const PlotAxisBitset none_sides
PlotRegion()
Default constructor.
casacore::CountedPtr< PlotSymbol > PlotSymbolPtr
virtual double width() const =0
ABSTRACT METHODS //.
virtual psize_t size() const =0
ABSTRACT METHODS //.
casacore::String currentColor
virtual void setAsHexadecimal(const casacore::String &hex)
CONVENIENCE METHODS //.
A PlotAxesStack is basically a list of PlotRegions as well as axis information that provides stack fu...
casacore::String getColor() const
Abstract class for a line.
virtual Pattern pattern() const =0
Returns the pattern for this area fill.
PlotAxis currentYAxis() const
Returns the y-axis for the current region in the stack.
static const casacore::String REC_WIDTH
casacore::Record key names.
std::vector< std::pair< PlotAxis, PlotAxis > > stackAxes() const
Returns a copy of the stack axes.
static const casacore::String REC_COLOR
casacore::Record key names.
virtual void setHeightIsPixel(bool pixel=true)=0
PlotCursor
Enum for cursors.
virtual void setColor(const PlotColor &color)=0
Sets the color of this font to the given.
PlotAxis
Enum for the four plot axes.
void shrinkStacks(unsigned int n)
Shrinks the region and axes stack to the given size, discarding the oldest UNLESS the stack index is ...
A hierarchical collection of named fields of various types.
Abstract class for a symbol.
static const casacore::String REC_SYMBOL
int lengthLimit() const
Gets/Sets the length limit on this stack.
PlotRegion moveAndReturn(int delta)
Moves the stack index the given delta (see move()) and returns the current region.
PlotAxesStack(int lengthLimit=-1)
Constructor for empty stack.
std::vector< PlotRegion > stack() const
Returns a copy of the stack.
virtual casacore::Record toRecord() const
RECORD METHODS //.
virtual PlotColorPtr color() const =0
ABSTRACT METHODS //.
static const casacore::String REC_FAMILY
virtual void setItalics(bool i=true)=0
virtual double pointSize() const =0
ABSTRACT METHODS //.
virtual void setSymbol(Symbol symbol)=0
Sets the symbol style to the given.
virtual bool operator==(const PlotColor &rh) const
Returns true if this PlotColor is equal to the given; false otherwise.
virtual char symbolChar() const =0
Returns the character for this symbol.
virtual casacore::String asHexadecimal() const =0
ABSTRACT METHODS //.
virtual bool operator!=(const PlotAreaFill &rh) const
Returns true if this PlotAreaFill is NOT equal to the given; false otherwise.
casacore::CountedPtr< PlotFont > PlotFontPtr
static const casacore::String REC_UCHAR
std::pair< double, double > prange_t
Typedef for range, which is two doubles (min and max).
virtual casacore::String fontFamily() const =0
Returns the font family.
std::pair< double, double > psize_t
Typedef for size, which is two doubles (width and height).
bool isValid() const
Returns whether the stack is valid (has size > 0) or not.
AngleFormat
Enum for angle formats.
unsigned int size() const
Returns the stack size.
virtual ~PlotSymbol()
PlotSymbol(const PlotSymbol& copy);.
const Double c
Fundamental physical constants (SI units):
virtual PlotAreaFill & operator=(const PlotAreaFill &rh)
OPERATORS //.
const PlotCoordinate & upperLeft() const
Returns the upper left coordinate.
PlotSymbol()
Non-Static //.
static const casacore::String REC_WIDTH
casacore::Record key names.
virtual void fromRecord(const casacore::Record &record)
virtual Symbol symbol() const =0
Returns the symbol style.
String: the storage and methods of handling collections of characters.
Bool operator==(const MVTime &lh, const MVTime &rh)
is equal operator, uses operator Double which returns days
virtual void setColor(const PlotColor &color)=0
Sets this line's color to the given.
const PlotCoordinate & lowerRight() const
Returns the lower right coordinate.
virtual bool heightIsPixel() const =0
Gets/Sets whether the set height is in pixels or points, ONLY for character symbols.
void addRegion(const PlotRegion ®ion, PlotAxis xAxis, PlotAxis yAxis)
Adds the given region to the stack.
virtual void setPixelSize(int size)=0
Sets the pixel size of this font to the given.
std::vector< PlotRegion > m_stack
Region stack.
virtual void setAsHexadecimalOrName(const casacore::String &str)=0
If the given casacore::String is a hexadecimal value, sets the color to it.
void setBase(const PlotRegion &base, PlotAxis xAxis, PlotAxis yAxis)
Resets the stack and sets the stack base to the given.
virtual ~PlotAreaFill()
Destructor.
virtual bool operator!=(const PlotFont &rh) const
Returns true if this PlotFont is NOT equal to the given; false otherwise.
virtual bool operator!=(const PlotColor &rh) const
Returns true if this PlotColor is NOT equal to the given; false otherwise.
Abstract class for fonts.
static const casacore::String REC_STYLE
double bottom() const
Returns the bottom y value.
PlotAxisScale
Enum for possible axis scales.
void clearStack(bool keepBase=false)
Clears the stack, including the base if keepBase is false.
virtual void setStyle(Style style)=0
Sets the style to the given.
double right() const
Returns the right x value.
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the color(i.e.,"000000"for black) and
virtual bool operator==(const PlotLine &rh) const
Returns true if this PlotLine is equal to the given; false otherwise.
A PlotRegion is basically just a wrapper for two PlotCoordinates: an upper left coordinate and a lowe...
int m_lengthLimit
Length limit.
static const casacore::String REC_HEXADECIMAL
casacore::Record key names.
PlotCanvasLayer
The canvas is composed of multiple layers, where changing/adding items from one layer will not affect...
virtual PlotSymbol & operator=(const PlotSymbol &rh)
OPERATORS //.
virtual ~PlotLine()
Destructor.
static const casacore::String REC_UNDERLINE
virtual void setUSymbol(unsigned short unicode)=0
Sets the symbol character unicode to the given.
virtual bool operator==(const PlotFont &rh) const
Returns true if this PlotFont is equal to the given; false otherwise.
virtual void setPattern(Pattern pattern)=0
Sets the pattern for this area fill to the given.
const casacore::String DEFAULT_COLOR
void setLengthLimit(int lengthLimit)
virtual casacore::String asName() const =0
Returns this color's value as a human-readable name if applicable, or an empty casacore::String if in...
virtual void fromRecord(const casacore::Record &record)
virtual Style style() const =0
Returns this line's style.
Defines nreal time structures used by the VLA table filler.