4
Copyright (C) 2005-2009 Julien Jorge, Sebastien Angibaud
4
Copyright (C) 2005-2010 Julien Jorge, Sebastien Angibaud
6
6
This program is free software; you can redistribute it and/or modify it
7
7
under the terms of the GNU General Public License as published by the
78
78
/*----------------------------------------------------------------------------*/
80
* \brief Get a rectangle where the element is completely opaque.
80
* \brief Get a rectangle where the element is fully opaque.
82
82
bear::visual::rectangle_type bear::visual::scene_element::get_opaque_box() const
171
171
/*----------------------------------------------------------------------------*/
173
* \brief Set the factor applied to the element when rendered.
174
* \param r The factor on both axis.
176
void bear::visual::scene_element::set_scale_factor( double r )
178
m_elem->set_scale_factor(r, r);
179
} // scene_element::set_scale_factor()
181
/*----------------------------------------------------------------------------*/
173
183
* \brief Get the factor applied on the x-axis to the element when rendered.
175
185
double bear::visual::scene_element::get_scale_factor_x() const
189
199
/*----------------------------------------------------------------------------*/
201
* \brief Get the width of the element (before the scaling factor).
203
bear::visual::size_type bear::visual::scene_element::get_element_width() const
205
if ( get_scale_factor_x() == 0 )
206
return get_bounding_box().width();
208
return get_bounding_box().width() / get_scale_factor_x();
209
} // scene_element::get_element_width()
211
/*----------------------------------------------------------------------------*/
213
* \brief Get the height of the element (before the scaling factor).
215
bear::visual::size_type bear::visual::scene_element::get_element_height() const
217
if ( get_scale_factor_y() == 0 )
218
return get_bounding_box().height();
220
return get_bounding_box().height() / get_scale_factor_y();
221
} // scene_element::get_element_height()
223
/*----------------------------------------------------------------------------*/
225
* \brief Get the width of the element (with the scaling factor).
227
bear::visual::size_type bear::visual::scene_element::get_width() const
229
return get_bounding_box().width();
230
} // scene_element::get_width()
232
/*----------------------------------------------------------------------------*/
234
* \brief Get the height of the element (with the scaling factor).
236
bear::visual::size_type bear::visual::scene_element::get_height() const
238
return get_bounding_box().height();
239
} // scene_element::get_height()
241
/*----------------------------------------------------------------------------*/
191
243
* \brief Set the attributes applied to the element when rendering.
192
244
* \param a The attributes.