SciFigs/AbstractLine.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of SciFigs.
00004 **
00005 **  This library is free software; you can redistribute it and/or
00006 **  modify it under the terms of the GNU Lesser General Public
00007 **  License as published by the Free Software Foundation; either
00008 **  version 2.1 of the License, or (at your option) any later version.
00009 **
00010 **  This file is distributed in the hope that it will be useful, but WITHOUT
00011 **  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 **  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
00013 **  License for more details.
00014 **
00015 **  You should have received a copy of the GNU Lesser General Public
00016 **  License along with this library; if not, write to the Free Software
00017 **  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 **
00019 **  See http://www.geopsy.org for more information.
00020 **
00021 **  Created : 2007-05-30
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (LGIT, Grenoble, France)
00025 **
00026 ***************************************************************************/
00027 
00028 #ifndef ABSTRACTLINE_H
00029 #define ABSTRACTLINE_H
00030 
00031 #include "SciFigsDLLExport.h"
00032 #include "Symbol.h"
00033 
00034 namespace SciFigs {
00035 
00036 class SCIFIGS_EXPORT AbstractLine : public XMLClass
00037 {
00038 public:
00039   AbstractLine() {_selected=false; _visible=true; _editable=true;}
00040   virtual ~AbstractLine() {}
00041 
00042   virtual const QString& xml_tagName() const {return xmlAbstractLineTag;}
00043   static const QString xmlAbstractLineTag;
00044 
00045   virtual AbstractLine * clone() const=0;
00046   virtual void operator=(const AbstractLine& o);
00047 
00048   virtual int count() const=0;
00049   virtual void clear()=0;
00050   virtual void append()=0;
00051   virtual void insert(int index)=0;
00052   virtual void removeLast()=0;
00053   virtual bool isValid(int) const {return true;}
00054   virtual void setValid(int, bool) {}
00055   virtual Point point(int index, const CurvePointOptions * options) const=0;
00056   virtual void setX(int index, double v)=0;
00057   virtual void setY(int index, double v, const CurvePointOptions * options)=0;
00058   virtual void setZ(int index, double v, const CurvePointOptions * options)=0;
00059 
00060   virtual QString toString(int index, const CurvePointOptions * options) const {return point(index, options).toString(20);}
00061   virtual bool fromString(int index, const StringSection& str, const QChar *& ptr, const CurvePointOptions * options);
00062 
00063   void setPen(const Pen& p) {_pen=p;}
00064   const Pen& pen() const {return _pen;}
00065 
00066   void setSymbol(const Symbol& s) {_symbol=s;}
00067   const Symbol& symbol() const {return _symbol;}
00068 
00069   bool isSelected() const {return _selected;}
00070   void setSelected(bool s) {_selected=s;}
00071 
00072   bool isVisible() const {return _visible;}
00073   void setVisible(bool v) {_visible=v;}
00074 
00075   bool isEditable() const {return _editable;}
00076   void setEditable(bool e) {_editable=e;}
00077 protected:
00078   Pen _pen;
00079   Symbol _symbol;
00080   uint _selected: 1;
00081   uint _visible: 1;
00082   uint _editable: 1;
00083   uint _unused: 29;
00084 protected:
00085   virtual void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const;
00086   virtual void xml_writeChildren(XML_WRITECHILDREN_ARGS) const;
00087   virtual bool xml_setProperty(XML_SETPROPERTY_ARGS);
00088   virtual XMLMember xml_member(XML_MEMBER_ARGS);
00089 };
00090 
00091 } // namespace SciFigs
00092 
00093 #endif // ABSTRACTLINE_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines