label.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: label.h,v 1.14.16.2 2007-04-09 20:44:38 amoll Exp $
00005 //
00006 
00007 #ifndef BALL_VIEW_PRIMITIV_LABEL_H
00008 #define BALL_VIEW_PRIMITIV_LABEL_H
00009 
00010 #ifndef BALL_VIEW_KERNEL_GEOMETRICOBJECT_H
00011 # include <BALL/VIEW/KERNEL/geometricObject.h>
00012 #endif
00013 
00014 #ifndef BALL_VIEW_DATATYPE_VERTEX1_H
00015 # include <BALL/VIEW/DATATYPE/vertex1.h>
00016 #endif
00017 
00018 #include <QtGui/qfont.h>
00019 
00020 namespace BALL
00021 {
00022   namespace VIEW
00023   {
00024 
00047     class BALL_VIEW_EXPORT Label
00048       : public GeometricObject,
00049         public Vertex
00050     {
00051       public:
00052 
00053       BALL_CREATE(Label)
00054 
00055       
00058 
00070       Label();
00071 
00077       Label(const Label& label);
00078 
00080 
00082 
00085       virtual ~Label();
00086 
00093       virtual void clear();
00094 
00096 
00098 
00103       void set(const Label& label);
00104 
00108       const Label& operator = (const Label& label);
00109 
00112       void swap(Label& label);
00113 
00115 
00117 
00120       void setText(const String& text)
00121         {text_ = text;}
00122 
00125       String getText() const
00126         { return text_;}
00127 
00130       String getExpandedText() const;
00131 
00133       const QFont& getFont() const { return font_;}
00134 
00136       void setFont(const QFont& font) { font_ = font;}
00137 
00139       void setFontSize(Size size) { font_.setPixelSize(size);}
00140 
00142 
00144 
00157       virtual bool isValid() const;
00158 
00169       virtual void dump(std::ostream&  s = std::cout, Size depth = 0) const;
00170       
00171       // Method to get all vertices from a geometric object
00172       virtual void getVertices(vector<Vector3>& vertices) const;
00173 
00174       protected:
00175         String text_;
00176         QFont  font_;
00177 
00179     };
00180 
00181   } // namespace VIEW
00182 } // namespace BALL
00183 
00184 #endif // BALL_VIEW_PRIMITIV_LABEL_H