/***************************************************************************
 * cm.cpp: implementation of Cm class
 *
 * This file is part of KTabEdit, a KDE tabulature editor
 *
 * copyright (C) 2003-2007 the KTabEdit development team <mrgwen@gmail.com>
 ***************************************************************************/

/***************************************************************************
 * 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.
 *
 * See the file COPYING for more information.
 ***************************************************************************/

#include "cm.h"

#include "inches.h"
#include "pixel.h"
/*
Cm::Cm(double cm, uint dpi)
: Unit(dpi),
  mCm(cm)
{
}

Cm::~Cm()
{

}

Inches Cm::toInches() const
{
	return Inches(mCm / inchesForACm(), dpi());
}

Pixel Cm::toPixel() const
{
	return Pixel(static_cast<uint>(static_cast<double>(dpi()) * (mCm / inchesForACm())), dpi());
}

double Cm::value() const
{
	return mCm;
}

uint Cm::valueOfPixel() const
{
	return toPixel().value();
}

Cm Cm::operator-() const
{
	Cm copy(*this);
	
	copy.mCm = -copy.mCm;
	
	return copy;
}

Cm Cm::operator+(const Cm& b) const
{
	return Cm(this->mCm + b.mCm, dpi());
}

Cm Cm::operator-(const Cm& b) const
{
	return Cm(this->mCm - b.mCm, dpi());
}

Cm Cm::operator*(const Cm& b) const
{
	return Cm(this->mCm * b.mCm, dpi());
}

Cm Cm::operator*(double b) const
{
	return Cm(this->mCm * b, dpi());
}

Cm Cm::operator/(const Cm& b) const
{
	return Cm(this->mCm / b.mCm, dpi());
}

Cm Cm::operator/(double b) const
{
	return Cm(this->mCm / b, dpi());
}

Cm& Cm::operator+=(const Cm& b)
{
	this->mCm = this->mCm + b.mCm;
	
	return *this;
}

Cm& Cm::operator-=(const Cm& b)
{
	this->mCm = this->mCm - b.mCm;
	
	return *this;
}

bool Cm::operator==(const Cm& b) const
{
	return (this->mCm == b.mCm);
}

bool Cm::operator<(const Cm& b) const
{
	return (this->mCm < b.mCm);
}

bool Cm::operator>(const Cm& b) const
{
	return (this->mCm > b.mCm);
}

bool Cm::operator<=(const Cm& b) const
{
	return (this->mCm <= b.mCm);
}

bool Cm::operator>=(const Cm& b) const
{
	return (this->mCm >= b.mCm);
}
*/
