Stefan Schuermans
implement drawing pixels
Stefan Schuermans commited 5bca604 at 2017-06-10 23:09:20
/*
* EtherPix simulator
*
* Copyright 2017 Stefan Schuermans <stefan schuermans info>
*
* 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, version 3 of the License.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <gtkmm.h>
#include "bbox.h"
#include "pixel.h"
#include "transform.h"
/// default constructor
Pixel::Pixel():
m_x(0.5),
m_y(0.5),
m_r(0.0)
{
}
/// constructor based on coordinates and radius
Pixel::Pixel(double x, double y, double r):
m_x(x),
m_y(y),
m_r(r)
{
}
/**
* @brief add pixel to the bounding box
* @param[in,out] bb bounding box
*/
void Pixel::updateBBox(BBox &bb) const
{
// add pixel plus some border to bounding box
bb.add(m_x - 2 * m_r, m_y - 2 * m_r);
bb.add(m_x + 2 * m_r, m_y + 2 * m_r);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX