//-*-C++-*-
/*
**************************************************************************
                                 description
                             --------------------
    copyright            : (C) 2000-2001 by Andreas Zehender
    email                : zehender@kde.org
**************************************************************************

**************************************************************************
*                                                                        *
*  This program is free software; you can redistribute it and/or modify  *
*  it under the terms of the GNU General Public License as published by  *
*  the Free Software Foundation; either version 2 of the License, or     *
*  (at your option) any later version.                                   *
*                                                                        *
**************************************************************************/


#ifndef PMSCALE_H
#define PMSCALE_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "pmobject.h"
#include "pmvector.h"


/**
 * Class for povray scale commands.
 */ 

class PMScale : public PMObject
{
   typedef PMObject Base;
public:
   /** Creates a scale < 0, 0, 0 > */
   PMScale( );
   /** deletes the object */
   virtual ~PMScale( );

   /** */
   virtual PMObject* newObject( ) const { return new PMScale( ); }
   /** */
   virtual QString className( ) const { return QString( "scale" ); }
   /** */
   virtual QString description( ) const;
   /** */
   virtual PMObjectType type( ) const { return PMTScale; }
   /** */
   virtual bool isA( PMObjectType t ) const;

   
   /** */
   virtual void serialize( PMOutputDevice& dev ) const;
   /** */
   virtual void serialize( QDomElement& e, QDomDocument& doc ) const;
   /** */
   virtual void readAttributes( const PMXMLHelper& h );

   /** Returns a new @ref PMScaleEdit */
   virtual PMDialogEditBase* editWidget( QWidget* parent ) const;
   /** */
   virtual QString pixmap( ) const { return QString( "pmscale" ); }

   /** Returns the scale */
   PMVector scale( ) const { return m_scale; }
   /** Sets the scale */
   void setScale( const PMVector& p );
   
   /** */
   virtual void restoreMemento( PMMemento* s );
   /** */
   virtual bool hasTransformationMatrix( ) const { return true; }
   /** */
   virtual PMMatrix transformationMatrix( ) const;
   /** */
   virtual void controlPoints( PMControlPointList& list );
   /** */
   virtual void controlPointsChanged( PMControlPointList& list );
private:
   /** IDs for @ref PMMementoData */
   enum PMScaleMementoID { PMScaleID };
   PMVector m_scale;
};

#endif
